QijingZheng / VaspBandUnfolding

A collection of python scripts that deal with VASP outpts, e.g. WAVECAR, POTCAR etc.
198 stars 89 forks source link

Installation #1

Closed sfragkos closed 6 months ago

sfragkos commented 6 years ago

Hello Qijing,

I tried to install your code but i didnt make it. What I want to do, is to plot the wavefunctions in real space. Could you please make me the instructions more clear? Thank you sincerely!

Sotirios Fragkos

sfragkos commented 6 years ago

I found a way to install it but now i get the following error:

phi = wav.wfc_r(ikpt=2, iband=72, ngrid=wav._ngrid * 2) Traceback (most recent call last): File "", line 1, in File "vaspwfc.py", line 258, in wfc_r gvec = self.gvectors(ikpt) File "vaspwfc.py", line 195, in gvectors (Gvec.shape[0], self._nplws[ikpt -1], np.prod(self._ngrid)) AssertionError: No. of planewaves not consistent! 6788 13576 17595

QijingZheng commented 6 years ago

Hi Sotirios

The error says something about the syntax, it may be that you are using python3 to run the script, which could be a problem since I was using python2 when I wrote the script.

Maybe you can avoid this error by explicitly using python2, e.g. python2 xxx.py

Best Qijing

On Sun, Apr 29, 2018 at 1:05 AM, sfragkos notifications@github.com wrote:

I think i managed to install it, but know i get the following error print 'Calculating IPR of #spin %4d, #kpt %4d, #band %4d' % (ispin+1, ikpt+1, iband+1) ^ SyntaxError: invalid syntax

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/QijingZheng/VaspBandUnfolding/issues/1#issuecomment-385191066, or mute the thread https://github.com/notifications/unsubscribe-auth/AIINPp7yI6m-87GZF3W57ls6SqgooZdOks5ttKFugaJpZM4TreOg .

sfragkos commented 6 years ago

Thank you very much for your answer. Your code works fine when i tried it on your example. But when i try to apply it in my case, i get the following error:

*phi = wav.wfc_r(ikpt=1, iband=72, ngrid=wav._ngrid 2) Traceback (most recent call last): File "", line 1, in File "/home/dimoulas/.local/lib/python2.7/site-packages/vaspwfc.py", line 258, in wfc_r gvec = self.gvectors(ikpt) File "/home/dimoulas/.local/lib/python2.7/site-packages/vaspwfc.py", line 195, in gvectors (Gvec.shape[0], self._nplws[ikpt -1], np.prod(self._ngrid)) AssertionError: No. of planewaves not consistent! 6821 13642 17595**

Do you know how can i fix this? what is ngrid? and what should be my KPOINTS file format? Thanks again!!!

QijingZheng commented 6 years ago

Hi Sotirios

Is your WAVECAR obtained from an Gamma-only VASP? Because the error message indicates that the number of G-vectors and planewaves does not match.

The ngrid determines the grid size out the FFT.

Best Qijing

On Sun, Apr 29, 2018 at 3:26 PM, sfragkos notifications@github.com wrote:

Thank you very much for your answer. Your code works fine when i tried it on your example. But when i try to apply it in my case, i get the following error:

phi = wav.wfc_r(ikpt=1, iband=72, ngrid=wav._ngrid 2) Traceback (most recent call last): File "", line 1, in File "/home/dimoulas/.local/lib/python2.7/site-packages/vaspwfc.py", line 258, in wfc_r gvec = self.gvectors(ikpt) File "/home/dimoulas/.local/lib/python2.7/site-packages/vaspwfc.py", line 195, in gvectors (Gvec.shape[0], self._nplws[ikpt -1], np.prod(self._ngrid)) AssertionError: No. of planewaves not consistent! 6821 13642 17595*

Do you know how can i fix this? what is ngrid? and what should be my KPOINTS file format? Thanks again!!!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/QijingZheng/VaspBandUnfolding/issues/1#issuecomment-385231689, or mute the thread https://github.com/notifications/unsubscribe-auth/AIINPoZqES7xrOWB9YMfw7eyGdRr8rPvks5ttWs3gaJpZM4TreOg .

sfragkos commented 6 years ago

Hi Qijing Because I'm new in DFT and i dont understand much yet, I attach you my INCAR KPOINTS and POSCAR files. I used 2 different types of KPOINTS file as you will see. What their format should be? I tried to turn off SOC, and this error didnt appear this time, but when i used wav.save2vesta(phi, poscar='/my_dirto/POSCAR') the wfc_i.vasp wfc_r.vasp file didn't appear (but it work for your example).

Thanks for your patient!

sfragkos commented 6 years ago

system = MoTe2 ISTART = 0 ICHARG = 1 LCHARG = .TRUE.

ENCUT = 450 ISMEAR = 0 SIGMA = 0.1 POTIM = 0.5 ISYM = 2

ISPIN = 2

NSW = 0 ISIF = 2 EDIFF = 1E-6 EDIFFG = -0.001 IBRION = -1

LWAVE = .TRUE.

LORBIT = 0 LNONCOLLINEAR = .TRUE. LSORBIT = .TRUE.

LPLANE = .TRUE. NPAR = 4 NSIM = 4

KPOINTS v1 kmesh 0 Monkhorst Pack 12 10 6 0 0 0

KPOINTS v2 kmesh 1 reciprocal 0 0 0 6.

QijingZheng commented 6 years ago

Hi Sotirios

The error does not complain about the KPOINTS format.

From your INCAR and KPOINTS V1, I guess you are doing a calculation for bulk 1T'-MoTe2? If so, then KPOINTS v1 is appropriate for the calculation, maybe you can increase the size of the k-grid.

According to your INCAR, you are doing a calculation with spin-orbit coupling, which, unfortunately, was not taken into account in the wfc_r function in my code. So there will be no "*.vasp" output by the code.

Best Qijing

On Sun, Apr 29, 2018 at 4:04 PM, sfragkos notifications@github.com wrote:

system = MoTe2 ISTART = 0 ICHARG = 1 LCHARG = .TRUE.

ENCUT = 450 ISMEAR = 0 SIGMA = 0.1 POTIM = 0.5 ISYM = 2

ISPIN = 2

NSW = 0 ISIF = 2 EDIFF = 1E-6 EDIFFG = -0.001 IBRION = -1

LWAVE = .TRUE.

LORBIT = 0 LNONCOLLINEAR = .TRUE. LSORBIT = .TRUE.

LPLANE = .TRUE. NPAR = 4 NSIM = 4

KPOINTS v1 kmesh 0 Monkhorst Pack 12 10 6 0 0 0

KPOINTS v2 kmesh 1 reciprocal 0 0 0 6.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/QijingZheng/VaspBandUnfolding/issues/1#issuecomment-385233881, or mute the thread https://github.com/notifications/unsubscribe-auth/AIINPmaGUYcUdEKJw8yS8OBYQ8IZPE4pks5ttXQkgaJpZM4TreOg .

sfragkos commented 6 years ago

Ok Qijing thank you very much! One last question. If i want to plot the wavefuntions at the Γ point, what ikpt should be equal to?

QijingZheng commented 6 years ago

The ikpt is the index of the k-point that you are interested in, starting from 1. Check OUTCAR and search the line containing "k-points in reciprocal lattice and weights:", where the k-points coordinates follows.

sfragkos commented 6 years ago

Thanks for everything! need any citation for using your code?

QijingZheng commented 6 years ago

It is not mandatory, but I am glad if you could cite my code so that more people will know it and it may help them with their problems.

sfragkos commented 6 years ago

Ok, how should I write the citation? I have also one more question, the fact that SOC wasnt included in these calculations, what effect could have to the way the wavefunctions look? ( the calculations were actually for Td-MoTe2 at Γ point and not for 1T' )

QijingZheng commented 6 years ago

I don't know, maybe just a link to the code is ok...

By including SOC in VASP calculations, the wavefunctions then become a spinor \phi -> (\phi^+, \phi^-), i.e. a two-component function. Note that I add a plus/minus sign in the superscript, however , there are no spin up/down for a spinor.

Check these sites for more information: https://github.com/rubel75/fold2Bloch-VASP http://www.andrew.cmu.edu/user/feenstra/wavetrans/

Subhendupj commented 11 months ago

Hi Qijing,

What is unit of transition dipole moment calculated in your code? Is it in Debye?

Subhendupj commented 11 months ago

Another question: The "WAVECAR" used for transition dipole moment (TDM) calcualtion should be taken from "scf" calculation or from "band" calculation? I want to calculate the TDM for a particular "K " point (not at Gamma). So the KPOINT value I should give from the OUTCAR of my band calculation. Thats why my doubt is which WAVECAR I should use?

QijingZheng commented 11 months ago

Hi

Best Qijing