3#include "Coulomb/QkTable.hpp"
4#include "Coulomb/meTable.hpp"
5#include "LinAlg/Matrix.hpp"
6#include "MBPT/Sigma2.hpp"
12class DiracDiracSpinor;
14class CorrelationPotential;
109 std::map<DiracSpinor::Index, double>
en{};
114 [[nodiscard]]
bool empty()
const {
return dS1.
empty(); }
140 bool read_write(
const std::string &fname, IO::FRW::RoW rw);
159[[nodiscard]] Sigma1Correction
161 const std::vector<DiracSpinor> &s1_basis_core,
162 const std::vector<DiracSpinor> &s1_basis_excited,
187[[nodiscard]] Sigma1Correction
189 const MBPT::CorrelationPotential &Sigma);
228 std::ostream &outstream = std::cout);
264 std::vector<double>
hk{};
344 const std::vector<double> &hk = {},
386 const Sigma1Correction *s1c =
nullptr);
403 const std::vector<double> &hk = {},
444 const std::vector<DiracSpinor> &s1_basis_core,
445 const std::vector<DiracSpinor> &s1_basis_excited,
464 const MBPT::CorrelationPotential &Sigma,
465 bool include_Sigma1);
485 const std::vector<DiracSpinor> &ci_basis,
int max_k,
486 bool no_new_integralsQ =
false);
502[[nodiscard]] std::vector<DiracSpinor>
504 const std::string &include_str,
505 const std::string &exclude_str =
"");
529 const std::vector<CI::CSF2> &CSFAs,
int twoJA,
531 const std::vector<CI::CSF2> &CSFBs,
int twoJB,
550 int K_rank,
int Parity) {
552 Bs.
twoJ(), h, K_rank, Parity);
578std::pair<std::string, double>
580 const std::vector<CSF2> &csfs);
595std::pair<int, int>
Term_S_L(
int l1,
int l2,
int twoJ,
double gJ_target);
614std::string
Term_Symbol(
int two_J,
int L,
int two_S,
int parity);
616std::string
Term_Symbol(
int L,
int two_S,
int parity);
644 const Sigma1Correction *s1c =
nullptr,
645 const std::vector<double> &hk = {},
Two-electron configuration state function (CSF).
Definition CSF.hpp:31
Container for CI solutions in a single (J, parity) block.
Definition CSF.hpp:248
LinAlg::View< const double > coefs(std::size_t i) const
CI expansion coefficients for the ith solution (one per CSF)
Definition CSF.cpp:334
const std::vector< CSF2 > & CSFs() const
Full list of CSFs spanning this (J, parity) block.
Definition CSF.cpp:322
int twoJ() const
Twice the total angular momentum 2J for this block.
Definition CSF.cpp:349
Base class template to store Coulomb integrals, and similar. 3 specific cases (by template instantiat...
Definition QkTable.hpp:118
uint16_t Index
Integer type for the compressed (n,kappa) index.
Definition DiracSpinor.hpp:51
Breit potentials for one- (Hartree-Fock Breit) and two-body Breit integrals.
Definition Breit.hpp:88
Row-major dense matrix with arithmetic and linear algebra support.
Definition Matrix.hpp:208
Non-owning strided view onto a 1D segment of an array.
Definition Matrix.hpp:69
Functions and classes for Configuration Interaction calculations.
Definition CI_Integrals.cpp:22
double CSF2_Breit(const Coulomb::WkTable &Bk, DiracSpinor::Index v, DiracSpinor::Index w, DiracSpinor::Index x, DiracSpinor::Index y, int twoJ)
Antisymmetrised two-body Breit matrix element in the coupled CSF basis.
Definition CI_Integrals.cpp:167
std::vector< DiracSpinor > basis_subset(const std::vector< DiracSpinor > &basis, const std::string &subset_string, const std::string &frozen_core_string)
Returns the subset of basis matching include_str, excluding states in exclude_str.
Definition CI_Integrals.cpp:685
Coulomb::meTable< double > calculate_h1_table(const std::vector< DiracSpinor > &ci_basis, const std::vector< DiracSpinor > &s1_basis_core, const std::vector< DiracSpinor > &s1_basis_excited, const Coulomb::QkTable &qk, bool include_Sigma1)
Builds the one-body Hamiltonian matrix element table for the CI basis.
Definition CI_Integrals.cpp:559
double corrected_Sigma(double Sigma, double dSigma, double dE)
Resummed derivative (dSigma/dE) correction to a Sigma_1 matrix element (Kozlov formula).
Definition CI_Integrals.cpp:233
double Breit_AB(const CI::CSF2 &A, const CI::CSF2 &B, int twoJ, const Coulomb::WkTable &Bk)
Breit correction to Hab().
Definition CI_Integrals.cpp:225
double RME_CSF2(const CI::CSF2 &X, int twoJX, const CI::CSF2 &V, int twoJV, const Coulomb::meTable< double > &h, int K_rank)
Reduced matrix element between two two-electron CSFs.
Definition CI_Integrals.cpp:764
std::string Term_Symbol(int two_J, int L, int two_S, int parity)
Returns spectroscopic term symbol string, e.g. "3P_1".
Definition CI_Integrals.cpp:898
double Hab(const CI::CSF2 &X, const CI::CSF2 &V, int twoJ, const Coulomb::meTable< double > &h1, const Coulomb::QkTable &qk, const Sigma1Correction *s1c)
CI Hamiltonian matrix element between two two-electron CSFs.
Definition CI_Integrals.cpp:521
std::pair< std::string, double > leading_config(const LinAlg::View< const double > &coefs, const std::vector< CSF2 > &csfs)
Leading non-relativistic configuration of a CI state.
Definition CI_Integrals.cpp:813
std::pair< int, int > Term_S_L_from_expectation(double L2, double S2, int twoJ)
Determines the (S, L) term for a two-electron state from the expectation values of L^2 and S^2.
Definition CI_Integrals.cpp:873
std::pair< int, int > Term_S_L(int l1, int l2, int twoJ, double gJ_target)
Determines the best-fit (S, L) term for a two-electron state by matching the g-factor.
Definition CI_Integrals.cpp:832
double ReducedME(const LinAlg::View< const double > &cA, const std::vector< CI::CSF2 > &CSFAs, int twoJA, const LinAlg::View< const double > &cB, const std::vector< CI::CSF2 > &CSFBs, int twoJB, const Coulomb::meTable< double > &h, int K_rank, int Parity)
Reduced matrix element between two CI states (low-level overload).
Definition CI_Integrals.cpp:725
std::vector< PsiJPi > levels
One entry per {J, parity} requested.
Definition CI_Integrals.hpp:293
double corrected_Sk(double Sk, double dSk, double dE0)
Resummed shift of a integral to a new reference energy E0 (Brillouin-Wigner denominators).
Definition CI_Integrals.cpp:249
double Sigma2_AB(const CI::CSF2 &A, const CI::CSF2 &B, int twoJ, const Coulomb::LkTable &Sk, const Coulomb::QkTable *qk, const std::vector< double > &hk, const Coulomb::LkTable *dSk, double dE0)
Two-body correction to Hab().
Definition CI_Integrals.cpp:215
double CSF2_Sigma2(const Coulomb::LkTable &Sk, DiracSpinor::Index v, DiracSpinor::Index w, DiracSpinor::Index x, DiracSpinor::Index y, int twoJ, const Coulomb::QkTable *qk, const std::vector< double > &hk, const Coulomb::LkTable *dSk, double dE0)
Two-body (MBPT) correction to CSF2_Coulomb().
Definition CI_Integrals.cpp:86
Coulomb::WkTable calculate_Bk(const std::string &bk_filename, const HF::Breit *const pBr, const std::vector< DiracSpinor > &ci_basis, int max_k, bool no_new_integrals)
Builds or loads the two-body Breit integral table.
Definition CI_Integrals.cpp:641
Sigma1Correction calculate_dSdE_correction(const std::vector< DiracSpinor > &ci_basis, const std::vector< DiracSpinor > &s1_basis_core, const std::vector< DiracSpinor > &s1_basis_excited, const Coulomb::QkTable &qk)
Builds the Sigma_1 derivative-correction tables; see Sigma1Correction.
Definition CI_Integrals.cpp:332
LinAlg::Matrix< double > construct_Hci(const PsiJPi &psi, const Coulomb::meTable< double > &h1, const Coulomb::QkTable &qk, const Coulomb::WkTable *Bk, const Coulomb::LkTable *Sk, const Sigma1Correction *s1c, const std::vector< double > &hk, const Coulomb::LkTable *dSk, double dE0)
Constructs the full CI Hamiltonian matrix in the CSF basis.
Definition CI_Integrals.cpp:913
Integrals integrals
Integral tables used to construct the CI Hamiltonians.
Definition CI_Integrals.hpp:295
double CSF2_Coulomb(const Coulomb::QkTable &qk, DiracSpinor::Index v, DiracSpinor::Index w, DiracSpinor::Index x, DiracSpinor::Index y, int twoJ)
Antisymmetrised two-body Coulomb matrix element in the coupled CSF basis.
Definition CI_Integrals.cpp:27
LinAlg::Matrix< double > iterate_E0(PsiJPi *psi, const Sigma1Correction &s1c, const Coulomb::meTable< double > &h1, const Coulomb::QkTable &qk, const Coulomb::WkTable *Bk, const Coulomb::LkTable *Sk, const std::vector< double > &hk, const Coulomb::LkTable *dSk, double E0_sigma2, std::ostream &outstream)
Finds the reference energy E0 for the dSigma/dE correction, for a single (J, parity); returns the CI ...
Definition CI_Integrals.cpp:434
The result of a CI calculation: the solutions, and the integrals used to construct the CI Hamiltonian...
Definition CI_Integrals.hpp:291
Functions and classes for Hartree-Fock.
Definition CI_Integrals.hpp:16
Many-body perturbation theory.
Definition MatrixElements.hpp:12
The integral tables required to construct the CI Hamiltonian matrix.
Definition CI_Integrals.hpp:250
Coulomb::LkTable Sk
Two-body Sigma_2 integrals, S^k; empty if not included.
Definition CI_Integrals.hpp:260
Sigma1Correction s1_corr
Derivative (dSigma/dE) correction for Sigma_1; empty if not included.
Definition CI_Integrals.hpp:272
std::vector< DiracSpinor > ci_basis
Single-particle basis used for the CI expansion.
Definition CI_Integrals.hpp:252
std::vector< double > hk
Average S^k/Q^k ratios, indexed by k; empty if Sigma_2 is not being extrapolated beyond the cis2 basi...
Definition CI_Integrals.hpp:264
bool availableQ() const
False if the tables were never calculated (e.g., CI was run 'read_only')
Definition CI_Integrals.hpp:275
Coulomb::QkTable qk
Two-body Coulomb integrals, Q^k.
Definition CI_Integrals.hpp:256
Coulomb::LkTable dSk
Energy derivatives dS^k/dE0 of the Sigma_2 integrals; empty unless the Brillouin-Wigner (E0-dependent...
Definition CI_Integrals.hpp:268
double E0_sigma2
Reference E0 that Sk and dSk were tabulated at (Brillouin-Wigner)
Definition CI_Integrals.hpp:270
Coulomb::meTable< double > h1
One-body matrix elements, <a|h1|b>; may include Sigma_1.
Definition CI_Integrals.hpp:254
Coulomb::WkTable Bk
Two-body Breit integrals, B^k; empty if not included.
Definition CI_Integrals.hpp:258
Derivative (dSigma/dE) correction data for the one-body Sigma_1 matrix elements.
Definition CI_Integrals.hpp:101
Coulomb::meTable< double > S1
One-body Sigma_1 matrix elements (uncorrected), <a|Sigma_1|b>
Definition CI_Integrals.hpp:103
double delta_h1(DiracSpinor::Index a, DiracSpinor::Index b, DiracSpinor::Index spectator) const
Correction to the one-body matrix element <a|h1|b>, given the spectator orbital.
Definition CI_Integrals.cpp:266
double E0
Reference total two-electron valence energy. 0.0 means "not set": it belongs to a single (J,...
Definition CI_Integrals.hpp:112
Coulomb::meTable< double > dS1
Energy derivative matrix elements, <a|dSigma_1/dE|b>
Definition CI_Integrals.hpp:105
bool read_write(const std::string &fname, IO::FRW::RoW rw)
Reads or writes the correction tables to/from a binary file.
Definition CI_Integrals.cpp:283
std::map< int, double > e_sigma
Energy Sigma_1 was evaluated at, for each kappa.
Definition CI_Integrals.hpp:107
std::map< DiracSpinor::Index, double > en
Single-particle orbital energies, keyed by nk_index.
Definition CI_Integrals.hpp:109