[gpaw-users] Eigen wave-function
Jussi Enkovaara
jussi.enkovaara at csc.fi
Thu Apr 22 09:36:28 CEST 2010
Duy Le wrote:
> Thank you. It produced with calc.wfs.kpt_u[ikpt].psit_nG[iband],
> However, there seems to be a problem. The header of cube file is
> different from that of charge cube file. I beleive that they must be
> identical. Could you please explain to me what is written in wave
> function cube file?
> ******Charge cube file's header:
> cube file from ase
> OUTER LOOP: X, MIDDLE LOOP: Y, INNER LOOP: Z
> 2 0.000000 0.000000 0.000000
> 48 0.196846 0.000000 0.000000
> 48 0.000000 0.196846 0.000000
> 48 0.000000 0.000000 0.196846
> 6 0.000000 3.684966 4.724315 4.724315
> 8 0.000000 5.763664 4.724315 4.724315
> ***wave function cube file's header:
> cube file from ase
> OUTER LOOP: X, MIDDLE LOOP: Y, INNER LOOP: Z
> 2 4.724315 0.000000 0.000000
> 1 4.724315 0.000000 0.000000
> 24 0.000000 0.393693 0.000000
> 24 0.000000 0.000000 0.393693
> 6 0.000000 3.684966 4.724315 4.724315
> 8 0.000000 5.763664 4.724315 4.724315
The headers (48 vs. 24) are different as for the charge density you use twice as dense grid as for the
wave functions (gridrefinement=2) in your script. Furthermore, your script contains small bug (see below)
which explains the dimension 1 in the second line of the wave function cube file.
> wf1=calc.wfs.kpt_u[k].psit_nG[band],
You have an extra ',' in the end of line, and as result you do not obtain the correct 3D wave function
data.
> wf2 = calc.get_pseudo_wave_function(band=band,kpt=k)
> fname1=basename+'.2.'+str(k)+'.'+str(band)+'.cube'
> write(fname2, atoms, data=wf2)
Here, "fname2" is not defined and the script exits with an error.
After the above corrections I was able to run your scripts and obtain reasonable looking plots.
Also other bands than the second (notice that indexing starts from 0, thus band=1 gives the second
band) seemed to work. I used relatively recent GPAW version 0.7.6336M.
Best regards,
Jussi
> Duy Le
> PhD Student
> Department of Physics
> University of Central Florida.
>
> "Men don't need hand to do things"
>
>
>
> On Wed, Apr 21, 2010 at 1:58 PM, Jun Yan <juya at fysik.dtu.dk> wrote:
>> Hi,
>>
>> Did you use calc.write('filename.gpw'.'all') command to write down the
>> wavefunctions ?
>> If you did and still have problems, can you attach your python file that
>> used to generate this error ?
>>
>> A direct way to get the wavefunction is
>> calc.wfs.kpt_u[ikpt].psit_nG[iband],
>> while ikpt and iband are the number of kpoints and bands for the
>> wavefunctions you want to get.
>> Hope this helps.
>>
>> All the best,
>> Jun Yan
>>
>> Duy Le wrote:
>>
>> Thanks. I have looked at that tutorial. I have never successfully
>> obtained the wave function in cube format. It always ended up with the
>> error "shape mismatch: objects cannot be broadcast to a single shape"
>> (I asked yesterday, see in the end of this email).
>> However, even if I successfully get cube file, I beleive that this
>> will give Square of wavefunction. I want wavefunction only for my
>> other analysis.
>>
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>> File "CO.wave.py", line 15, in ?
>> wf = calc.get_pseudo_wave_function(band=band)
>> File "/home/duyle/usr/lib64/python/gpaw/aseinterface.py", line 348, in
>> get_pse
>> udo_wave_function
>> pad=False)
>> File "/home/duyle/usr/lib64/python/gpaw/aseinterface.py", line 353, in
>> get_pse
>> udo_wave_function
>> psit_G = self.wfs.get_wave_function_array(band, kpt, spin)
>> File "/home/duyle/usr/lib64/python/gpaw/wavefunctions.py", line 405, in
>> get_wa
>> ve_function_array
>> psit_G = self.gd.collect(psit1_G)
>> File "/home/duyle/usr/lib64/python/gpaw/grid_descriptor.py", line 373, in
>> coll
>> ect
>> A_xg[..., b0:e0, b1:e1, b2:e2] = a_xg
>> ValueError: shape mismatch: objects cannot be broadcast to a single shape
>> ----------------------------------------------------------------------
>> --------------------------------------------------
>> Duy Le
>> PhD Student
>> Department of Physics
>> University of Central Florida.
>>
>> "Men don't need hand to do things"
>>
>>
>>
>> On Wed, Apr 21, 2010 at 12:19 PM, Ask Hjorth Larsen <askhl at fysik.dtu.dk>
>> wrote:
>>
>>
>> Dear Duy Le
>>
>>
>>
>> Dear all,
>> I wonder if it is possible to get KS wave functions with gpaw? I want
>> KS wave function to perform post processing.
>>
>>
>> You can find an example in the wave function plotting tutorial:
>>
>> https://wiki.fysik.dtu.dk/gpaw/tutorials/plotting/plot_wave_functions.html
>>
>> This will get the pseudo wave functions, not the all-electron ones. The
>> all-electron ones are normally too nasty.
>>
>> Regards
>> Ask
>>
>>
>>
>> _______________________________________________
>> gpaw-users mailing list
>> gpaw-users at listserv.fysik.dtu.dk
>> https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users
>>
>>
>
> _______________________________________________
> gpaw-users mailing list
> gpaw-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users
More information about the gpaw-users
mailing list