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

Namespaces

namespace  impl
 

Classes

struct  AccelerationPlan
 
struct  AssignedEnergy
 
class  CEModelCrystalGrowthCalculator
 
struct  CGConfig
 
struct  CGPreparation
 Result of loading and configuring a cg run: the crystal, the calculator options and any per-molecule charges. More...
 
class  CGSolvationModel
 Produces solvation surfaces for the cg pipeline. More...
 
struct  CGSolvationResult
 Per-monomer solvation surfaces, plus the wavefunctions the model can offer for solution-phase monomer and interaction energies. More...
 
struct  CGSolvationSettings
 Settings the concrete models need; a superset, each uses what applies. More...
 
struct  ConductorResult
 
struct  ConductorSettings
 Settings for the ideal-conductor COSMO calculation the segment descriptors are built from. More...
 
struct  CorrelationOptions
 Options for a post-HF correlation calculation on a converged SCF wavefunction. More...
 
struct  CorrelationResult
 Result of a post-HF correlation calculation. More...
 
struct  CosmoRSSettings
 
struct  CosmoRSSolvation
 A solvation free energy and the intermediates worth keeping. More...
 
struct  CosmoRSSolvationSettings
 Settings for a single-molecule openCOSMO-RS solvation free energy. More...
 
class  CrystalGrowthCalculator
 
struct  CrystalGrowthCalculatorOptions
 
struct  CrystalSurfaceEnergies
 
struct  DMAConfig
 
class  DMADriver
 
struct  DMAReferenceLevel
 Reference QM level for the monomer multipoles in the DMA+exp-6 model. More...
 
class  DummyCrystalGrowthCalculator
 
struct  FacetEnergies
 
struct  MethodSpec
 
struct  MorphologyOptions
 Options for the particle size/shape-dependent energy calculation. More...
 
struct  SolventSpec
 A solvent, possibly a mixture, at a temperature. More...
 
struct  VibrationalAnalysisConfig
 Configuration options for vibrational frequency analysis. More...
 
class  XTBCrystalGrowthCalculator
 

Typedefs

using WavefunctionList = std::vector< Wavefunction >
 
using MoleculeList = std::vector< occ::core::Molecule >
 

Enumerations

enum class  SolvationModelKind { None , Smd , CosmoRS }
 
enum class  WavefunctionChoice { GasPhase , Solvated }
 
enum class  MethodKind {
  HF , DFT , MP2 , CCSD ,
  CCSD_T , GFN2
}
 

Functions

std::size_t df_exchange_memory_budget ()
 Decide SCF acceleration (density fitting / COSX) for a calculation.
 
std::size_t df_exchange_intermediate_bytes (std::size_t nocc, std::size_t nbf, std::size_t ndf)
 Bytes DF-K would need for its half-transformed intermediate.
 
AccelerationPlan plan_acceleration (io::RIPolicy policy, const std::string &orbital_basis_name, std::size_t nbf, double exact_exchange, const std::string &user_df_basis, bool user_cosx, std::size_t df_exchange_bytes=0)
 
template<typename Proc >
void apply_acceleration (Proc &proc, std::size_t nbf, const io::OccInput &config, bool allow_cosx=true)
 Apply the active acceleration policy (DF / COSX) to an SCF procedure.
 
CGPreparation prepare_cg (CGConfig const &config)
 Load the crystal and build calculator options + charges from config.
 
occ::cg::CrystalGrowthResult run_cg_pipeline (CrystalGrowthCalculator &calc, const CrystalGrowthCalculatorOptions &opts, CGConfig const &config)
 Run the full crystal-growth pipeline on an already-constructed calculator: monomer energies -> lattice convergence -> molecular surroundings -> surface energies / morphology -> JSON serialization.
 
occ::cg::CrystalGrowthResult run_cg (CGConfig const &)
 
SolvationModelKind parse_solvation_model (const std::string &)
 
std::string solvation_model_name (SolvationModelKind)
 
std::unique_ptr< CGSolvationModelmake_cg_solvation_model (SolvationModelKind kind, const CGSolvationSettings &settings)
 
CorrelationResult run_correlation (const qm::Wavefunction &wfn, const CorrelationOptions &opts={})
 Run an MP2 / CCSD / CCSD(T) calculation on a converged SCF wavefunction, with the same backend dispatch, auxiliary-basis resolution and frozen-core handling as the CLI.
 
solvent::cosmors::Segments conductor_segments (const qm::Wavefunction &wavefunction, const solvent::cosmors::Parameters &params={}, double probe_radius_angs=0.0, int angular_points=590, bool constrain_charge=true, Vec *dielectric_energies=nullptr, double *cavity_volume_angs3=nullptr)
 Build segments from a wavefunction that has already been converged in the ideal-conductor reaction field, with both σ and σ⊥ averaged on params.
 
ConductorResult conductor_profile (const qm::Wavefunction &gas_wavefunction, const ConductorSettings &settings={})
 Converge the SCF in the ideal-conductor reaction field starting from a gas-phase wavefunction, then build the segments.
 
CosmoRSSolvation cosmors_solvation_free_energy (const core::Molecule &solute, const std::string &solvent_name, const CosmoRSSolvationSettings &settings={})
 Solvation free energy of solute in a named solvent, end to end.
 
CosmoRSSolvation cosmors_solvation_free_energy (const core::Molecule &solute, const core::Molecule &solvent, const CosmoRSSolvationSettings &settings={})
 The same, computing the solvent's conductor cavity from its geometry instead of loading a cached ensemble.
 
std::vector< std::string > available_cosmors_solvents ()
 Solvent names with a cached segment ensemble, sorted.
 
CGSolvationResult cosmors_solvation (const std::string &basename, const std::vector< core::Molecule > &molecules, const std::vector< qm::Wavefunction > &gas_wavefunctions, const SolventSpec &solvent, const CosmoRSSettings &settings={})
 Build openCOSMO-RS solvation surfaces for each molecule in solvent.
 
std::vector< AssignedEnergyassign_interaction_terms_to_nearest_neighbours (const crystal::CrystalDimers::MoleculeNeighbors &neighbors, const std::vector< double > &dimer_energies, double cg_radius)
 
MorphologyResult compute_crystal_morphology (const occ::crystal::Crystal &crystal, const occ::crystal::CrystalDimers &uc_dimers, const CrystalSurfaceEnergies &surface_energies, const occ::cg::CrystalGrowthResult &growth_result, const MorphologyOptions &options={})
 Compute the particle size/shape-dependent (surface + edge + corner) energy.
 
CrystalSurfaceEnergies calculate_crystal_surface_energies (const std::string &filename, const occ::crystal::Crystal &crystal, const occ::crystal::CrystalDimers &uc_dimers, int max_number_of_surfaces, int sign=-1, double min_interplanar_spacing=0.0)
 Surface energies for the morphologically important faces.
 
void to_json (nlohmann::json &j, const FacetEnergies &)
 
void to_json (nlohmann::json &j, const CrystalSurfaceEnergies &)
 
qm::Wavefunction geometry_optimization (const io::OccInput &config)
 Perform geometry optimization.
 
std::pair< qm::Wavefunction, core::VibrationalModesgeometry_optimization_with_frequencies (const io::OccInput &config, bool run_frequencies=true)
 Perform geometry optimization with optional vibrational analysis.
 
MethodSpec parse_method_string (const std::string &method_string)
 Parse a method string into base method, dispersion, kind and backend.
 
MethodKind method_kind_from_string (const std::string &name)
 
qm::SpinorbitalKind determine_spinorbital_kind (const std::string &name, int multiplicity, MethodKind method_kind)
 
occ::qm::Wavefunction calculate_wavefunction (const occ::core::Molecule &mol, const std::string &name, const std::string &energy_model, bool spherical)
 
WavefunctionList calculate_wavefunctions (const std::string &basename, const MoleculeList &molecules, const std::string &energy_model, bool spherical)
 
occ::qm::Wavefunction calculate_wavefunction (const occ::core::Molecule &mol, const std::string &name, const std::string &method, const std::string &basis, bool spherical)
 Compute a wavefunction at an explicit method/basis rather than a CE model name.
 
WavefunctionList calculate_wavefunctions (const std::string &basename, const MoleculeList &molecules, const std::string &method, const std::string &basis, bool spherical)
 
void compute_monomer_energies (const std::string &basename, WavefunctionList &wavefunctions, const std::string &model_name)
 
qm::Wavefunction single_point (const io::OccInput &)
 
qm::Wavefunction single_point (const io::OccInput &, const qm::Wavefunction &)
 
core::VibrationalModes vibrational_analysis (const io::OccInput &config, const qm::Wavefunction &wfn, const VibrationalAnalysisConfig &vib_config={})
 Perform vibrational frequency analysis on an optimized geometry.
 
core::VibrationalModes vibrational_analysis (const io::OccInput &config, const qm::Wavefunction &wfn)
 Convenience function for standard frequency analysis.
 

Typedef Documentation

◆ MoleculeList

using occ::driver::MoleculeList = typedef std::vector<occ::core::Molecule>

◆ WavefunctionList

Enumeration Type Documentation

◆ MethodKind

enum class occ::driver::MethodKind
strong
Enumerator
HF 
DFT 
MP2 
CCSD 
CCSD_T 
GFN2 

◆ SolvationModelKind

Enumerator
None 

gas phase, no solvation surfaces

Smd 

SMD via a solvated DFT SCF.

CosmoRS 

openCOSMO-RS 24a on an ideal-conductor cavity

◆ WavefunctionChoice

Enumerator
GasPhase 
Solvated 

Function Documentation

◆ apply_acceleration()

template<typename Proc >
void occ::driver::apply_acceleration ( Proc &  proc,
std::size_t  nbf,
const io::OccInput config,
bool  allow_cosx = true 
)

Apply the active acceleration policy (DF / COSX) to an SCF procedure.

Works for both HartreeFock and DFT (both expose the DF and COSX setters). COSX is only enabled for exact exchange, never for range-separated hybrids (COSX cannot handle range separation).

Parameters
allow_cosxpass false for gradient-producing calculations (geometry optimisation, frequencies): COSX has no analytic gradient, so it is downgraded to DF exchange there.

◆ assign_interaction_terms_to_nearest_neighbours()

std::vector< AssignedEnergy > occ::driver::assign_interaction_terms_to_nearest_neighbours ( const crystal::CrystalDimers::MoleculeNeighbors neighbors,
const std::vector< double > &  dimer_energies,
double  cg_radius 
)

◆ available_cosmors_solvents()

std::vector< std::string > occ::driver::available_cosmors_solvents ( )

Solvent names with a cached segment ensemble, sorted.

◆ calculate_crystal_surface_energies()

CrystalSurfaceEnergies occ::driver::calculate_crystal_surface_energies ( const std::string &  filename,
const occ::crystal::Crystal crystal,
const occ::crystal::CrystalDimers uc_dimers,
int  max_number_of_surfaces,
int  sign = -1,
double  min_interplanar_spacing = 0.0 
)

Surface energies for the morphologically important faces.

Faces are considered in Bravais-Friedel-Donnay-Harker order, largest interplanar spacing first. min_interplanar_spacing (Angstrom, positive to use) is the crystallographically meaningful cut: every face with d >= the threshold is included, so the selection never depends on where a count happens to land.

max_number_of_surfaces is the older count-based cut, kept for compatibility. It can split a Friedel pair — two distinct forms that are exactly degenerate in d whenever the point group is non-centrosymmetric — and produce an asymmetric Wulff construction, so it warns when it does. Set min_interplanar_spacing instead where you can.

◆ calculate_wavefunction() [1/2]

occ::qm::Wavefunction occ::driver::calculate_wavefunction ( const occ::core::Molecule mol,
const std::string &  name,
const std::string &  energy_model,
bool  spherical 
)

◆ calculate_wavefunction() [2/2]

occ::qm::Wavefunction occ::driver::calculate_wavefunction ( const occ::core::Molecule mol,
const std::string &  name,
const std::string &  method,
const std::string &  basis,
bool  spherical 
)

Compute a wavefunction at an explicit method/basis rather than a CE model name.

◆ calculate_wavefunctions() [1/2]

WavefunctionList occ::driver::calculate_wavefunctions ( const std::string &  basename,
const MoleculeList molecules,
const std::string &  energy_model,
bool  spherical 
)

◆ calculate_wavefunctions() [2/2]

WavefunctionList occ::driver::calculate_wavefunctions ( const std::string &  basename,
const MoleculeList molecules,
const std::string &  method,
const std::string &  basis,
bool  spherical 
)

◆ compute_crystal_morphology()

MorphologyResult occ::driver::compute_crystal_morphology ( const occ::crystal::Crystal crystal,
const occ::crystal::CrystalDimers uc_dimers,
const CrystalSurfaceEnergies surface_energies,
const occ::cg::CrystalGrowthResult growth_result,
const MorphologyOptions options = {} 
)

Compute the particle size/shape-dependent (surface + edge + corner) energy.

Parameters
uc_dimersmust already carry interaction energies (as produced by the cg flow via InteractionMapper); dimer.interaction_energy("Total") is read.

◆ compute_monomer_energies()

void occ::driver::compute_monomer_energies ( const std::string &  basename,
WavefunctionList wavefunctions,
const std::string &  model_name 
)

◆ conductor_profile()

ConductorResult occ::driver::conductor_profile ( const qm::Wavefunction gas_wavefunction,
const ConductorSettings settings = {} 
)

Converge the SCF in the ideal-conductor reaction field starting from a gas-phase wavefunction, then build the segments.

◆ conductor_segments()

solvent::cosmors::Segments occ::driver::conductor_segments ( const qm::Wavefunction wavefunction,
const solvent::cosmors::Parameters params = {},
double  probe_radius_angs = 0.0,
int  angular_points = 590,
bool  constrain_charge = true,
Vec dielectric_energies = nullptr,
double *  cavity_volume_angs3 = nullptr 
)

Build segments from a wavefunction that has already been converged in the ideal-conductor reaction field, with both σ and σ⊥ averaged on params.

Reusing a cached conductor wavefunction here is the whole point of the model: the segment descriptors are solvent independent, so one calculation serves every solvent.

◆ cosmors_solvation()

CGSolvationResult occ::driver::cosmors_solvation ( const std::string &  basename,
const std::vector< core::Molecule > &  molecules,
const std::vector< qm::Wavefunction > &  gas_wavefunctions,
const SolventSpec solvent,
const CosmoRSSettings settings = {} 
)

Build openCOSMO-RS solvation surfaces for each molecule in solvent.

The conductor wavefunction is solvent independent, so it is computed once per molecule and cached as <basename>_<i>_conductor.owf.json. Changing solvent then costs one apparent-surface-charge solve and a contraction, not another SCF.

Three of the model's terms are additive over surface elements and become cg channels: dielectric (gas to ideal conductor), residual (conductor to solvent), and cavity (the per-atom τ_α A_α term). The rest — combinatorial, ring, reference state and the constant η — are per-molecule with no surface-element home, so they carry no channel, but they are still added into total_solvation_energy so the reported figure is the model's whole solvation free energy. They are identical for a bulk and a surface molecule, so they cancel in the attachment-energy difference cg forms.

◆ cosmors_solvation_free_energy() [1/2]

CosmoRSSolvation occ::driver::cosmors_solvation_free_energy ( const core::Molecule solute,
const core::Molecule solvent,
const CosmoRSSolvationSettings settings = {} 
)

The same, computing the solvent's conductor cavity from its geometry instead of loading a cached ensemble.

Two SCFs rather than one, but it works for any solvent.

◆ cosmors_solvation_free_energy() [2/2]

CosmoRSSolvation occ::driver::cosmors_solvation_free_energy ( const core::Molecule solute,
const std::string &  solvent_name,
const CosmoRSSolvationSettings settings = {} 
)

Solvation free energy of solute in a named solvent, end to end.

Runs the gas-phase SCF, converges it again in the ideal-conductor reaction field, builds the segment descriptors on the model's own averaging radii, loads the solvent's cached segment ensemble and assembles the free energy. This is the whole model in one call; the pieces are available separately for callers that need them.

◆ determine_spinorbital_kind()

qm::SpinorbitalKind occ::driver::determine_spinorbital_kind ( const std::string &  name,
int  multiplicity,
MethodKind  method_kind 
)
inline

◆ df_exchange_intermediate_bytes()

std::size_t occ::driver::df_exchange_intermediate_bytes ( std::size_t  nocc,
std::size_t  nbf,
std::size_t  ndf 
)
inline

Bytes DF-K would need for its half-transformed intermediate.

◆ df_exchange_memory_budget()

std::size_t occ::driver::df_exchange_memory_budget ( )
inline

Decide SCF acceleration (density fitting / COSX) for a calculation.

Parameters
policyrequested RIPolicy (Auto by default)
orbital_basis_nameprimary orbital basis name (for aux-basis lookup)
nbfnumber of basis functions (for the COSX crossover)
exact_exchangefraction of exact (HF) exchange: 1.0 for HF, the hybrid mixing fraction for DFT, 0.0 for a pure GGA
user_df_basisexplicit –df-basis/–aux value ("" if unset)
user_cosxexplicit –cosx flag
df_exchange_bytessize of the DF-K intermediate, 0 if unknown

Explicit user settings always win; Auto only fills in choices left unset. The Auto rule (ORCA-style): density-fit the Coulomb term for every SCF method, and for exact exchange use DF-K below the basis-function crossover, seminumerical COSX above it.

Memory budget for the DF exchange intermediate, in bytes.

DF-K half-transforms the three-centre integrals into B[i][mu][P], which is nocc x nbf x ndf doubles. That intermediate cannot be blocked over the auxiliary index – K = sum_i B_i V^-1 B_i^T, and V^-1 couples every auxiliary function to every other – so its size is a hard requirement of the method rather than something an implementation can trade away.

COSX needs no such intermediate, which makes it the right choice once the DF-K workspace stops fitting, independent of how many basis functions there are.

◆ geometry_optimization()

qm::Wavefunction occ::driver::geometry_optimization ( const io::OccInput config)

Perform geometry optimization.

Parameters
configInput configuration
Returns
Optimized wavefunction

◆ geometry_optimization_with_frequencies()

std::pair< qm::Wavefunction, core::VibrationalModes > occ::driver::geometry_optimization_with_frequencies ( const io::OccInput config,
bool  run_frequencies = true 
)

Perform geometry optimization with optional vibrational analysis.

Parameters
configInput configuration
run_frequenciesIf true, compute vibrational frequencies after optimization
Returns
Pair of optimized wavefunction and vibrational modes (empty if not computed)

◆ make_cg_solvation_model()

std::unique_ptr< CGSolvationModel > occ::driver::make_cg_solvation_model ( SolvationModelKind  kind,
const CGSolvationSettings settings 
)

◆ method_kind_from_string()

MethodKind occ::driver::method_kind_from_string ( const std::string &  name)
inline

◆ parse_method_string()

MethodSpec occ::driver::parse_method_string ( const std::string &  method_string)
inline

Parse a method string into base method, dispersion, kind and backend.

Single source of truth: a leading "ri-"/"df-"/"thc-" backend prefix (only for correlation methods) is split off, then a dispersion suffix, then the base is classified. Anything not matching a known method alias is a DFT functional.

Examples: "pbe-d4" -> {base "pbe", disp "d4", kind DFT} "hf-d4" -> {base "hf", disp "d4", kind HF} "ccsd(t)" -> {base "ccsd(t)", kind CCSD_T, backend ""} "ri-ccsd(t)" -> {base "ccsd(t)", kind CCSD_T, backend "df"} "thc-mp2" -> {base "mp2", kind MP2, backend "thc"} "b97-d" -> {base "b97-d", kind DFT} (prefix/suffix kept)

◆ parse_solvation_model()

SolvationModelKind occ::driver::parse_solvation_model ( const std::string &  )

◆ plan_acceleration()

AccelerationPlan occ::driver::plan_acceleration ( io::RIPolicy  policy,
const std::string &  orbital_basis_name,
std::size_t  nbf,
double  exact_exchange,
const std::string &  user_df_basis,
bool  user_cosx,
std::size_t  df_exchange_bytes = 0 
)
inline

◆ prepare_cg()

CGPreparation occ::driver::prepare_cg ( CGConfig const &  config)

Load the crystal and build calculator options + charges from config.

◆ run_cg()

occ::cg::CrystalGrowthResult occ::driver::run_cg ( CGConfig const &  )

◆ run_cg_pipeline()

occ::cg::CrystalGrowthResult occ::driver::run_cg_pipeline ( CrystalGrowthCalculator calc,
const CrystalGrowthCalculatorOptions opts,
CGConfig const &  config 
)

Run the full crystal-growth pipeline on an already-constructed calculator: monomer energies -> lattice convergence -> molecular surroundings -> surface energies / morphology -> JSON serialization.

◆ run_correlation()

CorrelationResult occ::driver::run_correlation ( const qm::Wavefunction wfn,
const CorrelationOptions opts = {} 
)

Run an MP2 / CCSD / CCSD(T) calculation on a converged SCF wavefunction, with the same backend dispatch, auxiliary-basis resolution and frozen-core handling as the CLI.

Handles restricted and unrestricted references.

◆ single_point() [1/2]

qm::Wavefunction occ::driver::single_point ( const io::OccInput )

◆ single_point() [2/2]

qm::Wavefunction occ::driver::single_point ( const io::OccInput ,
const qm::Wavefunction  
)

◆ solvation_model_name()

std::string occ::driver::solvation_model_name ( SolvationModelKind  )

◆ to_json() [1/2]

void occ::driver::to_json ( nlohmann::json &  j,
const CrystalSurfaceEnergies  
)

◆ to_json() [2/2]

void occ::driver::to_json ( nlohmann::json &  j,
const FacetEnergies  
)

◆ vibrational_analysis() [1/2]

core::VibrationalModes occ::driver::vibrational_analysis ( const io::OccInput config,
const qm::Wavefunction wfn 
)

Convenience function for standard frequency analysis.

Uses default settings optimized for most common use cases:

  • Finite differences with acoustic sum rule
  • Step size: 0.005 Bohr
  • No projection of translational/rotational modes
Parameters
configInput configuration from OCC input file
wfnConverged wavefunction from optimization or single point
Returns
VibrationalModes Complete vibrational analysis results

◆ vibrational_analysis() [2/2]

core::VibrationalModes occ::driver::vibrational_analysis ( const io::OccInput config,
const qm::Wavefunction wfn,
const VibrationalAnalysisConfig vib_config = {} 
)

Perform vibrational frequency analysis on an optimized geometry.

This function computes the molecular Hessian using finite differences and performs normal mode analysis to obtain vibrational frequencies. It can be called after geometry optimization to characterize the stationary point.

Parameters
configInput configuration from OCC input file
wfnConverged wavefunction from optimization or single point
vib_configConfiguration options for vibrational analysis
Returns
VibrationalModes Complete vibrational analysis results