Skip to main content
← OpenMECP Documentation

gradient_blend_step

Function gradient_blend_step 

Source
pub fn gradient_blend_step(
    opt_state: &OptimizationState_blend,
    max_step: f64,
    thresh_rms_g: f64,
    switch_rms: f64,
    print_level: usize,
    reduced_factor: f64,
    step_reduction_multiplier: f64,
) -> DVector<f64>
Expand description

Gradient-weighted hybrid GEDIIS/GDIIS blend step.

Blends GDIIS and EDIIS geometries based on the RMS gradient magnitude:

  • Large forces (far from minimum): w→1, mostly EDIIS (stable global exploration)
  • Small forces (near minimum): w→0, mostly GDIIS (fast quadratic convergence)

§Formula

w = rms_g / (rms_g + switch_rms) where

  • rms_g = RMS of latest combined gradient (g_vec + f_vec)
  • switch_rms = gradient threshold parameter for smooth blending

x_new = w × x_EDIIS + (1-w) × x_GDIIS

§Arguments

  • opt_state - Optimization state with geometry, force, Hessian, and energy history.
  • max_step - Maximum allowed step size.
  • thresh_rms_g - RMS gradient convergence threshold (for factor check).
  • switch_rms - RMS gradient threshold for blend weighting.
  • reduced_factor - Step reduction factor when activated.

§Returns

The blended and step-controlled new geometry.