votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::Sigma_base Class Referenceabstract

#include <sigma_base.h>

Inheritance diagram for votca::xtp::Sigma_base:
Collaboration diagram for votca::xtp::Sigma_base:

Classes

struct  options
struct  DiagPoleForm
struct  ScreeningData

Public Member Functions

 Sigma_base (TCMatrix_gwbse &Mmn, const RPA &rpa)
virtual ~Sigma_base ()=default
void configure (options opt)
Eigen::MatrixXd CalcExchangeMatrix () const
Eigen::MatrixXd CalcHartreeMatrix (const Eigen::MatrixXd &R=Eigen::MatrixXd()) const
Eigen::MatrixXd CalcReactionFieldMatrix (const Eigen::MatrixXd &R) const
 Static self-energy of an environment reaction field: the COH+SEX pair for v_reac, in the QP window.
Eigen::VectorXd CalcCorrelationDiag (const Eigen::VectorXd &frequencies) const
virtual Eigen::MatrixXd CalcCorrelationOffDiag (const Eigen::VectorXd &frequencies) const
Eigen::MatrixXd CalcCorrelationSRG (const Eigen::VectorXd &frequencies, double s) const
virtual void PrepareScreening ()=0
virtual std::string ScreeningSummary () const
 One line about the screening just prepared (empty if nothing to say).
virtual bool HasOffDiagonal () const
 False if CalcCorrelationOffDiag only returns zeros (CDA).
virtual bool HasPoleForm () const
virtual DiagPoleForm PoleForm (Index gw_level) const
void setKeepScreeningData (bool keep)
virtual ScreeningData ScreeningDump (const Eigen::VectorXd &nu) const
virtual double CalcCorrelationDiagElementDerivative (Index gw_level, double frequency) const =0
virtual double CalcCorrelationDiagElement (Index gw_level, double frequency) const =0
virtual Eigen::VectorXd CalcCorrelationDiagElements (Index gw_level, const Eigen::VectorXd &frequencies) const
virtual double CalcCorrelationOffDiagElement (Index gw_level1, Index gw_level2, double frequency1, double frequency2) const =0
void setPairContractionMemory (double block_bytes, double chunk_bytes)
void setTimings (DFTTimings *timings)
 Times the parts of PrepareScreening in these timings (optional).
void ResetDiagEvalCounter () const
std::size_t GetDiagEvalCounter () const

Protected Member Functions

void CountDiagEval () const
Eigen::MatrixXd PairContraction (Index nrows, const std::function< void(Index, Eigen::MatrixXd &)> &makeX) const

Static Protected Member Functions

static void FrameSums (const Eigen::MatrixXd &a, const Eigen::VectorXd &omegas, const Eigen::VectorXd &nu, ScreeningData &data)

Protected Attributes

options opt_
TCMatrix_gwbse & Mmn_
const RPA & rpa_
DFTTimings * timings_ = nullptr
Index qptotal_ = 0
Index rpatotal_ = 0
bool keep_screening_data_ = false

Private Attributes

double block_bytes_ = 4e9
double chunk_bytes_ = 5e8
std::atomic< std::size_t > diag_eval_counter_ {0}

Detailed Description

Definition at line 38 of file sigma_base.h.

Constructor & Destructor Documentation

◆ Sigma_base()

votca::xtp::Sigma_base::Sigma_base ( TCMatrix_gwbse & Mmn,
const RPA & rpa )
inline

Definition at line 40 of file sigma_base.h.

◆ ~Sigma_base()

virtual votca::xtp::Sigma_base::~Sigma_base ( )
virtualdefault

Member Function Documentation

◆ CalcCorrelationDiag()

Eigen::VectorXd votca::xtp::Sigma_base::CalcCorrelationDiag ( const Eigen::VectorXd & frequencies) const

Definition at line 194 of file sigma_base.cc.

◆ CalcCorrelationDiagElement()

virtual double votca::xtp::Sigma_base::CalcCorrelationDiagElement ( Index gw_level,
double frequency ) const
pure virtual

◆ CalcCorrelationDiagElementDerivative()

virtual double votca::xtp::Sigma_base::CalcCorrelationDiagElementDerivative ( Index gw_level,
double frequency ) const
pure virtual

◆ CalcCorrelationDiagElements()

virtual Eigen::VectorXd votca::xtp::Sigma_base::CalcCorrelationDiagElements ( Index gw_level,
const Eigen::VectorXd & frequencies ) const
inlinevirtual

Diagonal element at several frequencies. The default evaluates them one by one; implementations may do all of them in one pass over the integrals.

Reimplemented in votca::xtp::Sigma_Exact, and votca::xtp::Sigma_PPM.

Definition at line 179 of file sigma_base.h.

◆ CalcCorrelationOffDiag()

Eigen::MatrixXd votca::xtp::Sigma_base::CalcCorrelationOffDiag ( const Eigen::VectorXd & frequencies) const
virtual

Reimplemented in votca::xtp::Sigma_Exact, and votca::xtp::Sigma_PPM.

Definition at line 267 of file sigma_base.cc.

◆ CalcCorrelationOffDiagElement()

virtual double votca::xtp::Sigma_base::CalcCorrelationOffDiagElement ( Index gw_level1,
Index gw_level2,
double frequency1,
double frequency2 ) const
pure virtual

◆ CalcCorrelationSRG()

Eigen::MatrixXd votca::xtp::Sigma_base::CalcCorrelationSRG ( const Eigen::VectorXd & frequencies,
double s ) const

Static correlation self-energy of SRG-regularized QSGW (Marie and Loos, arXiv:2303.05984, eq. 44), diagonal and off-diagonal, from the pole form (exact and ppm): with D_n(p) = w_n - z_p, S_n1n2 = prefactor sum_p c_p r_n1(p) r_n2(p) (D1 + D2) / (D1^2 + D2^2) [1 - exp(-s (D1^2 + D2^2))], on the diagonal (1 - exp(-2 s D^2)) / D. Hermitian without symmetrisation; s -> infinity gives the eta -> 0 limit of the symmetrised form on the diagonal. Throws without a pole form.

Definition at line 205 of file sigma_base.cc.

◆ CalcExchangeMatrix()

Eigen::MatrixXd votca::xtp::Sigma_base::CalcExchangeMatrix ( ) const

Definition at line 118 of file sigma_base.cc.

◆ CalcHartreeMatrix()

Eigen::MatrixXd votca::xtp::Sigma_base::CalcHartreeMatrix ( const Eigen::MatrixXd & R = Eigen::MatrixXd()) const

Hartree matrix of the active occupied levels (rpamin..homo) in the QP window, in the current orbitals of the integrals: J_mn = 2 sum_{i occ} (mn|ii) = 2 sum_PQ M_mn,P v_PQ d_Q, d = sum_{i occ} M_ii (the frozen core below rpamin is not included). QSGW uses the change of J between the DFT and the QP orbitals.

Without R the interaction is the bare v. With R, the reaction field of a static environment in the FILL-TIME auxiliary frame (as for CalcReactionFieldMatrix), it is u = v + v_reac, i.e. the kernel 1 + R: J^u_mn = 2 sum_PQ M_mn,P (1 + R)_PQ d_Q, which adds the potential of the dipoles the environment induces in response to the density. Both are evaluated in whatever frame the integrals are in now (rotated, dressed or not).

Definition at line 143 of file sigma_base.cc.

◆ CalcReactionFieldMatrix()

Eigen::MatrixXd votca::xtp::Sigma_base::CalcReactionFieldMatrix ( const Eigen::MatrixXd & R) const

Static self-energy of an environment reaction field: the COH+SEX pair for v_reac, in the QP window.

With the reaction field v_reac = v_12 chi^(2) v_21 of a static environment folded into the screened interaction, W = W_dyn + v_reac, and the frequency-independent part contributes

Sigma^SEX_nn' = - sum_{i occ} (ni|v_reac|n'i) Sigma^COH_nn' = 1/2 sum_{m} (nm|v_reac|n'm)

Sigma^reac_nn' = 1/2 sum_m s_m (nm|v_reac|n'm), s_m = -1 occ, +1 virt,

with (nm|v_reac|n'm) = M_nm R M_n'm^T. SEX alone would move the HOMO by twice the polarization energy and leave the LUMO where it is; with COH a level of density psi_n^2 moves by -+ 1/2 (nn|v_reac|nn): occupied levels up, virtual ones down, which is the familiar P_h + P_e gap closing of a polarizable environment.

The m-sum runs over the RPA window. COH needs it complete – it is a closure relation – so with rpamax below the last MO the result is truncated. v_reac is smooth over the molecule, so that converges fast, but it is not exact.

R must be in the FILL-TIME auxiliary frame, R = T^T B T as EnvironmentScreening::SymmetrizedReactionField returns it; it is brought into the frame of the integrals here.

Definition at line 180 of file sigma_base.cc.

◆ configure()

void votca::xtp::Sigma_base::configure ( options opt)
inline

Definition at line 56 of file sigma_base.h.

◆ CountDiagEval()

void votca::xtp::Sigma_base::CountDiagEval ( ) const
inlineprotected

Definition at line 221 of file sigma_base.h.

◆ FrameSums()

void votca::xtp::Sigma_base::FrameSums ( const Eigen::MatrixXd & a,
const Eigen::VectorXd & omegas,
const Eigen::VectorXd & nu,
ScreeningData & data )
staticprotected

ScreeningData from modes a_is given as (phi^T Z)^2-like weights: fills frame_moments and frame_eps_inv_imag from the weights a (frame x modes) and the mode frequencies.

Definition at line 98 of file sigma_base.cc.

◆ GetDiagEvalCounter()

std::size_t votca::xtp::Sigma_base::GetDiagEvalCounter ( ) const
inline

Definition at line 203 of file sigma_base.h.

◆ HasOffDiagonal()

virtual bool votca::xtp::Sigma_base::HasOffDiagonal ( ) const
inlinevirtual

False if CalcCorrelationOffDiag only returns zeros (CDA).

Reimplemented in votca::xtp::Sigma_CDA.

Definition at line 133 of file sigma_base.h.

◆ HasPoleForm()

virtual bool votca::xtp::Sigma_base::HasPoleForm ( ) const
inlinevirtual

Reimplemented in votca::xtp::Sigma_Exact, and votca::xtp::Sigma_PPM.

Definition at line 148 of file sigma_base.h.

◆ PairContraction()

Eigen::MatrixXd votca::xtp::Sigma_base::PairContraction ( Index nrows,
const std::function< void(Index, Eigen::MatrixXd &)> & makeX ) const
protected

A(m,n) = sum_{l < nrows, P} X_m(l,P) M_n(l,P) for all pairs of QP levels m, n, with M_n = Mmn_[n] (QP-window numbering) and X_m from makeX(m, X) (nrows x auxsize). Evaluated as matrix products over blocks of m and chunks of the auxiliary index, so the three-centre integrals are streamed a few times instead of once per pair.

Definition at line 41 of file sigma_base.cc.

◆ PoleForm()

Sigma_base::DiagPoleForm votca::xtp::Sigma_base::PoleForm ( Index gw_level) const
virtual

Reimplemented in votca::xtp::Sigma_Exact, and votca::xtp::Sigma_PPM.

Definition at line 86 of file sigma_base.cc.

◆ PrepareScreening()

virtual void votca::xtp::Sigma_base::PrepareScreening ( )
pure virtual

◆ ResetDiagEvalCounter()

void votca::xtp::Sigma_base::ResetDiagEvalCounter ( ) const
inline

Definition at line 202 of file sigma_base.h.

◆ ScreeningDump()

Sigma_base::ScreeningData votca::xtp::Sigma_base::ScreeningDump ( const Eigen::VectorXd & nu) const
virtual

Reimplemented in votca::xtp::Sigma_Exact, and votca::xtp::Sigma_PPM.

Definition at line 92 of file sigma_base.cc.

◆ ScreeningSummary()

virtual std::string votca::xtp::Sigma_base::ScreeningSummary ( ) const
inlinevirtual

One line about the screening just prepared (empty if nothing to say).

Reimplemented in votca::xtp::Sigma_PPM.

Definition at line 131 of file sigma_base.h.

◆ setKeepScreeningData()

void votca::xtp::Sigma_base::setKeepScreeningData ( bool keep)
inline

Keep what ScreeningDump needs from the next PrepareScreening on (the exact evaluator then keeps the aux x modes array Z).

Definition at line 169 of file sigma_base.h.

◆ setPairContractionMemory()

void votca::xtp::Sigma_base::setPairContractionMemory ( double block_bytes,
double chunk_bytes )
inline

Memory (bytes) for the level block and the integral chunk of PairContraction; smaller values only mean more passes.

Definition at line 194 of file sigma_base.h.

◆ setTimings()

void votca::xtp::Sigma_base::setTimings ( DFTTimings * timings)
inline

Times the parts of PrepareScreening in these timings (optional).

Definition at line 200 of file sigma_base.h.

Member Data Documentation

◆ block_bytes_

double votca::xtp::Sigma_base::block_bytes_ = 4e9
private

Definition at line 233 of file sigma_base.h.

◆ chunk_bytes_

double votca::xtp::Sigma_base::chunk_bytes_ = 5e8
private

Definition at line 234 of file sigma_base.h.

◆ diag_eval_counter_

std::atomic<std::size_t> votca::xtp::Sigma_base::diag_eval_counter_ {0}
mutableprivate

Definition at line 235 of file sigma_base.h.

◆ keep_screening_data_

bool votca::xtp::Sigma_base::keep_screening_data_ = false
protected

Definition at line 213 of file sigma_base.h.

◆ Mmn_

TCMatrix_gwbse& votca::xtp::Sigma_base::Mmn_
protected

Definition at line 207 of file sigma_base.h.

◆ opt_

options votca::xtp::Sigma_base::opt_
protected

Definition at line 206 of file sigma_base.h.

◆ qptotal_

Index votca::xtp::Sigma_base::qptotal_ = 0
protected

Definition at line 211 of file sigma_base.h.

◆ rpa_

const RPA& votca::xtp::Sigma_base::rpa_
protected

Definition at line 208 of file sigma_base.h.

◆ rpatotal_

Index votca::xtp::Sigma_base::rpatotal_ = 0
protected

Definition at line 212 of file sigma_base.h.

◆ timings_

DFTTimings* votca::xtp::Sigma_base::timings_ = nullptr
protected

Definition at line 209 of file sigma_base.h.


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