votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::TCMatrix_gwbse Class Referencefinal

#include <threecenter.h>

Inheritance diagram for votca::xtp::TCMatrix_gwbse:
Collaboration diagram for votca::xtp::TCMatrix_gwbse:

Classes

struct  ResponsePoint
 A response the RPA adds to its own sum over these integrals, epsilon(w) = 1 + X[M](w) + F^T Y(w) F, given in the fill-time frame (F = AuxFrame()) at fixed frequencies: the static response of a part of the system that is not in M, e.g. the inactive region of a projection-based embedding (InactiveScreening). Survives Fill and Rebuild (same auxiliary basis, same metric). The RPA throws when it is asked for epsilon at a frequency that has no Y. More...

Public Member Functions

const Eigen::MatrixXd & operator[] (Index i) const
Eigen::MatrixXd & operator[] (Index i)
Index auxsize () const
Index get_mmin () const
Index get_mmax () const
Index get_nmin () const
Index get_nmax () const
Index msize () const
Index nsize () const
void Initialize (Index basissize, Index mmin, Index mmax, Index nmin, Index nmax)
void Fill (const AOBasis &auxbasis, const AOBasis &dftbasis, const Eigen::MatrixXd &dft_orbitals)
void Fill (const AOBasis &auxbasis, const AOBasis &dftbasis, const Eigen::MatrixXd &dft_orbitals, const Eigen::MatrixXd &inv_sqrt)
void Rebuild ()
void MultiplyRightWithAuxMatrix (const Eigen::MatrixXd &matrix)
void MultiplyRightWithAuxMatrixLeading (const Eigen::MatrixXd &U, Index full_slices, Index lead)
 Rotate the auxiliary index of only the part of the tensor a consumer reads: all rows of slices [0, full_slices) and the first lead rows of slices [full_slices, lead).
bool PartiallyRotated () const
 Whether only a leading part was rotated since the last Fill.
const Eigen::MatrixXd & InvSqrt () const
const Eigen::MatrixXd & AuxFrame () const
void RestoreAuxFrame (const Eigen::MatrixXd &frame)
Eigen::MatrixXd ToCurrentAuxFrame (const Eigen::MatrixXd &K) const
bool AuxFrameIsOrthogonal () const
void DressAuxIndex (const Eigen::MatrixXd &S)
 Dress the auxiliary index with S: M_fill -> M_fill S.
void UndressAuxIndex ()
bool Dressed () const
const Eigen::MatrixXd & Dressing () const
 S of the current dressing (empty if bare).
void setAdditionalResponse (std::vector< ResponsePoint > points)
bool HasAdditionalResponse () const
Eigen::MatrixXd AdditionalResponse (bool imaginary, double frequency) const
 F^T Y F at this frequency, in the frame operator[] is in now.
void setAdditionalPoles (Eigen::VectorXd energies, Eigen::MatrixXd vectors)
 A response given as poles, in the form of transitions: Y(i w) = sum_k 4 W_k/(W_k^2 + w^2) c_k c_k^T, with energies W_k and vectors c_k (columns, fill-time frame). The RPA treats each pole as one more transition with energy W_k and integrals c_k: in epsilon at any frequency, and in the two-particle Hamiltonian of Sigma_Exact, where the poles couple to the transitions of M through the Coulomb interaction. E.g. the inactive region of a projection-based embedding, fitted to its response at two frequencies (InactiveScreening::FitPoles).
Index AdditionalPoleCount () const
const Eigen::VectorXd & AdditionalPoleEnergies () const
Eigen::MatrixXd AdditionalPoleVectors () const
 The pole vectors in the frame operator[] is in now: F^T c_k.
void setExcludedHoles (Index k)
 The first k occupied slices (levels rpamin .. rpamin+k-1) are left out of the RPA response sums, but stay in the integrals, so the self-energy still sums over them in G. For a projection-based embedding whose inactive occupied orbitals were put in front of the active ones (InactiveScreening, complete G): the inactive region then screens only through its additional response or poles. Survives Fill. Their slices are not stored (only their rows in the other slices, which G needs): set it before Fill. Nothing may read those slices.
Index ExcludedHoles () const
void RotateOrbitals (const Eigen::MatrixXd &U, Index first, Index last)
 Change the orbital basis of levels [first, last] for QSGW: phi_i = sum_k U_ki psi_k, both orbital indices, all slices.
Public Member Functions inherited from votca::xtp::TCMatrix
 TCMatrix ()=default
virtual ~TCMatrix ()=default
 TCMatrix (const TCMatrix &)=default
 TCMatrix (TCMatrix &&)=default
TCMatrix & operator= (const TCMatrix &)=default
TCMatrix & operator= (TCMatrix &&)=default
Index Removedfunctions () const

Static Public Member Functions

static Eigen::MatrixXd CoreExchange (const AOBasis &auxbasis, const AOBasis &dftbasis, const Eigen::MatrixXd &mos, Index ncore, Index qpmin, Index qpmax)

Static Public Attributes

static constexpr double metric_tolerance = 5e-7

Private Member Functions

void MultiplyInFillFrame (const Eigen::MatrixXd &A)
void Fill3cMO (const AOBasis &auxbasis, const AOBasis &dftbasis, const Eigen::MatrixXd &dft_orbitals)

Private Attributes

std::vector< Eigen::MatrixXd > matrix_
Index mmin_
Index mmax_
Index nmin_
Index nmax_
Index ntotal_
Index mtotal_
Index auxbasissize_
Eigen::MatrixXd aux_frame_
bool aux_frame_known_ = true
bool partially_rotated_ = false
Eigen::MatrixXd dressing_
std::vector< ResponsePoint > additional_response_
Eigen::VectorXd pole_energies_
Index excluded_holes_ = 0
Eigen::MatrixXd pole_vectors_
const AOBasis * auxbasis_ = nullptr
const AOBasis * dftbasis_ = nullptr
const Eigen::MatrixXd * dft_orbitals_ = nullptr

Additional Inherited Members

Public Types inherited from votca::xtp::TCMatrix
enum class  SpinChannel { Alpha , Beta }
Protected Attributes inherited from votca::xtp::TCMatrix
Index removedfunctions_ = 0
Eigen::MatrixXd inv_sqrt_

Detailed Description

Definition at line 146 of file threecenter.h.

Member Function Documentation

◆ AdditionalPoleCount()

Index votca::xtp::TCMatrix_gwbse::AdditionalPoleCount ( ) const
inline

Definition at line 327 of file threecenter.h.

◆ AdditionalPoleEnergies()

const Eigen::VectorXd & votca::xtp::TCMatrix_gwbse::AdditionalPoleEnergies ( ) const
inline

Definition at line 328 of file threecenter.h.

◆ AdditionalPoleVectors()

Eigen::MatrixXd votca::xtp::TCMatrix_gwbse::AdditionalPoleVectors ( ) const

The pole vectors in the frame operator[] is in now: F^T c_k.

Definition at line 216 of file threecenter.cc.

◆ AdditionalResponse()

Eigen::MatrixXd votca::xtp::TCMatrix_gwbse::AdditionalResponse ( bool imaginary,
double frequency ) const

F^T Y F at this frequency, in the frame operator[] is in now.

Definition at line 192 of file threecenter.cc.

◆ AuxFrame()

const Eigen::MatrixXd & votca::xtp::TCMatrix_gwbse::AuxFrame ( ) const
inline

Definition at line 246 of file threecenter.h.

◆ AuxFrameIsOrthogonal()

bool votca::xtp::TCMatrix_gwbse::AuxFrameIsOrthogonal ( ) const

Definition at line 135 of file threecenter.cc.

◆ auxsize()

Index votca::xtp::TCMatrix_gwbse::auxsize ( ) const
inline

Definition at line 159 of file threecenter.h.

◆ CoreExchange()

Eigen::MatrixXd votca::xtp::TCMatrix_gwbse::CoreExchange ( const AOBasis & auxbasis,
const AOBasis & dftbasis,
const Eigen::MatrixXd & mos,
Index ncore,
Index qpmin,
Index qpmax )
static

Exchange with the occupied levels 0..ncore-1 for the levels qpmin..qpmax of these MOs, with the bare Coulomb interaction: X(m,n) = - sum_{c < ncore} (m c | c n), from (m c | P) integrals filled for this purpose only. For frozen-core GW (rpamin = ncore > 0), whose Mmn has no rows for the core levels.

Definition at line 35 of file threecenter.cc.

◆ DressAuxIndex()

void votca::xtp::TCMatrix_gwbse::DressAuxIndex ( const Eigen::MatrixXd & S)

Dress the auxiliary index with S: M_fill -> M_fill S.

For a static environment the QM electrons interact through u = v + v_reac, which is 1 + R in the metric of M, and the screened interaction is W = [u^-1 - chi0]^-1. With S = (1 + R)^(1/2), that is exactly the ordinary RPA and correlation self-energy built from M S in place of M: every place that pairs two M's through the bare interaction pairs them through u instead.

S is in the fill-time frame, and is applied in whatever frame the integrals are in now; AuxFrame() records it, so ToCurrentAuxFrame still maps fill-time kernels correctly. Exchange-type sums that must keep the bare v take ToCurrentAuxFrame(identity) as their kernel once the frame is no longer orthogonal (see AuxFrameIsOrthogonal).

Throws if already dressed. Fill and Rebuild undress.

Definition at line 169 of file threecenter.cc.

◆ Dressed()

bool votca::xtp::TCMatrix_gwbse::Dressed ( ) const
inline

Definition at line 288 of file threecenter.h.

◆ Dressing()

const Eigen::MatrixXd & votca::xtp::TCMatrix_gwbse::Dressing ( ) const
inline

S of the current dressing (empty if bare).

Definition at line 290 of file threecenter.h.

◆ ExcludedHoles()

Index votca::xtp::TCMatrix_gwbse::ExcludedHoles ( ) const
inline

Definition at line 345 of file threecenter.h.

◆ Fill() [1/2]

void votca::xtp::TCMatrix_gwbse::Fill ( const AOBasis & auxbasis,
const AOBasis & dftbasis,
const Eigen::MatrixXd & dft_orbitals )

Definition at line 268 of file threecenter.cc.

◆ Fill() [2/2]

void votca::xtp::TCMatrix_gwbse::Fill ( const AOBasis & auxbasis,
const AOBasis & dftbasis,
const Eigen::MatrixXd & dft_orbitals,
const Eigen::MatrixXd & inv_sqrt )

Fill with a metric V^-1/2 already computed for auxbasis (InvSqrt() of another Fill), for repeated fills of the same auxiliary basis.

Definition at line 293 of file threecenter.cc.

◆ Fill3cMO()

void votca::xtp::TCMatrix_gwbse::Fill3cMO ( const AOBasis & auxbasis,
const AOBasis & dftbasis,
const Eigen::MatrixXd & dft_orbitals )
private

Definition at line 866 of file libint2_calls.cc.

◆ get_mmax()

Index votca::xtp::TCMatrix_gwbse::get_mmax ( ) const
inline

Definition at line 163 of file threecenter.h.

◆ get_mmin()

Index votca::xtp::TCMatrix_gwbse::get_mmin ( ) const
inline

Definition at line 161 of file threecenter.h.

◆ get_nmax()

Index votca::xtp::TCMatrix_gwbse::get_nmax ( ) const
inline

Definition at line 167 of file threecenter.h.

◆ get_nmin()

Index votca::xtp::TCMatrix_gwbse::get_nmin ( ) const
inline

Definition at line 165 of file threecenter.h.

◆ HasAdditionalResponse()

bool votca::xtp::TCMatrix_gwbse::HasAdditionalResponse ( ) const
inline

Definition at line 309 of file threecenter.h.

◆ Initialize()

void votca::xtp::TCMatrix_gwbse::Initialize ( Index basissize,
Index mmin,
Index mmax,
Index nmin,
Index nmax )

Definition at line 60 of file threecenter.cc.

◆ InvSqrt()

const Eigen::MatrixXd & votca::xtp::TCMatrix_gwbse::InvSqrt ( ) const
inline

Definition at line 234 of file threecenter.h.

◆ msize()

Index votca::xtp::TCMatrix_gwbse::msize ( ) const
inline

Definition at line 169 of file threecenter.h.

◆ MultiplyInFillFrame()

void votca::xtp::TCMatrix_gwbse::MultiplyInFillFrame ( const Eigen::MatrixXd & A)
private

Definition at line 148 of file threecenter.cc.

◆ MultiplyRightWithAuxMatrix()

void votca::xtp::TCMatrix_gwbse::MultiplyRightWithAuxMatrix ( const Eigen::MatrixXd & matrix)

Definition at line 95 of file threecenter.cc.

◆ MultiplyRightWithAuxMatrixLeading()

void votca::xtp::TCMatrix_gwbse::MultiplyRightWithAuxMatrixLeading ( const Eigen::MatrixXd & U,
Index full_slices,
Index lead )

Rotate the auxiliary index of only the part of the tensor a consumer reads: all rows of slices [0, full_slices) and the first lead rows of slices [full_slices, lead).

The BSE reads slices and rows up to its highest conduction level (lead) and, for the dielectric matrix, all rows of the occupied slices (full_slices). Rotating only those is exact for that use and skips the rows above the BSE window. The rest of the tensor is left in the old frame and is stale afterwards: AuxFrame() describes the rotated part, and dressing, which needs the whole tensor in one frame, throws until the next Fill or Rebuild.

Definition at line 108 of file threecenter.cc.

◆ nsize()

Index votca::xtp::TCMatrix_gwbse::nsize ( ) const
inline

Definition at line 171 of file threecenter.h.

◆ operator[]() [1/2]

Eigen::MatrixXd & votca::xtp::TCMatrix_gwbse::operator[] ( Index i)
inline

Definition at line 157 of file threecenter.h.

◆ operator[]() [2/2]

const Eigen::MatrixXd & votca::xtp::TCMatrix_gwbse::operator[] ( Index i) const
inline

Definition at line 154 of file threecenter.h.

◆ PartiallyRotated()

bool votca::xtp::TCMatrix_gwbse::PartiallyRotated ( ) const
inline

Whether only a leading part was rotated since the last Fill.

Definition at line 215 of file threecenter.h.

◆ Rebuild()

void votca::xtp::TCMatrix_gwbse::Rebuild ( )
inline

Definition at line 195 of file threecenter.h.

◆ RestoreAuxFrame()

void votca::xtp::TCMatrix_gwbse::RestoreAuxFrame ( const Eigen::MatrixXd & frame)
inline

Definition at line 251 of file threecenter.h.

◆ RotateOrbitals()

void votca::xtp::TCMatrix_gwbse::RotateOrbitals ( const Eigen::MatrixXd & U,
Index first,
Index last )

Change the orbital basis of levels [first, last] for QSGW: phi_i = sum_k U_ki psi_k, both orbital indices, all slices.

rows n in the window of every slice: M[m].rows <- U^T M[m].rows slices in the window: M[i] <- sum_k U_ki M[k]

Levels outside the window keep their orbitals. Everything that reads the tensor (RPA, self-energy, exchange) then works in the new basis without knowing about U. The auxiliary index is not touched.

Parameters
URotation matrix (window x window), columns = new orbitals
firstFirst level of the window (absolute MO index)
lastLast level of the window (absolute MO index)

Definition at line 308 of file threecenter.cc.

◆ setAdditionalPoles()

void votca::xtp::TCMatrix_gwbse::setAdditionalPoles ( Eigen::VectorXd energies,
Eigen::MatrixXd vectors )
inline

A response given as poles, in the form of transitions: Y(i w) = sum_k 4 W_k/(W_k^2 + w^2) c_k c_k^T, with energies W_k and vectors c_k (columns, fill-time frame). The RPA treats each pole as one more transition with energy W_k and integrals c_k: in epsilon at any frequency, and in the two-particle Hamiltonian of Sigma_Exact, where the poles couple to the transitions of M through the Coulomb interaction. E.g. the inactive region of a projection-based embedding, fitted to its response at two frequencies (InactiveScreening::FitPoles).

Definition at line 323 of file threecenter.h.

◆ setAdditionalResponse()

void votca::xtp::TCMatrix_gwbse::setAdditionalResponse ( std::vector< ResponsePoint > points)
inline

Definition at line 306 of file threecenter.h.

◆ setExcludedHoles()

void votca::xtp::TCMatrix_gwbse::setExcludedHoles ( Index k)

The first k occupied slices (levels rpamin .. rpamin+k-1) are left out of the RPA response sums, but stay in the integrals, so the self-energy still sums over them in G. For a projection-based embedding whose inactive occupied orbitals were put in front of the active ones (InactiveScreening, complete G): the inactive region then screens only through its additional response or poles. Survives Fill. Their slices are not stored (only their rows in the other slices, which G needs): set it before Fill. Nothing may read those slices.

Definition at line 83 of file threecenter.cc.

◆ ToCurrentAuxFrame()

Eigen::MatrixXd votca::xtp::TCMatrix_gwbse::ToCurrentAuxFrame ( const Eigen::MatrixXd & K) const

Definition at line 228 of file threecenter.cc.

◆ UndressAuxIndex()

void votca::xtp::TCMatrix_gwbse::UndressAuxIndex ( )

Definition at line 184 of file threecenter.cc.

Member Data Documentation

◆ additional_response_

std::vector<ResponsePoint> votca::xtp::TCMatrix_gwbse::additional_response_
private

Definition at line 381 of file threecenter.h.

◆ aux_frame_

Eigen::MatrixXd votca::xtp::TCMatrix_gwbse::aux_frame_
private

Definition at line 377 of file threecenter.h.

◆ aux_frame_known_

bool votca::xtp::TCMatrix_gwbse::aux_frame_known_ = true
private

Definition at line 378 of file threecenter.h.

◆ auxbasis_

const AOBasis* votca::xtp::TCMatrix_gwbse::auxbasis_ = nullptr
private

Definition at line 389 of file threecenter.h.

◆ auxbasissize_

Index votca::xtp::TCMatrix_gwbse::auxbasissize_
private

Definition at line 375 of file threecenter.h.

◆ dft_orbitals_

const Eigen::MatrixXd* votca::xtp::TCMatrix_gwbse::dft_orbitals_ = nullptr
private

Definition at line 391 of file threecenter.h.

◆ dftbasis_

const AOBasis* votca::xtp::TCMatrix_gwbse::dftbasis_ = nullptr
private

Definition at line 390 of file threecenter.h.

◆ dressing_

Eigen::MatrixXd votca::xtp::TCMatrix_gwbse::dressing_
private

Definition at line 380 of file threecenter.h.

◆ excluded_holes_

Index votca::xtp::TCMatrix_gwbse::excluded_holes_ = 0
private

Definition at line 383 of file threecenter.h.

◆ matrix_

std::vector<Eigen::MatrixXd> votca::xtp::TCMatrix_gwbse::matrix_
private

Definition at line 366 of file threecenter.h.

◆ metric_tolerance

double votca::xtp::TCMatrix_gwbse::metric_tolerance = 5e-7
staticconstexpr

Definition at line 151 of file threecenter.h.

◆ mmax_

Index votca::xtp::TCMatrix_gwbse::mmax_
private

Definition at line 370 of file threecenter.h.

◆ mmin_

Index votca::xtp::TCMatrix_gwbse::mmin_
private

Definition at line 369 of file threecenter.h.

◆ mtotal_

Index votca::xtp::TCMatrix_gwbse::mtotal_
private

Definition at line 374 of file threecenter.h.

◆ nmax_

Index votca::xtp::TCMatrix_gwbse::nmax_
private

Definition at line 372 of file threecenter.h.

◆ nmin_

Index votca::xtp::TCMatrix_gwbse::nmin_
private

Definition at line 371 of file threecenter.h.

◆ ntotal_

Index votca::xtp::TCMatrix_gwbse::ntotal_
private

Definition at line 373 of file threecenter.h.

◆ partially_rotated_

bool votca::xtp::TCMatrix_gwbse::partially_rotated_ = false
private

Definition at line 379 of file threecenter.h.

◆ pole_energies_

Eigen::VectorXd votca::xtp::TCMatrix_gwbse::pole_energies_
private

Definition at line 382 of file threecenter.h.

◆ pole_vectors_

Eigen::MatrixXd votca::xtp::TCMatrix_gwbse::pole_vectors_
private

Definition at line 384 of file threecenter.h.


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