[gpaw-users] The ELF function
Jens Jørgen Mortensen
jensj at fysik.dtu.dk
Fri Mar 12 13:48:35 CET 2010
On Fri, 2010-03-12 at 14:23 +0200, Kacprzak, Katarzyna wrote:
> Hi,
>
> So here what I get when I try to use each command:
>
> >> calc = GPAW('Na.gpw')
> >> atom = calc.get_atoms()
>
> >>>from gpaw.elf import *
> >>> elf = ELF(calc)
> >>> print elf
> <gpaw.elf.ELF instance at 0x2c90ae9248>
>
> >>> elf.initialize(calc)
> >>> print elf.initialize(calc)
> None
>
> >>> elf.update(calc.wfs)
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/v/linux26_x86_64/appl/nano/gpaw/svn//lib/python/gpaw/elf.py",
> line 103, in update
> wfs.add_to_kinetic_density_from_k_point(self.taut_sG[0], kpt)
> File "/v/linux26_x86_64/appl/nano/gpaw/svn//lib/python/gpaw/
> wavefunctions.py", line 1084, in add_to_kinetic_density_from_k_point
> raise RuntimeError('Wavefunctions have not been initialized.')
> RuntimeError: Wavefunctions have not been initialized.
Does the Na.gpw file have the wave functions? Did you write it with
calc.write('Na.gpw', mode='all')?
JJ
> It also doesn't change the fact that in the first script I get wrong
> values (not from 0 to 1, but from 0 to 0.465)
>
> Best regards,
>
>
> On Mar 12, 2010, at 11:09 AM, Jens Jørgen Mortensen wrote:
>
> > On Thu, 2010-03-11 at 18:24 +0200, Kacprzak, Katarzyna wrote:
> >> Hi,
> >>
> >> I have been trying to analyze some of my results with electron
> >> localization function. Since the analysis gave strange results, I
> >> have
> >> tried to run this analysis for Na atom. I attached figures with two
> >> different results for Na.
> >>
> >> Thus, one result obtain using this part of code:
> >>
> >> ------------------------------------------------------------------------------
> >> name = 'Na'
> >> atom = Atoms (read (name +".xyz"))
> >>
> >> atom.set_cell([7.92, 7.92, 7.92])
> >> calc = GPAW(h=0.18, nbands=-10, xc='PBE', txt=name+'.out')
> >> atom.set_calculator(calc)
> >> atom.get_potential_energy()
> >>
> >> from gpaw.elf import *
> >> elf = ELF(calc)
> >>
> >> elf.initialize(calc)
> >> elf.update(calc.wfs)
> >>
> >> elf_out = elf.get_electronic_localization_function(gridrefinement=2)
> >> write ('Na.plt', molecule, data=elf_out)
> >>
> >> ------------------------------------------------------------------------------
> >>
> >> and another was obtain, just by restarting gpw file. Thus, with this
> >> code:
> >>
> >> ------------------------------------------------------------------------------
> >> from ase import *
> >> from gpaw import *
> >>
> >>
> >> calc = GPAW('Na.gpw')
> >> atom = calc.get_atoms()
> >>
> >> from gpaw.elf import *
> >> elf = ELF(calc)
> >>
> >> elf_out = elf.get_electronic_localization_function(gridrefinement=2)
> >> write ('Na_2.plt', atom, data=elf_out)
> >
> > In your second script, you left out the two lines:
> >
> > elf.initialize(calc)
> > elf.update(calc.wfs)
> >
> > Are they not needed when you restart from a file?
> >
> > JJ
> >
> >>
> >> ------------------------------------------------------------------------------
> >> Each of these scripts gave two different results. First one, gave
> >> values from 0 to 0.456, and the second, gave values from 0 to 1. Even
> >> though the second gave correct values, plotting them I obtain
> >> localization far away from the atom... I attached the figure to this
> >> email. The "A" figure is related to the first case, the "B"- is
> >> related to the second case. Both of the figures are plotted for
> >> maximal values (A for 0.456, and B for 1)
> >>
> >> I will be grateful for any suggestions how to fix this problem and
> >> get
> >> correct analysis from GPAW.
> >>
> >> I have also compared the elf for another system using Octopus, and
> >> GPAW. And again I obtain two different results (from Octopus results
> >> are correct).
> >>
> >> Best regard,
> >>
> >> Katarzyna Kacprzak
> >>
> >> katarzyna.a.kacprzak at jyu.fi
> >>
> >> PhD student
> >> Nanoscience Center
> >> Univeristy of Jyvaskyla
> >>
> >>
> >>
> >> _______________________________________________
> >> 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