ampsci
c++ program for high-precision atomic structure calculations of single-valence systems
StructureRad.hpp
1 #pragma once
2 #include "Coulomb/Coulomb.hpp"
3 #include "Coulomb/meTable.hpp"
4 #include "IO/FRW_fileReadWrite.hpp"
5 #include "Wavefunction/DiracSpinor.hpp"
6 #include <memory>
7 #include <vector>
8 class Wavefunction;
9 class DiracSpinor;
10 namespace DiracOperator {
11 class TensorOperator;
12 }
13 namespace ExternalField {
14 class CorePolarisation;
15 }
16 
18 namespace MBPT {
19 
52 class StructureRad {
53 
54 public:
65  StructureRad(const std::vector<DiracSpinor> &basis, double en_core,
66  std::pair<int, int> nminmax = {0, 999},
67  const std::string &Qk_fname = "",
68  const std::vector<double> &fk = {},
69  const std::vector<double> &etak = {});
70 
71 private:
72  bool m_use_Qk;
73  std::vector<double> m_root_fk; // sqrt - add to both sides!
74  std::vector<double> m_etak;
75  Coulomb::YkTable mY{};
76  std::optional<Coulomb::QkTable> mQ{std::nullopt}; //?
77  // nb: it seems conter-intuative, but this copy makes it FASTER!
78  std::vector<DiracSpinor> mCore{}, mExcited{};
79 
80 public:
81  const std::vector<DiracSpinor> &core() const { return mCore; }
82  const std::vector<DiracSpinor> &excited() const { return mExcited; }
83 
84  const Coulomb::YkTable &Yk() const { return mY; }
85  const std::optional<Coulomb::QkTable> &Qk() const { return mQ; }
86 
89  std::pair<double, double>
90  srTB(const DiracOperator::TensorOperator *const h, const DiracSpinor &w,
91  const DiracSpinor &v, double omega = 0.0,
92  const ExternalField::CorePolarisation *const dV = nullptr) const;
93 
96  std::pair<double, double>
97  srC(const DiracOperator::TensorOperator *const h, const DiracSpinor &w,
98  const DiracSpinor &v,
99  const ExternalField::CorePolarisation *const dV = nullptr) const;
100 
103  std::pair<double, double>
104  norm(const DiracOperator::TensorOperator *const h, const DiracSpinor &w,
105  const DiracSpinor &v,
106  const ExternalField::CorePolarisation *const dV = nullptr) const;
107 
110  std::pair<double, double>
112  const DiracSpinor &v, double omega = 0.0,
113  const ExternalField::CorePolarisation *const dV = nullptr) const {
114  const auto [tb, dvtb] = srTB(h, w, v, omega, dV);
115  const auto [c, dvc] = srC(h, w, v, dV);
116  const auto [n, dvn] = norm(h, w, v, dV);
117  return {tb + c + n, dvtb + dvc + dvn};
118  }
119 
121  double f_root_scr(int k) const {
122  const auto sk = std::size_t(k);
123  return sk < m_root_fk.size() ? m_root_fk[sk] : 1.0;
124  }
125 
127  double eta_hp(int k) const {
128  const auto sk = std::size_t(k);
129  return sk < m_etak.size() ? m_etak[sk] : 1.0;
130  }
131 
135  std::pair<double, double>
136  BO(const DiracOperator::TensorOperator *const h, const DiracSpinor &w,
137  const DiracSpinor &v,
138  const ExternalField::CorePolarisation *const dV = nullptr, double fw = 1.0,
139  double fv = 1.0) const;
140 
144  const std::vector<DiracSpinor> &as,
145  const std::vector<DiracSpinor> &tbs = {}, double omega = 0.0,
146  const ExternalField::CorePolarisation *const dV = nullptr) const;
147 
148 private:
149  // "Top" diagrams
150  double t1234(int k, const DiracSpinor &w, const DiracSpinor &r,
151  const DiracSpinor &v, const DiracSpinor &c) const;
152  double t1(int k, const DiracSpinor &w, const DiracSpinor &r,
153  const DiracSpinor &v, const DiracSpinor &c) const;
154  double t2(int k, const DiracSpinor &w, const DiracSpinor &r,
155  const DiracSpinor &v, const DiracSpinor &c) const;
156  double t3(int k, const DiracSpinor &w, const DiracSpinor &r,
157  const DiracSpinor &v, const DiracSpinor &c) const;
158  double t4(int k, const DiracSpinor &w, const DiracSpinor &r,
159  const DiracSpinor &v, const DiracSpinor &c) const;
160 
161  // "Bottom" diagrams
162  double b1234(int k, const DiracSpinor &w, const DiracSpinor &c,
163  const DiracSpinor &v, const DiracSpinor &r) const;
164 
165  // "Centre" diagrams (most important)
166  double c1(int k, const DiracSpinor &w, const DiracSpinor &a,
167  const DiracSpinor &v, const DiracSpinor &c) const;
168  double c2(int k, const DiracSpinor &w, const DiracSpinor &a,
169  const DiracSpinor &v, const DiracSpinor &c) const;
170  double d1(int k, const DiracSpinor &w, const DiracSpinor &r,
171  const DiracSpinor &v, const DiracSpinor &m) const;
172  double d2(int k, const DiracSpinor &w, const DiracSpinor &r,
173  const DiracSpinor &v, const DiracSpinor &m) const;
174 
175  // "Normalisation" terms (most important)
176  double n1(const DiracSpinor &v) const;
177  double n2(const DiracSpinor &v) const;
178  double dSigma_dE(const DiracSpinor &v, const DiracSpinor &i,
179  const DiracSpinor &j, const DiracSpinor &k) const;
180 
181  std::pair<double, double>
182  z_bo(const DiracOperator::TensorOperator *const h, const DiracSpinor &w,
183  const DiracSpinor &v, bool transpose = false,
184  const ExternalField::CorePolarisation *const dV = nullptr) const;
185 
186  //
187  double Q(int k, const DiracSpinor &a, const DiracSpinor &b,
188  const DiracSpinor &c, const DiracSpinor &d) const {
189  // inlcudes effective Coulomb screening
190  const auto fk = f_root_scr(k);
191  return m_use_Qk ? fk * mQ->Q(k, a, b, c, d) : fk * mY.Q(k, a, b, c, d);
192  }
193 
194  double P(int k, const DiracSpinor &a, const DiracSpinor &b,
195  const DiracSpinor &c, const DiracSpinor &d) const {
196  // inlcudes effective Coulomb screening
197  return m_use_Qk ? mQ->P2(k, a, b, c, d, mY.SixJ(), m_root_fk) :
198  mY.P2(k, a, b, c, d, m_root_fk);
199  }
200 
201  double W(int k, const DiracSpinor &a, const DiracSpinor &b,
202  const DiracSpinor &c, const DiracSpinor &d) const {
203  // inlcudes effective Coulomb screening
204  return Q(k, a, b, c, d) + P(k, a, b, c, d);
205  }
206 };
207 
208 } // namespace MBPT
Calculates + stores Hartree Y functions + Angular (w/ look-up), taking advantage of symmetry.
Definition: YkTable.hpp:26
double Q(const int k, const DiracSpinor &Fa, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd) const
Calculates Qk using the existing yk integrals. Note: Yk and Ck tables must include all required value...
Definition: YkTable.cpp:127
const Angular::SixJTable & SixJ() const
Returns a (const ref) to SixJ table [see Angular::SixJTable].
Definition: YkTable.hpp:58
Look-up table for matrix elements. Note: does not assume any symmetry: (a,b) is stored independantly ...
Definition: meTable.hpp:17
General operator (virtual base class); operators derive from this.
Definition: TensorOperator.hpp:110
Stores radial Dirac spinor: F_nk = (f, g)
Definition: DiracSpinor.hpp:41
Virtual Core Polarisation class, for <a||dV||b>. See TDHF, DiagramRPA, etc.
Definition: CorePolarisation.hpp:35
Calculates Structure Radiation + Normalisation of states, using diagram method.
Definition: StructureRad.hpp:52
std::pair< double, double > srTB(const DiracOperator::TensorOperator *const h, const DiracSpinor &w, const DiracSpinor &v, double omega=0.0, const ExternalField::CorePolarisation *const dV=nullptr) const
Returns sum of Top+Bottom (SR) diagrams, reduced ME: <w||T+B||v>. Returns a pair: {TB,...
Definition: StructureRad.cpp:60
double f_root_scr(int k) const
Effective screening factor for Coulomb lines.
Definition: StructureRad.hpp:121
std::pair< double, double > BO(const DiracOperator::TensorOperator *const h, const DiracSpinor &w, const DiracSpinor &v, const ExternalField::CorePolarisation *const dV=nullptr, double fw=1.0, double fv=1.0) const
Returns Brueckner orbital contribution to the, reduced ME: <w||h||v>_norm. Returns a pair: {N,...
Definition: StructureRad.cpp:750
StructureRad(const std::vector< DiracSpinor > &basis, double en_core, std::pair< int, int > nminmax={0, 999}, const std::string &Qk_fname="", const std::vector< double > &fk={}, const std::vector< double > &etak={})
Definition: StructureRad.cpp:17
double eta_hp(int k) const
Effective hole-particle factor for polarisation loops.
Definition: StructureRad.hpp:127
std::pair< double, double > srn(const DiracOperator::TensorOperator *const h, const DiracSpinor &w, const DiracSpinor &v, double omega=0.0, const ExternalField::CorePolarisation *const dV=nullptr) const
Returns sum of SR+Norm diagrams, reduced ME: <w||T+B+C+N||v>. Returns a pair: {SRN,...
Definition: StructureRad.hpp:111
Coulomb::meTable< std::pair< double, double > > srn_table(const DiracOperator::TensorOperator *const h, const std::vector< DiracSpinor > &as, const std::vector< DiracSpinor > &tbs={}, double omega=0.0, const ExternalField::CorePolarisation *const dV=nullptr) const
constructs an me table of {srn, srn+dv} for each pair or {a,b}
Definition: StructureRad.cpp:199
std::pair< double, double > norm(const DiracOperator::TensorOperator *const h, const DiracSpinor &w, const DiracSpinor &v, const ExternalField::CorePolarisation *const dV=nullptr) const
Returns Normalisation of states, reduced ME: <w||h||v>_norm. Returns a pair: {N, N+dV}: second includ...
Definition: StructureRad.cpp:182
std::pair< double, double > srC(const DiracOperator::TensorOperator *const h, const DiracSpinor &w, const DiracSpinor &v, const ExternalField::CorePolarisation *const dV=nullptr) const
Returns Centre (SR) diagrams, reduced ME: <w||C||v>. Returns a pair: {C, C+dV}: second includes RPA (...
Definition: StructureRad.cpp:110
Stores Wavefunction (set of valence orbitals, grid, HF etc.)
Definition: Wavefunction.hpp:36
Dirac Operators: General + derived.
Definition: GenerateOperator.cpp:12
Calculates many-body corrections (RPA) to matrix elements of external field.
Definition: calcMatrixElements.cpp:14
Many-body perturbation theory.
Definition: CI_Integrals.hpp:9