|
occ
|
#include <integral_engine.h>
Classes | |
| struct | IntegralResult |
| struct | NoShellPairs |
Public Types | |
| using | ShellList = std::vector<Shell> |
| using | AtomList = std::vector<occ::core::Atom> |
| using | ShellPairList = std::vector<std::vector<size_t>> |
| using | IntEnv = cint::IntegralEnvironment |
| using | ShellKind = Shell::Kind |
| using | Op = cint::Operator |
Public Member Functions | |
| IntegralEngine (const AtomList &at, const ShellList &sh) | |
| IntegralEngine (const AtomList &at, const ShellList &sh, NoShellPairs) | |
| IntegralEngine (const AOBasis &basis) | |
| IntegralEngine (const AOBasis &basis, NoShellPairs) | |
| auto | nbf () const noexcept |
| auto | nbf_aux () const noexcept |
| auto | nsh () const noexcept |
| auto | nsh_aux () const noexcept |
| const AOBasis & | aobasis () const |
| const AOBasis & | auxbasis () const |
| const auto & | env () const |
| auto & | env () |
| const auto & | first_bf () const noexcept |
| const auto & | first_bf_aux () const noexcept |
| const auto & | shellpairs () const noexcept |
| const auto & | shells () const noexcept |
| void | set_auxiliary_basis (const ShellList &bs, bool dummy=false) |
| void | set_dummy_basis (const AtomList &dummy_atoms, const ShellList &bs) |
| void | clear_auxiliary_basis () |
| bool | have_auxiliary_basis () const noexcept |
| bool | have_effective_core_potentials () const noexcept |
| Mat | one_electron_operator (Op op, bool use_shellpair_list=true) const |
| MatTriple | one_electron_operator_grad (Op op, bool use_shellpair_list=true) const |
| std::vector< MatTriple > | multipole_operator_grad (Op op, bool use_shellpair_list=true) const |
| Multipole AO matrices with the gradient operator on the ket. | |
| MatSix | one_electron_operator_hess (Op op, bool use_shellpair_list=true) const |
| Mat | effective_core_potential (bool use_shellpair_list=true) const |
| Mat3N | effective_core_potential_gradient (const Mat &D, bool use_shellpair_list=true) const |
| Nuclear gradient of Tr(D V_ecp), per atom (3 x natoms). | |
| Mat | effective_core_potential_hessian (const Mat &P) const |
| Skeleton ECP Hessian sum P d2 V_ecp / dR dR (3N x 3N), P the total density. | |
| void | add_effective_core_potential_derivatives (std::vector< Mat > &H1) const |
| Add dV_ecp/dR for every nuclear coordinate into H1 (3N matrices). | |
| double | effective_nuclear_charge (size_t atom) const |
| Nuclear charge each atom's operators carry: Z minus its ECP electrons. | |
| Mat | fock_operator (SpinorbitalKind, const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const |
| Mat | fock_operator_mixed_basis (const Mat &D, const AOBasis &D_bs, bool is_shell_diagonal) |
| MatTriple | fock_operator_grad (SpinorbitalKind, const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const |
| MatSix | fock_operator_hess (SpinorbitalKind, const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const |
| Mat | coulomb (SpinorbitalKind, const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const |
| MatTriple | coulomb_grad (SpinorbitalKind, const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const |
| MatSix | coulomb_hess (SpinorbitalKind, const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const |
| MatSix | exchange_hess (SpinorbitalKind, const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const |
| JKTriple | coulomb_exchange_grad (SpinorbitalKind, const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const |
| Mat | one_electron_hessian (const Mat &P, const Mat &Q) const |
| Skeleton one-electron Hessian (3N x 3N): sum P h^{xy} - sum Q S^{xy} for total density P and total energy-weighted density Q, including the nuclear-attraction operator-centre terms. | |
| void | one_electron_derivative_matrices (std::vector< Mat > &S1, std::vector< Mat > &H1) const |
| First-derivative AO matrices for every nuclear coordinate (index 3 * atom + xyz): S^{(x)} and h^{(x)} = T^{(x)} + V^{(x)}, the latter including the Hellmann-Feynman operator derivative. | |
| Mat | jk_hessian (const MolecularOrbitals &mo, double jf, double kf, const Mat &Schwarz=Mat()) const |
| Skeleton two-electron Hessian (3N x 3N) of jf * E_J + kf * E_K at fixed density, contracted over unique quartets with second-derivative integrals; blocks of the omitted centre by translational invariance. | |
| std::vector< Mat > | jk_derivative_fock (const MolecularOrbitals &mo, double jf, double kf, const Mat &Schwarz=Mat()) const |
| Skeleton two-electron Fock derivatives for every nuclear coordinate: jf J^{(x)}[P_total] - kf K^{(x)}[P_spin], derivative integrals with the density held fixed. | |
| std::vector< Mat > | coulomb_exchange_response (const std::vector< Mat > &D, double jf, double kf, const Mat &Schwarz=Mat(), size_t exchange_only=0) const |
| Restricted two-electron response for a batch of symmetric per-spin densities: jf * 2 J[D1] - kf * K[D1] for each, the last exchange_only of them without the Coulomb term. | |
| Mat3N | jk_gradient (const MolecularOrbitals &mo, double jf, double kf, const Mat &Schwarz=Mat()) const |
| Nuclear gradient (3 x natom) of the two-electron energy jf * E_J[D] + kf * E_K[D] where E_K is the full exact-exchange energy (negative), so a global hybrid passes kf = its exact-exchange fraction and Coulomb-only passes kf = 0. | |
| JKPair | coulomb_and_exchange (SpinorbitalKind, const MolecularOrbitals &mo, const Mat &Schwarz=Mat()) const |
| std::vector< Mat > | coulomb_list (SpinorbitalKind, const std::vector< MolecularOrbitals > &mos, const Mat &Schwarz=Mat()) const |
| std::vector< JKPair > | coulomb_and_exchange_list (SpinorbitalKind, const std::vector< MolecularOrbitals > &mos, const Mat &Schwarz=Mat()) const |
| Eigen::Tensor< double, 4 > | four_center_integrals_tensor (const Mat &Schwarz=Mat()) const |
| Mat | four_center_integrals_packed (const Mat &Schwarz=Mat()) const |
| Unique AO 2-electron integrals as a packed symmetric matrix A(P,Q) = (μν|λσ), where P = canonical pair index of (μ≤ν) and Q of (λ≤σ). | |
| Eigen::Tensor< double, 4 > | ao_direct_half_transform (const Mat &C, const Mat &Schwarz=Mat()) const |
| AO-direct first-quarter MO transform. | |
| Mat | point_charge_potential (const std::vector< occ::core::PointCharge > &charges, double alpha=1e16) |
| Mat | wolf_point_charge_potential (const std::vector< occ::core::PointCharge > &charges, const std::vector< double > &partial_charges, double alpha, double cutoff_radius) |
| Vec | electric_potential (const MolecularOrbitals &mo, const Mat3N &points) |
| Vec | electric_potential_mmd (const MolecularOrbitals &mo, const Mat3N &points) const |
| Compute electric potential at grid points using fast MMD implementation. | |
| Mat | point_charge_potentials (const std::vector< Mat > &D, const Mat3N &points) const |
| sum_{mu nu} D_{mu nu} L^k_{mu nu} for each symmetric D: M x D.size(). | |
| std::vector< Mat > | point_charge_matrices (const Mat &Q, const Mat3N &points) const |
| sum_k Q(k, v) L^k for each column v of Q (M x nv): nv matrices. | |
| Mat | point_charge_potential_derivatives (const Mat &D, const Mat3N &points, const IVec &owner) const |
| d/dx sum_{mu nu} D_{mu nu} L^k_{mu nu} for every nuclear coordinate x (row 3 * atom + xyz) and point k (column): 3N x M, D symmetric. | |
| Mat | point_charge_hessian (const Mat &D, const Vec &q, const Mat3N &points, const IVec &owner) const |
| sum_k q_k sum_{mu nu} D_{mu nu} d2 L^k_{mu nu} / dx dy: 3N x 3N. | |
| std::vector< Mat > | point_charge_derivative_matrices (const Vec &q, const Mat3N &points, const IVec &owner) const |
| d/dx sum_k q_k L^k for every nuclear coordinate x: 3N symmetric matrices, basis-function and charge-position derivatives together. | |
| template<ShellKind kind> | |
| void | compute_shellpairs (double threshold=1e-12) |
| Mat | rinv_operator_atom_center (size_t atom_index, bool use_shellpair_list=true) const |
| MatTriple | rinv_operator_grad_atom (size_t atom_index, bool use_shellpair_list=true) const |
| MatSix | rinv_operator_hess_atom (size_t atom_index, bool use_shellpair_list=true) const |
| Vec | multipole (int order, const MolecularOrbitals &mo, const Vec3 &origin={0, 0, 0}) const |
| MatTriple | dipole_matrices (const Vec3 &origin={0, 0, 0}) const |
| AO matrices <mu| r_a - O_a |nu> for a = x, y, z (symmetric, nbf x nbf). | |
| Mat | schwarz () const |
| bool | is_spherical () const |
| void | set_effective_core_potentials (const ShellList &ecp_shells, const std::vector< int > &ecp_electrons) |
| double | range_separated_omega () const |
| void | set_range_separated_omega (double omega) |
| void | set_precision (double precision) |
| double | precision () const |
Static Public Member Functions | |
| static double | get_integral_8fold_symmetry (const Eigen::Tensor< double, 4 > &tensor, size_t i, size_t j, size_t k, size_t l, size_t n_ao) |
| using occ::qm::IntegralEngine::AtomList = std::vector<occ::core::Atom> |
| using occ::qm::IntegralEngine::ShellList = std::vector<Shell> |
| using occ::qm::IntegralEngine::ShellPairList = std::vector<std::vector<size_t>> |
|
inline |
|
inline |
|
inline |
| void occ::qm::IntegralEngine::add_effective_core_potential_derivatives | ( | std::vector< Mat > & | H1 | ) | const |
Add dV_ecp/dR for every nuclear coordinate into H1 (3N matrices).
| Eigen::Tensor< double, 4 > occ::qm::IntegralEngine::ao_direct_half_transform | ( | const Mat & | C, |
| const Mat & | Schwarz = Mat() ) const |
AO-direct first-quarter MO transform.
Returns the half-transformed integrals H(i, ν, ρ, σ) = Σ_μ C(μ,i) (μν|ρσ) for the coefficient block C (nbf x nblk), streaming shell quartets with an inlined contraction so the full N⁴ tensor is never materialized. Used by AO-direct correlation methods; the inner loop is templated (not a std::function) for speed.
|
inline |
|
inline |
|
inline |
|
inline |
| Mat occ::qm::IntegralEngine::coulomb | ( | SpinorbitalKind | , |
| const MolecularOrbitals & | mo, | ||
| const Mat & | Schwarz = Mat() ) const |
| JKPair occ::qm::IntegralEngine::coulomb_and_exchange | ( | SpinorbitalKind | , |
| const MolecularOrbitals & | mo, | ||
| const Mat & | Schwarz = Mat() ) const |
| std::vector< JKPair > occ::qm::IntegralEngine::coulomb_and_exchange_list | ( | SpinorbitalKind | , |
| const std::vector< MolecularOrbitals > & | mos, | ||
| const Mat & | Schwarz = Mat() ) const |
| JKTriple occ::qm::IntegralEngine::coulomb_exchange_grad | ( | SpinorbitalKind | , |
| const MolecularOrbitals & | mo, | ||
| const Mat & | Schwarz = Mat() ) const |
| std::vector< Mat > occ::qm::IntegralEngine::coulomb_exchange_response | ( | const std::vector< Mat > & | D, |
| double | jf, | ||
| double | kf, | ||
| const Mat & | Schwarz = Mat(), | ||
| size_t | exchange_only = 0 ) const |
Restricted two-electron response for a batch of symmetric per-spin densities: jf * 2 J[D1] - kf * K[D1] for each, the last exchange_only of them without the Coulomb term.
One integral pass per chunk of densities, digested as small dense products over the whole chunk (density index fastest), so the cost per extra density is close to the arithmetic, not memory traffic. Used by CPHF.
| MatTriple occ::qm::IntegralEngine::coulomb_grad | ( | SpinorbitalKind | , |
| const MolecularOrbitals & | mo, | ||
| const Mat & | Schwarz = Mat() ) const |
| MatSix occ::qm::IntegralEngine::coulomb_hess | ( | SpinorbitalKind | , |
| const MolecularOrbitals & | mo, | ||
| const Mat & | Schwarz = Mat() ) const |
| std::vector< Mat > occ::qm::IntegralEngine::coulomb_list | ( | SpinorbitalKind | , |
| const std::vector< MolecularOrbitals > & | mos, | ||
| const Mat & | Schwarz = Mat() ) const |
AO matrices <mu| r_a - O_a |nu> for a = x, y, z (symmetric, nbf x nbf).
The electric-field perturbation operator: an applied field F adds F . r to the one-electron Hamiltonian of an electron.
| Mat occ::qm::IntegralEngine::effective_core_potential | ( | bool | use_shellpair_list = true | ) | const |
| Mat3N occ::qm::IntegralEngine::effective_core_potential_gradient | ( | const Mat & | D, |
| bool | use_shellpair_list = true ) const |
Nuclear gradient of Tr(D V_ecp), per atom (3 x natoms).
Zero when there are no ECPs.
Skeleton ECP Hessian sum P d2 V_ecp / dR dR (3N x 3N), P the total density.
Zero when there are no ECPs.
|
inline |
Nuclear charge each atom's operators carry: Z minus its ECP electrons.
| Vec occ::qm::IntegralEngine::electric_potential | ( | const MolecularOrbitals & | mo, |
| const Mat3N & | points ) |
| Vec occ::qm::IntegralEngine::electric_potential_mmd | ( | const MolecularOrbitals & | mo, |
| const Mat3N & | points ) const |
Compute electric potential at grid points using fast MMD implementation.
| mo | Molecular orbitals (density matrix) |
| points | Grid points [3 x npts] |
|
inline |
|
inline |
| MatSix occ::qm::IntegralEngine::exchange_hess | ( | SpinorbitalKind | , |
| const MolecularOrbitals & | mo, | ||
| const Mat & | Schwarz = Mat() ) const |
|
inlinenoexcept |
|
inlinenoexcept |
| Mat occ::qm::IntegralEngine::fock_operator | ( | SpinorbitalKind | , |
| const MolecularOrbitals & | mo, | ||
| const Mat & | Schwarz = Mat() ) const |
| MatTriple occ::qm::IntegralEngine::fock_operator_grad | ( | SpinorbitalKind | , |
| const MolecularOrbitals & | mo, | ||
| const Mat & | Schwarz = Mat() ) const |
| MatSix occ::qm::IntegralEngine::fock_operator_hess | ( | SpinorbitalKind | , |
| const MolecularOrbitals & | mo, | ||
| const Mat & | Schwarz = Mat() ) const |
| Mat occ::qm::IntegralEngine::fock_operator_mixed_basis | ( | const Mat & | D, |
| const AOBasis & | D_bs, | ||
| bool | is_shell_diagonal ) |
Unique AO 2-electron integrals as a packed symmetric matrix A(P,Q) = (μν|λσ), where P = canonical pair index of (μ≤ν) and Q of (λ≤σ).
Built in a single AO pass (8-fold-symmetric storage: ~npair²/2 unique vs nao⁴), the GEMM-friendly form for in-core four-index transforms.
| Eigen::Tensor< double, 4 > occ::qm::IntegralEngine::four_center_integrals_tensor | ( | const Mat & | Schwarz = Mat() | ) | const |
|
static |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
| std::vector< Mat > occ::qm::IntegralEngine::jk_derivative_fock | ( | const MolecularOrbitals & | mo, |
| double | jf, | ||
| double | kf, | ||
| const Mat & | Schwarz = Mat() ) const |
Skeleton two-electron Fock derivatives for every nuclear coordinate: jf J^{(x)}[P_total] - kf K^{(x)}[P_spin], derivative integrals with the density held fixed.
Unrestricted: one per spin, alpha rows over beta rows.
| Mat3N occ::qm::IntegralEngine::jk_gradient | ( | const MolecularOrbitals & | mo, |
| double | jf, | ||
| double | kf, | ||
| const Mat & | Schwarz = Mat() ) const |
Nuclear gradient (3 x natom) of the two-electron energy jf * E_J[D] + kf * E_K[D] where E_K is the full exact-exchange energy (negative), so a global hybrid passes kf = its exact-exchange fraction and Coulomb-only passes kf = 0.
Contracted inside the integral loop over unique shell quartets; nothing nbf x nbf is formed. Restricted and unrestricted use the contracted kernel, general spinorbitals the matrix path.
| Mat occ::qm::IntegralEngine::jk_hessian | ( | const MolecularOrbitals & | mo, |
| double | jf, | ||
| double | kf, | ||
| const Mat & | Schwarz = Mat() ) const |
Skeleton two-electron Hessian (3N x 3N) of jf * E_J + kf * E_K at fixed density, contracted over unique quartets with second-derivative integrals; blocks of the omitted centre by translational invariance.
| Vec occ::qm::IntegralEngine::multipole | ( | int | order, |
| const MolecularOrbitals & | mo, | ||
| const Vec3 & | origin = {0, 0, 0} ) const |
| std::vector< MatTriple > occ::qm::IntegralEngine::multipole_operator_grad | ( | Op | op, |
| bool | use_shellpair_list = true ) const |
Multipole AO matrices with the gradient operator on the ket.
For op == Op::dipole libcint computes <φ_μ | r_α | ∇_β φ_ν> (9 components: α outer, β inner). For op == Op::quadrupole it computes <φ_μ | r_α r_β | ∇_γ φ_ν> (27 components: row-major (α,β) outer, γ inner). Returns one MatTriple per multipole component (3 for dipole, 9 for quadrupole), with the inner MatTriple holding the 3 spatial derivative components.
Use the chain rule ∂M_α(μ, ν, O=0)/∂R_(atom of ν)_β = - <φ_μ | M_α | ∂_β φ_ν> to convert these "ket-side" integrals to per-atom Cartesian gradients.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
| void occ::qm::IntegralEngine::one_electron_derivative_matrices | ( | std::vector< Mat > & | S1, |
| std::vector< Mat > & | H1 ) const |
First-derivative AO matrices for every nuclear coordinate (index 3 * atom + xyz): S^{(x)} and h^{(x)} = T^{(x)} + V^{(x)}, the latter including the Hellmann-Feynman operator derivative.
Full derivatives (bra and ket), symmetric.
Skeleton one-electron Hessian (3N x 3N): sum P h^{xy} - sum Q S^{xy} for total density P and total energy-weighted density Q, including the nuclear-attraction operator-centre terms.
No ECPs.
| MatTriple occ::qm::IntegralEngine::one_electron_operator_grad | ( | Op | op, |
| bool | use_shellpair_list = true ) const |
| MatSix occ::qm::IntegralEngine::one_electron_operator_hess | ( | Op | op, |
| bool | use_shellpair_list = true ) const |
| std::vector< Mat > occ::qm::IntegralEngine::point_charge_derivative_matrices | ( | const Vec & | q, |
| const Mat3N & | points, | ||
| const IVec & | owner ) const |
d/dx sum_k q_k L^k for every nuclear coordinate x: 3N symmetric matrices, basis-function and charge-position derivatives together.
| Mat occ::qm::IntegralEngine::point_charge_hessian | ( | const Mat & | D, |
| const Vec & | q, | ||
| const Mat3N & | points, | ||
| const IVec & | owner ) const |
sum_k q_k sum_{mu nu} D_{mu nu} d2 L^k_{mu nu} / dx dy: 3N x 3N.
| std::vector< Mat > occ::qm::IntegralEngine::point_charge_matrices | ( | const Mat & | Q, |
| const Mat3N & | points ) const |
sum_k Q(k, v) L^k for each column v of Q (M x nv): nv matrices.
| Mat occ::qm::IntegralEngine::point_charge_potential | ( | const std::vector< occ::core::PointCharge > & | charges, |
| double | alpha = 1e16 ) |
| Mat occ::qm::IntegralEngine::point_charge_potential_derivatives | ( | const Mat & | D, |
| const Mat3N & | points, | ||
| const IVec & | owner ) const |
d/dx sum_{mu nu} D_{mu nu} L^k_{mu nu} for every nuclear coordinate x (row 3 * atom + xyz) and point k (column): 3N x M, D symmetric.
| Mat occ::qm::IntegralEngine::point_charge_potentials | ( | const std::vector< Mat > & | D, |
| const Mat3N & | points ) const |
sum_{mu nu} D_{mu nu} L^k_{mu nu} for each symmetric D: M x D.size().
|
inline |
|
inline |
| Mat occ::qm::IntegralEngine::rinv_operator_atom_center | ( | size_t | atom_index, |
| bool | use_shellpair_list = true ) const |
| MatTriple occ::qm::IntegralEngine::rinv_operator_grad_atom | ( | size_t | atom_index, |
| bool | use_shellpair_list = true ) const |
| MatSix occ::qm::IntegralEngine::rinv_operator_hess_atom | ( | size_t | atom_index, |
| bool | use_shellpair_list = true ) const |
| Mat occ::qm::IntegralEngine::schwarz | ( | ) | const |
|
inline |
|
inline |
| void occ::qm::IntegralEngine::set_effective_core_potentials | ( | const ShellList & | ecp_shells, |
| const std::vector< int > & | ecp_electrons ) |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
| Mat occ::qm::IntegralEngine::wolf_point_charge_potential | ( | const std::vector< occ::core::PointCharge > & | charges, |
| const std::vector< double > & | partial_charges, | ||
| double | alpha, | ||
| double | cutoff_radius ) |