|
votca 2026-dev
|
#include <convergenceacc.h>

Classes | |
| struct | options |
| struct | SpinDensity |
| Spin-resolved density matrices returned for open-shell SCF updates. More... | |
Public Types | |
| enum | KSmode { closed , open , fractional , restricted_open } |
| Occupation model used when constructing density matrices. More... | |
Public Member Functions | |
| void | Configure (const ConvergenceAcc::options &opt) |
| void | setLogger (Logger *log) |
| Attach the logger used for convergence diagnostics. | |
| void | PrintConfigOptions () const |
| Print the active convergence-acceleration settings to the logger. | |
| bool | isConverged () const |
| double | getDeltaE () const |
| Return the total-energy change between the two most recent SCF iterations. | |
| void | setOverlap (AOOverlap &S, double etol) |
| Precompute overlap-dependent quantities used when solving the Fock matrix. | |
| double | getDIIsError () const |
| Return the DIIS commutator norm from the latest iteration. | |
| bool | getUseMixing () const |
| Eigen::MatrixXd | Iterate (const Eigen::MatrixXd &dmat, Eigen::MatrixXd &H, tools::EigenSystem &MOs, double totE) |
| tools::EigenSystem | SolveFockmatrix (const Eigen::MatrixXd &H) const |
| Solve the generalized eigenvalue problem for the current Fock matrix. | |
| void | Levelshift (Eigen::MatrixXd &H, const Eigen::MatrixXd &MOs_old) const |
| Apply a virtual-space level shift in the molecular-orbital basis. | |
| Eigen::MatrixXd | DensityMatrix (const tools::EigenSystem &MOs) const |
| SpinDensity | DensityMatrixSpinResolved (const tools::EigenSystem &MOs) const |
Private Member Functions | |
| Eigen::MatrixXd | DensityMatrixGroundState (const Eigen::MatrixXd &MOs) const |
| Eigen::MatrixXd | DensityMatrixGroundState_unres (const Eigen::MatrixXd &MOs) const |
| Eigen::MatrixXd | DensityMatrixGroundState_frac (const tools::EigenSystem &MOs) const |
| Construct a fractional-occupation density matrix from orbital occupations. | |
| SpinDensity | DensityMatrixGroundState_restricted_open (const Eigen::MatrixXd &MOs) const |
Private Attributes | |
| options | opt_ |
| bool | usedmixing_ = true |
| double | diiserror_ = std::numeric_limits<double>::max() |
| Logger * | log_ |
| const AOOverlap * | S_ |
| Eigen::MatrixXd | Sminusahalf |
| std::vector< Eigen::MatrixXd > | mathist_ |
| std::vector< Eigen::MatrixXd > | dmatHist_ |
| std::vector< double > | totE_ |
| Index | nocclevels_ |
| Index | maxerrorindex_ = 0 |
| double | maxerror_ = 0.0 |
| ADIIS | adiis_ |
| DIIS | diis_ |
SCF convergence accelerator for Kohn-Sham iterations.
The class stores the Fock and density history needed for linear mixing, Pulay DIIS, and ADIIS, and provides the density construction matching the selected occupation model.
Definition at line 43 of file convergenceacc.h.
Occupation model used when constructing density matrices.
| Enumerator | |
|---|---|
| closed | |
| open | |
| fractional | |
| restricted_open | |
Definition at line 46 of file convergenceacc.h.
|
inline |
Store SCF acceleration settings and derive the number of occupied levels for the selected KS mode.
Definition at line 105 of file convergenceacc.h.
| Eigen::MatrixXd votca::xtp::ConvergenceAcc::DensityMatrix | ( | const tools::EigenSystem & | MOs | ) | const |
Build the density matrix corresponding to the configured KS occupation model.
Definition at line 383 of file convergenceacc.cc.
|
private |
Construct a closed-shell ground-state density matrix from occupied orbitals.
Definition at line 258 of file convergenceacc.cc.
|
private |
Construct a fractional-occupation density matrix from orbital occupations.
Definition at line 292 of file convergenceacc.cc.
|
private |
Construct alpha and beta densities for a restricted open-shell determinant.
Definition at line 337 of file convergenceacc.cc.
|
private |
Construct a fully occupied unrestricted density matrix from the supplied orbitals.
Definition at line 270 of file convergenceacc.cc.
| ConvergenceAcc::SpinDensity votca::xtp::ConvergenceAcc::DensityMatrixSpinResolved | ( | const tools::EigenSystem & | MOs | ) | const |
Build separate alpha and beta density matrices for spin-resolved SCF modes.
Definition at line 366 of file convergenceacc.cc.
|
inline |
Return the total-energy change between the two most recent SCF iterations.
Definition at line 137 of file convergenceacc.h.
|
inline |
Return the DIIS commutator norm from the latest iteration.
Definition at line 148 of file convergenceacc.h.
|
inline |
Report whether plain density mixing is currently used instead of extrapolation.
Definition at line 152 of file convergenceacc.h.
|
inline |
Check whether both the total-energy change and DIIS error are below their thresholds.
Definition at line 127 of file convergenceacc.h.
| Eigen::MatrixXd votca::xtp::ConvergenceAcc::Iterate | ( | const Eigen::MatrixXd & | dmat, |
| Eigen::MatrixXd & | H, | ||
| tools::EigenSystem & | MOs, | ||
| double | totE ) |
Advance the SCF accelerator by one step and return the updated density matrix.
Definition at line 60 of file convergenceacc.cc.
| void votca::xtp::ConvergenceAcc::Levelshift | ( | Eigen::MatrixXd & | H, |
| const Eigen::MatrixXd & | MOs_old ) const |
Apply a virtual-space level shift in the molecular-orbital basis.
Definition at line 219 of file convergenceacc.cc.
| void votca::xtp::ConvergenceAcc::PrintConfigOptions | ( | ) | const |
Print the active convergence-acceleration settings to the logger.
Definition at line 157 of file convergenceacc.cc.
|
inline |
Attach the logger used for convergence diagnostics.
Definition at line 120 of file convergenceacc.h.
| void votca::xtp::ConvergenceAcc::setOverlap | ( | AOOverlap & | S, |
| double | etol ) |
Precompute overlap-dependent quantities used when solving the Fock matrix.
Convergence acceleration for the SCF cycle.
The central residual is the AO-metric commutator R = F P S - S P F, which vanishes at self-consistency in a non-orthogonal basis. This file provides the orthogonalized residual, DIIS or ADIIS extrapolation, level shifting, and occupation-model-specific density construction.
Definition at line 37 of file convergenceacc.cc.
| tools::EigenSystem votca::xtp::ConvergenceAcc::SolveFockmatrix | ( | const Eigen::MatrixXd & | H | ) | const |
Solve the generalized eigenvalue problem for the current Fock matrix.
Definition at line 194 of file convergenceacc.cc.
|
private |
Definition at line 203 of file convergenceacc.h.
|
private |
Definition at line 204 of file convergenceacc.h.
|
private |
Definition at line 191 of file convergenceacc.h.
|
private |
Definition at line 197 of file convergenceacc.h.
|
private |
Definition at line 192 of file convergenceacc.h.
|
private |
Definition at line 196 of file convergenceacc.h.
|
private |
Definition at line 202 of file convergenceacc.h.
|
private |
Definition at line 201 of file convergenceacc.h.
|
private |
Definition at line 200 of file convergenceacc.h.
|
private |
Definition at line 172 of file convergenceacc.h.
|
private |
Definition at line 193 of file convergenceacc.h.
|
private |
Definition at line 195 of file convergenceacc.h.
|
private |
Definition at line 198 of file convergenceacc.h.
|
private |
Definition at line 190 of file convergenceacc.h.