From percolation model, a interesting issue occur when try to find a shortest way from one point to another. A good algorithm is Dijkstra Algorithm, which is perfectly illustrated by this video.
https://www.youtube.com/watch?v=0nVYi3o161A
The source code is now published online.
https://github.com/lYC92/Dijkstra
Yangchuan Li's notes
My learning notes
Sunday, June 26, 2016
Friday, April 22, 2016
Compile SIESTA
I have to say compile the siesta is not a good experience for me. But when I go through it, I felt it's worth because it push me to understand the process to "make" a program.
Anyway, the error happened when linking the linear algebra libraries (BLAS BLACS LAPACK SCALAPACK). In my opinion, the time I felt I was on the right track to solve the problem is when I compile these packages from official website rather than install them from Ubuntu software center.
========= For Serial version =========
cd /to/siesta/folder/
cd Obj/
../Src/obj_setup.sh
../Src/configure
make siesta
If you encounter this problem:
========= For Parallel version =========
First prepare linear algebra packages
BLAS & LAPACK can follow this webpage
http://ab-initio.mit.edu/wiki/index.php/Template:Installing_BLAS_and_LAPACK
ScaLAPACK
Down load the package from http://www.netlib.org/scalapack/
Compile it
If you encounter a problem about "librefblas.a"
Solve it by this website http://askubuntu.com/questions/564584/how-can-i-get-librefblas-a-on-ubuntu-14-04-1-lts-trusty
Anyway, the error happened when linking the linear algebra libraries (BLAS BLACS LAPACK SCALAPACK). In my opinion, the time I felt I was on the right track to solve the problem is when I compile these packages from official website rather than install them from Ubuntu software center.
========= For Serial version =========
cd /to/siesta/folder/
cd Obj/
../Src/obj_setup.sh
../Src/configure
make siesta
If you encounter this problem:
m_ts_aux_rout.o: In function `csolveg':
/home/alibaba/packages/siesta-3.0-b/Src/m_ts_aux_rout.F:344: undefined
reference to `zgesv_'
collect2: ld returned 1 exit status
make: *** [transiesta] Error 1
Go to this page https://www.mail-archive.com/siesta-l@uam.es/msg00532.html========= For Parallel version =========
First prepare linear algebra packages
BLAS & LAPACK can follow this webpage
http://ab-initio.mit.edu/wiki/index.php/Template:Installing_BLAS_and_LAPACK
ScaLAPACK
Down load the package from http://www.netlib.org/scalapack/
Compile it
If you encounter a problem about "librefblas.a"
Solve it by this website http://askubuntu.com/questions/564584/how-can-i-get-librefblas-a-on-ubuntu-14-04-1-lts-trusty
After compile those package you will get *.a file in each directory.
Go into the siesta Obj folder
Assign the correspondent directories to macros in arch.make file.
https://www.researchgate.net/post/Problem_to_run_Siesta_in_Parallel_Anyone_know_what_is_going_on
https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/294650
../Src/obj_setup.sh
../Src/configure --enable-mpi
make siesta
(Recently I have compile siesta on stampede. A very helpful webpage to link MKL is https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor)
Hope it can be helpful.
Go into the siesta Obj folder
Assign the correspondent directories to macros in arch.make file.
https://www.researchgate.net/post/Problem_to_run_Siesta_in_Parallel_Anyone_know_what_is_going_on
https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/294650
../Src/obj_setup.sh
../Src/configure --enable-mpi
make siesta
(Recently I have compile siesta on stampede. A very helpful webpage to link MKL is https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor)
Hope it can be helpful.
Sunday, April 10, 2016
Parallel compilation tips of quantum espresso
1. Compile MPI package
- When there is error about can't find file ("*so*") when try to run "mpirun" command, try "sudo ldconfig" to update shared library.
- Search MPICH or OpenMPI in software center
- When using OpenMPI, install "libopenmpi-dev" to get the wrapper parallel compiler (mpicc mpif90).
- Run ./configure
- make all
Thursday, February 11, 2016
Matlab code to calculate silicon band structure using empirical pseudopotential method
This study note and matlab code are totally followed the file from
(1) https://nanohub.org/resources/8405
(2) https://www.ece.nus.edu.sg/stfpage/eleadj/pseudopotential.htm
Also, another great document about this topic can be found at
http://www.scientificpython.net/uploads/1/1/5/9/11598566/epm.pdf
To get the bandstructure start from schrodinger equation
And simplify the Hamiltonian to the following form
Two problem pop up here. How to represent reciprocal lattice vector G and potential V.
For reciprocal lattice vector G, please refer to REF(2).
For potential V, use empirical pseudopotential method and can simplify it to
The final result is not very accurate. Still need works on it.
(1) https://nanohub.org/resources/8405
(2) https://www.ece.nus.edu.sg/stfpage/eleadj/pseudopotential.htm
Also, another great document about this topic can be found at
http://www.scientificpython.net/uploads/1/1/5/9/11598566/epm.pdf
To get the bandstructure start from schrodinger equation
And simplify the Hamiltonian to the following form
Two problem pop up here. How to represent reciprocal lattice vector G and potential V.
For reciprocal lattice vector G, please refer to REF(2).
For potential V, use empirical pseudopotential method and can simplify it to
The final result is not very accurate. Still need works on it.
Tuesday, February 9, 2016
Converge test in Quantum Espresso
Several parameters (like ecutwfc, kpoints and also a reasonable pseudopotential) need to be determined before running ultimate model. To determine these, we need to make convergence test.
Here shows a result use Si model
1. Energy cutoff
ecutwfc (Kinetic energy cutoff for wavefunctions) and ecutrho (Kinetic energy cutoff for charge density and potential) are set according to the pseudopotential. When using ultrasoft PP, ecutrho should be 8~12*ecutwfc. Under norm-conserving PP, ecutrho don't need to be assigned. Just use the default value = 4*ecutwfc.
To get ecutwfc, do a convergence test by input different value of ecutwfc. Or by a loop, like the following. Don't forget the last "done".
for cutoff in 16 20 24 28 32 ; do
cat > scf.$cutoff.in <<EOF
! Your other code
ecutwfc=$cutoff
! ...
EOF
pw.x < scf.$cutoff.in > scf.$cutoff.out
Done
Here shows a result use Si model
2. kpoints
You can write you own kpoints or generate a list of it by kpoints.x or use "automatic" to make a kpoints mesh. Again, to decide how dense the mesh should be, use the loop above to do convergence test.
Here shows a test result use Si model.
Some other good answers about kpts and ecutwfc
(1) https://www.researchgate.net/post/Anyone_have_experience_with_K-point_sampling_for_electronic_and_phonon_structure_calculations
(2) http://qe-forge.org/pipermail/pw_forum/2013-February/101122.html
3. degauss/smearing
Smearing method and deguess will affect converge speed.
For DOS calculation, use occupation='tetrahedra'
4. Problem about convergence (screenshot form pwscf manual)
5. mixing_beta
This is answered by Prof Nicola Marzari
http://qe-forge.org/pipermail/pw_forum/2014-January/103176.html
For problem on relax a model about force
http://qe-forge.org/pipermail/pw_forum/2009-March/086638.html
Reference:
(1) http://www.tcl.t.u-tokyo.ac.jp/pdf/2014_lm/1st_day_pm.pdf
(2) http://www.quantum-espresso.org/wp-content/uploads/Doc/pw_user_guide.pdf
You can write you own kpoints or generate a list of it by kpoints.x or use "automatic" to make a kpoints mesh. Again, to decide how dense the mesh should be, use the loop above to do convergence test.
Here shows a test result use Si model.
Some other good answers about kpts and ecutwfc
(1) https://www.researchgate.net/post/Anyone_have_experience_with_K-point_sampling_for_electronic_and_phonon_structure_calculations
(2) http://qe-forge.org/pipermail/pw_forum/2013-February/101122.html
3. degauss/smearing
Smearing method and deguess will affect converge speed.
For DOS calculation, use occupation='tetrahedra'
4. Problem about convergence (screenshot form pwscf manual)
5. mixing_beta
This is answered by Prof Nicola Marzari
http://qe-forge.org/pipermail/pw_forum/2014-January/103176.html
For problem on relax a model about force
http://qe-forge.org/pipermail/pw_forum/2009-March/086638.html
Reference:
(1) http://www.tcl.t.u-tokyo.ac.jp/pdf/2014_lm/1st_day_pm.pdf
(2) http://www.quantum-espresso.org/wp-content/uploads/Doc/pw_user_guide.pdf
Subscribe to:
Posts (Atom)