template<typename T>
class mpqc::cc::DIISSolver< T >
DIISSolver updates the CC T amplitudes using DIIS
- Template Parameters
-
T | the type representing the n-body amplitude set |
|
| DIISSolver (const KeyVal &kv) |
| The KeyVal constructor. More...
|
|
virtual | ~DIISSolver ()=default |
|
void | update (std::vector< std::reference_wrapper< T >> &t_pack, const std::vector< std::reference_wrapper< const T >> &r_pack, double dE=0) override |
|
bool | is_converged (double target_precision, double error, double dE) const override |
|
void | reset () |
| Resets the DIIS solver; used when switching to a new solver subspace. More...
|
|
|
virtual void | update_only (std::vector< std::reference_wrapper< T >> &t_pack, const std::vector< std::reference_wrapper< const T >> &r_pack, double dE=0) |
|
TA::DIIS< TVec > & | diis () |
|
◆ Policy
◆ Tile
◆ TVec
◆ DIISSolver()
The KeyVal constructor.
- Parameters
-
kv | the KeyVal object; it will be queried for the following keywords |
Keyword | Type | Default | Description |
diis_start | int | 1 | The DIIS extrapolation will begin on the iteration given by this integer. |
n_diis | int | 8 | This specifies maximum number of data sets to retain. |
diis_damp | real | 0.0 | This nonnegative floating point number is used to dampen the DIIS extrapolation. |
diis_damping_attenuation | real | 1e-3 | this nonnegative floating point number defines the 2-norm of the error when when the damping factor for the DIIS extrapolation starts to decay linearly with the error |
diis_ngroup | int | 1 | The number of iterations in a DIIS group. DIIS extrapolation is only used for the first diis_group_nstart of these iterations. If diis_ngroup is 1 and diis_group_nstart is greater than 0, then DIIS will be used on all iterations after and including the start iteration. |
diis_group_nstart | int | 1 | The number of DIIS extrapolations to do at the beginning of an iteration group. See the documentation for diis_ngroup . |
◆ ~DIISSolver()
◆ diis()
◆ is_converged()
template<typename T >
bool mpqc::cc::DIISSolver< T >::is_converged |
( |
double |
target_precision, |
|
|
double |
error, |
|
|
double |
dE |
|
) |
| const |
|
inlineoverride |
Tests if the solver has converged
- Parameters
-
target_precision | The desired precision for the final CC energy |
error | The value of the error computed from the equation residuals |
dE | The energy change between two consecutive solver iterations |
- Returns
- Whether or not the solver has converged
◆ precision_margin_energy()
Specifies the extra margin for converging energy. DIIS solver is converged to precision eps
if the energy between two successive iterations is converged to eps
times the margin. Currently it is fixed empirically at 0.1 , i.e. solver is converged if the difference between two consecutive iterations is less than 1/10th of the target precision.
- Returns
- the extra margin for converging energy
◆ reset()
Resets the DIIS solver; used when switching to a new solver subspace.
◆ update()
template<typename T >
void mpqc::cc::DIISSolver< T >::update |
( |
std::vector< std::reference_wrapper< T >> & |
t_pack, |
|
|
const std::vector< std::reference_wrapper< const T >> & |
r_pack, |
|
|
double |
dE = 0 |
|
) |
| |
|
inlineoverride |
Update the amplitudes using update_only() and extrapolate using DIIS.
- Warning
- This function assumes that {
t1
, t2
} and {r1
, r2
} are congruent, but does not assume any particular structure. Derived classes may impose additional assumptions on the structure of the arguments.
- Parameters
-
t1 | the 1-body amplitude set (current values on input, updated values on output) |
t2 | the 2-body amplitude set (current values on input, updated values on output) |
r1 | the 1-body amplitude equation residual set (contents may be modified) |
r2 | the 2-body amplitude equation residual set (contents may be modified) |
◆ update_only()
template<typename T >
virtual void mpqc::cc::DIISSolver< T >::update_only |
( |
std::vector< std::reference_wrapper< T >> & |
t_pack, |
|
|
const std::vector< std::reference_wrapper< const T >> & |
r_pack, |
|
|
double |
dE = 0 |
|
) |
| |
|
inlineprotectedvirtual |
this performs the amplitude update only, to be followed up with DIIS
- Warning
- This function assumes that {
t1
, t2
} and {r1
, r2
} are congruent, but does not assume any particular structure. Derived classes may impose additional assumptions on the structure of the arguments.
The documentation for this class was generated from the following files: