Skip to main content
← OpenMECP Documentation

gdiis_step_direct

Function gdiis_step_direct 

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

Performs a simplified GDIIS step matching exactly.

This is a clean, minimal implementation of GDIIS

§Algorithm propagationGDIIS())

1. Compute mean Hessian: B_mean = mean(B_history)
2. Error vectors: e_i = solve(B_mean, g_i)  for each history point
3. B matrix: B_ij = e_i · e_j, with constraint row/col
4. Solve: B × c = [0,...,0,1]
5. Interpolate: X' = Σ c_i × X_i,  G' = Σ c_i × G_i
6. Correction: X_new = X' - solve(B_mean, G')
7. Apply MaxStep and step reduction

§Arguments

  • opt_state - Optimization state with geometry/gradient/Hessian history
  • config - Configuration with step size limits

§Returns

Returns the new geometry coordinates in A.

§Key Differences from Complex GDIIS

  • No coefficient magnitude check
  • No stuck detection (handled at main loop level if needed)
  • No adaptive step size multiplier
  • No cascading NaN fallbacks (single final check only)
  • Uses direct Hessian solve (not inverse multiply)