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

Unrestricted RPA helper for spin-resolved GW screening. More...

#include <rpa_uks.h>

Collaboration diagram for votca::xtp::RPA_UKS:

Classes

struct  rpa_eigensolution
 Solution of the two-particle Hamiltonian in the unrestricted basis. More...

Public Member Functions

 RPA_UKS (Logger &log, const TCMatrix_gwbse_spin &Mmn)
void configure (Index homo_alpha, Index homo_beta, Index rpamin, Index rpamax)
 Configure orbital window and spin-resolved HOMO indices.
double getEta () const
 Small positive broadening used in the real-frequency response.
Eigen::MatrixXd calculate_epsilon_i (double frequency) const
 Dielectric matrix on the imaginary frequency axis.
Eigen::MatrixXd calculate_epsilon_r (double frequency) const
 Dielectric matrix on the real frequency axis.
Eigen::MatrixXd calculate_epsilon_r (std::complex< double > frequency) const
 Real part of the dielectric matrix at complex frequency.
const Eigen::VectorXd & getRPAInputEnergiesAlpha () const
 Access the current alpha RPA input energies used in the response.
const Eigen::VectorXd & getRPAInputEnergiesBeta () const
 Access the current beta RPA input energies used in the response.
void setRPAInputEnergies (const Eigen::VectorXd &rpaenergies_alpha, const Eigen::VectorXd &rpaenergies_beta)
 Set alpha and beta RPA input energies directly.
void UpdateRPAInputEnergies (const Eigen::VectorXd &dftenergies_alpha, const Eigen::VectorXd &dftenergies_beta, const Eigen::VectorXd &gwaenergies_alpha, const Eigen::VectorXd &gwaenergies_beta, Index qpmin)
 Update alpha and beta RPA input energies from DFT and GW energies.
const rpa_eigensolutionDiagonalize_H2p () const
 Diagonalize the unrestricted two-particle Hamiltonian.
Index getHomoAlpha () const
Index getHomoBeta () const
void GetCachedScreeningModes (const Eigen::VectorXd *&omegas, const std::vector< Eigen::VectorXd > *&modes) const

Private Member Functions

template<bool imag>
Eigen::MatrixXd calculate_epsilon (double frequency) const
 Internal implementation of epsilon(w).
void InvalidateH2pCache ()
Eigen::VectorXd Calculate_H2p_AmB () const
 Construct the diagonal AmB block of the two-particle Hamiltonian.
Eigen::MatrixXd Calculate_H2p_ApB () const
 Construct the ApB block of the unrestricted two-particle Hamiltonian.
Eigen::SelfAdjointEigenSolver< Eigen::MatrixXd > Diagonalize_H2p_C (const Eigen::MatrixXd &C) const
 Diagonalize the symmetrized two-particle matrix C.
void ShiftUncorrectedEnergies (Eigen::VectorXd &energies, const Eigen::VectorXd &dftenergies, Index homo, Index qpmin, Index gwsize)
 Shift uncorrected states outside the GW window.
double getMaxCorrection (const Eigen::VectorXd &energies, const Eigen::VectorXd &dftenergies, Index min, Index max) const
 Return the largest absolute GW correction in a given index range.
void BuildCachedScreeningModes () const

Private Attributes

Index homo_alpha_
Index homo_beta_
Index rpamin_
Index rpamax_
const double eta_ = 0.0001
Eigen::VectorXd energies_alpha_
Eigen::VectorXd energies_beta_
Loggerlog_
const TCMatrix_gwbse_spinMmn_
bool h2p_cached_ = false
rpa_eigensolution h2p_solution_cache_
bool screening_cached_ = false
Eigen::VectorXd screening_omegas_
std::vector< Eigen::VectorXd > screening_modes_

Detailed Description

Unrestricted RPA helper for spin-resolved GW screening.

This class is the unrestricted/open-shell analogue of the existing restricted RPA class. It constructs the independent-particle polarizability and related dielectric quantities from explicit alpha and beta particle-hole channels.

Conceptually, for a collinear unrestricted reference,

chi0(w) = chi0_alpha(w) + chi0_beta(w)

where each spin contribution contains only same-spin particle-hole excitations:

i_alpha -> a_alpha i_beta -> a_beta

The Coulomb interaction is spin-independent, so the resulting dielectric matrix is built from the sum of both spin channels. This is exactly what is needed later for unrestricted GW, where Sigma^alpha and Sigma^beta share the same screened interaction W but differ in exchange and in the external spin-resolved states on which Sigma acts.

Compared to the restricted closed-shell implementation:

  • we do not assume one doubly occupied spatial-orbital ladder,
  • we do not insert a blanket closed-shell spin-degeneracy factor,
  • instead, alpha and beta channels are treated explicitly and summed.

The class also provides a two-particle Hamiltonian construction (Diagonalize_H2p), mainly mirroring the restricted implementation. For the initial unrestricted GW work, the dielectric functions are the more critical part; the H2p diagonalization is included for completeness and future use.

Definition at line 68 of file rpa_uks.h.

Constructor & Destructor Documentation

◆ RPA_UKS()

votca::xtp::RPA_UKS::RPA_UKS ( Logger & log,
const TCMatrix_gwbse_spin & Mmn )
inline
Parameters
logLogger used for diagnostic output
MmnSpin-resolved three-center integrals in the MO basis

Mmn_.alpha and Mmn_.beta contain the RI three-center objects transformed with alpha and beta MOs, respectively.

Definition at line 77 of file rpa_uks.h.

Member Function Documentation

◆ BuildCachedScreeningModes()

void votca::xtp::RPA_UKS::BuildCachedScreeningModes ( ) const
private

Definition at line 92 of file rpa_uks.cc.

◆ calculate_epsilon()

template<bool imag>
template Eigen::MatrixXd votca::xtp::RPA_UKS::calculate_epsilon< false > ( double frequency) const
private

Internal implementation of epsilon(w).

imag=true -> imaginary frequency branch imag=false -> real frequency branch

The result is accumulated as a sum of alpha and beta independent-particle contributions in the auxiliary basis.

Definition at line 204 of file rpa_uks.cc.

◆ calculate_epsilon_i()

Eigen::MatrixXd votca::xtp::RPA_UKS::calculate_epsilon_i ( double frequency) const
inline

Dielectric matrix on the imaginary frequency axis.

This evaluates the analogue of the restricted epsilon(iw), but with explicit alpha and beta particle-hole sums.

Definition at line 111 of file rpa_uks.h.

◆ calculate_epsilon_r() [1/2]

Eigen::MatrixXd votca::xtp::RPA_UKS::calculate_epsilon_r ( double frequency) const
inline

Dielectric matrix on the real frequency axis.

The implementation uses the same algebraic structure as the restricted version, but accumulates alpha and beta channel contributions explicitly.

Definition at line 121 of file rpa_uks.h.

◆ calculate_epsilon_r() [2/2]

Eigen::MatrixXd votca::xtp::RPA_UKS::calculate_epsilon_r ( std::complex< double > frequency) const

Real part of the dielectric matrix at complex frequency.

This is used in the same contexts as in the restricted code path, but with unrestricted spin resolution.

Definition at line 306 of file rpa_uks.cc.

◆ Calculate_H2p_AmB()

Eigen::VectorXd votca::xtp::RPA_UKS::Calculate_H2p_AmB ( ) const
private

Construct the diagonal AmB block of the two-particle Hamiltonian.

For each particle-hole excitation v -> c, this contributes the bare excitation energy

Delta_e = e_c - e_v

evaluated separately for alpha and beta channels and then concatenated into one vector.

Definition at line 425 of file rpa_uks.cc.

◆ Calculate_H2p_ApB()

Eigen::MatrixXd votca::xtp::RPA_UKS::Calculate_H2p_ApB ( ) const
private

Construct the ApB block of the unrestricted two-particle Hamiltonian.

This contains Coulomb coupling between particle-hole excitations. In the unrestricted case, all four spin blocks are present:

alpha-alpha, alpha-beta, beta-alpha, beta-beta

because the Coulomb interaction couples total density fluctuations and is spin independent.

Definition at line 464 of file rpa_uks.cc.

◆ configure()

void votca::xtp::RPA_UKS::configure ( Index homo_alpha,
Index homo_beta,
Index rpamin,
Index rpamax )
inline

Configure orbital window and spin-resolved HOMO indices.

The same global orbital window [rpamin_, rpamax_] is used for both spin channels, but the occupied/virtual split is spin dependent:

alpha: occupied <= homo_alpha_, virtual >= homo_alpha_ + 1 beta : occupied <= homo_beta_, virtual >= homo_beta_ + 1

This keeps the interface close to the restricted implementation while still allowing different alpha and beta occupations.

Definition at line 91 of file rpa_uks.h.

◆ Diagonalize_H2p()

const RPA_UKS::rpa_eigensolution & votca::xtp::RPA_UKS::Diagonalize_H2p ( ) const

Diagonalize the unrestricted two-particle Hamiltonian.

This constructs the unrestricted analogue of the restricted H2p problem. The diagonal AmB part contains bare particle-hole energy differences, while ApB adds Coulomb coupling between particle-hole excitations from both spin channels.

Definition at line 369 of file rpa_uks.cc.

◆ Diagonalize_H2p_C()

Eigen::SelfAdjointEigenSolver< Eigen::MatrixXd > votca::xtp::RPA_UKS::Diagonalize_H2p_C ( const Eigen::MatrixXd & C) const
private

Diagonalize the symmetrized two-particle matrix C.

This helper mirrors the restricted implementation and performs the final Hermitian diagonalization after symmetrization with sqrt(AmB).

Definition at line 560 of file rpa_uks.cc.

◆ GetCachedScreeningModes()

void votca::xtp::RPA_UKS::GetCachedScreeningModes ( const Eigen::VectorXd *& omegas,
const std::vector< Eigen::VectorXd > *& modes ) const

Definition at line 82 of file rpa_uks.cc.

◆ getEta()

double votca::xtp::RPA_UKS::getEta ( ) const
inline

Small positive broadening used in the real-frequency response.

Definition at line 103 of file rpa_uks.h.

◆ getHomoAlpha()

Index votca::xtp::RPA_UKS::getHomoAlpha ( ) const
inline

Definition at line 258 of file rpa_uks.h.

◆ getHomoBeta()

Index votca::xtp::RPA_UKS::getHomoBeta ( ) const
inline

Definition at line 259 of file rpa_uks.h.

◆ getMaxCorrection()

double votca::xtp::RPA_UKS::getMaxCorrection ( const Eigen::VectorXd & energies,
const Eigen::VectorXd & dftenergies,
Index min,
Index max ) const
private

Return the largest absolute GW correction in a given index range.

Definition at line 186 of file rpa_uks.cc.

◆ getRPAInputEnergiesAlpha()

const Eigen::VectorXd & votca::xtp::RPA_UKS::getRPAInputEnergiesAlpha ( ) const
inline

Access the current alpha RPA input energies used in the response.

These are typically DFT orbital energies corrected by available GW energies in the qp window, with outer states shifted by a constant maximal correction, matching the philosophy of the restricted implementation.

Definition at line 140 of file rpa_uks.h.

◆ getRPAInputEnergiesBeta()

const Eigen::VectorXd & votca::xtp::RPA_UKS::getRPAInputEnergiesBeta ( ) const
inline

Access the current beta RPA input energies used in the response.

Definition at line 147 of file rpa_uks.h.

◆ InvalidateH2pCache()

void votca::xtp::RPA_UKS::InvalidateH2pCache ( )
private

Definition at line 73 of file rpa_uks.cc.

◆ setRPAInputEnergies()

void votca::xtp::RPA_UKS::setRPAInputEnergies ( const Eigen::VectorXd & rpaenergies_alpha,
const Eigen::VectorXd & rpaenergies_beta )
inline

Set alpha and beta RPA input energies directly.

This is the unrestricted counterpart of setting one restricted RPA energy ladder. The vectors are assumed to span the configured range [rpamin_, rpamax_].

Definition at line 158 of file rpa_uks.h.

◆ ShiftUncorrectedEnergies()

void votca::xtp::RPA_UKS::ShiftUncorrectedEnergies ( Eigen::VectorXd & energies,
const Eigen::VectorXd & dftenergies,
Index homo,
Index qpmin,
Index gwsize )
private

Shift uncorrected states outside the GW window.

Occupied states below qpmin are shifted by the largest occupied correction found within the GW window, and virtual states above qpmax are shifted by the largest virtual correction. This is done independently for each spin channel.

Definition at line 163 of file rpa_uks.cc.

◆ UpdateRPAInputEnergies()

void votca::xtp::RPA_UKS::UpdateRPAInputEnergies ( const Eigen::VectorXd & dftenergies_alpha,
const Eigen::VectorXd & dftenergies_beta,
const Eigen::VectorXd & gwaenergies_alpha,
const Eigen::VectorXd & gwaenergies_beta,
Index qpmin )

Update alpha and beta RPA input energies from DFT and GW energies.

Inside the qp window, available GW quasiparticle energies replace the DFT ones. Outside that window, states are shifted by a constant correction equal to the largest correction seen in the occupied or virtual GW region, respectively. This mirrors the existing restricted strategy.

Definition at line 41 of file rpa_uks.cc.

Member Data Documentation

◆ energies_alpha_

Eigen::VectorXd votca::xtp::RPA_UKS::energies_alpha_
private

Definition at line 347 of file rpa_uks.h.

◆ energies_beta_

Eigen::VectorXd votca::xtp::RPA_UKS::energies_beta_
private

Definition at line 348 of file rpa_uks.h.

◆ eta_

const double votca::xtp::RPA_UKS::eta_ = 0.0001
private

Definition at line 344 of file rpa_uks.h.

◆ h2p_cached_

bool votca::xtp::RPA_UKS::h2p_cached_ = false
mutableprivate

Definition at line 356 of file rpa_uks.h.

◆ h2p_solution_cache_

rpa_eigensolution votca::xtp::RPA_UKS::h2p_solution_cache_
mutableprivate

Definition at line 357 of file rpa_uks.h.

◆ homo_alpha_

Index votca::xtp::RPA_UKS::homo_alpha_
private

Definition at line 336 of file rpa_uks.h.

◆ homo_beta_

Index votca::xtp::RPA_UKS::homo_beta_
private

Definition at line 337 of file rpa_uks.h.

◆ log_

Logger& votca::xtp::RPA_UKS::log_
private

Definition at line 350 of file rpa_uks.h.

◆ Mmn_

const TCMatrix_gwbse_spin& votca::xtp::RPA_UKS::Mmn_
private

Definition at line 354 of file rpa_uks.h.

◆ rpamax_

Index votca::xtp::RPA_UKS::rpamax_
private

Definition at line 341 of file rpa_uks.h.

◆ rpamin_

Index votca::xtp::RPA_UKS::rpamin_
private

Definition at line 340 of file rpa_uks.h.

◆ screening_cached_

bool votca::xtp::RPA_UKS::screening_cached_ = false
mutableprivate

Definition at line 360 of file rpa_uks.h.

◆ screening_modes_

std::vector<Eigen::VectorXd> votca::xtp::RPA_UKS::screening_modes_
mutableprivate

Definition at line 362 of file rpa_uks.h.

◆ screening_omegas_

Eigen::VectorXd votca::xtp::RPA_UKS::screening_omegas_
mutableprivate

Definition at line 361 of file rpa_uks.h.


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