Improved optimizer

I mentioned briefly in the May 2026 Development Updates - I’ve implemented some improvements in the geometry optimizer:

  • an updated version of the cppoptlib library, improving L-BFGS substantially
  • an implementation of the FIRE / ABC-FIRE method inspired by ASE
    • this approaches geometry optimization like MD - “skiing downhill”
    • it only performs one gradient per step, so it’s much faster at rough geometries
  • a “hybrid” approach (now the default) that uses ABC-FIRE in early steps, then switches to L-BFGS once the gradient is small

The result is pretty impressive. It’s ~6x faster than geometry optimizations in 2.0 - the auto-opt snaps back maybe a bit too fast.

It’s also more reliable - sometimes the optimizer would quit in 2.0 and earlier versions because L-BFGS would try to take big steps. It’s now tuned better to chemical problems.

It also works better with plugins - fewer gradient evaluations means xtb and ML methods are more useful.

2 Likes

For reference, the UFF optimization of 1MYK.pdb on my M4 Mac laptop (single core) takes ~350 ms for 1000 steps. That’s a 780 atom protein.

I’ll look around for something really big, but interactive optimizations of polymers and proteins is definitely possible.

The code does some adaptive timing so “chunks” can happen ~30 fps. For small molecules that means some large chunks (e.g., 200 optimization steps). Caffeine optimizes in ~2 ms. That’s not a typo.

As I said, I almost wonder about slowing it down for AutoOpt. Right now if you distort an atom, it snaps back really really fast.

1 Like