occ
Loading...
Searching...
No Matches
occ::interaction::HartreeFock Class Reference

#include <hf.h>

Inheritance diagram for occ::interaction::HartreeFock:
[legend]
Collaboration diagram for occ::interaction::HartreeFock:
[legend]

Public Types

enum class  ResponseMode { Exact , Approximate }
 Operators for a CPHF response: the SCF's own (Exact), or a cheaper stand-in to precondition with (Approximate: RI-J and four-centre exchange; a DFT procedure also coarsens its XC grid). More...
using COSXGridSchedule = occ::qm::COSXGridSchedule
using ExchangeOperators = std::vector<std::pair<double, double>>
 Exact-exchange operators (c_t, omega_t) in the energy; HF is {(1, 0)}.

Public Member Functions

 HartreeFock (const AOBasis &basis)
const auto & aobasis () const
auto nbf () const
bool usual_scf_energy () const
void update_scf_energy (occ::core::EnergyComponents &) const
FockBuildProperties fock_build_properties () const
bool have_effective_core_potentials () const
void set_density_fitting_basis (const std::string &, double auto_aux_threshold=1e-4)
void set_density_fitting_policy (IntegralEngineDF::Policy policy)
void set_density_fitting_memory_limit (size_t bytes)
void set_coulomb_method (CoulombMethod method)
void set_cosx_exchange (occ::numint::COSXGridLevel level=occ::numint::COSXGridLevel::Grid1)
 COSX exchange on one fixed grid.
void set_cosx_settings (const occ::qm::cosx::Settings &settings)
void set_cosx_exchange_scale (double scale)
 The factor the caller applies to this exchange (a global hybrid's exact exchange fraction).
void set_cosx_grid_schedule (const COSXGridSchedule &schedule={})
bool advance_scf_grid (double diis_error, bool converged)
 SCF hook: called after each iteration's DIIS step.
bool scf_fock_approximate () const
 SCF hooks for the frozen grid correction: whether the last Fock build used it (so convergence there is not convergence on the refine grid), and a request that the next build be exact and refresh it.
void refresh_scf_fock_correction ()
void set_scf_fock_incremental (bool incremental)
 SCF hook: whether the next Fock build is handed a difference density.
double incremental_fock_floor () const
 SCF hook: the DIIS error below which difference-density builds stop.
double final_energy_correction (const MolecularOrbitals &mo)
 SCF hook: called once at convergence.
double finalize_cosx_grid (const MolecularOrbitals &mo, const ExchangeOperators &operators)
double cosx_energy_shift_from (occ::numint::COSXGridLevel other, const MolecularOrbitals &mo, const ExchangeOperators &operators={ {1.0, 0.0}})
 COSX exchange energy at mo on the current grid minus that on other, non-self-consistently, leaving the current grid in place.
bool using_cosx () const
bool using_density_fitting () const
const IntegralEngine & integral_engine () const
 The exact-integral engine (one-electron and point-charge integrals).
HartreeFock with_new_basis (const AOBasis &new_basis) const
 Create a new HartreeFock instance with the same settings but different basis.
void copy_two_electron_setup_to (HartreeFock &other) const
 Give other (typically the same system at another geometry) this object's two-electron treatment: density fitting (basis rebuilt for other's atoms), Coulomb method and storage policy, and COSX (fixed grid or schedule, and settings).
std::vector< Mat > factor_response_densities (const std::vector< Mat > &D1, const Mat &C) const
 Factor each response density as Cx C^T + C Cx^T (no virtual-virtual block); throws otherwise.
IntegralEngineDF * approximate_coulomb_engine () const
 RI-J engine for approximate responses: the SCF's own when it fits J, else one built on def2-universal-jkfit (null if unavailable).
IntegralEngineDF * exchange_df_engine (double omega) const
 The density-fitting engine for exchange with operator omega (the attenuated twin for omega != 0).
void set_precision (double precision)
double integral_precision () const
double nuclear_point_charge_interaction_energy (const PointChargeList &) const
double wolf_point_charge_interaction_energy (const PointChargeList &, const std::vector< double > &partial_charges, double alpha, double rc) const
Mat compute_fock (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
Mat3N additional_atomic_gradients (const MolecularOrbitals &mo) const
MatTriple compute_fock_gradient (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
Mat compute_fock_mixed_basis (const MolecularOrbitals &mo_minbs, const gto::AOBasis &bs, bool is_shell_diagonal)
Mat compute_fock_from_density (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
 Fock matrix from a density already expressed in this method's own basis.
JKPair compute_JK (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
JKTriple compute_JK_gradient (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
std::vector< JKPair > compute_JK_list (const std::vector< MolecularOrbitals > &mo, const Mat &Schwarz=Mat()) const
Mat compute_J (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
Mat compute_K (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
JKPair coulomb_and_range_separated_exchange (const MolecularOrbitals &mo, double omega, double alpha, double beta, const Mat &Schwarz=Mat())
MatTriple compute_J_gradient (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
Mat3N compute_jk_gradient (const MolecularOrbitals &mo, double jf, double kf, const Mat &Schwarz=Mat()) const
 Nuclear gradient of jf * E_J + kf * E_K (E_K the full exact-exchange energy), contracted in the integral loop: 3 x natom, no derivative matrices.
Mat3N compute_k_gradient_long_range (const MolecularOrbitals &mo, double omega, double kf, const Mat &Schwarz=Mat()) const
 As compute_jk_gradient, exchange only, with the attenuated operator erf(omega r)/r: the gradient of kf * E_K[erf].
std::vector< Mat > compute_response_fock (const MolecularOrbitals &mo, const std::vector< Mat > &D1, const Mat &Schwarz=Mat()) const
 G[D1] = dF/dD . D1 for each first-order density (same layout as mo.D).
std::vector< Mat > compute_response_jk (const std::vector< Mat > &D1, double jf, double kf, double omega=0.0, const Mat &Schwarz=Mat(), const MolecularOrbitals *ref=nullptr) const
 jf * 2 J[D1] - kf * K[D1] for each restricted D1; omega != 0 selects the attenuated exchange (then jf must be 0).
std::vector< Mat > response_occ (const MolecularOrbitals &mo, const std::vector< Mat > &Cx, double jf, const ExchangeOperators &K, const Mat &Schwarz, ResponseMode mode=ResponseMode::Exact) const
 (jf 2 J[D1] - sum_t c_t K_{omega_t}[D1]) Co for D1 = Cx Co^T + Co Cx^T (restricted), or per spin (jf J[D1^a + D1^b] - sum_t c_t K[D1^s]) Co^s (unrestricted).
std::vector< Mat > compute_response_fock_occ (const MolecularOrbitals &mo, const std::vector< Mat > &Cx, const Mat &Schwarz=Mat()) const
 The CPHF response of HF: G[D1] Co with D1 = Cx Co^T + Co Cx^T.
std::vector< Mat > compute_response_fock_occ_approx (const MolecularOrbitals &mo, const std::vector< Mat > &Cx, const Mat &Schwarz=Mat()) const
bool has_approximate_response () const
 Whether the approximate response (density-fitted Coulomb, four-centre exchange) is cheaper than the exact one: only when the exact exchange is COSX, since four-centre exchange costs as much as RI-K.
std::string analytic_hessian_unsupported (SpinorbitalKind kind) const
 Empty if the analytic Hessian supports this calculation, otherwise why not (the caller falls back to finite differences).
Mat compute_jk_hessian (const MolecularOrbitals &mo, double jf, const ExchangeOperators &K, const Mat &Schwarz=Mat()) const
 Skeleton Hessian (fixed density) of jf E_J + sum_t c_t E_K[omega_t], with the SCF's operators (four-centre, RI-J, RI-K; four-centre Coulomb and full-range exchange in one pass).
std::vector< Mat > compute_jk_derivative_fock (const MolecularOrbitals &mo, double jf, const ExchangeOperators &K, const Mat &Schwarz=Mat()) const
 Skeleton Fock derivatives of jf 2J - sum_t c_t K[omega_t] for every nuclear coordinate, as full matrices (unrestricted: per spin, alpha rows over beta rows) or contracted with C_o (cphf::contract_occupied).
std::vector< Mat > compute_jk_derivative_fock_occ (const MolecularOrbitals &mo, double jf, const ExchangeOperators &K, const Mat &Schwarz=Mat()) const
std::vector< Mat > compute_exchange_nonvariational_fock_occ (const MolecularOrbitals &mo, const ExchangeOperators &K) const
 d/dR (1/2 dE_K/dD - F_K) C_o at fixed density, F_K = -sum_t c_t K_{omega_t} the SCF's exchange: the COSX Fock is not exactly the energy's density derivative, and the analytic gradient's density response sees the latter.
Mat compute_one_electron_hessian (const Mat &P, const Mat &Q) const
 sum P h^{xy} - sum Q S^{xy} (3N x 3N), total densities.
void compute_one_electron_derivative_matrices (std::vector< Mat > &S1, std::vector< Mat > &H1) const
 S^{(x)} and h^{(x)} for every nuclear coordinate (3N each).
Mat two_electron_hessian (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
 Skeleton two-electron Hessian (fixed density), Coulomb + full exchange.
std::vector< Mat > two_electron_derivative_fock (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
 Skeleton two-electron Fock derivatives (3N matrices).
std::vector< Mat > two_electron_derivative_fock_occ (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
 The same contracted with the occupied coefficients (nbf x nocc each).
std::vector< Mat > nonvariational_fock_derivative_occ (const MolecularOrbitals &mo) const
Mat3N compute_exchange_gradient (const MolecularOrbitals &mo, double kf, double omega=0.0, const Mat &Schwarz=Mat()) const
 Gradient of kf * E_K for the exchange operator in use: COSX when it is enabled (consistent with the COSX energy), else exact four-centre.
Mat3N two_electron_gradient (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
 Two-electron part of the HF nuclear gradient (Coulomb + full exchange), with the same exchange approximation as the SCF.
Mat3N compute_coulomb_gradient (const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const
 Gradient of E_J for the Coulomb operator in use: RI-J when the SCF's J is density-fitted, else four-centre.
std::vector< Mat > compute_J_list (const std::vector< MolecularOrbitals > &mo, const Mat &Schwarz=Mat()) const
Mat compute_kinetic_matrix () const
MatTriple compute_kinetic_gradient () const
Mat compute_overlap_matrix () const
Mat compute_overlap_matrix_for_basis (const occ::gto::AOBasis &basis) const
MatTriple compute_overlap_gradient () const
Mat compute_nuclear_attraction_matrix () const
MatTriple compute_nuclear_attraction_gradient () const
MatTriple compute_rinv_gradient_for_atom (size_t atom_index) const
Mat compute_effective_core_potential_matrix () const
Mat3N compute_ecp_gradient (const MolecularOrbitals &mo) const
 Nuclear gradient of the ECP energy (3 x natoms), zero without ECPs.
Mat compute_point_charge_interaction_matrix (const PointChargeList &point_charges, double alpha=1e16) const
Mat compute_wolf_interaction_matrix (const PointChargeList &point_charges, const std::vector< double > &partial_charges, double alpha, double rc) const
Mat3N electronic_electric_field_contribution (const MolecularOrbitals &mo, const Mat3N &) const
Vec electronic_electric_potential_contribution (const MolecularOrbitals &mo, const Mat3N &) const
Mat compute_schwarz_ints () const
void update_core_hamiltonian (const MolecularOrbitals &mo, Mat &H)
template<int order>
occ::core::Multipole< order > compute_electronic_multipoles (const MolecularOrbitals &mo, const Vec3 &o={0.0, 0.0, 0.0}) const
template<unsigned int order = 1>
auto compute_nuclear_multipoles (const Vec3 &o={0.0, 0.0, 0.0}) const
template<int order>
auto compute_multipoles (const MolecularOrbitals &mo, const Vec3 &o={0.0, 0.0, 0.0}) const
Mat compute_K_long_range (const MolecularOrbitals &mo, double omega, const Mat &Schwarz=Mat()) const
 Exchange built with the attenuated operator erf(omega r)/r.
MatTriple compute_K_gradient_long_range (const MolecularOrbitals &mo, double omega, const Mat &Schwarz=Mat()) const
 Exchange gradient with the attenuated operator, as above.
std::string name () const
Public Member Functions inherited from occ::qm::SCFMethodBase
 SCFMethodBase (const std::vector< core::Atom > &)
const auto & atoms () const
int system_charge () const
int total_electrons () const
int active_electrons () const
const auto & frozen_electrons () const
Vec3 center_of_mass () const
void set_system_charge (int charge)
double nuclear_repulsion_energy () const
Mat3N nuclear_repulsion_gradient () const
Vec nuclear_electric_potential_contribution (const Mat3N &) const
Mat3N nuclear_electric_field_contribution (const Mat3N &) const
void set_frozen_electrons (const std::vector< int > &)

Additional Inherited Members

Protected Member Functions inherited from occ::qm::SCFMethodBase
void update_electron_count ()
Protected Attributes inherited from occ::qm::SCFMethodBase
int m_charge {0}
int m_num_electrons {0}
int m_num_frozen {0}
std::vector< occ::core::Atom > m_atoms
std::vector< int > m_frozen_electrons

Member Typedef Documentation

◆ COSXGridSchedule

◆ ExchangeOperators

using occ::qm::HartreeFock::ExchangeOperators = std::vector<std::pair<double, double>>

Exact-exchange operators (c_t, omega_t) in the energy; HF is {(1, 0)}.

Member Enumeration Documentation

◆ ResponseMode

Operators for a CPHF response: the SCF's own (Exact), or a cheaper stand-in to precondition with (Approximate: RI-J and four-centre exchange; a DFT procedure also coarsens its XC grid).

Enumerator
Exact 
Approximate 

Constructor & Destructor Documentation

◆ HartreeFock()

occ::qm::HartreeFock::HartreeFock ( const AOBasis & basis)

Member Function Documentation

◆ additional_atomic_gradients()

Mat3N occ::qm::HartreeFock::additional_atomic_gradients ( const MolecularOrbitals & mo) const
inline

◆ advance_scf_grid()

bool occ::qm::HartreeFock::advance_scf_grid ( double diis_error,
bool converged )

SCF hook: called after each iteration's DIIS step.

Returns true when the procedure switched to a finer COSX grid, in which case the SCF must rebuild the Fock matrix in full and keep iterating.

◆ analytic_hessian_unsupported()

Empty if the analytic Hessian supports this calculation, otherwise why not (the caller falls back to finite differences).

◆ aobasis()

const auto & occ::qm::HartreeFock::aobasis ( ) const
inline

◆ approximate_coulomb_engine()

RI-J engine for approximate responses: the SCF's own when it fits J, else one built on def2-universal-jkfit (null if unavailable).

◆ compute_coulomb_gradient()

Mat3N occ::qm::HartreeFock::compute_coulomb_gradient ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const
inline

Gradient of E_J for the Coulomb operator in use: RI-J when the SCF's J is density-fitted, else four-centre.

◆ compute_ecp_gradient()

Mat3N occ::qm::HartreeFock::compute_ecp_gradient ( const MolecularOrbitals & mo) const
inline

Nuclear gradient of the ECP energy (3 x natoms), zero without ECPs.

Contracted with mo's density; the caller applies occ's factor of two. The ECP operator is spin-independent, so open-shell densities are contracted as the sum of their spin blocks. Handing the kernel the stacked 2n x n mo.D would silently read only the alpha block, since it indexes D.block(bf0, bf1, ...).

◆ compute_effective_core_potential_matrix()

◆ compute_electronic_multipoles()

template<int order>
occ::core::Multipole< order > occ::qm::HartreeFock::compute_electronic_multipoles ( const MolecularOrbitals & mo,
const Vec3 & o = {0.0, 0.0, 0.0} ) const
inline

◆ compute_exchange_gradient()

Mat3N occ::qm::HartreeFock::compute_exchange_gradient ( const MolecularOrbitals & mo,
double kf,
double omega = 0.0,
const Mat & Schwarz = Mat() ) const

Gradient of kf * E_K for the exchange operator in use: COSX when it is enabled (consistent with the COSX energy), else exact four-centre.

omega != 0 selects erf(omega r)/r.

◆ compute_exchange_nonvariational_fock_occ()

std::vector< Mat > occ::qm::HartreeFock::compute_exchange_nonvariational_fock_occ ( const MolecularOrbitals & mo,
const ExchangeOperators & K ) const

d/dR (1/2 dE_K/dD - F_K) C_o at fixed density, F_K = -sum_t c_t K_{omega_t} the SCF's exchange: the COSX Fock is not exactly the energy's density derivative, and the analytic gradient's density response sees the latter.

Empty when they coincide (not COSX).

◆ compute_fock()

Mat occ::qm::HartreeFock::compute_fock ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const

◆ compute_fock_from_density()

Mat occ::qm::HartreeFock::compute_fock_from_density ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const
inline

Fock matrix from a density already expressed in this method's own basis.

The conventional four-centre build, which reads mo.D and screens on it as well as on Schwarz. Density fitting and COSX cannot serve here: both build exchange from the occupied coefficients, and a guess has a density before it has any orbitals.

Distinct from compute_fock_mixed_basis, which exists to project a density out of a different basis. Handing that function this method's own basis makes it duplicate every shell as auxiliary and run the full four-index loop unscreened – on a 566-function system that cost 256 s against 59 s for the whole rest of an SCF iteration.

◆ compute_fock_gradient()

MatTriple occ::qm::HartreeFock::compute_fock_gradient ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const

◆ compute_fock_mixed_basis()

Mat occ::qm::HartreeFock::compute_fock_mixed_basis ( const MolecularOrbitals & mo_minbs,
const gto::AOBasis & bs,
bool is_shell_diagonal )

◆ compute_J()

Mat occ::qm::HartreeFock::compute_J ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const

◆ compute_J_gradient()

MatTriple occ::qm::HartreeFock::compute_J_gradient ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const

◆ compute_J_list()

std::vector< Mat > occ::qm::HartreeFock::compute_J_list ( const std::vector< MolecularOrbitals > & mo,
const Mat & Schwarz = Mat() ) const

◆ compute_JK()

JKPair occ::qm::HartreeFock::compute_JK ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const

◆ compute_jk_derivative_fock()

std::vector< Mat > occ::qm::HartreeFock::compute_jk_derivative_fock ( const MolecularOrbitals & mo,
double jf,
const ExchangeOperators & K,
const Mat & Schwarz = Mat() ) const

Skeleton Fock derivatives of jf 2J - sum_t c_t K[omega_t] for every nuclear coordinate, as full matrices (unrestricted: per spin, alpha rows over beta rows) or contracted with C_o (cphf::contract_occupied).

◆ compute_jk_derivative_fock_occ()

std::vector< Mat > occ::qm::HartreeFock::compute_jk_derivative_fock_occ ( const MolecularOrbitals & mo,
double jf,
const ExchangeOperators & K,
const Mat & Schwarz = Mat() ) const

◆ compute_JK_gradient()

JKTriple occ::qm::HartreeFock::compute_JK_gradient ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const

◆ compute_jk_gradient()

Mat3N occ::qm::HartreeFock::compute_jk_gradient ( const MolecularOrbitals & mo,
double jf,
double kf,
const Mat & Schwarz = Mat() ) const

Nuclear gradient of jf * E_J + kf * E_K (E_K the full exact-exchange energy), contracted in the integral loop: 3 x natom, no derivative matrices.

Always the conventional four-centre engine.

◆ compute_jk_hessian()

Mat occ::qm::HartreeFock::compute_jk_hessian ( const MolecularOrbitals & mo,
double jf,
const ExchangeOperators & K,
const Mat & Schwarz = Mat() ) const

Skeleton Hessian (fixed density) of jf E_J + sum_t c_t E_K[omega_t], with the SCF's operators (four-centre, RI-J, RI-K; four-centre Coulomb and full-range exchange in one pass).

◆ compute_JK_list()

std::vector< JKPair > occ::qm::HartreeFock::compute_JK_list ( const std::vector< MolecularOrbitals > & mo,
const Mat & Schwarz = Mat() ) const

◆ compute_K()

Mat occ::qm::HartreeFock::compute_K ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const

◆ compute_K_gradient_long_range()

MatTriple occ::qm::HartreeFock::compute_K_gradient_long_range ( const MolecularOrbitals & mo,
double omega,
const Mat & Schwarz = Mat() ) const

Exchange gradient with the attenuated operator, as above.

◆ compute_k_gradient_long_range()

Mat3N occ::qm::HartreeFock::compute_k_gradient_long_range ( const MolecularOrbitals & mo,
double omega,
double kf,
const Mat & Schwarz = Mat() ) const

As compute_jk_gradient, exchange only, with the attenuated operator erf(omega r)/r: the gradient of kf * E_K[erf].

◆ compute_K_long_range()

Mat occ::qm::HartreeFock::compute_K_long_range ( const MolecularOrbitals & mo,
double omega,
const Mat & Schwarz = Mat() ) const

Exchange built with the attenuated operator erf(omega r)/r.

The attenuated operator gets its own engines, fixed to it for the life of the calculation, rather than being produced by toggling omega on the shared ones and toggling it back. Omega is constant for a calculation – it comes from the functional – so the only thing the toggling ever bought was letting one engine serve two operators, and it cost exception safety, const-correctness, and the ability to cache anything that belongs to an operator rather than to a basis.

COSX is the exception and takes omega as a plain argument: nothing in it is cached per operator, so a second grid and shell-pair map would be pure duplication.

◆ compute_kinetic_gradient()

◆ compute_kinetic_matrix()

◆ compute_multipoles()

template<int order>
auto occ::qm::HartreeFock::compute_multipoles ( const MolecularOrbitals & mo,
const Vec3 & o = {0.0, 0.0, 0.0} ) const
inline

◆ compute_nuclear_attraction_gradient()

◆ compute_nuclear_attraction_matrix()

◆ compute_nuclear_multipoles()

template<unsigned int order = 1>
auto occ::qm::HartreeFock::compute_nuclear_multipoles ( const Vec3 & o = {0.0, 0.0, 0.0}) const
inline

◆ compute_one_electron_derivative_matrices()

void occ::qm::HartreeFock::compute_one_electron_derivative_matrices ( std::vector< Mat > & S1,
std::vector< Mat > & H1 ) const
inline

S^{(x)} and h^{(x)} for every nuclear coordinate (3N each).

◆ compute_one_electron_hessian()

Mat occ::qm::HartreeFock::compute_one_electron_hessian ( const Mat & P,
const Mat & Q ) const
inline

sum P h^{xy} - sum Q S^{xy} (3N x 3N), total densities.

◆ compute_overlap_gradient()

◆ compute_overlap_matrix()

◆ compute_overlap_matrix_for_basis()

◆ compute_point_charge_interaction_matrix()

Mat occ::qm::HartreeFock::compute_point_charge_interaction_matrix ( const PointChargeList & point_charges,
double alpha = 1e16 ) const

◆ compute_response_fock()

std::vector< Mat > occ::qm::HartreeFock::compute_response_fock ( const MolecularOrbitals & mo,
const std::vector< Mat > & D1,
const Mat & Schwarz = Mat() ) const

G[D1] = dF/dD . D1 for each first-order density (same layout as mo.D).

◆ compute_response_fock_occ()

std::vector< Mat > occ::qm::HartreeFock::compute_response_fock_occ ( const MolecularOrbitals & mo,
const std::vector< Mat > & Cx,
const Mat & Schwarz = Mat() ) const
inline

The CPHF response of HF: G[D1] Co with D1 = Cx Co^T + Co Cx^T.

◆ compute_response_fock_occ_approx()

std::vector< Mat > occ::qm::HartreeFock::compute_response_fock_occ_approx ( const MolecularOrbitals & mo,
const std::vector< Mat > & Cx,
const Mat & Schwarz = Mat() ) const
inline

◆ compute_response_jk()

std::vector< Mat > occ::qm::HartreeFock::compute_response_jk ( const std::vector< Mat > & D1,
double jf,
double kf,
double omega = 0.0,
const Mat & Schwarz = Mat(),
const MolecularOrbitals * ref = nullptr ) const

jf * 2 J[D1] - kf * K[D1] for each restricted D1; omega != 0 selects the attenuated exchange (then jf must be 0).

ref (the reference orbitals) is needed for density-fitted exchange.

◆ compute_rinv_gradient_for_atom()

◆ compute_schwarz_ints()

◆ compute_wolf_interaction_matrix()

Mat occ::qm::HartreeFock::compute_wolf_interaction_matrix ( const PointChargeList & point_charges,
const std::vector< double > & partial_charges,
double alpha,
double rc ) const

◆ copy_two_electron_setup_to()

Give other (typically the same system at another geometry) this object's two-electron treatment: density fitting (basis rebuilt for other's atoms), Coulomb method and storage policy, and COSX (fixed grid or schedule, and settings).

Finite-difference derivatives need this to stay on one energy surface.

◆ cosx_energy_shift_from()

double occ::qm::HartreeFock::cosx_energy_shift_from ( occ::numint::COSXGridLevel other,
const MolecularOrbitals & mo,
const ExchangeOperators & operators = { {1.0, 0.0}} )

COSX exchange energy at mo on the current grid minus that on other, non-self-consistently, leaving the current grid in place.

Used to put energies from SCFs on different grids on one surface.

◆ coulomb_and_range_separated_exchange()

JKPair occ::qm::HartreeFock::coulomb_and_range_separated_exchange ( const MolecularOrbitals & mo,
double omega,
double alpha,
double beta,
const Mat & Schwarz = Mat() )

◆ electronic_electric_field_contribution()

Mat3N occ::qm::HartreeFock::electronic_electric_field_contribution ( const MolecularOrbitals & mo,
const Mat3N &  ) const

◆ electronic_electric_potential_contribution()

Vec occ::qm::HartreeFock::electronic_electric_potential_contribution ( const MolecularOrbitals & mo,
const Mat3N &  ) const

◆ exchange_df_engine()

IntegralEngineDF * occ::qm::HartreeFock::exchange_df_engine ( double omega) const

The density-fitting engine for exchange with operator omega (the attenuated twin for omega != 0).

◆ factor_response_densities()

std::vector< Mat > occ::qm::HartreeFock::factor_response_densities ( const std::vector< Mat > & D1,
const Mat & C ) const

Factor each response density as Cx C^T + C Cx^T (no virtual-virtual block); throws otherwise.

◆ final_energy_correction()

double occ::qm::HartreeFock::final_energy_correction ( const MolecularOrbitals & mo)

SCF hook: called once at convergence.

With a COSX schedule, moves to the final grid and returns the change in the exact-exchange energy, -sum_t c_t [tr(D K_t,final) - tr(D K_t,current)] for the operators (c_t, omega_t) given (default: full HF exchange).

◆ finalize_cosx_grid()

double occ::qm::HartreeFock::finalize_cosx_grid ( const MolecularOrbitals & mo,
const ExchangeOperators & operators )

◆ fock_build_properties()

FockBuildProperties occ::qm::HartreeFock::fock_build_properties ( ) const
inline

◆ has_approximate_response()

Whether the approximate response (density-fitted Coulomb, four-centre exchange) is cheaper than the exact one: only when the exact exchange is COSX, since four-centre exchange costs as much as RI-K.

◆ have_effective_core_potentials()

◆ incremental_fock_floor()

SCF hook: the DIIS error below which difference-density builds stop.

The COSX charge x density screen is absolute, so each difference build drops a different set of shell pairs and the accumulated exchange carries their error; below this the iterations are full builds, so the SCF converges onto the full build's own fixed point.

◆ integral_engine()

const IntegralEngine & occ::qm::HartreeFock::integral_engine ( ) const
inline

The exact-integral engine (one-electron and point-charge integrals).

◆ integral_precision()

◆ name()

std::string occ::qm::HartreeFock::name ( ) const
inline

◆ nbf()

auto occ::qm::HartreeFock::nbf ( ) const
inline

◆ nonvariational_fock_derivative_occ()

std::vector< Mat > occ::qm::HartreeFock::nonvariational_fock_derivative_occ ( const MolecularOrbitals & mo) const
inline

◆ nuclear_point_charge_interaction_energy()

◆ refresh_scf_fock_correction()

◆ response_occ()

std::vector< Mat > occ::qm::HartreeFock::response_occ ( const MolecularOrbitals & mo,
const std::vector< Mat > & Cx,
double jf,
const ExchangeOperators & K,
const Mat & Schwarz,
ResponseMode mode = ResponseMode::Exact ) const

(jf 2 J[D1] - sum_t c_t K_{omega_t}[D1]) Co for D1 = Cx Co^T + Co Cx^T (restricted), or per spin (jf J[D1^a + D1^b] - sum_t c_t K[D1^s]) Co^s (unrestricted).

Four-centre Coulomb and full-range exchange share one integral pass when both are four-centre.

◆ scf_fock_approximate()

SCF hooks for the frozen grid correction: whether the last Fock build used it (so convergence there is not convergence on the refine grid), and a request that the next build be exact and refresh it.

◆ set_cosx_exchange()

◆ set_cosx_exchange_scale()

The factor the caller applies to this exchange (a global hybrid's exact exchange fraction).

The COSX shell-pair screen is loosened by it, so the absolute screening error in the Fock matrix stays that of HF.

◆ set_cosx_grid_schedule()

◆ set_cosx_settings()

◆ set_coulomb_method()

◆ set_density_fitting_basis()

void occ::qm::HartreeFock::set_density_fitting_basis ( const std::string & ,
double auto_aux_threshold = 1e-4 )

◆ set_density_fitting_memory_limit()

◆ set_density_fitting_policy()

◆ set_precision()

void occ::qm::HartreeFock::set_precision ( double precision)
inline

◆ set_scf_fock_incremental()

SCF hook: whether the next Fock build is handed a difference density.

An incremental build leaves out the frozen grid correction (it is already in the accumulated Fock matrix) and must not refresh it.

◆ two_electron_derivative_fock()

std::vector< Mat > occ::qm::HartreeFock::two_electron_derivative_fock ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const
inline

Skeleton two-electron Fock derivatives (3N matrices).

◆ two_electron_derivative_fock_occ()

std::vector< Mat > occ::qm::HartreeFock::two_electron_derivative_fock_occ ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const
inline

The same contracted with the occupied coefficients (nbf x nocc each).

◆ two_electron_gradient()

Mat3N occ::qm::HartreeFock::two_electron_gradient ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const
inline

Two-electron part of the HF nuclear gradient (Coulomb + full exchange), with the same exchange approximation as the SCF.

◆ two_electron_hessian()

Mat occ::qm::HartreeFock::two_electron_hessian ( const MolecularOrbitals & mo,
const Mat & Schwarz = Mat() ) const
inline

Skeleton two-electron Hessian (fixed density), Coulomb + full exchange.

◆ update_core_hamiltonian()

void occ::qm::HartreeFock::update_core_hamiltonian ( const MolecularOrbitals & mo,
Mat & H )
inline

◆ update_scf_energy()

◆ using_cosx()

bool occ::qm::HartreeFock::using_cosx ( ) const
inline

◆ using_density_fitting()

◆ usual_scf_energy()

◆ with_new_basis()

HartreeFock occ::qm::HartreeFock::with_new_basis ( const AOBasis & new_basis) const

Create a new HartreeFock instance with the same settings but different basis.

Parameters
new_basisThe new basis set to use
Returns
New HartreeFock instance

◆ wolf_point_charge_interaction_energy()

double occ::qm::HartreeFock::wolf_point_charge_interaction_energy ( const PointChargeList & ,
const std::vector< double > & partial_charges,
double alpha,
double rc ) const

The documentation for this class was generated from the following file:
  • /home/runner/work/occ/occ/include/occ/qm/hf.h