[gpaw-users] Manipulating the SCF Loop

Tristan Maxson tgmaxson at gmail.com
Wed Jul 9 19:58:21 CEST 2014


Would a way of manually running a SCF loop with a initialize,  iterate,
 and finalize be something of interest to be developed?...It seems like it
should be a fairly simple thing to break down and use and I might be
interested in helping to develop it if it does not currently exist.

Thank you for your solution,  it appears to work but I agree a different
method would probably be preferred.  For clarification,  do observers reset
(for example the iterations value) by defining it as you did,  when the
calculation ends or would I have to reset it after convergence manually to
perform the calculation again?


On Wed, Jul 9, 2014 at 10:52 AM, Tristan Maxson <tgmaxson at gmail.com> wrote:

> Would a way of manually running a SCF loop with a initialize,  iterate,
>  and finalize be something of interest to be developed?...It seems like it
> should be a fairly simple thing to break down and use and I might be
> interested in helping to develop it if it does not currently exist.
>
> Thank you for your solution,  it appears to work but I agree a different
> method would probably be preferred.  For clarification,  do observers reset
> (for example the iterations value) by defining it as you did,  when the
> calculation ends or would I have to reset it after convergence manually to
> perform the calculation again?
>
>
> On Wed, Jul 9, 2014 at 4:18 AM, Ask Hjorth Larsen <asklarsen at gmail.com>
> wrote:
>
>> Hi Tristan
>>
>> Something like this.  I haven't quite tested.
>>
>> calc = GPAW(convergence=dict(density=-1))
>>
>> class Observer:
>>     def __init__(self):
>>         self.iterations = 0
>>
>>     def __call__(self):
>>         print 'Do something'
>>         if self.iterations > 20 and calc.scf.density_error < 1e-4:
>>             calc.scf.converged = True
>>         self.iterations += 1
>>
>> calc.attach(Observer(), 1)
>>
>>
>> It would be nice if one could just iterate the sodding thing like this:
>>
>> for i in range(20):
>>     calc.iterate()
>>
>> and then trigger the normal SCF procedure afterwards.  But that isn't
>> possible at the moment.
>>
>> You could probably also call calc.set(convergence=...) from within the
>> observer, but the set() method is prone to severe bugginess.
>>
>> Best regards
>> Ask
>>
>> 2014-07-08 22:32 GMT+02:00 Tristan Maxson <tgmaxson at gmail.com>:
>> > I have been doing some work which requires actively manipulating the SCF
>> > loop between iterations and encountered a problem where the loop may end
>> > before I desire it to.
>> >
>> > I am looking for some sort of "miniter" or a method of forcing another
>> > iteration of the SCF loop from an attached observer that does not
>> require
>> > modifying the source if at all possible.  I need the calculation to
>> continue
>> > as if the convergence was not reached in that iteration.
>> >
>> > _______________________________________________
>> > 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/20140709/1b993b23/attachment.html>


More information about the gpaw-users mailing list