[gpaw-users] wavefunction squared from cube file

Jens Jørgen Mortensen jensj at fysik.dtu.dk
Mon Jun 3 14:09:51 CEST 2013


Den 16-05-2013 15:58, Chengjun Jin skrev:
> Hi All,
>
> If I have a cube file containing wavefunction, is it possible to get 
> the *wavefunction squared* by manipulating the wavefucntion cube file.
>
>
> If the above strategy is not possible,

I think it should be possible.  Can you show us how you got your cube file?

Jens Jørgen

> I am wondering how to generate a cube file containing *wavefunction 
> squared* by wfs.basis_functions.lcao_to_grid method? In this case, I 
> have the coefficient for each lcao basis.
>
> below is the pseudo code to generate wavefunction cube file.
>           wfs = calc.wfs
>           nao = wfs.setups.nao
>           nk = 1
>           psi = np.zeros([nk,nao])
>           then fill the psi with coefficient
>           psi = psi.reshape(1,-1)
>           psi_g = wfs.gd.zeros(nk, dtype=wfs.dtype)
>           ss = psi_g.shape
>           psi_g = psi_g.reshape(1, -1)
>           wfs.basis_functions.lcao_to_grid(psi, psi_g, q=0)
>           psi_g = psi_g.reshape(ss)
>           write('psi.cube'), atoms, data=psi_g[0])
>
>
> Regards,
> Chengjun
>
>
>
> _______________________________________________
> gpaw-users mailing list
> gpaw-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.fysik.dtu.dk/pipermail/gpaw-users/attachments/20130603/259905e3/attachment.html 


More information about the gpaw-users mailing list