[gpaw-users] Get all electron wavefunction

Jens Jørgen Mortensen jensj at fysik.dtu.dk
Wed Jun 26 10:38:24 CEST 2013


Den 25-06-2013 14:39, Torsten Hahn skrev:
>
> Am 21.06.2013 um 09:20 schrieb Jens Jørgen Mortensen <jensj at fysik.dtu.dk>:
>
>> Den 19-06-2013 14:52, Torsten Hahn skrev:
>>> Dear all,
>>>
>>> gpaw has the possibility to extract n the all electron density by
>>>
>>> n = calc.get_all_electron_density(gridrefinement=2)
>>>
>>> Is there a way to get access to the all-electron wave functions as well ?
>> No, that hasn't been implemented.  I can guide you in the right
>> direction if you would like to try to implement it.
>>
>> Jens Jørgen
> That would be very helpful. I will try the implementation …

Try to read the code for new_get_all_electron_density() in density.py.  
Make a class like this:

class AllElectronWaveFunctions:
     def __init__(self, calc):
         self.calc = calc
         copy-paste code from new_get_all_electron_density() to get:
         self.phi = ...
         and
         self.phit = ...
         use gd (grid-descriptor) from calc.wfs.gd

     def get_wave_functions(self, k, s):
         wfs = self.calc.wfs
         kpt_rank, u = wfs.kd.get_rank_and_index(s, k)
         kpt = wfs.kpt_u[u]
         w_nG = kpt.psit_nG.copy()
         self.phi.add(w_nG, P_ani, kpt.q)
         w_nG *= -1
         self.phit.add(w_nG, P_ani, kpt.q)
         w_nG *= -1
         return w_nG

and ask for more help when you need it.

Jens Jørgen

>
> Torsten Hahn.
>
>



More information about the gpaw-users mailing list