occ
Loading...
Searching...
No Matches
occ::qm Namespace Reference

quantum mechanics/quantum chemistry functionality including Hartree-Fock and more More...

Namespaces

namespace  cc
namespace  cint
namespace  cphf
 Coupled-perturbed SCF (CPHF / CPKS).
namespace  impl
namespace  guess
namespace  block
namespace  orb
namespace  cosx
namespace  basis_sets

Classes

class  ADIIS
 ADIIS (Augmented Direct Inversion in Iterative Subspace) Based on Hu & Yang, J. More...
struct  AutoAuxResult
 Statistics about the auto auxiliary basis generation. More...
class  CDIIS
class  ConvergenceAccelerator
 Encapsulates SCF convergence acceleration strategies (CDIIS, EDIIS, ADIIS). More...
class  DFIntegrals
 Builds metric-folded density-fitting "B" tensors for correlated methods. More...
class  MOIntegralEngine
 Lightweight holder of molecular-orbital information for post-HF methods, plus a brute-force single MO electron-repulsion integral evaluator kept as a reference/testing utility. More...
class  MP2
class  PostHFMethod
class  CoulombMetric
 Factorization of a density-fitting Coulomb metric V = (P|Q). More...
class  PackedDFStore
 Three-centre integrals (μν|P) over the screened canonical shell pairs (q <= p, as IntegralEngine::shellpairs()), packed: one contiguous np x nq block per stored shell pair, every auxiliary function a column. More...
class  EDIIS
struct  PointChargePotential
 Plain external point charges (vacuum Coulomb). More...
struct  WolfPointChargePotential
 Wolf-summed periodic point charges. More...
class  GradientEvaluator
class  HessianEvaluator
 Evaluates molecular Hessian matrices (second derivatives of energy). More...
struct  COSXGridSchedule
 ORCA's COSX grid schedule: iterate on a coarse grid, switch to a finer one once the SCF is close (DIIS error below refine_threshold, or converged on the coarse grid), and evaluate the final exchange energy once on the final grid. More...
class  HartreeFock
struct  GuessRequest
 What a guess needs to know about the system. More...
struct  Guess
 The starting point a guess produces. More...
struct  JKPair
struct  JKTriple
class  IntegralEngine
class  ScopedRangeSeparation
 Applies a range-separation parameter for the duration of a scope, and puts back whatever was there before however the scope is left. More...
class  IntegralEngineDF
struct  PipekMezeySettings
struct  LocalizedOrbitals
 Orbitals localized by an orthogonal rotation of the input set. More...
struct  MolecularOrbitals
struct  Oniom
struct  OrbitalSmearing
class  CanonicalOrthogonalizer
struct  SCFContext
struct  SCF
struct  SCFConvergenceSettings
struct  FockBuildProperties
 What a method guarantees about its Fock build, so the SCF driver can decide whether to accumulate F += G(ΔD) instead of rebuilding from H each cycle. More...
class  SCFMethodBase
class  SplitRIJ
 Split-RI-J: Coulomb matrix via Hermite Gaussian basis (Neese 2003). More...
struct  Energy
struct  Wavefunction
class  AOBasis
struct  Shell
class  FchkReader
class  FchkWriter
class  MoldenReader
 Reader for Molden format wavefunction files. More...
class  OrcaJSONReader

Concepts

concept  ExternalPotential
 Concept for an external-potential model: a self-contained engine that produces a one-electron potential matrix V_ext and the nuclear–external interaction energy when handed an SCF procedure (HF/DFT/etc.).
concept  AnalyticHessianProcedure
 A procedure that provides every term the analytic Hessian needs.
concept  SCFMethod
concept  DensityFittingMethod
concept  PointChargeMethod

Typedefs

using PointChargeList = std::vector<occ::core::PointCharge>
using DispersionGradientFunc
 Callback that computes a dispersion energy and nuclear gradient for the given basis / orbitals / charge.
using HessianMatrix = Mat
using ShellPairList = std::vector<std::vector<size_t>>
using Vec
using Vec

Enumerations

enum class  FittingKind { JK , J , Correlation }
enum class  DispersionType { None , D4 }
enum class  GuessKind {
  Auto , Core , Soad , Sap ,
  AtomicScf
}
 Where the SCF starts from. More...
enum class  CoulombMethod { Traditional , SplitRIJ }
 Method for computing Coulomb matrix in density fitting. More...
enum class  PopulationKind { Mulliken , Lowdin }
 Atomic population entering the Pipek-Mezey functional. More...
enum class  DiisStrategy { CDIIS , EDIIS_CDIIS , ADIIS_CDIIS }
 Strategy for DIIS extrapolation during SCF. More...
enum class  SpinComponent { Total , Alpha , Beta }
enum  SpinorbitalKind
 Spin treatment for molecular orbitals / SCF. More...

Functions

AutoAuxResult generate_auto_aux (const AOBasis &basis, double threshold=1e-7, std::optional< int > max_l=std::nullopt)
 Generate automatic auxiliary basis using pivoted Cholesky decomposition Based on Lehtola, J.
Vec chelpg_charges (const Wavefunction &wfn)
template<SpinorbitalKind kind, typename TA>
TA::Scalar expectation (const TA &left, const TA &right)
template<typename TA>
TA::Scalar expectation (SpinorbitalKind sk, const TA &left, const TA &right)
std::string resolve_fitting_basis (const std::string &orbital_basis_name, FittingKind kind)
int cosx_nbf_crossover ()
std::string_view guess_kind_name (GuessKind kind)
const std::vector< std::pair< std::string, GuessKind > > & guess_kind_names ()
 The names a user may write, and what each selects.
std::optional< GuessKind > guess_kind_from_string (std::string_view name)
 Parse a guess name. Returns nothing for an unrecognised one.
bool minimal_basis_covers (const gto::AOBasis &basis)
 Whether the shipped minimal basis has shells for every atom in basis.
GuessKind select_guess (GuessKind requested, const gto::AOBasis &basis)
 Resolve Auto into a concrete kind; anything else passes through unchanged, so an explicit request is honoured even where it is a poor choice.
Guess build_guess (GuessKind kind, const GuessRequest &request)
 Build kind for request.
template<typename T>
 ScopedRangeSeparation (T &, double) -> ScopedRangeSeparation< T >
void from_json (const nlohmann::json &J, Energy &energy)
void to_json (nlohmann::json &J, const Energy &energy)
void from_json (const nlohmann::json &J, Wavefunction &wfn)
void to_json (nlohmann::json &J, const Wavefunction &wfn)
LocalizedOrbitals pipek_mezey (const AOBasis &basis, const Mat &S, const Mat &C, const PipekMezeySettings &settings={})
 Pipek-Mezey localization (Pipek & Mezey, JCP 90, 4916 (1989)) of the columns of C by Jacobi sweeps: maximizes sum_k sum_A (q_A^k)^2, the atomic populations of each orbital, over rotations among the columns of C.
LocalizedOrbitals pipek_mezey (const Wavefunction &wfn, int n_frozen=0, const PipekMezeySettings &settings={})
 Pipek-Mezey localization of the occupied orbitals of a closed-shell restricted wavefunction, the n_frozen lowest left out.
std::pair< Mat, Vec > merge_molecular_orbitals (const Mat &, const Mat &, const Vec &, const Vec &, bool sort_by_energy=false)
AOBasis merge_basis_sets (const AOBasis &, const AOBasis &)
std::vector< occ::core::Atom > merge_atoms (const std::vector< occ::core::Atom > &, const std::vector< occ::core::Atom > &)
Vec mulliken_partition (const AOBasis &basis, const MolecularOrbitals &mo, Eigen::Ref< const Mat > op)
constexpr bool supports_incremental_fock_build (const FockBuildProperties &properties)
 F can only be accumulated when the build is linear and the core Hamiltonian is fixed; screening decides whether it is worth doing.
template<SpinorbitalKind sk, Shell::Kind kind>
Mat shellblock_norm (const AOBasis &basis, const Mat &matrix) noexcept
template<SpinorbitalKind kind>
constexpr std::pair< size_t, size_t > matrix_dimensions (size_t nbf)
constexpr std::pair< size_t, size_t > matrix_dimensions (SpinorbitalKind kind, size_t nbf)
template<SpinorbitalKind kind, typename TA>
TA::Scalar expectation (const TA &left, const TA &right)
template<typename T>
constexpr bool is_odd (T a)
bool get_spinorbital_kind_from_string (const std::string &s, SpinorbitalKind &sk)
constexpr const char * spinorbital_kind_to_string (const SpinorbitalKind &sk)

Variables

template<typename T>
constexpr bool is_scf_method_v = SCFMethod<T>
template<typename T>
constexpr bool supports_density_fitting_v = DensityFittingMethod<T>
template<typename T>
constexpr bool supports_point_charges_v = PointChargeMethod<T>
constexpr auto OCC_MINIMAL_BASIS

Detailed Description

quantum mechanics/quantum chemistry functionality including Hartree-Fock and more

Typedef Documentation

◆ DispersionGradientFunc

Initial value:
std::function<std::pair<double, Mat3N>(
const AOBasis &, const MolecularOrbitals &, int)>
Definition shell.h:72
Definition mo.h:10

Callback that computes a dispersion energy and nuclear gradient for the given basis / orbitals / charge.

Used to inject corrections (e.g. XDM) that live in libraries above occ_qm, so occ_qm need not depend on them.

◆ HessianMatrix

◆ PointChargeList

◆ ShellPairList

using occ::qm::ShellPairList = std::vector<std::vector<size_t>>

◆ Vec [1/2]

using occ::Vec

◆ Vec [2/2]

using occ::Vec

Enumeration Type Documentation

◆ CoulombMethod

enum class occ::qm::CoulombMethod
strong

Method for computing Coulomb matrix in density fitting.

Enumerator
Traditional 

libcint 3-center integrals (default)

SplitRIJ 

MMD kernels using Hermite basis (no atomics).

◆ DiisStrategy

enum class occ::qm::DiisStrategy
strong

Strategy for DIIS extrapolation during SCF.

Enumerator
CDIIS 

Standard commutator DIIS only.

EDIIS_CDIIS 

EDIIS early, switch to CDIIS when error is small.

ADIIS_CDIIS 

ADIIS early, switch to CDIIS when error is small (recommended).

◆ DispersionType

enum class occ::qm::DispersionType
strong
Enumerator
None 
D4 

◆ FittingKind

enum class occ::qm::FittingKind
strong
Enumerator
JK 
J 
Correlation 

◆ GuessKind

enum class occ::qm::GuessKind
strong

Where the SCF starts from.

Every kind here ends in the same place – diagonalise a Fock matrix built from something cheaper than the answer – and differs only in what that something is. See <occ/qm/initial_guess.h> for how each is built.

This lives apart from the rest of the guess API, and depends on nothing, so that input handling can name a guess without taking on a dependency on the SCF itself.

Enumerator
Auto 

Choose per system; see select_guess.

Core 

No guess: diagonalise the bare core Hamiltonian.

Always available, and always the worst starting point that still converges.

Soad 

Superposition of atomic densities: tabulated ground-state occupations spread over a minimal basis, projected into the orbital basis.

Cheap and good, but only for elements the shipped minimal basis covers.

Sap 

Superposition of atomic potentials: a fitted effective potential per element added to the core Hamiltonian.

Covers every element, but has no sound treatment of effective core potentials.

AtomicScf 

Superposition of converged isolated-atom densities, one small SCF per element in this calculation's own basis.

Costs more than the others and works wherever the orbital basis does, ECPs included.

◆ PopulationKind

enum class occ::qm::PopulationKind
strong

Atomic population entering the Pipek-Mezey functional.

Enumerator
Mulliken 

qA = sum{mu in A} C_mu (S C)_mu, the original PM choice

Lowdin 

qA = sum{mu in A} (S^1/2 C)_mu^2, never negative

◆ SpinComponent

enum class occ::qm::SpinComponent
strong
Enumerator
Total 
Alpha 
Beta 

◆ SpinorbitalKind

Spin treatment for molecular orbitals / SCF.

Unscoped enum: the enumerators are intentionally usable unqualified within the enclosing namespace. The canonical definition lives here (occ_core) so that low-level consumers (e.g. input/config structs) can reference it without depending on occ_qm; occ::qm re-exports the type and enumerators for backwards compatibility (see occ/qm/spinorbital.h).

Function Documentation

◆ build_guess()

Guess occ::qm::build_guess ( GuessKind kind,
const GuessRequest & request )

Build kind for request.

Falls back to Core – an empty Guess – when the guess cannot be built for this system, having said why in the log. Every caller therefore gets a usable starting point.

◆ chelpg_charges()

Vec occ::qm::chelpg_charges ( const Wavefunction & wfn)

◆ cosx_nbf_crossover()

int occ::qm::cosx_nbf_crossover ( )

◆ expectation() [1/3]

template<SpinorbitalKind kind, typename TA>
TA::Scalar occ::qm::expectation ( const TA & left,
const TA & right )

◆ expectation() [2/3]

template<SpinorbitalKind kind, typename TA>
TA::Scalar occ::qm::expectation ( const TA & left,
const TA & right )

◆ expectation() [3/3]

template<typename TA>
TA::Scalar occ::qm::expectation ( SpinorbitalKind sk,
const TA & left,
const TA & right )

◆ from_json() [1/2]

void occ::qm::from_json ( const nlohmann::json & J,
Energy & energy )

◆ from_json() [2/2]

void occ::qm::from_json ( const nlohmann::json & J,
Wavefunction & wfn )

◆ generate_auto_aux()

AutoAuxResult occ::qm::generate_auto_aux ( const AOBasis & basis,
double threshold = 1e-7,
std::optional< int > max_l = std::nullopt )

Generate automatic auxiliary basis using pivoted Cholesky decomposition Based on Lehtola, J.

Chem. Theory Comput. 2021, 17, 6886-6900

◆ get_spinorbital_kind_from_string()

bool occ::core::get_spinorbital_kind_from_string ( const std::string & s,
SpinorbitalKind & sk )
inline

◆ guess_kind_from_string()

std::optional< GuessKind > occ::qm::guess_kind_from_string ( std::string_view name)
inline

Parse a guess name. Returns nothing for an unrecognised one.

◆ guess_kind_name()

std::string_view occ::qm::guess_kind_name ( GuessKind kind)
inline

◆ guess_kind_names()

const std::vector< std::pair< std::string, GuessKind > > & occ::qm::guess_kind_names ( )
inline

The names a user may write, and what each selects.

Shared by the command line and by any other input route, so they cannot drift apart.

◆ is_odd()

template<typename T>
bool occ::util::is_odd ( T a)
constexpr

◆ matrix_dimensions() [1/2]

template<SpinorbitalKind kind>
std::pair< size_t, size_t > occ::qm::matrix_dimensions ( size_t nbf)
constexpr

◆ matrix_dimensions() [2/2]

std::pair< size_t, size_t > occ::qm::matrix_dimensions ( SpinorbitalKind kind,
size_t nbf )
inlineconstexpr

◆ merge_atoms()

std::vector< occ::core::Atom > occ::qm::merge_atoms ( const std::vector< occ::core::Atom > & ,
const std::vector< occ::core::Atom > &  )

◆ merge_basis_sets()

AOBasis occ::qm::merge_basis_sets ( const AOBasis & ,
const AOBasis &  )

◆ merge_molecular_orbitals()

std::pair< Mat, Vec > occ::qm::merge_molecular_orbitals ( const Mat & ,
const Mat & ,
const Vec & ,
const Vec & ,
bool sort_by_energy = false )

◆ minimal_basis_covers()

bool occ::qm::minimal_basis_covers ( const gto::AOBasis & basis)

Whether the shipped minimal basis has shells for every atom in basis.

build_sto3g_shells drops elements it has no entry for rather than failing, so loading the minimal basis is not itself a coverage test: an uncovered atom simply comes back carrying no shells.

◆ mulliken_partition()

Vec occ::qm::mulliken_partition ( const AOBasis & basis,
const MolecularOrbitals & mo,
Eigen::Ref< const Mat > op )

◆ pipek_mezey() [1/2]

LocalizedOrbitals occ::qm::pipek_mezey ( const AOBasis & basis,
const Mat & S,
const Mat & C,
const PipekMezeySettings & settings = {} )

Pipek-Mezey localization (Pipek & Mezey, JCP 90, 4916 (1989)) of the columns of C by Jacobi sweeps: maximizes sum_k sum_A (q_A^k)^2, the atomic populations of each orbital, over rotations among the columns of C.

The span of C is unchanged; S is the AO overlap.

◆ pipek_mezey() [2/2]

LocalizedOrbitals occ::qm::pipek_mezey ( const Wavefunction & wfn,
int n_frozen = 0,
const PipekMezeySettings & settings = {} )

Pipek-Mezey localization of the occupied orbitals of a closed-shell restricted wavefunction, the n_frozen lowest left out.

◆ resolve_fitting_basis()

std::string occ::qm::resolve_fitting_basis ( const std::string & orbital_basis_name,
FittingKind kind )

◆ ScopedRangeSeparation()

template<typename T>
occ::qm::ScopedRangeSeparation ( T & ,
double  )->ScopedRangeSeparation< T >

◆ select_guess()

GuessKind occ::qm::select_guess ( GuessKind requested,
const gto::AOBasis & basis )

Resolve Auto into a concrete kind; anything else passes through unchanged, so an explicit request is honoured even where it is a poor choice.

Logs the reason whenever Auto picks something other than SOAD.

◆ shellblock_norm()

template<SpinorbitalKind sk, Shell::Kind kind>
Mat occ::qm::shellblock_norm ( const AOBasis & basis,
const Mat & matrix )
inlinenoexcept

◆ spinorbital_kind_to_string()

const char * occ::core::spinorbital_kind_to_string ( const SpinorbitalKind & sk)
constexpr

◆ supports_incremental_fock_build()

bool occ::qm::supports_incremental_fock_build ( const FockBuildProperties & properties)
constexpr

F can only be accumulated when the build is linear and the core Hamiltonian is fixed; screening decides whether it is worth doing.

◆ to_json() [1/2]

void occ::qm::to_json ( nlohmann::json & J,
const Energy & energy )

◆ to_json() [2/2]

void occ::qm::to_json ( nlohmann::json & J,
const Wavefunction & wfn )

Variable Documentation

◆ is_scf_method_v

template<typename T>
bool occ::qm::is_scf_method_v = SCFMethod<T>
constexpr

◆ OCC_MINIMAL_BASIS

◆ supports_density_fitting_v

template<typename T>
bool occ::qm::supports_density_fitting_v = DensityFittingMethod<T>
constexpr

◆ supports_point_charges_v

template<typename T>
bool occ::qm::supports_point_charges_v = PointChargeMethod<T>
constexpr