CG vs BFGS optimizer

Matthias Krack matthia... at
Fri Jul 18 11:52:47 UTC 2014

Dear Tobias,

BFGS should be fine up to the order of  (a few) 1000 atoms depending on 
your computational resources, because it involves the diagonalisation of a 
matrix with the dimensions of 3 times the number of atoms. This becomes 
readily a bottleneck.

For large systems I would recommend LBFGS which shows an efficiency close 
to BFGS and it workw for 100,000s of atoms. The CG can show a very slow 
convergence, but it is usually quite robust and can be used for cases where 
LBFGS troubles.

You may also dump in the formats dcd or dcd_aligned_cell see
DCD is a binary dump, but this saves time and disk space for large systems. 
DCD files can be displayed for instance with vmd, but they contain no 
atomic information. Thus you have first to load a pdb or xyz file of your 
system (just one configuration, but same atomic order, e.g. the intial one) 
and then you load the dcd file into this molecule. This allows a plotting 
of the atoms and the cell for each configuration, which is useful for 
variable cells.



On Friday, 18 July 2014 13:29:12 UTC+2, Tobias Kraemer wrote:
> Dear all,
> I was wondering if someone could clarify for which system size the CG 
> optimizers should be preferred over BFGS?
> The manual states that CG is "OK for large systems", while BFGS is "most 
> efficient for 'small' systems". 
> One of my systems contains 520 atoms, and I have tried both optimizers, on 
> the same starting structure. While 
> BFGS converged within 40 geometry optimisation cycles (~15 hrs walltime), 
> CG is still going (started at same time).
> It is showing signs of convergence though, which is  good. So I understand 
> that BFGS is much more efficient in this
> particular case. Is there a rule of thumb for the system size in terms of 
> number of atoms?
> Another question in the context of geometry optimisations, is there a way 
> to output both the cell axis along with the current
> geometry of the model? The xyz does not contain info about the cell axis, 
> while I seem to be unable to analyse each
> step of the optimiation if I set the format in the output to pdb. Is there 
> a viewer which could show both (essentially showing the
> individual structures during the geometry optimisation steps and the cell 
> axis).
> Your answers are much appreciated ....
> Best
> Tobias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the CP2K-user mailing list