occ
Loading...
Searching...
No Matches
occ::qm::HessianEvaluator< Proc > Class Template Reference

Evaluates molecular Hessian matrices (second derivatives of energy) More...

#include <hessians.h>

Public Types

enum class  Method { FiniteDifferences , Analytical }
 Method for Hessian calculation. More...
 

Public Member Functions

 HessianEvaluator (Proc &p)
 Construct a HessianEvaluator for the given procedure.
 
void set_method (Method method)
 Set the method for Hessian calculation.
 
void set_step_size (double h)
 Set the finite differences step size.
 
void set_use_acoustic_sum_rule (bool use)
 Enable/disable acoustic sum rule optimization.
 
double step_size () const
 Get the current step size for finite differences.
 
bool use_acoustic_sum_rule () const
 Check if acoustic sum rule is enabled.
 
Method method () const
 Get the current calculation method.
 
void set_scf_convergence_settings (const SCFConvergenceSettings &settings)
 Set the SCF convergence settings for displaced calculations.
 
const SCFConvergenceSettingsscf_convergence_settings () const
 Get the current SCF convergence settings.
 
HessianMatrix nuclear_repulsion () const
 Compute the nuclear repulsion contribution to the Hessian.
 
const HessianMatrixoperator() (const Wavefunction &wfn)
 Compute the full molecular Hessian.
 

Detailed Description

template<typename Proc>
class occ::qm::HessianEvaluator< Proc >

Evaluates molecular Hessian matrices (second derivatives of energy)

The HessianEvaluator class computes the Hessian matrix, which contains second derivatives of the energy with respect to nuclear coordinates: H_ij = d2E/dR_i dR_j

Currently supports:

  • Finite differences method with configurable step size
  • Acoustic sum rule optimization (reduces computational cost by ~33%)
  • Nuclear repulsion Hessian computation
Template Parameters
ProcThe quantum chemical procedure type (e.g., HartreeFock, DFT)

Usage example:

hess_eval.set_step_size(0.005); // 0.005 Bohr
hess_eval.set_use_acoustic_sum_rule(true); // Use optimization
auto hessian = hess_eval(mo);
Evaluates molecular Hessian matrices (second derivatives of energy)
Definition hessians.h:39

Member Enumeration Documentation

◆ Method

Method for Hessian calculation.

Enumerator
FiniteDifferences 

Central finite differences (currently only supported method)

Analytical 

Analytical second derivatives (not yet implemented)

Constructor & Destructor Documentation

◆ HessianEvaluator()

template<typename Proc >
occ::qm::HessianEvaluator< Proc >::HessianEvaluator ( Proc p)
inlineexplicit

Construct a HessianEvaluator for the given procedure.

Parameters
pThe quantum chemical procedure (HF, DFT, etc.)

Member Function Documentation

◆ method()

template<typename Proc >
Method occ::qm::HessianEvaluator< Proc >::method ( ) const
inline

Get the current calculation method.

Returns
The Hessian calculation method

◆ nuclear_repulsion()

template<typename Proc >
HessianMatrix occ::qm::HessianEvaluator< Proc >::nuclear_repulsion ( ) const
inline

Compute the nuclear repulsion contribution to the Hessian.

Returns
Nuclear repulsion Hessian matrix (3N×3N)

Computes d²V_nn/dR_A dR_B where V_nn is the nuclear-nuclear repulsion. This is the only part of the Hessian that can be computed analytically without significant computational cost.

◆ operator()()

Compute the full molecular Hessian.

Parameters
wfnWavefunction from converged SCF calculation
Returns
Complete Hessian matrix including nuclear and electronic contributions

This is the main interface for computing the Hessian. The method used depends on the configuration (set_method, set_step_size, etc.). The wavefunction provides both the molecular orbitals for the reference calculation and the charge/multiplicity for displaced calculations.

◆ scf_convergence_settings()

template<typename Proc >
const SCFConvergenceSettings & occ::qm::HessianEvaluator< Proc >::scf_convergence_settings ( ) const
inline

Get the current SCF convergence settings.

Returns
The SCF convergence settings used for displaced calculations

◆ set_method()

template<typename Proc >
void occ::qm::HessianEvaluator< Proc >::set_method ( Method  method)
inline

Set the method for Hessian calculation.

Parameters
methodThe method to use (currently only FiniteDifferences supported)

◆ set_scf_convergence_settings()

template<typename Proc >
void occ::qm::HessianEvaluator< Proc >::set_scf_convergence_settings ( const SCFConvergenceSettings settings)
inline

Set the SCF convergence settings for displaced calculations.

Parameters
settingsSCF convergence settings to use

By default, Hessian calculations use tighter convergence criteria (energy_threshold=1e-10, commutator_threshold=1e-8) for improved accuracy.

◆ set_step_size()

template<typename Proc >
void occ::qm::HessianEvaluator< Proc >::set_step_size ( double  h)
inline

Set the finite differences step size.

Parameters
hStep size in Bohr (typical: 0.001 to 0.01)

Smaller step sizes reduce truncation error but increase numerical error. Default: 0.005 Bohr (matches ORCA default)

◆ set_use_acoustic_sum_rule()

template<typename Proc >
void occ::qm::HessianEvaluator< Proc >::set_use_acoustic_sum_rule ( bool  use)
inline

Enable/disable acoustic sum rule optimization.

Parameters
useIf true, use acoustic sum rule to reduce computations

The acoustic sum rule (translational invariance) reduces the number of required displacements from 3N to 3(N-1), saving some computation for a 3-atom system. Based on: d2E/dR_i dR_j = -Σ_k≠j d2E/dR_i dR_k

◆ step_size()

template<typename Proc >
double occ::qm::HessianEvaluator< Proc >::step_size ( ) const
inline

Get the current step size for finite differences.

Returns
Step size in Bohr

◆ use_acoustic_sum_rule()

template<typename Proc >
bool occ::qm::HessianEvaluator< Proc >::use_acoustic_sum_rule ( ) const
inline

Check if acoustic sum rule is enabled.

Returns
True if acoustic sum rule optimization is enabled

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