Optimizers (pele.optimize)

This module contains all of the optimizers available in pele. There are so many available for testing purposes and because sometimes different optimizers are more appropriate in different circumstances. These optimizers are all local. That is they find the nearest local minimum. For global optimization see global optimization.

In our experience, we have found that the best minizers are lbfgs and fire. lbfgs seems to be by far the fastest, however there are some circumstances where the better stability of fire might be useful. These cases include where it is important to clearly define the boundary between basins of attraction. LBFGS can also fail in non-Hamiltonian situations where you have forces, but no potential function. This is the case in the Nudged elastic band, where the NEB force doesn’t correspond to any NEB energy.


we use the words “optimize”, “quench”, and “minimize” interchangeably

All of the optimizers that are functions in this package have the same form:

res = optimizer(coords, getEnergyGradient, **kwargs)

where coords is the starting structure for the minimaztion, getEnergyGradient is a function which return the energy and gradient, and kwargs are a collection of optional parameters. The return value is a pele.optimze.Result object (similar to scipy.optimize.Result), which is simply a dictionary where __getattr__ is a wrapper for __getitem__. So the coords can be accessed as res.coords or as res[“coords”].

Result A container for the return values of an optimizer ..

We have tried to make the minimizers as consistent as possible, but it is not always possible. Some of the common parameters most of them accept are:

  1. nsteps : number of iterations
  2. tol : tolerance criterion for the rms gradient
  3. iprint : how often to print status informatation

LBFGS routines

limited-memory BFGS (Broyden-Fletcher-Goldfarb-Shanno) routine


These routines (excluding the scipy version) are slightly different from most lbfgs routines in that the don’t use a line search. Instead, both the step size and direction returned by the lbfgs routine are accepted subject to a constraint on the energy change. If the energy rises more than a given amount then the step size is reduce until the condition is satisfied. Note: this is what makes lbfgs potentially fail with non-Hamiltonian systems.

LBFGS(X, pot[, maxstep, maxErise, M, ...]) minimize a function using the LBFGS routine
lbfgs_py(coords, pot, **kwargs)
MYLBFGS(X, pot, **lbfgs_py_kwargs) minimize a function using the LBFGS routine
mylbfgs(coords, pot, **kwargs)
lbfgs_scipy(coords, pot[, iprint, tol, nsteps]) a wrapper function for lbfgs routine in scipy


Fire(coords, potential[, restart, logfile, ...]) The FIRE optimization algorithm
fire(coords, pot[, tol, nsteps]) A wrapper function for the pele FIRE implementation

Other routines

most of these are simply wrappers to the optimizers available in scipy.optimize. These are not used very often and may be buggy.

cg(coords, pot[, iprint, tol, nsteps]) a wrapper function for conjugate gradient routine in scipy
steepest_descent(x0, pot[, iprint, dx, ...]) steepest descent minimization

Table Of Contents

Previous topic


Next topic