pub struct GdiisOptimizer {
pub max_vectors: usize,
pub cosine_check: CosineCheckMode,
pub coeff_check: CoeffCheckMode,
a_matrix: TriangularMatrix,
a_inv: TriangularMatrix,
scale: f64,
el2_min: f64,
solver: DiisCoeffSolver,
}Expand description
Main GDIIS optimizer.
Implements the full GDIIS algorithm with validation checks.
Fields§
§max_vectors: usizeMaximum number of vectors to store
cosine_check: CosineCheckModeCosine check mode
coeff_check: CoeffCheckModeCoefficient check mode
a_matrix: TriangularMatrixOverlap matrix A
a_inv: TriangularMatrixInverse of A
scale: f64Current scale factor
el2_min: f64Minimum error norm squared
solver: DiisCoeffSolverDIIS coefficient solver
Implementations§
Source§impl GdiisOptimizer
impl GdiisOptimizer
Sourcepub fn compute_step(
&mut self,
coords: &VecDeque<DVector<f64>>,
errors: &VecDeque<DVector<f64>>,
_hessians: &VecDeque<DMatrix<f64>>,
) -> Result<(DVector<f64>, Vec<f64>, usize), GdiisError>
pub fn compute_step( &mut self, coords: &VecDeque<DVector<f64>>, errors: &VecDeque<DVector<f64>>, _hessians: &VecDeque<DMatrix<f64>>, ) -> Result<(DVector<f64>, Vec<f64>, usize), GdiisError>
Sourcefn initialize_matrices(
&mut self,
errors: &VecDeque<DVector<f64>>,
n: usize,
) -> Result<(), GdiisError>
fn initialize_matrices( &mut self, errors: &VecDeque<DVector<f64>>, n: usize, ) -> Result<(), GdiisError>
Initializes overlap matrices from error vectors.
Sourcefn extend_matrices(
&mut self,
errors: &VecDeque<DVector<f64>>,
n: usize,
) -> Result<(), GdiisError>
fn extend_matrices( &mut self, errors: &VecDeque<DVector<f64>>, n: usize, ) -> Result<(), GdiisError>
Extends matrices with new error vector.
Sourcefn validate_coefficients(
&self,
coeffs: &[f64],
n_used: usize,
) -> Result<(), GdiisError>
fn validate_coefficients( &self, coeffs: &[f64], n_used: usize, ) -> Result<(), GdiisError>
Validates DIIS coefficients.
GDIIS coefficient check logic:
- CMax = 15.0
- CMin = 1 - CMax = -14 for IChkC != 1
- CMin = 4 * (1 - CMax) = -56 for IChkC == 1 (Regular mode)
Sourcefn validate_cosine(
&self,
residuum: &DVector<f64>,
last_error: &DVector<f64>,
n_used: usize,
) -> Result<(), GdiisError>
fn validate_cosine( &self, residuum: &DVector<f64>, last_error: &DVector<f64>, n_used: usize, ) -> Result<(), GdiisError>
Validates GDIIS step using cosine check.
Auto Trait Implementations§
impl Freeze for GdiisOptimizer
impl RefUnwindSafe for GdiisOptimizer
impl Send for GdiisOptimizer
impl Sync for GdiisOptimizer
impl Unpin for GdiisOptimizer
impl UnsafeUnpin for GdiisOptimizer
impl UnwindSafe for GdiisOptimizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
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
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.