LIBINT 2.9.0
libint2::DIIS< D > Class Template Reference

DIIS (`‘direct inversion of iterative subspace’') extrapolation. More...

#include <diis.h>

Public Types

typedef diis::traits< D >::element_type value_type
 

Public Member Functions

 DIIS (unsigned int strt=1, unsigned int ndi=5, value_type dmp=0, unsigned int ngr=1, unsigned int ngrdiis=1, value_type mf=0)
 Constructor.
 
void extrapolate (D &x, D &error, bool extrapolate_error=false)
 
void start_extrapolation ()
 calling this function forces the extrapolation to start upon next call to extrapolate() even if this object was initialized with start value greater than the current iteration index.
 
void reinitialize (const D *data=0)
 

Detailed Description

template<typename D>
class libint2::DIIS< D >

DIIS (`‘direct inversion of iterative subspace’') extrapolation.

The DIIS class provides DIIS extrapolation to an iterative solver of (systems of) linear or nonlinear equations of the $ f(x) = 0 $ form, where $ f(x) $ is a (non-linear) function of $ x $ (in general, $ x $ is a set of numeric values). Such equations are usually solved iteratively as follows:

  • given a current guess at the solution, $ x_i $, evaluate the error (`‘residual’') $ e_i = f(x_i) $ (NOTE that the dimension of $ x $ and $ e $ do not need to coincide);
  • use the error to compute an updated guess $ x_{i+1} = x_i + g(e_i)
$;
  • proceed until a norm of the error is less than the target precision $ \epsilon $. Another convergence criterion may include $ ||x_{i+1} - x_i|| < \epsilon $ . \ For example, in the Hartree-Fock method in the density form, one could choose $ x \equiv \mathbf{P} $, the one-electron density matrix, and $ f(\mathbf{P}) \equiv [\mathbf{F}, \mathbf{P}] $ , where $ \mathbf{F} = \mathbf{F}(\mathbf{P}) $ is the Fock matrix, a linear function of the density. Because $ \mathbf{F} $ is a linear function of the density and DIIS uses a linear extrapolation, it is possible to just extrapolate the Fock matrix itself, i.e. $ x \equiv \mathbf{F} $ and $ f(\mathbf{F}) \equiv [\mathbf{F}, \mathbf{P}] $ . \ Similarly, in the Hartree-Fock method in the molecular orbital representation, DIIS is used to extrapolate the Fock matrix, i.e. $ x \equiv \mathbf{F} $ and $ f(\mathbf{F}) \equiv \{ F_i^a \} $ , where $ i $ and $ a $ are the occupied and unoccupied orbitals, respectively. \ Here's a short description of the DIIS method. Given a set of solution guess vectors $ \{ x_k \}, k=0..i $ and the corresponding error vectors $ \{ e_k \} $ DIIS tries to find a linear combination of $ x $ that would minimize the error by solving a simple linear system set up from the set of errors. The solution is a vector of coefficients $ \{ C_k \} $ that can be used to obtain an improved $ x $: $ x_{\mathrm{extrap},i+1} = \sum\limits_{k=0}^i C_{k,i} x_{k} $ A more complicated version of DIIS introduces mixing: $ x_{\mathrm{extrap},i+1} = \sum\limits_{k=0}^i C_{k,i} ( (1-f) x_{k} + f
x_{extrap,k} ) $ Note that the mixing is not used in the first iteration. \ The original DIIS reference: P. Pulay, Chem. Phys. Lett. 73, 393 (1980).
    Template Parameters
    Dtype of x

Constructor & Destructor Documentation

◆ DIIS()

template<typename D >
libint2::DIIS< D >::DIIS ( unsigned int strt = 1,
unsigned int ndi = 5,
value_type dmp = 0,
unsigned int ngr = 1,
unsigned int ngrdiis = 1,
value_type mf = 0 )
inline

Constructor.

Parameters
strtThe DIIS extrapolation will begin on the iteration given by this integer (default = 1).
ndiThis integer maximum number of data sets to retain (default = 5).
dmpThis nonnegative floating point number is used to dampen the DIIS extrapolation (default = 0.0).
ngrThe number of iterations in a DIIS group. DIIS extrapolation is only used for the first ngrdiis of these iterations (default = 1). If ngr is 1 and ngrdiis is greater than 0, then DIIS will be used on all iterations after and including the start iteration.
ngrdiisThe number of DIIS extrapolations to do at the beginning of an iteration group. See the documentation for ngr (default = 1).
mfThis real number in [0,1] is used to dampen the DIIS extrapolation by mixing the input data with the output data for each iteration (default = 0.0), which performs no mixing. The approach described in Kerker, Phys. Rev. B, 23, p3082, 1981.

Member Function Documentation

◆ extrapolate()

template<typename D >
void libint2::DIIS< D >::extrapolate ( D & x,
D & error,
bool extrapolate_error = false )
inline
Parameters
[in,out]xOn input, the most recent solution guess; on output, the extrapolated guess
[in,out]errorOn input, the most recent error; on output, the if extrapolate_error == true will be the extrapolated error, otherwise the value unchanged
extrapolate_errorwhether to extrapolate the error (default = false).

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