High-precision calculations for one- and two-valence atomic systems
ExternalField::AndersonVectorHistory

ok

Anderson mixing history of a fixed-point iteration x -> G(x) on a state held as one real vector, as used by the TDHF solvers (the whole set of core corrections, flattened).

As AndersonHistory: holds the map outputs \( g_k = G(x_k) \), the residuals \( r_k = g_k - x_k \) and their Gram matrix (Euclidean inner product), kept incrementally. At most depth entries are kept: the oldest is dropped when the history is full, and (see anderson_coefficients) while the Gram matrix is ill-conditioned.

#include <Anderson.hpp>

Public Member Functions

 AndersonVectorHistory (std::size_t depth)
 
void push (const std::vector< double > &x, std::vector< double > g)
 Adds the entry for iterate x with map output g = G(x) (residual g - x); drops the oldest entry if the history is full.
 
std::vector< double > mix ()
 The Anderson extrapolation over the kept entries, x = sum_k c_k g_k, with the coefficients of anderson_coefficients; entries that had to be dropped for conditioning are dropped from the history too.
 
std::size_t size () const
 Number of kept entries.
 

Member Function Documentation

◆ push()

void ExternalField::AndersonVectorHistory::push ( const std::vector< double > &  x,
std::vector< double >  g 
)

Adds the entry for iterate x with map output g = G(x) (residual g - x); drops the oldest entry if the history is full.

◆ mix()

std::vector< double > ExternalField::AndersonVectorHistory::mix ( )

The Anderson extrapolation over the kept entries, x = sum_k c_k g_k, with the coefficients of anderson_coefficients; entries that had to be dropped for conditioning are dropped from the history too.

If no entry is usable (the coefficients could not be solved for), returns the plain step: the latest map output, and the history is cleared.

◆ size()

std::size_t ExternalField::AndersonVectorHistory::size ( ) const
inline

Number of kept entries.


The documentation for this class was generated from the following files: