RFO Optimization

Overview

RFO (Rational Function Optimization) is a second-order optimization method that uses a trust-radius strategy to control step sizes. Rather than relying solely on the gradient direction, RFO constructs a rational function model of the potential energy surface and determines the optimal step within a dynamically adjusted trust region.

At each iteration, the algorithm compares the predicted energy change from its model with the actual energy change. If the model prediction is accurate, the trust radius is expanded to allow larger steps. If the prediction is poor, the step is rejected and the trust radius is contracted. This adaptive behavior makes RFO more robust than L-BFGS for systems with strong curvature or difficult potential energy surfaces.

Parameters

Parameter Type Default Description
max_iter int 256 Maximum number of optimization cycles.
trust_radius_init float 0.2 Initial trust radius in Angstrom.
trust_radius_min float 1e-3 Minimum trust radius.
trust_radius_max float 1.0 Maximum trust radius.
eta_shrink float 0.75 Trust radius shrink factor when step quality is poor.
eta_expand float 1.75 Trust radius expansion factor when step quality is good.
evals_eps float 1e-10 Eigenvalue epsilon for numerical stability.
mu_margin float 1e-8 Margin for the level-shift parameter mu.
max_bisect_it int 60 Maximum bisection iterations for level-shift optimization.
write_traj bool True Write intermediate geometries to a trajectory file.
traj_every int 1 Write trajectory frame every N optimization steps.

Input Example

A minimal input file using RFO optimization:

#model=uma
#opt(method=rfo)
#device=gpu0

O    0.000000    0.000000    0.117300
H    0.000000    0.757200   -0.469200
H    0.000000   -0.757200   -0.469200

When to Use RFO

RFO is a good alternative when L-BFGS struggles to converge. Consider switching to RFO in the following situations:

  • Systems near a minimum with strong curvature: RFO uses full Hessian information (built up over iterations) and a trust-radius mechanism, which handles regions of high curvature more reliably than the limited-memory approximation in L-BFGS.
  • Difficult or sensitive potential energy surfaces: When L-BFGS oscillates or fails to reduce the energy monotonically, the trust-radius step acceptance/rejection logic in RFO provides a built-in safeguard against bad steps.
  • Small to medium-sized molecules: RFO stores and manipulates the full Hessian matrix, so its memory and computational cost scale quadratically with system size. For very large systems (thousands of atoms), L-BFGS is generally more efficient.
  • Pre-optimization before frequency calculations: When a tight convergence is needed, RFO can be more reliable for the final stages of optimization because its trust-radius approach adapts naturally to the curvature near the minimum.
Tip

For large systems where RFO is too expensive, try L-BFGS with a reduced max_step as a compromise between robustness and efficiency.