|
votca 2026-dev
|
Unrestricted RPA helper for spin-resolved GW screening. More...
#include <rpa_uks.h>

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 | setOutOfWindowShift (const OutOfWindowShift &shift) |
| Configure orbital window and spin-resolved HOMO indices. | |
| void | configure (Index homo_alpha, Index homo_beta, Index rpamin, Index rpamax) |
| double | getEta () const |
| Small positive broadening used in the real-frequency response. | |
| void | setTimings (DFTTimings *timings) |
| Times the dielectric-matrix builds in these timings (optional). | |
| 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_eigensolution & | Diagonalize_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 Types | |
| using | SpinWeightsFn = std::function<void(bool, Index, Eigen::VectorXd&)> |
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. | |
| SymmetricEigenSystem | 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. | |
| Eigen::MatrixXd | ResponseSum (const SpinWeightsFn &weights) const |
| void | BuildCachedScreeningModes () const |
Private Attributes | |
| OutOfWindowShift | out_of_window_ |
| Index | homo_alpha_ |
| Index | homo_beta_ |
| Index | rpamin_ |
| Index | rpamax_ |
| const double | eta_ = 0.0001 |
| Eigen::VectorXd | energies_alpha_ |
| Eigen::VectorXd | energies_beta_ |
| Logger & | log_ |
| const TCMatrix_gwbse_spin & | Mmn_ |
| DFTTimings * | timings_ = nullptr |
| bool | h2p_cached_ = false |
| rpa_eigensolution | h2p_solution_cache_ |
| bool | screening_cached_ = false |
| Eigen::VectorXd | screening_omegas_ |
| std::vector< Eigen::VectorXd > | screening_modes_ |
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:
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.
|
private |
|
inline |
|
private |
Definition at line 90 of file rpa_uks.cc.
|
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 207 of file rpa_uks.cc.
|
inline |
|
inline |
| 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 243 of file rpa_uks.cc.
|
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 324 of file rpa_uks.cc.
|
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 363 of file rpa_uks.cc.
| 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 268 of file rpa_uks.cc.
|
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 459 of file rpa_uks.cc.
| void votca::xtp::RPA_UKS::GetCachedScreeningModes | ( | const Eigen::VectorXd *& | omegas, |
| const std::vector< Eigen::VectorXd > *& | modes ) const |
Definition at line 80 of file rpa_uks.cc.
|
inline |
|
inline |
|
inline |
|
private |
Definition at line 71 of file rpa_uks.cc.
|
private |
Definition at line 167 of file rpa_uks.cc.
|
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. How levels outside the GW window are shifted by UpdateRPAInputEnergies.
|
inline |
|
inline |
|
private |
Shift uncorrected states outside the GW window.
Occupied states below qpmin and virtual states above qpmax are shifted as set by setOutOfWindowShift (OutOfWindowShift), independently for each spin channel.
Definition at line 161 of file rpa_uks.cc.
| 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.
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
private |