Skip to main content
← OpenMECP Documentation

adjust_trust_radius

Function adjust_trust_radius 

Source
pub fn adjust_trust_radius(
    state: &mut OptimizationState_blend,
    current_e1: f64,
    config: &Config,
)
Expand description

Adjusts the trust radius based on the actual energy change from QM.

Uses a simple heuristic:

  • If energy increased significantly (> 0.0001 Ha): halve trust radius
  • If energy decreased (> 0.0001 Ha): increase trust radius by 20%
  • Otherwise: keep unchanged

Updates both trust_radius and prev_e1 in the state.

ยงArguments

  • state - Mutable optimization state to update.
  • current_e1 - E1 energy from the most recent QM calculation.
  • print_level - Print level (0=quiet, 1=normal, 2=verbose).