[gpaw-users] gpaw-users Digest, Vol 32, Issue 10

mohnish pandey mohnish.iitk at gmail.com
Mon Apr 22 13:06:59 CEST 2013


On Mon, Sep 17, 2012 at 12:00 PM,
<gpaw-users-request at listserv.fysik.dtu.dk>wrote:

> Send gpaw-users mailing list submissions to
>         gpaw-users at listserv.fysik.dtu.dk
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users
> or, via email, send a message with subject or body 'help' to
>         gpaw-users-request at listserv.fysik.dtu.dk
>
> You can reach the person managing the list at
>         gpaw-users-owner at listserv.fysik.dtu.dk
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of gpaw-users digest..."
>
>
> Today's Topics:
>
>    1. Re: Using old wavefunctions as initial guess (Marcin Dulak)
>    2. Re: Using old wavefunctions as initial guess (Jussi Enkovaara)
>    3. Re: Using old wavefunctions as initial guess (Thomas Olsen)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 16 Sep 2012 14:06:21 +0200
> From: Marcin Dulak <Marcin.Dulak at fysik.dtu.dk>
> Subject: Re: [gpaw-users] Using old wavefunctions as initial guess
> To: "krister.henriksson at helsinki.fi" <krister.henriksson at helsinki.fi>
> Cc: "gpaw-users at listserv.fysik.dtu.dk"
>         <gpaw-users at listserv.fysik.dtu.dk>
> Message-ID: <5055C0BD.6060705 at fysik.dtu.dk>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> Hi,
>
> your system is periodic and
> https://wiki.fysik.dtu.dk/gpaw/documentation/xc/exx.html says:
> "
> Support for periodic systems:
> Actually, the code won?t complain, but the results have not been tested.
> "
> Thomas/Jun can you explain how periodic systems can be calculated with
> hybrids (pw mode only?)
> and put the assertion in the code that prevents running not implemented
> features?
> https://wiki.fysik.dtu.dk/gpaw/devel/projects/hybrids.html needs to be
> updated too.
>
> Best regards,
>
> Marcin
>
> On 09/15/12 13:42, krister.henriksson at helsinki.fi wrote:
> >     Hi,
> >
> > My intent is to perform a PBE0 relaxation/calculation of Si bulk
> > (diamond lattice, 216 atoms). I have tried several times with somewhat
> > different settings for the occupations, minimizer routine ('cg' or
> > other), max. number of iterations, ... but the calculation never seems
> > to converge, even after about 20 itrations. The total energy is just
> > hovering around -1308 eV (if I remember correctly).
> >
> > So I decided to try to use PBE to do an initial relaxation (it was
> > very quick) and then use the relaxed structure and wave functions as
> > input to a PBE0 run. The problem is that I cannot seem to achieve this
> > with the functions I know. I tried
> >
> > # Get PBE-relaxed Si bulk:
> > si = read('Si-n%d-h%.2f-%d.gpw' % (n,h,iiter_old))
> > # Set current calculator:
> > calc = GPAW(xc = 'PBE0',
> >               txt='gpaw-Si-n%d-h%.2f-%d.txt' % (n,h,iiter),
> >               nbands = nb
> >               )
> > # Read old wfs, which hopefully works as the initialization wfs now:
> > calc.read_wave_functions(mode='gpw:wfs_tmp/psit_Gs%dk%dn%d')
> >
> > calc.attach(calc.write, 1, 'Si-n%d-h%.2f-%d.gpw' % (n,h,iiter),
> mode='all')
> > si.set_calculator(calc)
> > ...
> >
> > This does not seem to work, gpaw just died after complaining:
> >
> > Traceback (most recent call last):
> >     File "bulk-n3-2.py", line 54, in <module>
> >       calc.read_wave_functions(mode='gpw:wfs_tmp/psit_Gs%dk%dn%d')
> >     File
> >
> "/fs/local/linux26_x86_64/appl/nano/gpaw/0.9.0/lib/python/gpaw/aseinterface.py",
> line 671, in
> > read_wave_functions
> >       for u, kpt in enumerate(self.wfs.kpt_u):
> > AttributeError: EmptyWaveFunctions instance has no attribute 'kpt_u'
> > GPAW CLEANUP (node 63): <type 'exceptions.AttributeError'> occurred.
> > Calling MPI_Abort!
> >
> > So my question is, what is the best way to perform a calculation where
> > the initial wave functions are taken from a previous "similar" run?
> >
> > I'm attaching the full python scripts I have been using. First I used
> > bulk-n3-1.py and then bulk-n3-2.py.
> >
> >     Best regards,
> >     Krister Henriksson
> >
> > Mr Krister Henriksson, Ph.D., doc.
> > Department of Physics
> > University of Helsinki
> > P.O. Box 43
> > FIN-00014 University of Helsinki
>
>
> --
> ***********************************
>
> Marcin Dulak
> Technical University of Denmark
> Department of Physics
> Building 307, Room 229
> DK-2800 Kongens Lyngby
> Denmark
> Tel.: (+45) 4525 3157
> Fax.: (+45) 4593 2399
> email: Marcin.Dulak at fysik.dtu.dk
>
> ***********************************
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 17 Sep 2012 10:12:58 +0300
> From: Jussi Enkovaara <jussi.enkovaara at aalto.fi>
> Subject: Re: [gpaw-users] Using old wavefunctions as initial guess
> To: <krister.henriksson at helsinki.fi>
> Cc: gpaw-users at listserv.fysik.dtu.dk
> Message-ID: <5056CD7A.1000206 at aalto.fi>
> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
>
> On 2012-09-15 14:42, krister.henriksson at helsinki.fi wrote:
> >
> >    Hi,
> >
> > So I decided to try to use PBE to do an initial relaxation (it was very
> > quick) and then use the relaxed structure and wave functions as input to
> > a PBE0 run. The problem is that I cannot seem to achieve this with the
> > functions I know. I tried
> >
> > # Get PBE-relaxed Si bulk:
> > si = read('Si-n%d-h%.2f-%d.gpw' % (n,h,iiter_old))
> > # Set current calculator:
> > calc = GPAW(xc = 'PBE0',
> >              txt='gpaw-Si-n%d-h%.2f-%d.txt' % (n,h,iiter),
> >              nbands = nb
> >              )
> > # Read old wfs, which hopefully works as the initialization wfs now:
> > calc.read_wave_functions(mode='gpw:wfs_tmp/psit_Gs%dk%dn%d')
>
> Hi,
> neglecting for the moment the issue of PBE0 and periodic system,
> the problem with the above script is that you are creating
> a pristine calculator ( GPAW(...) ) which does not have any information
> about k-points, grid spacing, etc., and therefore you have no data
> structures into which to read the wave functions. The 'read' function
> reads information only about the Atoms object and not about the calculator.
>
> The proper way to start from old wave functions would be:
> -----------
> from gpaw import GPAW, restart
>
> si, calc = restart('Si-n%d-h%.2f-%d.gpw' % (n,h,iiter_old))
> calc.set(xc='PBE0', txt=...)
> si.get_potential_energy()
> ...
> ------------
>
> or
>
> -----------
> from ase.io import read
> from gpaw import GPAW, restart
>
> si = read('Si-n%d-h%.2f-%d.gpw' % (n,h,iiter_old))
> calc = GPAW('Si-n%d-h%.2f-%d.gpw' % (n,h,iiter_old),
>              xc='PBE0', txt=...)
> si.set_calculator(calc)
> si.get_potential_energy()
> ...
> ------------
>
> Note that if you try to set the number of bands in the either of the
> above two examples, information about the old wave functions is lost and
> one starts from standard LCAO initial guess (density from old
> calculation is still reused).
>
> Returning to subject of hybrids and periodic systems, as Marcin pointed
> out they are not fully supported yet (at least with k-points), and when
> trying to use PBE0 with k-points there is an error message:
>
> ...
>      assert wfs.gamma
> AssertionError
>
>
> Best regards,
> Jussi
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 17 Sep 2012 09:32:03 +0200
> From: Thomas Olsen <tolsen at fysik.dtu.dk>
> Subject: Re: [gpaw-users] Using old wavefunctions as initial guess
> To: gpaw-users at listserv.fysik.dtu.dk
> Message-ID: <5056D1F3.8030308 at fysik.dtu.dk>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi
>
> EXX for periodic systems (with kpoints) is not implemented in GPAW yet
> and therefore you cannot run relaxation with PBE0 for this system. You
> can get the non-selfconsistent PBE0 energy by:
>
> from gpaw.xc.hybridk import HybridXC
> E = calc.get_potential_energy()
> E_pbe0 = E + calc.get_xc_difference(HybridXC('PBE0'))
>
> where calc is your calculator object. Or if you are using plane waves:
>
> from gpaw.xc.hybridg import HybridXC
> E = calc.get_potential_energy()
> E_pbe0 = E + calc.get_xc_difference(HybridXC('PBE0'))
>
> I would not trust the existing self-consistent EXX code for periodic
> systems, allthough it only fails explicitly if one is using kpoints.
>
> BR Thomas
>
>
> On 09/17/2012 09:12 AM, Jussi Enkovaara wrote:
> > On 2012-09-15 14:42, krister.henriksson at helsinki.fi wrote:
> >>     Hi,
> >>
> >> So I decided to try to use PBE to do an initial relaxation (it was very
> >> quick) and then use the relaxed structure and wave functions as input to
> >> a PBE0 run. The problem is that I cannot seem to achieve this with the
> >> functions I know. I tried
> >>
> >> # Get PBE-relaxed Si bulk:
> >> si = read('Si-n%d-h%.2f-%d.gpw' % (n,h,iiter_old))
> >> # Set current calculator:
> >> calc = GPAW(xc = 'PBE0',
> >>               txt='gpaw-Si-n%d-h%.2f-%d.txt' % (n,h,iiter),
> >>               nbands = nb
> >>               )
> >> # Read old wfs, which hopefully works as the initialization wfs now:
> >> calc.read_wave_functions(mode='gpw:wfs_tmp/psit_Gs%dk%dn%d')
> > Hi,
> > neglecting for the moment the issue of PBE0 and periodic system,
> > the problem with the above script is that you are creating
> > a pristine calculator ( GPAW(...) ) which does not have any information
> > about k-points, grid spacing, etc., and therefore you have no data
> > structures into which to read the wave functions. The 'read' function
> > reads information only about the Atoms object and not about the
> calculator.
> >
> > The proper way to start from old wave functions would be:
> > -----------
> > from gpaw import GPAW, restart
> >
> > si, calc = restart('Si-n%d-h%.2f-%d.gpw' % (n,h,iiter_old))
> > calc.set(xc='PBE0', txt=...)
> > si.get_potential_energy()
> > ...
> > ------------
> >
> > or
> >
> > -----------
> > from ase.io import read
> > from gpaw import GPAW, restart
> >
> > si = read('Si-n%d-h%.2f-%d.gpw' % (n,h,iiter_old))
> > calc = GPAW('Si-n%d-h%.2f-%d.gpw' % (n,h,iiter_old),
> >               xc='PBE0', txt=...)
> > si.set_calculator(calc)
> > si.get_potential_energy()
> > ...
> > ------------
> >
> > Note that if you try to set the number of bands in the either of the
> > above two examples, information about the old wave functions is lost and
> > one starts from standard LCAO initial guess (density from old
> > calculation is still reused).
> >
> > Returning to subject of hybrids and periodic systems, as Marcin pointed
> > out they are not fully supported yet (at least with k-points), and when
> > trying to use PBE0 with k-points there is an error message:
> >
> > ...
> >       assert wfs.gamma
> > AssertionError
> >
> >
> > Best regards,
> > Jussi
> >
> > _______________________________________________
> > 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
>
> End of gpaw-users Digest, Vol 32, Issue 10
> ******************************************
>



-- 
Regards,
MOHNISH,
-----------------------------------------------------------------
Mohnish Pandey,
PhD Student,
Center for Atomic Scale Materials Design,
Department of Physics,
Technical University of Denmark
-----------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.fysik.dtu.dk/pipermail/gpaw-users/attachments/20130422/802fe9d1/attachment-0001.html 


More information about the gpaw-users mailing list