Struct rest::scf_io::ScfTraceRecord
source · [−]pub struct ScfTraceRecord {
pub num_iter: usize,
pub mixer: String,
pub num_max_records: usize,
pub mix_param: f64,
pub start_diis_cycle: usize,
pub scf_energy: f64,
pub eigenvectors: [MatrixFull<f64>; 2],
pub eigenvalues: [Vec<f64>; 2],
pub density_matrix: [Vec<MatrixFull<f64>>; 2],
pub target_vector: Vec<[MatrixFull<f64>; 2]>,
pub error_vector: Vec<Vec<f64>>,
}
Fields
num_iter: usize
mixer: String
num_max_records: usize
mix_param: f64
start_diis_cycle: usize
scf_energy: f64
eigenvectors: [MatrixFull<f64>; 2]
eigenvalues: [Vec<f64>; 2]
density_matrix: [Vec<MatrixFull<f64>>; 2]
target_vector: Vec<[MatrixFull<f64>; 2]>
error_vector: Vec<Vec<f64>>
Implementations
sourceimpl ScfTraceRecord
impl ScfTraceRecord
pub fn new(
num_max_records: usize,
mix_param: f64,
mixer: String,
start_diis_cycle: usize
) -> ScfTraceRecord
pub fn initialize(scf: &SCF) -> ScfTraceRecord
sourcepub fn update(&mut self, scf: &SCF)
pub fn update(&mut self, scf: &SCF)
This subroutine updates:
scf_energy: from previous to the current value
scf_eigenvalues: from previous to the current value
scf_eigenvectors: from previous to the current value
scf_density_matrix: [pre, cur]
num_iter
This subroutine should be called after [scf.check_scf_convergence
] and before [self.prepare_next_input
]“
sourcepub fn prepare_next_input(&mut self, scf: &mut SCF)
pub fn prepare_next_input(&mut self, scf: &mut SCF)
This subroutine prepares the fock matrix for the next step according different mixing algorithm
self.mixer =
- “direct”: the output density matrix in the current step
n0[out]
will be used directly to generate the the input fock matrix of the next step - “linear”: the density matrix used in the next step
n1[in]
is a mix between the input density matrix in the current stepn0[in]
andn0[out]
n1[in] = alpha*n0[out] + (1-alpha)*n0[in]
= n0[in] + alpha * Rn0
where alpha the mixing parameter obtained from self.mix_param andRn0 = n0[out]-n0[in]
is the density matrix change in the current step.n1[in]
is then be used to generate the input fock matrix of the next step - “diis”: the input fock matrix of the next step
f1[in] = sum_{i} c_i*f_i[in]
, wheref_i[in]
is the input fock matrix of the ith step and c_i is obtained by the diis altogirhm against the error vector of the commutator(f_i[out]*d_i[out]*s-s*d_i[out]*f_i[out])
, where
-f_i[out]
is the ith output fock matrix,
-d_i[out]
is the ith output density matrix,
-s
is the overlap matrix - Ref: P. Pulay, Improved SCF Convergence Acceleration, JCC, 1982, 3:556-560.
Trait Implementations
sourceimpl Clone for ScfTraceRecord
impl Clone for ScfTraceRecord
sourcefn clone(&self) -> ScfTraceRecord
fn clone(&self) -> ScfTraceRecord
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations
impl RefUnwindSafe for ScfTraceRecord
impl Send for ScfTraceRecord
impl Sync for ScfTraceRecord
impl Unpin for ScfTraceRecord
impl UnwindSafe for ScfTraceRecord
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
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 morefn 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.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 morefn 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).unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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.