Expand description
Optimization algorithms for MECP calculations.
This module implements various optimization algorithms used in Minimum Energy Crossing Point (MECP) calculations, including:
- BFGS: Broyden-Fletcher-Goldfarb-Shanno quasi-Newton method
- GDIIS: Geometry-based Direct Inversion in Iterative Subspace
- GEDIIS: Energy-Informed DIIS with improved convergence
- Hessian Updates: PSB (Powell-Symmetric-Broyden) formula
- Convergence Checking: Multiple criteria for optimization termination
The module also provides functions to compute MECP effective gradients that combine the energy difference minimization and energy perpendicular components according to the Harvey et al. algorithm.
§Optimization Strategy
OpenMECP uses a hybrid optimization strategy:
- Initialization: BFGS for the first 3 steps to build curvature information
- Convergence Acceleration: Switch to GDIIS or GEDIIS for faster convergence
- Adaptive Step Control: Automatic step size limiting prevents overshooting
- Checkpointing: Save optimization state for restart capability
§Implementation Improvements (v2.0)
Recent enhancements ensure mathematical rigor and numerical stability:
- Adaptive GEDIIS Parameters: α scales with 1/|g| for better stability
- PSB Curvature Check: Validates
s^T y > 0before Hessian update - Improved MECP Gradient: Uses minimum norm vector to prevent premature convergence
- Better Fallback Handling: Steepest descent properly scaled in BFGS
- High-Precision Thresholds: Tighter convergence criteria for research use
§MECP Gradient Calculation
The MECP effective gradient combines two components:
G_MECP = (E1 - E2) * x_norm + (f1 - (x_norm · f1) * x_norm)Where:
E1, E2: Energies of the two electronic statesf1, f2: Gradients (forces) of the two statesx_norm = (f1 - f2) / |f1 - f2|: Normalized gradient difference
The first term drives the energy difference to zero (f-vector). The second term minimizes energy perpendicular to the gradient difference (g-vector).
Re-exports§
pub use crate::gdiis::CosineCheckMode;pub use crate::gdiis::CoeffCheckMode;pub use crate::gdiis::GdiisError;pub use crate::gdiis::GdiisOptimizer;pub use crate::gediis::compute_dynamic_gediis_weight as gediis_dynamic_weight;pub use crate::gediis::EnergyRiseTracker;pub use crate::gediis::GediisConfig;pub use crate::gediis::GediisOptimizer;pub use crate::gediis::GediisVariant;pub use crate::hessian_update::HessianUpdateMethod;
Structs§
- Convergence
Status - Tracks convergence status for each optimization criterion.
- Mecp
Gradient - Holds the decomposed MECP effective gradient.
- Optimization
State - Tracks optimization state and history for adaptive optimization algorithms.
- Optimization
State_ blend - Holds optimization state for the GDIIS_blend and GEDIIS_blend implementations.
Functions§
- adjust_
trust_ radius - Adjusts the trust radius based on the actual energy change from QM.
- bfgs_
step - Performs a BFGS optimization step.
- bfgs_
step_ direct - Performs a BFGS step using a direct Hessian (matching exactly).
- build_
b_ 🔒matrix - Builds the B matrix for GDIIS optimization.
- build_
gediis_ 🔒b_ matrix - Computes enhanced error vectors for GEDIIS optimization.
- build_
gediis_ 🔒b_ matrix_ taylor - Builds the GEDIIS B-matrix using the Taylor expansion formula.
- check_
convergence - Checks convergence criteria for MECP optimization.
- compute_
adaptive_ scale - Computes adaptive step scaling based on optimization progress.
- compute_
error_ 🔒vectors - Computes error vectors for GDIIS optimization.
- compute_
mecp_ gradient - Computes the MECP effective gradient for optimization.
- fixed_
blend_ step - Hybrid GEDIIS/GDIIS step.
- fixed_
sequential_ blend_ step - Fixed-then-GDIIS sequential blend step.
- gdiis_
blend_ step - GDIIS_blend step: interpolate geometry, apply Newton correction via INVERTED mean true Hessian, with step control.
- gdiis_
step - Performs a GDIIS (Geometry-based Direct Inversion in Iterative Subspace) optimization step.
- gdiis_
step_ direct - Performs a simplified GDIIS step matching exactly.
- gediis_
blend_ step - GEDIIS_blend step: pure interpolation using Taylor expansion B-matrix.
- gediis_
step - Performs a GEDIIS (Energy-Informed Direct Inversion in Iterative Subspace) optimization step.
- gradient_
blend_ step - Gradient-weighted hybrid GEDIIS/GDIIS blend step.
- initialize_
direct_ hessian - Initializes the direct Hessian matrix for direct Hessian BFGS optimization.
- initialize_
inverse_ hessian - Updates the Hessian matrix using the PSB (Powell-Symmetric-Broyden) formula.
- initialize_
true_ hessian - Creates an identity matrix as the initial true Hessian approximation.
- parse_
coeff_ mode - Converts config string to
CoeffCheckMode. - parse_
cosine_ mode - Performs a hybrid GEDIIS optimization step (50% GDIIS + 50% GEDIIS).
- parse_
gediis_ variant - Converts config string to
GediisVariant. - parse_
hessian_ update_ method - Converts config string to
HessianUpdateMethod. - robust_
gdiis_ step - Performs a robust GDIIS step using the new GdiisOptimizer.
- robust_
gediis_ step - Performs a robust GEDIIS step using the new GediisOptimizer.
- select_
blend_ step - Dispatcher for the blend experiment methods.
- select_
diis_ step - Selects and runs the appropriate DIIS/GEDIIS step based on configuration.
- sequential_
blend_ step - Smart sequential hybrid GEDIIS/GDIIS blend step.
- sequential_
hybrid_ gediis_ step - Computes dynamic GEDIIS weight based on energy trend and oscillation detection.
- solve_
constrained_ step - Solves the augmented Hessian system for a constrained optimization step.
- stepsize_
blend - Applies step size reduction and capping.
- update_
hessian - Updates the inverse Hessian matrix using the BFGS formula.
- update_
hessian_ advanced - Updates the Hessian matrix using the specified method from the hessian_update module.
- update_
hessian_ by_ method - Updates the Hessian matrix using the specified method.
- update_
hessian_ psb - Updates the Hessian matrix using the PSB (Powell-Symmetric-Broyden) formula.
- update_
inverse_ hessian_ advanced - Updates the inverse Hessian using the BFGS formula from the hessian_update module.