occ
Loading...
Searching...
No Matches
occ::qm::cosx::SemiNumericalExchange Class Reference

#include <seminumerical_exchange.h>

Classes

struct  SecondDerivatives
 Second-derivative terms of the COSX exchange energy E_x = -tr(D K) (restricted, D = C_o C_o^T) at fixed AO density, with every dependence compute_K_gradient differentiates, for the operator selected by omega. More...

Public Member Functions

 SemiNumericalExchange (const gto::AOBasis &, const occ::numint::GridSettings &={})
Mat compute_K (const qm::MolecularOrbitals &mo, double precision=std::numeric_limits< double >::epsilon(), const occ::Mat &Schwarz=occ::Mat(), double omega=0.0) const
 Seminumerical exchange for one operator.
Mat compute_K_range_separated (const qm::MolecularOrbitals &mo, double alpha, double beta, double omega, double precision=std::numeric_limits< double >::epsilon()) const
 Fused range-separated exchange: builds the full Hartree-Fock exchange matrix of a range-separated hybrid, K = (alpha+beta)*K[1/r] - beta*K[erf(omega*r)/r], in a SINGLE grid sweep.
std::vector< Mat > compute_K_response (const std::vector< Mat > &D, double omega=0.0) const
 K[D_k] for several densities in shared grid sweeps, in the convention of compute_K for a restricted mo.D = D_k (CPHF response densities).
Mat compute_overlap_matrix () const
Mat3N compute_K_gradient (const qm::MolecularOrbitals &mo, double omega=0.0, double threshold=1e-12) const
 Nuclear gradient (3 x natoms) of the COSX exchange energy, -tr(D K) restricted or -1/2 sum_s tr(P^s K[P^s]) unrestricted, for the operator selected by omega as in compute_K.
SecondDerivatives compute_K_second_derivatives (const qm::MolecularOrbitals &mo, double omega=0.0, double threshold=1e-12) const
const auto & engine () const
void set_use_esp (bool use_esp)
 Enable or disable the ESP-based approach (default: disabled for backward compatibility).
bool use_esp () const
void set_use_spatial_hierarchy (bool use_hierarchy)
 Enable or disable spatial hierarchy (default: enabled).
bool use_spatial_hierarchy () const
void set_settings (const Settings &settings)
 Configuration settings.
const Settings & settings () const
void set_far_field_screening (bool on)
 Whether the exchange build's pair screen uses the far-field form of the charge bound (on by default).
size_t num_grid_points () const
 Range-separation parameter for the exchange operator.
size_t num_batches () const
size_t num_atoms () const
const occ::numint::MolecularGrid & grid () const
 Get the underlying molecular grid.

Constructor & Destructor Documentation

◆ SemiNumericalExchange()

occ::qm::cosx::SemiNumericalExchange::SemiNumericalExchange ( const gto::AOBasis & ,
const occ::numint::GridSettings & = {} )

Member Function Documentation

◆ compute_K()

Mat occ::qm::cosx::SemiNumericalExchange::compute_K ( const qm::MolecularOrbitals & mo,
double precision = std::numeric_limits< double >::epsilon(),
const occ::Mat & Schwarz = occ::Mat(),
double omega = 0.0 ) const

Seminumerical exchange for one operator.

omega selects it: zero for the full Coulomb 1/r, nonzero for the attenuated erf(omega r)/r. Passed rather than held, because nothing here is cached per operator – the grid, the shell-pair map and the density contraction are shared, and only the analytic ESP integral looks at omega at all.

◆ compute_K_gradient()

Mat3N occ::qm::cosx::SemiNumericalExchange::compute_K_gradient ( const qm::MolecularOrbitals & mo,
double omega = 0.0,
double threshold = 1e-12 ) const

Nuclear gradient (3 x natoms) of the COSX exchange energy, -tr(D K) restricted or -1/2 sum_s tr(P^s K[P^s]) unrestricted, for the operator selected by omega as in compute_K.

Includes the basis-function, ESP-integral, grid-point, partition-weight and overlap-fitting (Q = S_num^{-1} S) derivatives. threshold screens shell pairs on charge x |u| x |v|.

◆ compute_K_range_separated()

Mat occ::qm::cosx::SemiNumericalExchange::compute_K_range_separated ( const qm::MolecularOrbitals & mo,
double alpha,
double beta,
double omega,
double precision = std::numeric_limits< double >::epsilon() ) const

Fused range-separated exchange: builds the full Hartree-Fock exchange matrix of a range-separated hybrid, K = (alpha+beta)*K[1/r] - beta*K[erf(omega*r)/r], in a SINGLE grid sweep.

The grid-point basis values, density contraction, shell-pair screening and final back-contraction are shared between the two operators; only the analytic ESP integral is evaluated twice per shell pair. Equivalent to compute_K(full) and compute_K(long-range) combined, but without duplicating the per-batch overhead. (Restricted only.)

◆ compute_K_response()

std::vector< Mat > occ::qm::cosx::SemiNumericalExchange::compute_K_response ( const std::vector< Mat > & D,
double omega = 0.0 ) const

K[D_k] for several densities in shared grid sweeps, in the convention of compute_K for a restricted mo.D = D_k (CPHF response densities).

◆ compute_K_second_derivatives()

SecondDerivatives occ::qm::cosx::SemiNumericalExchange::compute_K_second_derivatives ( const qm::MolecularOrbitals & mo,
double omega = 0.0,
double threshold = 1e-12 ) const

◆ compute_overlap_matrix()

Mat occ::qm::cosx::SemiNumericalExchange::compute_overlap_matrix ( ) const

◆ engine()

const auto & occ::qm::cosx::SemiNumericalExchange::engine ( ) const
inline

◆ grid()

const occ::numint::MolecularGrid & occ::qm::cosx::SemiNumericalExchange::grid ( ) const
inline

Get the underlying molecular grid.

◆ num_atoms()

size_t occ::qm::cosx::SemiNumericalExchange::num_atoms ( ) const

◆ num_batches()

size_t occ::qm::cosx::SemiNumericalExchange::num_batches ( ) const

◆ num_grid_points()

size_t occ::qm::cosx::SemiNumericalExchange::num_grid_points ( ) const

Range-separation parameter for the exchange operator.

Get grid information

◆ set_far_field_screening()

void occ::qm::cosx::SemiNumericalExchange::set_far_field_screening ( bool on)
inline

Whether the exchange build's pair screen uses the far-field form of the charge bound (on by default).

A difference-density SCF build turns it off: there the looser screen's errors accumulate over the incremental builds instead of being redone each time.

◆ set_settings()

void occ::qm::cosx::SemiNumericalExchange::set_settings ( const Settings & settings)

Configuration settings.

◆ set_use_esp()

void occ::qm::cosx::SemiNumericalExchange::set_use_esp ( bool use_esp)
inline

Enable or disable the ESP-based approach (default: disabled for backward compatibility).

◆ set_use_spatial_hierarchy()

void occ::qm::cosx::SemiNumericalExchange::set_use_spatial_hierarchy ( bool use_hierarchy)
inline

Enable or disable spatial hierarchy (default: enabled).

◆ settings()

const Settings & occ::qm::cosx::SemiNumericalExchange::settings ( ) const
inline

◆ use_esp()

bool occ::qm::cosx::SemiNumericalExchange::use_esp ( ) const
inline

◆ use_spatial_hierarchy()

bool occ::qm::cosx::SemiNumericalExchange::use_spatial_hierarchy ( ) const
inline

The documentation for this class was generated from the following file: