#include <uks_convergenceacc.h>
|
| void | Configure (const options &opt_alpha, const options &opt_beta) |
| void | setLogger (Logger *log) |
| void | setOverlap (AOOverlap &S, double etol) |
| void | setCoupledFockBuilder (const CoupledFockBuilder &builder) |
| void | setOrbitalHessian (const OrbitalHessian &hessian) |
| SpinDensity | DensityMatrix (const tools::EigenSystem &MOs_alpha, const tools::EigenSystem &MOs_beta) const |
| SpinDensity | Iterate (const SpinDensity &dmat, SpinFock &H, tools::EigenSystem &MOs_alpha, tools::EigenSystem &MOs_beta, double totE) |
| tools::EigenSystem | SolveFockmatrix (const Eigen::MatrixXd &H) const |
| Eigen::MatrixXd | UnflattenRotation (const Eigen::VectorXd &v_ov, Index nao, Index nocclevels) const |
| std::pair< Eigen::MatrixXd, Eigen::MatrixXd > | UnflattenCoupledRotation (const Eigen::VectorXd &v, Index nao_alpha, Index nocclevels_alpha, Index nao_beta, Index nocclevels_beta) const |
| Eigen::VectorXd | BuildCoupledSigmaVector (const Eigen::VectorXd &v, const Eigen::MatrixXd &C_alpha, Index nocclevels_alpha, const Eigen::MatrixXd &C_beta, Index nocclevels_beta, const CoupledFockBuilder &coupled_fock_builder, double finite_diff_step=1e-3) const |
| std::pair< Eigen::MatrixXd, Eigen::MatrixXd > | CoupledAugmentedHessianStep (const Eigen::MatrixXd &H_AO_alpha, const tools::EigenSystem &MOs_alpha, Index nocclevels_alpha, const Eigen::MatrixXd &H_AO_beta, const tools::EigenSystem &MOs_beta, Index nocclevels_beta, const CoupledFockBuilder &coupled_fock_builder, double trust_radius, double &predicted_energy_change) const |
| Eigen::MatrixXd | DirectMinimizationRotation (const Eigen::MatrixXd &H_AO, const tools::EigenSystem &MOs, Index nocclevels, double &predicted_energy_change) const |
| bool | isConverged () const |
| double | getDIIsError () const |
| double | getDeltaE () const |
| bool | getUseMixing () const |
|
| Eigen::MatrixXd | DensityMatrixGroundState_unres (const Eigen::MatrixXd &MOs, Index nocclevels) const |
| void | Levelshift (Eigen::MatrixXd &H, const Eigen::MatrixXd &MOs_old, const options &opt, Index nocclevels) const |
| Eigen::MatrixXd | BuildErrorMatrix (const Eigen::MatrixXd &dmat, const Eigen::MatrixXd &H) const |
| double | CombinedError (const Eigen::MatrixXd &err_alpha, const Eigen::MatrixXd &err_beta) const |
| bool | TrailingAverageStalled () const |
| SpinDensity | SecondOrderStep (const SpinDensity &dmat, const SpinFock &H, tools::EigenSystem &MOs_alpha, tools::EigenSystem &MOs_beta, double totE) |
Definition at line 42 of file uks_convergenceacc.h.
◆ CoupledFockBuilder
Initial value:
std::function<
SpinFock(
const Eigen::MatrixXd& ,
const Eigen::MatrixXd& )>
Builds both AO Fock matrices (H0 + Coulomb + exchange + XC) from both spin densities together. Used by CoupledAugmentedHessianStep/BuildCoupledSigmaVector to include the alpha-beta coupling (shared Coulomb potential, cross-spin XC kernel); a decoupled treatment failed to converge in cases where ORCA's coupled TRAH converges. Set by DFTEngine (setCoupledFockBuilder), which owns the integral and XC machinery.
Definition at line 66 of file uks_convergenceacc.h.
◆ KSmode
◆ options
◆ OrbitalHessian
Initial value:std::function<Eigen::MatrixXd(
const Eigen::MatrixXd& F_alpha, const Eigen::MatrixXd& F_beta,
const Eigen::MatrixXd& X)>
Analytic UKS energy Hessian d^2E/dx dx (both channels, layout of trah.h) at the orbitals (MOs_alpha, MOs_beta) with Fock matrices (F_alpha, F_beta), applied to the columns of X. If set, it replaces the finite-difference products of BuildCoupledSigmaVector; if it throws (no second derivatives in libxc), those are used instead.
Definition at line 82 of file uks_convergenceacc.h.
◆ BuildCoupledSigmaVector()
| Eigen::VectorXd votca::xtp::UKSConvergenceAcc::BuildCoupledSigmaVector |
( |
const Eigen::VectorXd & | v, |
|
|
const Eigen::MatrixXd & | C_alpha, |
|
|
Index | nocclevels_alpha, |
|
|
const Eigen::MatrixXd & | C_beta, |
|
|
Index | nocclevels_beta, |
|
|
const CoupledFockBuilder & | coupled_fock_builder, |
|
|
double | finite_diff_step = 1e-3 ) const |
Product of the energy Hessian d^2E/dx dx (both spin channels, with the alpha-beta coupling through J and the XC kernel) with v: a central finite difference of EnergyGradientScale * F_ia along v, with BOTH channels rotated together and one coupled_fock_builder call per displacement. Layout as UnflattenCoupledRotation: alpha block first.
Definition at line 132 of file uks_convergenceacc.cc.
◆ BuildErrorMatrix()
| Eigen::MatrixXd votca::xtp::UKSConvergenceAcc::BuildErrorMatrix |
( |
const Eigen::MatrixXd & | dmat, |
|
|
const Eigen::MatrixXd & | H ) const |
|
private |
◆ CombinedError()
| double votca::xtp::UKSConvergenceAcc::CombinedError |
( |
const Eigen::MatrixXd & | err_alpha, |
|
|
const Eigen::MatrixXd & | err_beta ) const |
|
private |
◆ Configure()
| void votca::xtp::UKSConvergenceAcc::Configure |
( |
const options & | opt_alpha, |
|
|
const options & | opt_beta ) |
◆ CoupledAugmentedHessianStep()
| std::pair< Eigen::MatrixXd, Eigen::MatrixXd > votca::xtp::UKSConvergenceAcc::CoupledAugmentedHessianStep |
( |
const Eigen::MatrixXd & | H_AO_alpha, |
|
|
const tools::EigenSystem & | MOs_alpha, |
|
|
Index | nocclevels_alpha, |
|
|
const Eigen::MatrixXd & | H_AO_beta, |
|
|
const tools::EigenSystem & | MOs_beta, |
|
|
Index | nocclevels_beta, |
|
|
const CoupledFockBuilder & | coupled_fock_builder, |
|
|
double | trust_radius, |
|
|
double & | predicted_energy_change ) const |
TRAH step (trah::Step) over the combined (alpha+beta) rotation space, with Hessian products from the analytic OrbitalHessian if set (else BuildCoupledSigmaVector with coupled_fock_builder) and the orbitals rotated by exp(kappa). Returns both new MO coefficient matrices and, in predicted_energy_change, g.x + 1/2 x.H.x of the step taken (used by Iterate's Fletcher accept/reject check).
Definition at line 289 of file uks_convergenceacc.cc.
◆ DensityMatrix()
◆ DensityMatrixGroundState_unres()
| Eigen::MatrixXd votca::xtp::UKSConvergenceAcc::DensityMatrixGroundState_unres |
( |
const Eigen::MatrixXd & | MOs, |
|
|
Index | nocclevels ) const |
|
private |
◆ DirectMinimizationRotation()
| Eigen::MatrixXd votca::xtp::UKSConvergenceAcc::DirectMinimizationRotation |
( |
const Eigen::MatrixXd & | H_AO, |
|
|
const tools::EigenSystem & | MOs, |
|
|
Index | nocclevels, |
|
|
double & | predicted_energy_change ) const |
Diagonal-Hessian direct-minimisation step for one spin channel, used when no coupled Fock builder is set (e.g. the atomic UKS guess): kappa_ia = -g_ia / h_ia with g_ia = -2 F_ia and h_ia = 2 (eps_a - eps_i) (gaps below 1e-3 Ha raised to 1e-3), each element clamped to 0.1 and the whole step to the current trust radius (Frobenius norm of the antisymmetric kappa). predicted_energy_change: the model's Sum_ia [g_ia kappa_ia + 1/2 h_ia kappa_ia^2] for the step taken.
Definition at line 211 of file uks_convergenceacc.cc.
◆ getDeltaE()
| double votca::xtp::UKSConvergenceAcc::getDeltaE |
( |
| ) |
const |
◆ getDIIsError()
| double votca::xtp::UKSConvergenceAcc::getDIIsError |
( |
| ) |
const |
|
inline |
◆ getUseMixing()
| bool votca::xtp::UKSConvergenceAcc::getUseMixing |
( |
| ) |
const |
|
inline |
◆ isConverged()
| bool votca::xtp::UKSConvergenceAcc::isConverged |
( |
| ) |
const |
◆ Iterate()
◆ Levelshift()
| void votca::xtp::UKSConvergenceAcc::Levelshift |
( |
Eigen::MatrixXd & | H, |
|
|
const Eigen::MatrixXd & | MOs_old, |
|
|
const options & | opt, |
|
|
Index | nocclevels ) const |
|
private |
◆ SecondOrderStep()
One second-order step from the current orbitals (or their density first, if dmat is not it); see Iterate.
Definition at line 705 of file uks_convergenceacc.cc.
◆ setCoupledFockBuilder()
| void votca::xtp::UKSConvergenceAcc::setCoupledFockBuilder |
( |
const CoupledFockBuilder & | builder | ) |
|
|
inline |
◆ setLogger()
| void votca::xtp::UKSConvergenceAcc::setLogger |
( |
Logger * | log | ) |
|
◆ setOrbitalHessian()
| void votca::xtp::UKSConvergenceAcc::setOrbitalHessian |
( |
const OrbitalHessian & | hessian | ) |
|
|
inline |
◆ setOverlap()
| void votca::xtp::UKSConvergenceAcc::setOverlap |
( |
AOOverlap & | S, |
|
|
double | etol ) |
◆ SolveFockmatrix()
| tools::EigenSystem votca::xtp::UKSConvergenceAcc::SolveFockmatrix |
( |
const Eigen::MatrixXd & | H | ) |
const |
◆ TrailingAverageStalled()
| bool votca::xtp::UKSConvergenceAcc::TrailingAverageStalled |
( |
| ) |
const |
|
private |
◆ UnflattenCoupledRotation()
| std::pair< Eigen::MatrixXd, Eigen::MatrixXd > votca::xtp::UKSConvergenceAcc::UnflattenCoupledRotation |
( |
const Eigen::VectorXd & | v, |
|
|
Index | nao_alpha, |
|
|
Index | nocclevels_alpha, |
|
|
Index | nao_beta, |
|
|
Index | nocclevels_beta ) const |
Coupled analogue of UnflattenRotation: splits v (size n_ov_alpha + n_ov_beta, alpha block first) into the antisymmetric rotation matrices kappa_alpha (nao_alpha x nao_alpha) and kappa_beta (nao_beta x nao_beta). Public for unit tests.
Definition at line 117 of file uks_convergenceacc.cc.
◆ UnflattenRotation()
| Eigen::MatrixXd votca::xtp::UKSConvergenceAcc::UnflattenRotation |
( |
const Eigen::VectorXd & | v_ov, |
|
|
Index | nao, |
|
|
Index | nocclevels ) const |
One column of the Davidson trial-vector matrix V, containing [v0; v_ov] (the scalar augmented component and the flattened occ-virt rotation-space vector), mapped back to a full nao x nao antisymmetric matrix (occ-virt/virt-occ blocks only, matching DirectMinimizationRotation's convention), used to apply a trial rotation when building the finite-difference sigma vector. Public for unit tests (test_uks_convergenceacc.cc).
Definition at line 102 of file uks_convergenceacc.cc.
◆ adiis_
| ADIIS votca::xtp::UKSConvergenceAcc::adiis_ |
|
private |
◆ analytic_hessian_failed_
| bool votca::xtp::UKSConvergenceAcc::analytic_hessian_failed_ = false |
|
mutableprivate |
◆ consecutive_adiis_failures_
| Index votca::xtp::UKSConvergenceAcc::consecutive_adiis_failures_ = 0 |
|
private |
◆ coupled_fock_builder_
◆ diis_
| DIIS votca::xtp::UKSConvergenceAcc::diis_ |
|
private |
◆ diiserror_
| double votca::xtp::UKSConvergenceAcc::diiserror_ = 1.0 |
|
private |
◆ diiserror_history_
| std::vector<double> votca::xtp::UKSConvergenceAcc::diiserror_history_ |
|
private |
◆ direct_min_floor_hit_
| bool votca::xtp::UKSConvergenceAcc::direct_min_floor_hit_ = false |
|
private |
◆ direct_min_linear_
| double votca::xtp::UKSConvergenceAcc::direct_min_linear_ = 0.0 |
|
private |
◆ direct_min_pending_
| bool votca::xtp::UKSConvergenceAcc::direct_min_pending_ = false |
|
private |
◆ direct_min_pre_energy_
| double votca::xtp::UKSConvergenceAcc::direct_min_pre_energy_ = 0.0 |
|
private |
◆ direct_min_pre_H_
| SpinFock votca::xtp::UKSConvergenceAcc::direct_min_pre_H_ |
|
private |
◆ direct_min_pre_MOs_alpha_
| Eigen::MatrixXd votca::xtp::UKSConvergenceAcc::direct_min_pre_MOs_alpha_ |
|
private |
◆ direct_min_pre_MOs_alpha_energies_
| Eigen::VectorXd votca::xtp::UKSConvergenceAcc::direct_min_pre_MOs_alpha_energies_ |
|
private |
◆ direct_min_pre_MOs_beta_
| Eigen::MatrixXd votca::xtp::UKSConvergenceAcc::direct_min_pre_MOs_beta_ |
|
private |
◆ direct_min_pre_MOs_beta_energies_
| Eigen::VectorXd votca::xtp::UKSConvergenceAcc::direct_min_pre_MOs_beta_energies_ |
|
private |
◆ direct_min_predicted_change_
| double votca::xtp::UKSConvergenceAcc::direct_min_predicted_change_ = 0.0 |
|
private |
◆ direct_min_step_norm_
| double votca::xtp::UKSConvergenceAcc::direct_min_step_norm_ = 0.0 |
|
private |
◆ dmatHist_alpha_
| std::vector<Eigen::MatrixXd> votca::xtp::UKSConvergenceAcc::dmatHist_alpha_ |
|
private |
◆ dmatHist_beta_
| std::vector<Eigen::MatrixXd> votca::xtp::UKSConvergenceAcc::dmatHist_beta_ |
|
private |
◆ EnergyGradientScale
| double votca::xtp::UKSConvergenceAcc::EnergyGradientScale = -2.0 |
|
staticconstexpr |
Orbital rotations C' = C (1 + kappa), with kappa_ia = x_ia (i occupied, a virtual) and kappa_ai = -x_ia, followed by Lowdin orthonormalisation. Occupied orbital i changes by -x_ia phi_a, so for one spin channel the energy gradient is dE/dx_ia = -2 F_ia, with F the Fock matrix in the current MO basis. All gradients, Hessian products and predicted energy changes of the second-order fallback use this scale.
Definition at line 124 of file uks_convergenceacc.h.
◆ errhist_
| std::vector<double> votca::xtp::UKSConvergenceAcc::errhist_ |
|
private |
◆ kAutoStartIteration
| Index votca::xtp::UKSConvergenceAcc::kAutoStartIteration = 50 |
|
staticconstexprprivate |
◆ kDensityMismatchTolerance
| double votca::xtp::UKSConvergenceAcc::kDensityMismatchTolerance = 1e-8 |
|
staticconstexprprivate |
◆ kEnergyRiseForADIIS
| double votca::xtp::UKSConvergenceAcc::kEnergyRiseForADIIS = 1e-4 |
|
staticconstexprprivate |
◆ kMaxConsecutiveADIISFailures
| Index votca::xtp::UKSConvergenceAcc::kMaxConsecutiveADIISFailures = 5 |
|
staticconstexprprivate |
◆ kMeanRatioTolerance
| double votca::xtp::UKSConvergenceAcc::kMeanRatioTolerance = 1.125 |
|
staticconstexprprivate |
◆ kMinTrustRadius
| double votca::xtp::UKSConvergenceAcc::kMinTrustRadius = 3e-3 |
|
staticconstexprprivate |
◆ kRemovedShift
| double votca::xtp::UKSConvergenceAcc::kRemovedShift = 1e3 |
|
staticconstexprprivate |
◆ kTrailingWindowSize
| Index votca::xtp::UKSConvergenceAcc::kTrailingWindowSize = 10 |
|
staticconstexprprivate |
◆ last_rejected_
| bool votca::xtp::UKSConvergenceAcc::last_rejected_ = false |
|
private |
◆ last_step_linear_
| double votca::xtp::UKSConvergenceAcc::last_step_linear_ = 0.0 |
|
mutableprivate |
◆ last_step_norm_
| double votca::xtp::UKSConvergenceAcc::last_step_norm_ = 0.0 |
|
mutableprivate |
◆ log_
| Logger* votca::xtp::UKSConvergenceAcc::log_ = nullptr |
|
private |
◆ mathist_alpha_
| std::vector<Eigen::MatrixXd> votca::xtp::UKSConvergenceAcc::mathist_alpha_ |
|
private |
◆ mathist_beta_
| std::vector<Eigen::MatrixXd> votca::xtp::UKSConvergenceAcc::mathist_beta_ |
|
private |
◆ nocclevels_alpha_
| Index votca::xtp::UKSConvergenceAcc::nocclevels_alpha_ = 0 |
|
private |
◆ nocclevels_beta_
| Index votca::xtp::UKSConvergenceAcc::nocclevels_beta_ = 0 |
|
private |
◆ opt_alpha_
| options votca::xtp::UKSConvergenceAcc::opt_alpha_ |
|
private |
◆ opt_beta_
| options votca::xtp::UKSConvergenceAcc::opt_beta_ |
|
private |
◆ orbital_hessian_
◆ removed_projector_
| Eigen::MatrixXd votca::xtp::UKSConvergenceAcc::removed_projector_ |
|
private |
◆ S_
| AOOverlap* votca::xtp::UKSConvergenceAcc::S_ = nullptr |
|
private |
◆ Sminusahalf
| Eigen::MatrixXd votca::xtp::UKSConvergenceAcc::Sminusahalf |
|
private |
◆ total_iteration_count_
| Index votca::xtp::UKSConvergenceAcc::total_iteration_count_ = 0 |
|
private |
◆ totE_
| std::vector<double> votca::xtp::UKSConvergenceAcc::totE_ |
|
private |
◆ trah_active_
| bool votca::xtp::UKSConvergenceAcc::trah_active_ = false |
|
private |
◆ trah_options_
◆ trah_subspace_
◆ trust_
◆ usedmixing_
| bool votca::xtp::UKSConvergenceAcc::usedmixing_ = true |
|
private |
The documentation for this class was generated from the following files: