votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::HirshfeldPartition Class Reference

#include <hirshfeldpartition.h>

Classes

struct  AtomicReference
struct  Constraint

Static Public Member Functions

static std::vector< AtomicReference > BuildAtomicReferences (const QMMolecule &mol, const std::string &basisset_name, const std::map< std::string, Eigen::MatrixXd > &reference_densities)
static double EvaluateAtomicDensity (const AOBasis &atom_basis, const Eigen::MatrixXd &reference_density, const Eigen::Vector3d &point)
static Eigen::Vector3d EvaluateAtomicDensityGradient (const AOBasis &atom_basis, const Eigen::MatrixXd &reference_density, const Eigen::Vector3d &point)
static double EvaluateWeight (const std::vector< AtomicReference > &atoms, Index target_atom_index, const Eigen::Vector3d &point)
static Eigen::Vector3d EvaluateWeightGradient (const std::vector< AtomicReference > &atoms, Index target_atom_index, Index differentiate_atom_index, const Eigen::Vector3d &point)
static Eigen::Vector3d EvaluatePointWeightGradient (const std::vector< AtomicReference > &atoms, Index target_atom_index, const Eigen::Vector3d &point)
static Eigen::MatrixXd GridWeightDerivativeContribution (const std::vector< AtomicReference > &atoms, Index target_atom_index, const Eigen::MatrixXd &density_matrix, const QMMolecule &mol, const Vxc_Grid &grid)
static Eigen::MatrixXd PulayAndTranslationContribution (const std::vector< AtomicReference > &atoms, Index target_atom_index, const Eigen::MatrixXd &density_matrix, const AOBasis &full_dftbasis, const Vxc_Grid &grid)
static Eigen::MatrixXd WeightFunctionDerivativeContribution (const std::vector< AtomicReference > &atoms, Index target_atom_index, const Eigen::MatrixXd &density_matrix, const AOBasis &full_dftbasis, const Vxc_Grid &grid)
static Eigen::MatrixXd ComputeCDFTForceContribution (const std::vector< AtomicReference > &atoms, Index target_atom_index, const Eigen::MatrixXd &density_matrix, const QMMolecule &mol, const AOBasis &full_dftbasis, const Vxc_Grid &grid)
static Eigen::MatrixXd BuildWeightMatrix (const std::vector< AtomicReference > &atoms, Index target_atom_index, const AOBasis &full_dftbasis, const Vxc_Grid &grid)

Detailed Description

Definition at line 50 of file hirshfeldpartition.h.

Member Function Documentation

◆ BuildAtomicReferences()

std::vector< HirshfeldPartition::AtomicReference > votca::xtp::HirshfeldPartition::BuildAtomicReferences ( const QMMolecule & mol,
const std::string & basisset_name,
const std::map< std::string, Eigen::MatrixXd > & reference_densities )
static

Builds one AtomicReference per atom of mol (each needs its own basis center). Call once per geometry and reuse for all grid points.

Definition at line 35 of file hirshfeldpartition.cc.

◆ BuildWeightMatrix()

Eigen::MatrixXd votca::xtp::HirshfeldPartition::BuildWeightMatrix ( const std::vector< AtomicReference > & atoms,
Index target_atom_index,
const AOBasis & full_dftbasis,
const Vxc_Grid & grid )
static

AO-basis weight matrix for the Lagrange-multiplier potential, W_i,munu = integral w_i(r) phi_mu(r) phi_nu(r) dr, integrated numerically box by box as in Vxc_Potential::IntegrateVXC. grid should be the grid of the molecular SCF.

AO values are skipped at points where EvaluateWeight returns exactly 0 (performance only).

Definition at line 168 of file hirshfeldpartition.cc.

◆ ComputeCDFTForceContribution()

Eigen::MatrixXd votca::xtp::HirshfeldPartition::ComputeCDFTForceContribution ( const std::vector< AtomicReference > & atoms,
Index target_atom_index,
const Eigen::MatrixXd & density_matrix,
const QMMolecule & mol,
const AOBasis & full_dftbasis,
const Vxc_Grid & grid )
static

Full d(Tr[D*W_c])/dR for all atoms of mol: the sum of the four product-rule terms of d[omega_p * w_c(r_p) * rho_molecule(r_p)]/dR (SSW grid weight, weight function, Pulay, grid-point translation). This is a gradient, not a force; the force of constraint c is F_i^c = -lambda_c * dN_c/dR_i (Wu-Van Voorhis Lagrangian).

Definition at line 585 of file hirshfeldpartition.cc.

◆ EvaluateAtomicDensity()

double votca::xtp::HirshfeldPartition::EvaluateAtomicDensity ( const AOBasis & atom_basis,
const Eigen::MatrixXd & reference_density,
const Eigen::Vector3d & point )
static

Isolated-atom reference density at point, rho_i^free(point) = sum_munu P_munu phi_mu(point) phi_nu(point), with atom_basis centered on the atom in the molecule.

All shells are evaluated (AOShell::EvalAOspace) without the significant-shell screening of GridBox, which does not pay off for a single-atom basis.

Definition at line 69 of file hirshfeldpartition.cc.

◆ EvaluateAtomicDensityGradient()

Eigen::Vector3d votca::xtp::HirshfeldPartition::EvaluateAtomicDensityGradient ( const AOBasis & atom_basis,
const Eigen::MatrixXd & reference_density,
const Eigen::Vector3d & point )
static

Spatial gradient grad_r rho_i^free(point) of an isolated-atom reference density, needed for the weight derivative in the CDFT forces (see EvaluateWeightGradient): grad_rho(r) = 2 * derivatives^T * (P * values), using the derivatives returned by AOShell::EvalAOspace.

Definition at line 80 of file hirshfeldpartition.cc.

◆ EvaluatePointWeightGradient()

Eigen::Vector3d votca::xtp::HirshfeldPartition::EvaluatePointWeightGradient ( const std::vector< AtomicReference > & atoms,
Index target_atom_index,
const Eigen::Vector3d & point )
static

Gradient grad_r w_target(point) with respect to the evaluation point (EvaluateWeightGradient differentiates with respect to an atom position instead). Needed for the grid-point-translation force term: grid points move rigidly with their owner atom (r_p = R_owner + const, see PulayGradient), so quantities evaluated at r_p depend on R_owner through r_p.

grad_r w(r) = [grad_r rho_target(r) - w(r) * grad_r rho_tot(r)] / rho_tot(r)

Definition at line 144 of file hirshfeldpartition.cc.

◆ EvaluateWeight()

double votca::xtp::HirshfeldPartition::EvaluateWeight ( const std::vector< AtomicReference > & atoms,
Index target_atom_index,
const Eigen::Vector3d & point )
static

Hirshfeld weight w_target(point) = rho_target(point) / sum_j rho_j(point), with the sum over all atoms. Returns 0 where the denominator is negligible (far from all atoms).

Definition at line 96 of file hirshfeldpartition.cc.

◆ EvaluateWeightGradient()

Eigen::Vector3d votca::xtp::HirshfeldPartition::EvaluateWeightGradient ( const std::vector< AtomicReference > & atoms,
Index target_atom_index,
Index differentiate_atom_index,
const Eigen::Vector3d & point )
static

d w_target(point) / d R_A with A = differentiate_atom_index, for the CDFT forces. Since rho_j(r - R_j) depends only on R_j, d rho_j/d R_A = -delta_jA grad_r rho_A, and the quotient rule gives d w_target/d R_A = [w_target(point) - 1_{A==target}]

  • grad_rho_A(point) / rho_tot(point). This is nonzero for every atom A, since all atoms enter rho_tot. For a multi-atom fragment, sum over the fragment atoms as target_atom_index, as BuildCDFTConstraint does for BuildWeightMatrix.

Definition at line 118 of file hirshfeldpartition.cc.

◆ GridWeightDerivativeContribution()

Eigen::MatrixXd votca::xtp::HirshfeldPartition::GridWeightDerivativeContribution ( const std::vector< AtomicReference > & atoms,
Index target_atom_index,
const Eigen::MatrixXd & density_matrix,
const QMMolecule & mol,
const Vxc_Grid & grid )
static

CDFT force term from the derivative of the SSW grid weights, d(Tr[D*W_c])/dR for all atoms of mol (Natoms x 3). The trace is contracted inside the grid loop, without forming d(W_c)/dR, as in Vxc_Potential::GridWeightGradient. Implemented separately from that function (duplicating the SSW functions) to leave the validated XC gradient code unchanged.

density_matrix is the converged molecular density in the full AO basis, from which rho_molecule(point) is evaluated; w_c(point) comes from the Hirshfeld references in atoms.

Definition at line 252 of file hirshfeldpartition.cc.

◆ PulayAndTranslationContribution()

Eigen::MatrixXd votca::xtp::HirshfeldPartition::PulayAndTranslationContribution ( const std::vector< AtomicReference > & atoms,
Index target_atom_index,
const Eigen::MatrixXd & density_matrix,
const AOBasis & full_dftbasis,
const Vxc_Grid & grid )
static

Pulay (basis-function derivative) and grid-point-translation terms of d(Tr[D*W_c])/dR (Natoms x 3), computed in one grid loop. The translation term arises because grid points move with their owner atom (see EvaluatePointWeightGradient).

Follows the bookkeeping and sign convention of PulayGradient, -weight * potential * temp(mu) * ao.derivatives.row(mu), with w_c(point) in place of xc.df_drho; kept separate from it for the same reason as GridWeightDerivativeContribution.

Definition at line 426 of file hirshfeldpartition.cc.

◆ WeightFunctionDerivativeContribution()

Eigen::MatrixXd votca::xtp::HirshfeldPartition::WeightFunctionDerivativeContribution ( const std::vector< AtomicReference > & atoms,
Index target_atom_index,
const Eigen::MatrixXd & density_matrix,
const AOBasis & full_dftbasis,
const Vxc_Grid & grid )
static

Weight-function derivative term of the CDFT forces (Natoms x 3): sum_p omega_p * [d w_c(r_p)/d R_A] * rho_molecule(r_p), with omega_p and rho_molecule(r_p) held fixed (product-rule term of omega_p*w_c(r_p)*rho_molecule(r_p)). rho_molecule is evaluated from the converged density matrix in the full AO basis.

Definition at line 527 of file hirshfeldpartition.cc.


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