pele.optimize.lbfgs_scipy#

pele.optimize.lbfgs_scipy(coords, pot, iprint=-1, tol=0.001, nsteps=15000)[source]#

a wrapper function for lbfgs routine in scipy

Warning

the scipy version of lbfgs uses linesearch based only on energy which can make the minimization stop early. When the step size is so small that the energy doesn’t change to within machine precision (times the parameter factr) the routine declares success and stops. This sounds fine, but if the gradient is analytical the gradient can still be not converged. This is because in the vicinity of the minimum the gradient changes much more rapidly then the energy. Thus we want to make factr as small as possible. Unfortunately, if we make it too small the routine realizes that the linesearch routine isn’t working and declares failure and exits.

So long story short, if your tolerance is very small (< 1e-6) this routine will probably stop before truly reaching that tolerance. If you reduce factr too much to mitigate this lbfgs will stop anyway, but declare failure misleadingly.