How to read wavefunction from WAVRCAR using python directly

Question on input files/tags, interpreting output, etc.

Please check whether the answer to your question is given in the VASP online manual or has been discussed in this forum previously!

Moderators: Global Moderator, Moderator

Post Reply
Message
Author
Physics_cat
Newbie
Newbie
Posts: 3
Joined: Sun May 23, 2021 12:15 pm

How to read wavefunction from WAVRCAR using python directly

#1 Post by Physics_cat » Tue Jun 29, 2021 6:41 am

Background: I want to calculate Bott index, which is a topological invariant constructed by wavefunction in real space. After consulting Google, others prefer to mapping the VASP model to a tight binding model in order to use wannier function. As we know, we can get Z2 number(another topological invariant) with the method of wannier charge center.
Question: However, is there any better option rather than mapping to tight binding model? According the formula of bott index(Ref: PhysRevB 98.125130), wavefunction in real space totally decides the bott index. So can we extract wavefunction from VASP directly? For example, with python script. Since WAVECAR is a binary file, I have no idea to deal with it.

henrique_miranda
Global Moderator
Global Moderator
Posts: 234
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: How to read wavefunction from WAVRCAR using python directly

#2 Post by henrique_miranda » Tue Jun 29, 2021 8:12 pm

I believe you can find the answer to this question on some previous posts in the forum:
forum/viewtopic.php?t=7384

In particular, here you find some documentation of an external code that reads the WAVECAR
http://www.andrew.cmu.edu/user/feenstra/wavetrans/

Here are a couple of other external tools that read the VASP WAVECAR file:
https://github.com/band-unfolding/bandup (Fortran)
https://github.com/QijingZheng/VaspBandUnfolding (python)

Mind that these packages are not officially supported by us.

Another alternative would be perhaps to read the UNK file produced for wannier90
wiki/index.php/LWRITE_UNK

User avatar
shaldar
Newbie
Newbie
Posts: 5
Joined: Tue Oct 20, 2009 5:08 am
License Nr.: 20-0458
Location: Kiel, Germany

Re: How to read wavefunction from WAVRCAR using python directly

#3 Post by shaldar » Tue Jun 29, 2021 8:25 pm

Maybe you can also look into the routines of irrep https://github.com/stepan-tsirkin/irrep. This can be used to read the wave functions stored by ab-initio codes

Physics_cat
Newbie
Newbie
Posts: 3
Joined: Sun May 23, 2021 12:15 pm

Re: How to read wavefunction from WAVRCAR using python directly

#4 Post by Physics_cat » Thu Jul 08, 2021 12:01 pm

henrique_miranda wrote:
Tue Jun 29, 2021 8:12 pm
I believe you can find the answer to this question on some previous posts in the forum:
forum/viewtopic.php?t=7384

In particular, here you find some documentation of an external code that reads the WAVECAR
http://www.andrew.cmu.edu/user/feenstra/wavetrans/

Here are a couple of other external tools that read the VASP WAVECAR file:
https://github.com/band-unfolding/bandup (Fortran)
https://github.com/QijingZheng/VaspBandUnfolding (python)

Mind that these packages are not officially supported by us.

Another alternative would be perhaps to read the UNK file produced for wannier90
wiki/index.php/LWRITE_UNK
Thanks a lot for your help. I had checked the python package listed above. It seems that they can only give electron distribution or electron location function which can be read easily by vesta. However, for calculating the topological number, I need know exactly form of wavefunction, which means, I need a n*1 array under plane wave basis.

henrique_miranda
Global Moderator
Global Moderator
Posts: 234
Joined: Mon Nov 04, 2019 12:41 pm
Contact:

Re: How to read wavefunction from WAVRCAR using python directly

#5 Post by henrique_miranda » Thu Jul 08, 2021 1:45 pm

It looked to me like this class is reading the WAVECAR file
https://github.com/QijingZheng/VaspBand ... wfc.py#L61
but maybe I misunderstood it.

If this is not what you need then I would suggest you try reading the information in the UNK files.

Physics_cat
Newbie
Newbie
Posts: 3
Joined: Sun May 23, 2021 12:15 pm

Re: How to read wavefunction from WAVRCAR using python directly

#6 Post by Physics_cat » Fri Jul 09, 2021 2:55 am

shaldar wrote:
Tue Jun 29, 2021 8:25 pm
Maybe you can also look into the routines of irrep https://github.com/stepan-tsirkin/irrep. This can be used to read the wave functions stored by ab-initio codes
Also thanks for your help. Although Irrep cannot solve my problem directly, I also can use it to find irrepresentation of hamiltonian, which is very helpful for building the k dot p model.

Post Reply