Skip to main content
← OpenMECP Documentation

OptimizationState_blend

Struct OptimizationState_blend 

Source
pub struct OptimizationState_blend {
    pub geom_history: VecDeque<DVector<f64>>,
    pub true_hess_history: VecDeque<DMatrix<f64>>,
    pub grad_history: VecDeque<DVector<f64>>,
    pub f_vec_history: VecDeque<DVector<f64>>,
    pub e1_history: VecDeque<f64>,
    pub energy_history: VecDeque<f64>,
    pub max_history: usize,
    pub prev_e1: Option<f64>,
    pub trust_radius: f64,
}
Expand description

Holds optimization state for the GDIIS_blend and GEDIIS_blend implementations.

§Key Difference from OptimizationState

The existing OptimizationState stores INVERSE Hessians in hess_history. This struct stores TRUE Hessians in true_hess_history, matching the convention where Hm = mean(Hhist) and Hm^{-1} is computed by inversion.

§Note on naming

The name _blend suffix distinguishes this from the existing OptimizationState and indicates that it is designed for the GDIIS_blend (inverted mean Hessian error vectors) and GEDIIS_blend (Taylor expansion B-matrix) methods.

Fields§

§geom_history: VecDeque<DVector<f64>>

History of geometries as column vectors.

§true_hess_history: VecDeque<DMatrix<f64>>

History of TRUE Hessian matrices (NxN), NOT inverse Hessians.

Hhist/Bhist (list of NxN matrices). Mean is inverted for error vectors: error_i = H_mean^{-1} @ F_i.

§grad_history: VecDeque<DVector<f64>>

History of MECP g-vectors (perpendicular component) in Ha/A.

§f_vec_history: VecDeque<DVector<f64>>

History of f-vectors (energy difference drive term) in Hartree (Ha).

§e1_history: VecDeque<f64>

History of E1 energies (used as RHS for EDIIS: y = [-E_hist, 1]).

§energy_history: VecDeque<f64>

History of E1 - E2 energy differences (stored for compatibility / debugging but NOT used in EDIIS RHS).

§max_history: usize

Maximum number of history entries (keeps max 4).

§prev_e1: Option<f64>

E1 energy from the previous iteration (for trust-radius adjustment).

§trust_radius: f64

Current trust radius for adaptive step control. Initialized from config.max_step_size and adjusted dynamically.

Implementations§

Source§

impl OptimizationState_blend

Source

pub fn new(max_history: usize, trust_radius: f64) -> Self

Creates a new empty optimization state for blend methods.

Source

pub fn has_enough_history(&self) -> bool

Returns true when at least 3 iterations of history exist, matching the minimum needed for reliable DIIS interpolation.

Source

pub fn add_to_history( &mut self, geom: DVector<f64>, grad: DVector<f64>, f_vec: DVector<f64>, true_hess: DMatrix<f64>, e1: f64, energy_diff: f64, )

Adds a new entry to all history deques with FIFO eviction.

Trait Implementations§

Source§

impl Clone for OptimizationState_blend

Source§

fn clone(&self) -> OptimizationState_blend

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OptimizationState_blend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.