ampsci
High-precision calculations for one- and two-valence atomic systems
Sigma2.hpp
1#pragma once
2#include "Angular/SixJTable.hpp"
3#include "Coulomb/QkTable.hpp"
4#include "Wavefunction/DiracSpinor.hpp"
5#include "qip/String.hpp"
6#include <string>
7#include <vector>
8
9namespace MBPT {
10
11/*! @brief Type of energy demoninators: RS, Fermi, Fermi0
12
13 - RS : Use energy denominator ascociated with actual orbital for external legs. Symmeterised so that diagram is symmetric. May be danger of accidental enhancement.
14 - Fermi : Use energy from the "Fermi" level (i.e., lowest state for given kappa in excited spectrum).
15 - Fermi0 : As above, but assume Fermi level for all kappas the same. These often cancel, so there is no (excited-excited) term in denominator (except diagram d). Fine, since the remaining core-excited always dominates.
16
17Energy for internal legs (hole-particle) always actual orbtials.
18*/
19enum class Denominators { RS, Fermi, Fermi0 };
20
21//! Returns string representation of Denominators enum
22std::string parse_Denominators(Denominators d);
23
24//! Parses string to Denominators enum (case-insensitive); returns Fermi0 if unrecognised
25Denominators parse_Denominators(std::string_view s);
26
27/*!
28 @brief Splits the basis into the core (holes) and excited states.
29 @details
30 States with energy below @p E_Fermi are considered core/holes.
31 Only core states with \f$ n \geq \f$ @p min_n_core, and excited states with
32 \f$ n \leq \f$ @p max_n_excited are kept.
33
34 @note Negative energy states not dealt with! Assumed not to be present in basis. Fix?
35
36 @note Replace all instances with \ref DiracSpinor::split_by_energy
37
38 @param basis Full set of single-particle basis states.
39 @param E_Fermi Energy threshold separating core from excited states.
40 @param min_n_core Minimum principal quantum number for core states.
41 @param max_n_excited Maximum principal quantum number for excited states.
42
43 @return Pair {core, excited} of DiracSpinor vectors.
44*/
45std::pair<std::vector<DiracSpinor>, std::vector<DiracSpinor>>
46split_basis(const std::vector<DiracSpinor> &basis, double E_Fermi,
47 int min_n_core = 1, int max_n_excited = 999);
48
49/*!
50 @brief Reduced two-body Sigma (2nd-order correlation) operator matrix element.
51 @details
52 Computes \f$ S^k_{vwxy} \f$, the reduced matrix element of the two-body
53 second-order correlation (Sigma_2) operator, summed over all 9 Goldstone
54 diagrams.
55
56 \f[
57 \begin{equation*}
58 \begin{split}
59 \Sigma^2_{vwxy}
60 =& ~
61 \frac{g_{vnxa}\widetilde g_{awny}-g_{vnax}g_{awny}}
62 {e_{xa}-\varepsilon_{vn}}\quad\text{(diagram 'a')}\\
63 &+
64 \frac{g_{vaxn}\widetilde g_{nway}-g_{vanx} g_{nway}}{e_{ya}-\varepsilon_{wn}}
65 \quad\text{(diagram 'b')}
66 \\
67 &-\frac{g_{vnay}g_{awxn}}
68 {e_{ya}-\varepsilon_{vn}}
69 -\frac{g_{vany}g_{nwxa}}
70 {e_{xa}-\varepsilon_{wn}} \quad\text{(diagram 'c1+c2')}\\
71 &+
72 \frac{g_{vwab}g_{abxy}}{\varepsilon_{ab}-\varepsilon_{vw}}\quad\text{(diagram 'd')}.
73 \end{split}
74 \end{equation*}
75 \f]
76
77 The 'reduced' Sk is defined similarly to Coulomb case (\ref Coulomb).
78 The correlation diagrams have the same angular decomposition as the Coulomb integrals:
79 \f[
80 \Sigma^2_{vwxy} = \sum_k A^k_{vwxy} S^k_{vwxy},
81 \f]
82
83 Note: these have fewer symmetries than \f$ Q^k \f$; specifically
84 \f$ S^k_{vwxy} = S^k_{xyvw} \f$. We call with the "Lk" symmetry
85 (though, we should have called it "Sk")
86
87 @param k Multipolarity.
88 @param v External spinor.
89 @param w External spinor.
90 @param x External spinor.
91 @param y External spinor.
92 @param qk Coulomb integral table (QkTable).
93 @param core Core (hole) states for internal lines.
94 @param excited Excited (particle) states (internal lines).
95 @param SixJ Precomputed 6-j symbol table.
96 @param denominators Energy denominator convention (RS or BW) ** not implemented correctly **.
97
98 @return \f$ S^k_{vwxy} \f$.
99*/
100double Sk_vwxy(int k, const DiracSpinor &v, const DiracSpinor &w,
101 const DiracSpinor &x, const DiracSpinor &y,
102 const Coulomb::QkTable &qk, const std::vector<DiracSpinor> &core,
103 const std::vector<DiracSpinor> &excited,
104 const Angular::SixJTable &SixJ,
105 Denominators denominators = Denominators::Fermi0);
106
107/*!
108 @brief Selection rule for \f$ S^k_{vwxy} \f$.
109 @details
110 Differs from the \f$ Q^k_{vwxy} \f$ selection rule due to parity.
111
112 @return True if \f$ S^k_{vwxy} \f$ is non-zero by selection rules.
113*/
114bool Sk_vwxy_SR(int k, const DiracSpinor &v, const DiracSpinor &w,
115 const DiracSpinor &x, const DiracSpinor &y);
116
117/*!
118 @brief Minimum and maximum \f$ k \f$ allowed by selection rules for \f$ S^k_{vwxy} \f$.
119 @details
120 Unlike \f$ Q^k \f$, \f$ k \f$ does not step by 2 for Sigma_2 matrix elements.
121
122 @return Pair {k_min, k_max}.
123*/
124std::pair<int, int> k_minmax_S(const DiracSpinor &v, const DiracSpinor &w,
125 const DiracSpinor &x, const DiracSpinor &y);
126
127//! @brief Overload taking \f$ 2j \f$ values directly.
128std::pair<int, int> k_minmax_S(int twoj_v, int twoj_w, int twoj_x, int twoj_y);
129
130/*!
131 @brief Matrix element of the 1-body Sigma (2nd-order correlation) operator.
132 @details
133 Computes \f$ \langle v | \Sigma(E) | w \rangle \f$ by summing over internal
134 core and excited states using the provided Coulomb integral table.
135
136 The energy at which Sigma is evaluated:
137 - If @p ev is given, it is used directly.
138 - Otherwise \f$ E = \frac{1}{2}(\varepsilon_v + \varepsilon_w) \f$ is used.
139
140 @p max_l_internal truncates the angular momentum of internal lines; intended
141 for convergence tests only.
142
143 @param v External bra spinor.
144 @param w External ket spinor.
145 @param qk Coulomb integral table (YkTable or QkTable).
146 @param core Core (hole) states.
147 @param excited Excited (particle) states.
148 @param max_l_internal Maximum \f$ l \f$ for internal lines (default 99).
149 @param ev Optional energy at which Sigma is evaluated.
150
151 @return \f$ \langle v | \Sigma(E) | w \rangle \f$.
152*/
153template <class CoulombIntegral> // CoulombIntegral may be YkTable or QkTable
154double Sigma_vw(const DiracSpinor &v, const DiracSpinor &w,
155 const CoulombIntegral &qk, const std::vector<DiracSpinor> &core,
156 const std::vector<DiracSpinor> &excited,
157 int max_l_internal = 99,
158 std::optional<double> ev = std::nullopt);
159
160/*!
161 @brief Returns energy of first excited state matching a given \f$ \kappa \f$.
162 @details
163 Searches @p excited for the first state with the given @p kappa_v and
164 returns its energy. Used to set a representative energy for a partial wave.
165
166 @param kappa_v Relativistic angular momentum quantum number.
167 @param excited Excited (particle) states.
168
169 @note Assumes excited is sorted by energy (for each kappa); returns *first* (not lowest) energy
170
171 @note If no state with given kappa is present, returns 0. (Matrix element will be zero anyway)
172
173 @return Energy of the matching state, if kappa is present, otherwise 0
174*/
175double e_bar(int kappa_v, const std::vector<DiracSpinor> &excited);
176
177/*!
178 @brief Calculates (or reads in) a table of two-body Sigma_2 matrix elements.
179
180 @details
181 Computes \f$ S^k_{vwxy} \f$ for all relevant combinations of states in
182 @p external, using the provided core and excited bases and Coulomb table.
183 Results are written to / read from @p filename (empty string disables I/O).
184
185 @param filename File to read/write the table. (blank for "false" to not write)
186 @param external Basis states for external legs (all ME between these are computed).
187 @param core Core (hole) states for internal summations.
188 @param excited Excited (particle) states for internal summations.
189 @param qk Precomputed Coulomb integral table (QkTable).
190 @param max_k Maximum multipolarity to include.
191 @param exclude_wrong_parity_box If true, excludes box diagrams with "wrong" parity.
192 @param denominators RS, Fermi, Fermi0: see \ref MBPT::Denominators
193 @param no_new_integrals If true, only reads existing intergals; no new computation.
194
195 @note no_new_integrals - if we _know_ all required integrals are already in the
196 file to be read in, saves time.
197 Otherwise, ampsci will check if any new integrals a requred.
198 This checking can take a while, particularly for large basis.
199
200 @return LkTable containing all computed \f$ S^k_{vwxy} \f$ matrix elements.
201*/
202[[nodiscard]] Coulomb::LkTable calculate_Sk(
203 const std::string &filename, const std::vector<DiracSpinor> &external,
204 const std::vector<DiracSpinor> &core, const std::vector<DiracSpinor> &excited,
205 const Coulomb::QkTable &qk, int max_k, bool exclude_wrong_parity_box,
206 Denominators denominators, bool no_new_integrals = false);
207
208//==============================================================================
209//==============================================================================
210
211//! Functions for each Sigma2 diagram; called by \ref Sk_vwxy.
212//! @details Broken up for computational convenience, not diagram-by-diagram.
213namespace Sigma2 {
214
215/*!
216 @brief Diagrams a+b contribution to the reduced two-body Sigma.
217 @details
218 Computes the sum of Goldstone diagrams a and b for \f$ S^k_{vwxy} \f$.
219
220 @param k Multipolarity.
221 @param v (+ w x y) External spinors.
222 @param qk Coulomb integral table.
223 @param core Core states.
224 @param excited Excited states.
225 @param SixJ 6-j symbol table.
226 @param denominators Energy denominator convention.
227
228 @return Diagrams a+b contribution to \f$ S^k_{vwxy} \f$.
229*/
230double S_Sigma2_ab(int k, const DiracSpinor &v, const DiracSpinor &w,
231 const DiracSpinor &x, const DiracSpinor &y,
232 const Coulomb::QkTable &qk,
233 const std::vector<DiracSpinor> &core,
234 const std::vector<DiracSpinor> &excited,
235 const Angular::SixJTable &SixJ, Denominators denominators);
236
237/*!
238 @brief Diagram c1 contribution to the reduced two-body Sigma.
239 @details
240 Computes Goldstone diagram c1 for \f$ S^k_{vwxy} \f$.
241
242 @param k Multipolarity.
243 @param v (+ w x y) External spinors.
244 @param qk Coulomb integral table.
245 @param core Core states.
246 @param excited Excited states.
247 @param SixJ 6-j symbol table.
248 @param denominators Energy denominator convention.
249
250 @return Diagram c1 contribution to \f$ S^k_{vwxy} \f$.
251*/
252double S_Sigma2_c1(int k, const DiracSpinor &v, const DiracSpinor &w,
253 const DiracSpinor &x, const DiracSpinor &y,
254 const Coulomb::QkTable &qk,
255 const std::vector<DiracSpinor> &core,
256 const std::vector<DiracSpinor> &excited,
257 const Angular::SixJTable &SixJ, Denominators denominators);
258
259/*!
260 @brief Diagram c2 contribution to the reduced two-body Sigma.
261 @details
262 Computes Goldstone diagram c2 for \f$ S^k_{vwxy} \f$.
263
264 @param k Multipolarity.
265 @param v (+ w x y) External spinors.
266 @param qk Coulomb integral table.
267 @param core Core states.
268 @param excited Excited states.
269 @param SixJ 6-j symbol table.
270 @param denominators Energy denominator convention.
271
272 @return Diagram c2 contribution to \f$ S^k_{vwxy} \f$.
273*/
274double S_Sigma2_c2(int k, const DiracSpinor &v, const DiracSpinor &w,
275 const DiracSpinor &x, const DiracSpinor &y,
276 const Coulomb::QkTable &qk,
277 const std::vector<DiracSpinor> &core,
278 const std::vector<DiracSpinor> &excited,
279 const Angular::SixJTable &SixJ, Denominators denominators);
280
281/*!
282 @brief Diagram d contribution to the reduced two-body Sigma.
283 @details
284 Computes Goldstone diagram d for \f$ S^k_{vwxy} \f$.
285
286 @param k Multipolarity.
287 @param v (+ w x y) External spinors.
288 @param qk Coulomb integral table.
289 @param core Core states.
290 @param excited Excited states.
291 @param SixJ 6-j symbol table.
292 @param denominators Energy denominator convention.
293
294 @return Diagram d contribution to \f$ S^k_{vwxy} \f$.
295*/
296double S_Sigma2_d(int k, const DiracSpinor &v, const DiracSpinor &w,
297 const DiracSpinor &x, const DiracSpinor &y,
298 const Coulomb::QkTable &qk,
299 const std::vector<DiracSpinor> &core,
300 const std::vector<DiracSpinor> &excited,
301 const Angular::SixJTable &SixJ, Denominators denominators);
302
303} // namespace Sigma2
304
305} // namespace MBPT
306
307//==============================================================================
308#include "Sigma2.ipp"
Lookup table for Wigner 6j symbols.
Definition SixJTable.hpp:68
Base class template to store Coulomb integrals, and similar. 3 specific cases (by template instantiat...
Definition QkTable.hpp:102
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:42
double S_Sigma2_c1(int k, const DiracSpinor &v, const DiracSpinor &w, const DiracSpinor &x, const DiracSpinor &y, const Coulomb::QkTable &qk, const std::vector< DiracSpinor > &core, const std::vector< DiracSpinor > &excited, const Angular::SixJTable &SixJ, Denominators denominators)
Diagram c1 contribution to the reduced two-body Sigma.
Definition Sigma2.cpp:162
double S_Sigma2_d(int k, const DiracSpinor &v, const DiracSpinor &w, const DiracSpinor &x, const DiracSpinor &y, const Coulomb::QkTable &qk, const std::vector< DiracSpinor > &core, const std::vector< DiracSpinor > &excited, const Angular::SixJTable &SixJ, Denominators denominators)
Diagram d contribution to the reduced two-body Sigma.
Definition Sigma2.cpp:286
double S_Sigma2_c2(int k, const DiracSpinor &v, const DiracSpinor &w, const DiracSpinor &x, const DiracSpinor &y, const Coulomb::QkTable &qk, const std::vector< DiracSpinor > &core, const std::vector< DiracSpinor > &excited, const Angular::SixJTable &SixJ, Denominators denominators)
Diagram c2 contribution to the reduced two-body Sigma.
Definition Sigma2.cpp:224
double S_Sigma2_ab(int k, const DiracSpinor &v, const DiracSpinor &w, const DiracSpinor &x, const DiracSpinor &y, const Coulomb::QkTable &qk, const std::vector< DiracSpinor > &core, const std::vector< DiracSpinor > &excited, const Angular::SixJTable &SixJ, Denominators denominators)
Diagrams a+b contribution to the reduced two-body Sigma.
Definition Sigma2.cpp:106
Many-body perturbation theory.
Definition CI_Integrals.hpp:10
std::string parse_Denominators(Denominators d)
Returns string representation of Denominators enum.
Definition Sigma2.cpp:10
double e_bar(int kappa_v, const std::vector< DiracSpinor > &excited)
Returns energy of first excited state matching a given .
Definition Sigma2.cpp:45
Coulomb::LkTable calculate_Sk(const std::string &filename, const std::vector< DiracSpinor > &external, const std::vector< DiracSpinor > &core, const std::vector< DiracSpinor > &excited, const Coulomb::QkTable &qk, int max_k, bool exclude_wrong_parity_box, Denominators denominators, bool no_new_integrals)
Calculates (or reads in) a table of two-body Sigma_2 matrix elements.
Definition Sigma2.cpp:352
bool Sk_vwxy_SR(int k, const DiracSpinor &v, const DiracSpinor &w, const DiracSpinor &x, const DiracSpinor &y)
Selection rule for .
Definition Sigma2.cpp:56
std::pair< int, int > k_minmax_S(const DiracSpinor &v, const DiracSpinor &w, const DiracSpinor &x, const DiracSpinor &y)
Minimum and maximum allowed by selection rules for .
Definition Sigma2.cpp:63
Denominators
Type of energy demoninators: RS, Fermi, Fermi0.
Definition Sigma2.hpp:19
std::pair< std::vector< DiracSpinor >, std::vector< DiracSpinor > > split_basis(const std::vector< DiracSpinor > &basis, double E_Fermi, int min_n_core, int max_n_excited)
Splits the basis into the core (holes) and excited states.
Definition Sigma2.cpp:29
double Sk_vwxy(int k, const DiracSpinor &v, const DiracSpinor &w, const DiracSpinor &x, const DiracSpinor &y, const Coulomb::QkTable &qk, const std::vector< DiracSpinor > &core, const std::vector< DiracSpinor > &excited, const Angular::SixJTable &SixJ, Denominators denominators)
Reduced two-body Sigma (2nd-order correlation) operator matrix element.
Definition Sigma2.cpp:87
double Sigma_vw(const DiracSpinor &v, const DiracSpinor &w, const CoulombIntegral &qk, const std::vector< DiracSpinor > &core, const std::vector< DiracSpinor > &excited, int max_l_internal=99, std::optional< double > ev=std::nullopt)
Matrix element of the 1-body Sigma (2nd-order correlation) operator.
Definition Sigma2.ipp:11