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

Charge-response matrix Pi of one molecule type. More...

#include <chargeresponse.h>

Collaboration diagram for votca::xtp::ChargeResponse:

Public Member Functions

 ChargeResponse ()=default
 ChargeResponse (std::vector< std::string > elements, Eigen::MatrixXd pi)
void LoadFromFile (const std::string &filename)
 Reads a .crm file and checks it (see Check). Positions are in bohr.
bool empty () const
Index size () const
const Eigen::MatrixXd & Pi () const
const std::vector< std::string > & Elements () const
ChargeResponse Permuted (const std::vector< Index > &order) const
void WriteToCpt (CheckpointWriter &w) const
void ReadFromCpt (CheckpointReader &r)

Private Member Functions

void Check (const std::string &source)

Private Attributes

std::vector< std::string > elements_
Eigen::MatrixXd pi_

Detailed Description

Charge-response matrix Pi of one molecule type.

In the charge-response (CR) environment model the induced atomic charges of a molecule are dq = -Pi phi, with phi the external electrostatic potential at its atoms. Pi (N x N, atomic units e^2/Hartree) is symmetric, positive semidefinite and conserves charge (every row sums to zero). It already contains the molecule's own Coulomb screening, so induced charges of the same molecule do not interact. What charges cannot carry is in residual induced dipoles, the ordinary polarizabilities of the molecule's .mps file.

Pi is invariant under rotations, so it is stored once per molecule type in the atom order of the type's .mps file, in a .crm file:

! comment lines start with '!' N El x y z (N lines, Angstrom, the fit geometry; informational) Pi_11 ... Pi_1N (N lines of N numbers, e^2/Hartree)

written by xtp_tools -e crfit (ChargeResponseFit) or the PySCF script xtp_cr_fit: the response to Hirshfeld-localized potentials, measured with Hirshfeld charges.

Definition at line 58 of file chargeresponse.h.

Constructor & Destructor Documentation

◆ ChargeResponse() [1/2]

votca::xtp::ChargeResponse::ChargeResponse ( )
default

◆ ChargeResponse() [2/2]

votca::xtp::ChargeResponse::ChargeResponse ( std::vector< std::string > elements,
Eigen::MatrixXd pi )

Definition at line 45 of file chargeresponse.cc.

Member Function Documentation

◆ Check()

void votca::xtp::ChargeResponse::Check ( const std::string & source)
private

Definition at line 117 of file chargeresponse.cc.

◆ Elements()

const std::vector< std::string > & votca::xtp::ChargeResponse::Elements ( ) const
inline

Definition at line 69 of file chargeresponse.h.

◆ empty()

bool votca::xtp::ChargeResponse::empty ( ) const
inline

Definition at line 66 of file chargeresponse.h.

◆ LoadFromFile()

void votca::xtp::ChargeResponse::LoadFromFile ( const std::string & filename)

Reads a .crm file and checks it (see Check). Positions are in bohr.

Definition at line 51 of file chargeresponse.cc.

◆ Permuted()

ChargeResponse votca::xtp::ChargeResponse::Permuted ( const std::vector< Index > & order) const

The response of the atoms order[0], order[1], ... of this one, in that order. order must be a permutation of 0..N-1: a subset of atoms would not conserve charge.

Definition at line 160 of file chargeresponse.cc.

◆ Pi()

const Eigen::MatrixXd & votca::xtp::ChargeResponse::Pi ( ) const
inline

Definition at line 68 of file chargeresponse.h.

◆ ReadFromCpt()

void votca::xtp::ChargeResponse::ReadFromCpt ( CheckpointReader & r)

Definition at line 199 of file chargeresponse.cc.

◆ size()

Index votca::xtp::ChargeResponse::size ( ) const
inline

Definition at line 67 of file chargeresponse.h.

◆ WriteToCpt()

void votca::xtp::ChargeResponse::WriteToCpt ( CheckpointWriter & w) const

Definition at line 190 of file chargeresponse.cc.

Member Data Documentation

◆ elements_

std::vector<std::string> votca::xtp::ChargeResponse::elements_
private

Definition at line 86 of file chargeresponse.h.

◆ pi_

Eigen::MatrixXd votca::xtp::ChargeResponse::pi_
private

Definition at line 87 of file chargeresponse.h.


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