Skip to main content
← OpenMECP Documentation

gdiis_step

Function gdiis_step 

Source
pub fn gdiis_step(
    opt_state: &mut OptimizationState,
    config: &Config,
) -> DVector<f64>
Expand description

Performs a GDIIS (Geometry-based Direct Inversion in Iterative Subspace) optimization step.

GDIIS is an accelerated optimization method that uses a linear combination of previous geometries and gradients to construct an optimal step direction. It typically provides 2-3x faster convergence than BFGS once sufficient history has been accumulated.

The method constructs error vectors from the gradient history and solves a constrained minimization problem to find optimal interpolation coefficients. These coefficients are then used to predict the next geometry.

§Unit Conventions

  • Input geometries (geom_history): Angstrom (A)
  • Input gradients (grad_history): Hartree/Angstrom (Ha/A)
  • Interpolated geometry: Angstrom (A) - linear combination of Angstrom geometries
  • Output geometry: Angstrom (A)

The interpolation preserves units because it’s a weighted sum of geometries with coefficients that sum to 1 (DIIS constraint). The correction step uses the mean Hessian (Ų/Ha) applied to the interpolated gradient (Ha/A), producing a correction in A that is implicitly handled by the algorithm.

§Advantages over BFGS

  • Faster convergence (typically 2-3x fewer iterations)
  • More robust for difficult optimization problems
  • Automatically handles ill-conditioned Hessian matrices
  • Does not require explicit Hessian updates

§Requirements

  • Requires at least 3 iterations of history (checked via has_enough_history())
  • History includes geometries, gradients, and Hessian estimates
  • Uses the most recent max_history iterations for DIIS extrapolation (configurable, default: 5)

Validates: Requirement 7.3

§Arguments

  • opt_state - Optimization state with history of geometries, gradients, and Hessians
  • config - Configuration with step size limits

§Returns

Returns the new geometry coordinates in Angstrom after the GDIIS step as a DVector<f64>.

§Examples

use omecp::optimizer::{gdiis_step, OptimizationState};

let opt_state = OptimizationState::new();


// let x_new = gdiis_step(&opt_state, &config);