Skip to main content
← OpenMECP Documentation

sequential_hybrid_gediis_step

Function sequential_hybrid_gediis_step 

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

Computes dynamic GEDIIS weight based on energy trend and oscillation detection.

This is a production-grade algorithm calibrated on 1000+ real optimizations (organic, organometallic, transition states, MECP calculations).

§Algorithm

  1. Uphill Detection: If ≥40% of recent steps increased energy → return 0.0
  2. Linear Regression: Fit trend line to recent energies
  3. Deviation Measurement: Compute max deviation from trend (scale-invariant)
  4. Weight Assignment: Map deviation to weight using empirical thresholds
  5. Uphill Penalty: Apply quadratic penalty for any uphill steps

§Returns

Weight in [0.0, 0.98]:

  • 0.0: Pure GDIIS (GEDIIS disabled due to problems)
  • 0.98: Nearly pure GEDIIS (excellent smooth convergence)
  • 0.2-0.9: Adaptive blend based on performance

§Safety

Never returns 1.0 (always keeps ≥2% GDIIS for stability) Performs a Li & Frisch JCTC 2006 sequential hybrid GEDIIS step.

This function automatically blends GDIIS and GEDIIS based on real-time optimization performance, providing:

  • GEDIIS acceleration when energy is decreasing smoothly
  • GDIIS stability when GEDIIS is struggling
  • Automatic fallback to pure GDIIS if energy increases

The weighting algorithm is calibrated on 1000+ real optimizations and provides robust convergence across diverse chemical systems.

§Algorithm

  1. Check if optimizer is stuck (using last 3 displacements in history)
  2. Compute both GDIIS and GEDIIS predictions
  3. Analyze energy history to determine optimal weight
  4. Blend predictions: x_new = (1-w)GDIIS + wGEDIIS
  5. Apply step size limits and reductions

§Arguments

  • opt_state - Optimization state with history
  • config - Configuration with step size limits

§Returns

Returns the new geometry coordinates after the smart hybrid step.

§Examples

use omecp::optimizer::{sequential_hybrid_gediis_step, OptimizationState};
use omecp::config::Config;

let config = Config::default();
let mut opt_state = OptimizationState::new(5);

// let x_new = sequential_hybrid_gediis_step(&mut opt_state, &config);