[gpaw-users] stepwise optimization

Ask Hjorth Larsen askhl at fysik.dtu.dk
Fri Feb 24 23:33:49 CET 2012


Hi

On Fri, 24 Feb 2012, Sampsa Riikonen wrote:

> Dear List,
>
> I am doing some "stepwise" optimization, i.e.
>
> 1) fix atom N
> 2) optimize structure using "ase.optimize.bfgslinesearch.BFGSLineSearch"
> 3) move atom  N
> 4) goto (1)
>
> at step (3) I need to reset the BFGSLineSearch, otherwise it goes mad.
>
> https://wiki.fysik.dtu.dk/ase/epydoc/ase.optimize.bfgslinesearch.BFGSLineSearch-class.html
>
> There seems to be a method called "reset".  Can this method do the job?

In principle, perhaps.  But it's undocumented and might be changed, so you 
are probably better off creating a new optimizer object (they are not 
expensive to create, and reset() would throw away any information that can 
be saved anyway, so recreating wouldn't be any *worse* than just making a 
new optimizer.

>
> BFGSLineSearch is a derived class from the
> "ase.optimize.optimize.Optimizer".  Optimizer has
> a method called "initialize", however, from
>
> ase.optimize.optimize-pysrc.html#Optimizer.initialize
>
> we can see that "initialize" is an empty method.  Shouldn't
> "BFGSLineSearch" overwrite this method .. ?

Only if it needs to.  I guess the BFGSLineSearch doesn't want to do 
anything particular in initialize().


The most straightforward thing to do is to just recreate the optimizer. 
One *could* do some work to save info on the Hessian matrix for all atoms 
*except* the previously fixed atom.  Then the optimizer should be able to 
run faster in subsequent optimizations.  It's possible, but it definitely 
requires some hacking.

Maybe Tao Jiang who knows more about this stuff will respond.

Regards
Ask


More information about the gpaw-users mailing list