Page 1 of 1

How to read wavefunction from WAVRCAR using python directly

Posted: Tue Jun 29, 2021 6:41 am
by Physics_cat
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.

Re: How to read wavefunction from WAVRCAR using python directly

Posted: Tue Jun 29, 2021 8:12 pm
by henrique_miranda
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

Re: How to read wavefunction from WAVRCAR using python directly

Posted: Tue Jun 29, 2021 8:25 pm
by shaldar
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

Re: How to read wavefunction from WAVRCAR using python directly

Posted: Thu Jul 08, 2021 12:01 pm
by Physics_cat
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.

Re: How to read wavefunction from WAVRCAR using python directly

Posted: Thu Jul 08, 2021 1:45 pm
by henrique_miranda
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.

Re: How to read wavefunction from WAVRCAR using python directly

Posted: Fri Jul 09, 2021 2:55 am
by Physics_cat
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.