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
- Uphill Detection: If ≥40% of recent steps increased energy → return 0.0
- Linear Regression: Fit trend line to recent energies
- Deviation Measurement: Compute max deviation from trend (scale-invariant)
- Weight Assignment: Map deviation to weight using empirical thresholds
- 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
- Check if optimizer is stuck (using last 3 displacements in history)
- Compute both GDIIS and GEDIIS predictions
- Analyze energy history to determine optimal weight
- Blend predictions: x_new = (1-w)GDIIS + wGEDIIS
- Apply step size limits and reductions
§Arguments
opt_state- Optimization state with historyconfig- 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);