152 virtual void clear()=0;
163 std::vector<diis_unpol_entry_t>
stack;
181 void update(
const arma::mat & F,
const arma::mat & P,
double E,
double & error);
196 std::vector<diis_pol_entry_t>
stack;
214 void update(
const arma::mat & Fa,
const arma::mat & Fb,
const arma::mat & Pa,
const arma::mat & Pb,
double E,
double & error);
217 void solve_F(arma::mat & Fa, arma::mat & Fb);
220 void solve_P(arma::mat & Pa, arma::mat & Pb);
arma::mat Fb
Beta Fock matrix.
Definition: diis.h:34
std::vector< diis_unpol_entry_t > stack
Fock matrices in AO basis.
Definition: diis.h:163
bool usediis
Use DIIS?
Definition: diis.h:103
arma::vec get_energies() const
Get energies.
Definition: diis.cpp:193
~rDIIS()
Destructor.
Definition: diis.cpp:66
Spin-unpolarized entry.
Definition: diis.h:43
DIIS(const arma::mat &S, const arma::mat &Sinvh, bool usediis, bool c1diis, double diiseps, double diisthr, bool useadiis, bool verbose, size_t imax)
Constructor.
Definition: diis.cpp:39
bool c1diis
C1-DIIS?
Definition: diis.h:105
void solve_F(arma::mat &Fa, arma::mat &Fb)
Compute new Fock matrix, use C1-DIIS if wanted.
Definition: diis.cpp:409
void erase_last()
Reduce size of stack by one.
Definition: diis.cpp:80
void clear()
Clear Fock matrices and errors.
Definition: diis.cpp:72
size_t imax
Maximum amount of matrices to store.
Definition: diis.h:119
bool verbose
Verbose operation?
Definition: diis.h:109
virtual void clear()=0
Clear Fock matrices and errors.
arma::vec get_dEdx_adiis(const arma::vec &x) const
Compute derivative of energy wrt contraction coefficients.
Definition: diis.cpp:653
void clear()
Clear Fock matrices and errors.
Definition: diis.cpp:76
arma::mat Pa
Alpha density matrix.
Definition: diis.h:28
void update(const arma::mat &Fa, const arma::mat &Fb, const arma::mat &Pa, const arma::mat &Pb, double E, double &error)
Add matrices to stack.
Definition: diis.cpp:131
arma::vec get_w()
Compute weights.
Definition: diis.cpp:206
virtual void erase_last()=0
Reduce size of stack by one.
double E
Energy.
Definition: diis.h:36
arma::vec get_w_diis() const
Compute DIIS weights.
Definition: diis.cpp:267
DIIS - Direct Inversion in the Iterative Subspace and ADIIS.
Definition: diis.h:95
Spin-unrestricted DIIS.
Definition: diis.h:194
double E
Energy.
Definition: diis.h:49
Spin-polarized entry.
Definition: diis.h:26
Spin-restricted DIIS.
Definition: diis.h:161
arma::vec err
DIIS error matrix.
Definition: diis.h:39
arma::vec get_c_adiis(bool verbose=false) const
Solve coefficients.
void solve_F(arma::mat &F)
Compute new Fock matrix, use C1-DIIS if wanted.
Definition: diis.cpp:391
arma::mat P
Density matrix.
Definition: diis.h:45
uDIIS(const arma::mat &S, const arma::mat &Sinvh, bool usediis, bool c1diis, double diiseps, double diisthr, bool useadiis, bool verbose, size_t imax)
Constructor.
Definition: diis.cpp:60
double get_E_adiis(const arma::vec &x) const
Compute energy with contraction coefficients .
Definition: diis.cpp:636
arma::vec get_w_diis_wrk(const arma::mat &err) const
Compute DIIS weights, worker routine.
Definition: diis.cpp:272
rDIIS(const arma::mat &S, const arma::mat &Sinvh, bool usediis, bool c1diis, double diiseps, double diisthr, bool useadiis, bool verbose, size_t imax)
Constructor.
Definition: diis.cpp:57
arma::mat Pb
Beta density matrix.
Definition: diis.h:32
virtual ~DIIS()
Destructor.
Definition: diis.cpp:63
std::vector< diis_pol_entry_t > stack
Fock matrices in AO basis - spin polarized.
Definition: diis.h:196
int cooloff
Counter for not using DIIS.
Definition: diis.h:116
arma::mat F
Fock matrix.
Definition: diis.h:47
~uDIIS()
Destructor.
Definition: diis.cpp:69
virtual arma::mat get_diis_error() const =0
Get errors.
void solve_P(arma::mat &Pa, arma::mat &Pb)
Compute new density matrix, use C1-DIIS if wanted.
Definition: diis.cpp:448
bool useadiis
Use ADIIS?
Definition: diis.h:107
arma::vec err
DIIS error matrix.
Definition: diis.h:52
void PiF_update()
ADIIS update.
Definition: diis.cpp:116
void PiF_update()
ADIIS update.
Definition: diis.cpp:162
double diisthr
When to start using DIIS exclusively.
Definition: diis.h:114
virtual arma::vec get_energies() const =0
Get energies.
void solve_P(arma::mat &P)
Compute new density matrix, use C1-DIIS if wanted.
Definition: diis.cpp:430
double diiseps
When to start using DIIS weights.
Definition: diis.h:112
void erase_last()
Reduce size of stack by one.
Definition: diis.cpp:84
void update(const arma::mat &F, const arma::mat &P, double E, double &error)
Add matrices to stack.
Definition: diis.cpp:88
arma::mat PiFj
< P_i - P_n | F(D_j) - F(D_n) > or < Pa_i - Pa_n | Fa(P_j) - Fa(P_n) > + < Pb_i - Pb_n | Fb(P_j) - Fb...
Definition: diis.h:131
arma::mat Fa
Alpha Fock matrix.
Definition: diis.h:30
arma::mat S
Overlap matrix.
Definition: diis.h:98
arma::mat get_diis_error() const
Get errors.
Definition: diis.cpp:186
arma::vec get_w_adiis() const
Compute ADIIS weights.
Definition: diis.cpp:509
arma::vec get_energies() const
Get energies.
Definition: diis.cpp:179
arma::mat Sinvh
Half-inverse overlap matrix.
Definition: diis.h:100
arma::vec PiF
< P_i - P_n | F(D_n) > or < Pa_i - Pa_n | Fa(P_n) > + < Pb_i - Pb_n | Fb(P_n) >
Definition: diis.h:129
arma::mat get_diis_error() const
Get errors.
Definition: diis.cpp:199