ampsci
High-precision calculations for one- and two-valence atomic systems
TensorOperator.hpp
1#pragma once
2#include "Angular/Wigner369j.hpp"
3#include "Maths/Grid.hpp"
4#include "Maths/NumCalc_quadIntegrate.hpp"
5#include "Maths/SphericalBessel.hpp"
6#include "Physics/PhysConst_constants.hpp"
7#include "Potentials/NuclearPotentials.hpp"
8#include "Wavefunction/DiracSpinor.hpp"
9#include "qip/Vector.hpp"
10#include <cmath>
11#include <memory>
12#include <string>
13#include <vector>
14
15//! Dirac Operators: General + derived
16namespace DiracOperator {
17
18//! Parity of operator
19enum class Parity { even, odd, Error };
20
21//! Realness of matrix element; impacts symmetry only
22enum class Realness { real, imaginary, Error };
23
24//! Type of matrix element returned
25/*! @details
26 Specifies which form of matrix element is used or returned.
27
28 @value Reduced : Reduced matrix element
29 @value Stretched : Matrix element for stretched states (m = j)
30 @value HFConstant : Hyperfine (A,B,C...) constant
31
32 For off-diagonal, j:=min(ja,jb)
33*/
34enum class MatrixElementType { Reduced, Stretched, HFConstant, Error };
35
36//! Convert string to Parity
37Parity parse_Parity(const std::string &s);
38
39//! Convert Parity to string
40std::string parse_Parity(Parity p);
41
42//! Convert string to Realness
43Realness parse_Realness(const std::string &s);
44
45//! Convert Realness to string
46std::string parse_Realness(Realness r);
47
48//! Convert string to MatrixElementType
49MatrixElementType parse_MatrixElementType(const std::string &s);
50
51//! Convert MatrixElementType to string
53
54//==============================================================================
55//! @brief General operator (virtual base class); operators derive from this.
56/*! @details
57 - k is rank, c is multiplicative constant, d_order is derivative order,
58 - pi is parity, may be Parity::even or ::odd.
59 - RorI may be Realness::real or Realness::imaginary.
60 - Note: You may not construct a TensorOperator. Instead, you must construct
61 one of the derived 'operators' (there are some general ones); see
62 operators.hpp for list of operators. Operators work by overrideing the
63 angularCxx() functions and angularF().
64 - c, v, and Cxx are included in radial integral.
65*/
67protected:
68 //! @brief Constructs a tensor operator description.
69 /*! @details
70 Initialises the basic properties of a tensor operator.
71
72 @param rank_k Tensor rank k of the operator.
73 @param pi Parity of the operator (Parity::even or Parity::odd).
74 @param constant Multiplicative constant c, included in the radial integral.
75 @param vec Overall v=f(r) radial function, as std::vector array
76 @param RorI Specifies whether the matrix element is real or imaginary
77 (Realness::real or Realness::imaginary).
78 @param freq_dep Indicates whether the operator depends on frequency
79 (e.g., dynamic external fields).
80
81 @note TensorOperator is a virtual base class and may not be constructed
82 directly. It is intended to be initialised by derived operator classes.
83 */
84 TensorOperator(int rank_k, Parity pi, double constant = 1.0,
85 const std::vector<double> &vec = {}, int diff_order = 0,
86 Realness RorI = Realness::real, bool freq_dep = false)
87 : m_rank(rank_k),
88 m_parity(pi),
89 m_diff_order(diff_order),
90 opC(RorI),
91 m_freqDependantQ(freq_dep),
92 m_constant(constant),
93 m_vec(vec){};
94
95public:
96 //! Used to pass generic parameters to update() function
97 /*! @details
98 Override in derived class, then use as:
99
100 auto const* params = dynamic_cast<const Params*>(&p);
101
102 Rarely used.
103 */
104 struct Params {
105 virtual ~Params() = default;
106 };
107
108public:
109 virtual ~TensorOperator() = default;
110 TensorOperator(const TensorOperator &) = default;
111 TensorOperator &operator=(const TensorOperator &) = default;
112 TensorOperator(TensorOperator &&) = default;
113 TensorOperator &operator=(TensorOperator &&) = default;
114
115protected:
116 int m_rank;
117 Parity m_parity;
118 int m_diff_order;
119 Realness opC;
120 bool m_freqDependantQ{false};
121
122protected:
123 // these may be updated for frequency-dependant operators
124 double m_constant; // included in radial integral
125 std::vector<double> m_vec;
126
127public:
128 bool freqDependantQ() const { return m_freqDependantQ; }
129
130public:
131 //! If matrix element <a|h|b> is zero, returns true
132 bool isZero(int ka, int kb) const;
133 bool isZero(const DiracSpinor &Fa, const DiracSpinor &Fb) const;
134
135 bool selectrion_rule(int twoJA, int piA, int twoJB, int piB) const {
136 if (twoJA == twoJB && twoJA == 0.0)
137 return false;
138
139 if (Angular::triangle(twoJA, twoJB, 2 * m_rank) == 0)
140 return false;
141
142 return (m_parity == Parity::even) == (piA == piB);
143 }
144
145 //! Update frequency for frequency-dependant operators.
146 virtual void updateFrequency(const double) {
147 std::cout << "Must reimplement updateFrequency()\n";
148 std::cout << this->name() << "\n";
149 std::abort();
150 };
151
152 //! Updates the rank of operator (rarely used). Generally also updates parity
153 /*!
154 @note: Will usually have to call updateFrequency() after this!
155 */
156 virtual void updateRank(int) {
157 std::cout << "Must reimplement updateRank() is needed\n";
158 std::cout << this->name() << "\n";
159 std::abort();
160 }
161
162 //! Permanently re-scales the operator by constant, lambda
163 void scale(double lambda);
164
165 //! Returns a const ref to vector v
166 const std::vector<double> &getv() const { return m_vec; }
167
168 //! Returns a const ref to constant c
169 double getc() const { return m_constant; }
170
171 int get_d_order() const { return m_diff_order; }
172
173 //! returns true if operator is imaginary (has imag MEs)
174 bool imaginaryQ() const { return (opC == Realness::imaginary); }
175
176 //! Rank k of operator
177 int rank() const { return m_rank; }
178
179 //! returns parity, as integer (+1 or -1)
180 int parity() const { return (m_parity == Parity::even) ? 1 : -1; }
181
182 //! returns relative sign between <a||x||b> and <b||x||a>
183 int symm_sign(const DiracSpinor &Fa, const DiracSpinor &Fb) const {
184 const auto sra_i = imaginaryQ() ? -1 : 1;
185 const auto sra = Angular::neg1pow_2(Fa.twoj() - Fb.twoj());
186 return sra_i * sra;
187 }
188
189 //! Returns "name" of operator (e.g., 'E1')
190 virtual std::string name() const { return "Operator"; };
191 //! Returns units of operator (usually au, may be MHz, etc.)
192 virtual std::string units() const { return "au"; };
193
194public:
195 // These are needed for radial integrals
196 // Usually just constants, but can also be functions of kappa
197
198 //! Angular factor for f_a*f_b part of radial integral
199 /*! @details
200 - Often constant, though sometimes depends on \f$\kappa_a,\kappa_b\f$
201 \f[
202 \int_0^\infty v(r)\left(
203 C_{ff}f_a(r)f_b(r) +
204 C_{fg}f_a(r)g_b(r) +
205 C_{gf}g_a(r)f_b(r) +
206 C_{gg}g_a(r)g_b(r)
207 \right)\,{\rm d}r
208 \f]
209 */
210 virtual double angularCff(int /*k_a*/, int /*k_b*/) const { return 1.0; }
211 //! Angular factor for g_a*g_b part of radial integral
212 virtual double angularCgg(int, int) const { return 1.0; }
213 //! Angular factor for f_a*g_b part of radial integral
214 virtual double angularCfg(int, int) const { return 0.0; }
215 //! Angular factor for g_a*f_b part of radial integral
216 virtual double angularCgf(int, int) const { return 0.0; }
217
218public:
219 //! @brief angularF: links radiation integral to RME.
220 //! RME = <a||h||b> = angularF(a,b) * radial_int(a,b)
221 virtual double angularF(const int, const int) const = 0;
222
223 //! Returns a polymorphic copy at the current state, or nullptr if not supported.
224 virtual std::unique_ptr<TensorOperator> clone() const { return nullptr; }
225
226 //! radial_int = Fa * radial_rhs(a, Fb) (a needed for angular factor)
227 /*! @details
228
229 By default, is defined as:
230
231 \f[
232 \delta F_{\rm b} =
233 C_{\rm overall}\,v(r)
234 \begin{pmatrix}
235 C_{ff}f_b(r) + C_{fg}g_b(r) \\
236 C_{gf}f_b(r) + C_{gg}g_b(r)
237 \end{pmatrix}
238 \f]
239
240 \f$ C_{f/g} \f$ are angular coeficients - see \ref TensorOperator::angularCff
241
242 See also: \ref TensorOperator::radial_rhs
243 */
244 virtual DiracSpinor radial_rhs(const int kappa_a,
245 const DiracSpinor &Fb) const;
246
247 //! Radial part of integral R_ab = (Fa|t|Fb).
248 /*! @details
249
250 <a||t||b> = angularF(a,b) * radialIntegral(a,b)
251
252 The 'radial' integral \f$R_{ab}\f$ for operator \f$t\f$ is defined as
253 \f[
254 \langle a ||t|| b \rangle \equiv R_{ab} * A_{ab}
255 \f]
256
257 where \f$A_{ab}\f$ is TensorOperator::angularF()
258
259 By default, is implemented as:
260 \f[
261 R = \int_0^\infty F_a\cdot\delta F_{\rm b} \,{\rm d}r
262 \f]
263
264 where \f$ \delta F_{\rm b} \f$ is defined in \ref TensorOperator::radial_rhs
265
266 So, if \ref TensorOperator::radial_rhs is defined normally, we have:
267 \f[
268 C_{\rm overall}\int_0^\infty v(r)\left(
269 C_{ff}f_a(r)f_b(r) +
270 C_{fg}f_a(r)g_b(r) +
271 C_{gf}g_a(r)f_b(r) +
272 C_{gg}g_a(r)g_b(r)
273 \right)\,{\rm d}r
274 \f]
275
276 \f$ C_{f/g} \f$ are angular coeficients - see \ref TensorOperator::angularCff
277
278 @warning
279 - This is defined for the "standard" case, which doesn't always suit
280 - \ref TensorOperator::radial_rhs may be overridden for special cases
281 - If radial_rhs is overridden, then radialIntegral must also be_
282 */
283 virtual double radialIntegral(const DiracSpinor &Fa,
284 const DiracSpinor &Fb) const;
285
286 //! ME = rme3js * RME
287 double rme3js(int twoja, int twojb, int two_mb = 1, int two_q = 0) const;
288
289 //! ME = rme3js * RME
290 double rme3js(const DiracSpinor &Fa, const DiracSpinor &Fb, int two_mb = 1,
291 int two_q = 0) const {
292 return rme3js(Fa.twoj(), Fb.twoj(), two_mb, two_q);
293 }
294
295 //! <a||h||b> = Fa * reduced_rhs(a, Fb) (a needed for angular factor)
296 DiracSpinor reduced_rhs(const int ka, const DiracSpinor &Fb) const;
297
298 //! <b||h||a> = Fa * reduced_lhs(a, Fb) (a needed for angular factor)
299 DiracSpinor reduced_lhs(const int ka, const DiracSpinor &Fb) const;
300
301 //! The reduced matrix element
302 double reducedME(const DiracSpinor &Fa, const DiracSpinor &Fb) const;
303
304 //! Returns "full" matrix element, for optional (ma, mb, q) [taken as int 2*].
305 //! If not specified, returns z-component (q=0), with ma=mb=min(ja,jb)
306 double fullME(const DiracSpinor &Fa, const DiracSpinor &Fb,
307 std::optional<int> two_ma = std::nullopt,
308 std::optional<int> two_mb = std::nullopt,
309 std::optional<int> two_q = std::nullopt) const;
310
311 //! Converts reduced matrix element to different "type" (MatrixElementType)
312 double matel_factor(MatrixElementType type, int twoJa, int twoJb) const;
313
314 double matel_factor(MatrixElementType type, const DiracSpinor &Fa,
315 const DiracSpinor &Fb) const {
316 return matel_factor(type, Fa.twoj(), Fb.twoj());
317 }
318};
319
320//============================================================================
321//============================================================================
322//! Speacial case for scalar operator
324public:
325 ScalarOperator(Parity pi, double in_coef,
326 const std::vector<double> &in_v = {},
327 const std::array<int, 4> &in_g = {1, 0, 0, 1}, int in_diff = 0,
328 Realness rori = Realness::real)
329 : TensorOperator(0, pi, in_coef, in_v, in_diff, rori),
330 c_ff(in_g[0]),
331 c_fg(in_g[1]),
332 c_gf(in_g[2]),
333 c_gg(in_g[3]) {}
334
335 ScalarOperator(const std::vector<double> &in_v = {}, double in_coef = 1.0)
336 : TensorOperator(0, Parity::even, in_coef, in_v, 0),
337 c_ff(1.0),
338 c_fg(0.0),
339 c_gf(0.0),
340 c_gg(1.0) {}
341
342public:
343 virtual double angularF(const int ka, const int kb) const override {
344 // For scalar operators, <a||h||b> = RadInt / 3js
345 // 3js:= 1/(Sqrt[2j+1]) ... depends on m???
346 // |k| = j+1/2
347 return (std::abs(ka) == std::abs(kb)) ? std::sqrt(2.0 * std::abs(ka)) : 0.0;
348 }
349
350private:
351 const double c_ff, c_fg, c_gf, c_gg;
352
353protected:
354 double virtual angularCff(int, int) const override { return c_ff; }
355 double virtual angularCgg(int, int) const override { return c_gg; }
356 double virtual angularCfg(int, int) const override { return c_fg; }
357 double virtual angularCgf(int, int) const override { return c_gf; }
358};
359
360//------------------------------------------------------------------------------
361//! Speacial operator: 0
362class NullOperator final : public ScalarOperator {
363public:
364 NullOperator() : ScalarOperator(Parity::even, 0, {}) {}
365
366protected:
367 double virtual angularCff(int, int) const override final { return 0.0; }
368 double virtual angularCgg(int, int) const override final { return 0.0; }
369 double virtual angularCfg(int, int) const override final { return 0.0; }
370 double virtual angularCgf(int, int) const override final { return 0.0; }
371};
372
373//******************************************************************************
374// Helper functions: Useful for several operators
375//******************************************************************************
376
377//! Pab function: Int[ (fa*gb + pm*ga*fb) * t(r) , dr]. pm = +/-1 (usually)
378/*! @details
379Note: does not know selection rules, so only evaluate if non-zero
380*/
381double Pab(double pm, const std::vector<double> &t, const DiracSpinor &Fa,
382 const DiracSpinor &Fb);
383
384//! Rab function: Int[ (fa*fb + pm*ga*gb) * t(r) , dr]. pm = +/-1 (usually)
385/*! @details
386Note: does not know selection rules, so only evaluate if non-zero
387*/
388double Rab(double pm, const std::vector<double> &t, const DiracSpinor &Fa,
389 const DiracSpinor &Fb);
390
391//! Pab_rhs function: dF_ab += A * t(r) * (g, pm*f) , pm=+/-1 (usually).
392//! NOTE: uses +=, so can combine. Ensure empty to begin.
393/*! @details
394Note: does not know selection rules, so only evaluate if non-zero.
395Should have Fa*Pab_rhs = A * Pab.
396*/
397void Pab_rhs(double pm, const std::vector<double> &t, DiracSpinor *dF,
398 const DiracSpinor &Fb, double A = 1.0);
399
400//! Rab_rhs function: dF_ab += A * t(r) * (f, pm*g) , pm=+/-1 (usually).
401//! NOTE: uses +=, so can combine. Ensure empty to begin.
402/*! @details
403Note: does not know selection rules, so only evaluate if non-zero.
404Should have Fa*Rab_rhs = A * Rab.
405*/
406void Rab_rhs(double pm, const std::vector<double> &t, DiracSpinor *dF,
407 const DiracSpinor &Fb, double A = 1.0);
408
409//! Vab function: Int[ (fa*gb ) * t(r) , dr].
410double Vab(const std::vector<double> &t, const DiracSpinor &Fa,
411 const DiracSpinor &Fb);
412//! Wab function: Int[ (ga*fb ) * t(r) , dr].
413double Wab(const std::vector<double> &t, const DiracSpinor &Fa,
414 const DiracSpinor &Fb);
415
416//! Gab function: Int[ (ga*gb ) * t(r) , dr].
417double Gab(const std::vector<double> &t, const DiracSpinor &Fa,
418 const DiracSpinor &Fb);
419
420void Gab_rhs(const std::vector<double> &t, DiracSpinor *dF,
421 const DiracSpinor &Fb, double a);
422
423// Same - for constant t(r)=c
424
425//! Pab[1] function: Int[ (fa*gb + pm*ga*fb) , dr]. pm = +/-1 (usually)
426double Pab(double pm, const DiracSpinor &Fa, const DiracSpinor &Fb);
427
428//! Rab[1] function: Int[ (fa*fb + pm*ga*gb) , dr] = Int[ (pm-1)*ga*gb) , dr].
429//! NOTE: assumes NOT diagonal, using orthogonality condition.
430double Rab(double pm, const DiracSpinor &Fa, const DiracSpinor &Fb);
431
432//! Pab_rhs[1] function: dF_ab += A * (g, pm*f) , pm=+/-1 (usually).
433void Pab_rhs(double pm, DiracSpinor *dF, const DiracSpinor &Fb, double A = 1.0);
434
435//! Rab_rhs[1] function: dF_ab += A * (f, pm*g) = dF_ab += A * (0, (pm-1)*g).
436//! NOTE: assumes NOT diagonal, using orthogonality condition.
437void Rab_rhs(double pm, DiracSpinor *dF, const DiracSpinor &Fb, double A = 1.0);
438
439//! Gab = Int[ ga*gb , dr] - (just relativistic correction part of integral)
440double Gab(const DiracSpinor &Fa, const DiracSpinor &Fb);
441
442//! Gab_rhs(r) += a*g_b(r). Note: uses += so may be sumulative
443void Gab_rhs(DiracSpinor *dF, const DiracSpinor &Fb, double a);
444
445} // namespace DiracOperator
Speacial operator: 0.
Definition TensorOperator.hpp:362
virtual double angularCgg(int, int) const override final
Angular factor for g_a*g_b part of radial integral.
Definition TensorOperator.hpp:368
virtual double angularCgf(int, int) const override final
Angular factor for g_a*f_b part of radial integral.
Definition TensorOperator.hpp:370
virtual double angularCff(int, int) const override final
Angular factor for f_a*f_b part of radial integral.
Definition TensorOperator.hpp:367
virtual double angularCfg(int, int) const override final
Angular factor for f_a*g_b part of radial integral.
Definition TensorOperator.hpp:369
Speacial case for scalar operator.
Definition TensorOperator.hpp:323
virtual double angularCgf(int, int) const override
Angular factor for g_a*f_b part of radial integral.
Definition TensorOperator.hpp:357
virtual double angularCfg(int, int) const override
Angular factor for f_a*g_b part of radial integral.
Definition TensorOperator.hpp:356
virtual double angularCgg(int, int) const override
Angular factor for g_a*g_b part of radial integral.
Definition TensorOperator.hpp:355
virtual double angularF(const int ka, const int kb) const override
angularF: links radiation integral to RME. RME = <a||h||b> = angularF(a,b) * radial_int(a,...
Definition TensorOperator.hpp:343
virtual double angularCff(int, int) const override
Angular factor for f_a*f_b part of radial integral.
Definition TensorOperator.hpp:354
General operator (virtual base class); operators derive from this.
Definition TensorOperator.hpp:66
double fullME(const DiracSpinor &Fa, const DiracSpinor &Fb, std::optional< int > two_ma=std::nullopt, std::optional< int > two_mb=std::nullopt, std::optional< int > two_q=std::nullopt) const
Returns "full" matrix element, for optional (ma, mb, q) [taken as int 2*]. If not specified,...
Definition TensorOperator.cpp:67
virtual double angularCgf(int, int) const
Angular factor for g_a*f_b part of radial integral.
Definition TensorOperator.hpp:216
virtual std::unique_ptr< TensorOperator > clone() const
Returns a polymorphic copy at the current state, or nullptr if not supported.
Definition TensorOperator.hpp:224
int symm_sign(const DiracSpinor &Fa, const DiracSpinor &Fb) const
returns relative sign between <a||x||b> and <b||x||a>
Definition TensorOperator.hpp:183
bool imaginaryQ() const
returns true if operator is imaginary (has imag MEs)
Definition TensorOperator.hpp:174
virtual std::string units() const
Returns units of operator (usually au, may be MHz, etc.)
Definition TensorOperator.hpp:192
int parity() const
returns parity, as integer (+1 or -1)
Definition TensorOperator.hpp:180
double rme3js(const DiracSpinor &Fa, const DiracSpinor &Fb, int two_mb=1, int two_q=0) const
ME = rme3js * RME.
Definition TensorOperator.hpp:290
virtual double angularCff(int, int) const
Angular factor for f_a*f_b part of radial integral.
Definition TensorOperator.hpp:210
virtual double angularF(const int, const int) const =0
angularF: links radiation integral to RME. RME = <a||h||b> = angularF(a,b) * radial_int(a,...
virtual double angularCfg(int, int) const
Angular factor for f_a*g_b part of radial integral.
Definition TensorOperator.hpp:214
double matel_factor(MatrixElementType type, int twoJa, int twoJb) const
Converts reduced matrix element to different "type" (MatrixElementType)
Definition TensorOperator.cpp:84
virtual std::string name() const
Returns "name" of operator (e.g., 'E1')
Definition TensorOperator.hpp:190
double getc() const
Returns a const ref to constant c.
Definition TensorOperator.hpp:169
double reducedME(const DiracSpinor &Fa, const DiracSpinor &Fb) const
The reduced matrix element.
Definition TensorOperator.cpp:62
virtual double angularCgg(int, int) const
Angular factor for g_a*g_b part of radial integral.
Definition TensorOperator.hpp:212
DiracSpinor reduced_lhs(const int ka, const DiracSpinor &Fb) const
<b||h||a> = Fa * reduced_lhs(a, Fb) (a needed for angular factor)
Definition TensorOperator.cpp:55
void scale(double lambda)
Permanently re-scales the operator by constant, lambda.
Definition TensorOperator.cpp:104
double rme3js(int twoja, int twojb, int two_mb=1, int two_q=0) const
ME = rme3js * RME.
Definition TensorOperator.cpp:40
bool isZero(int ka, int kb) const
If matrix element <a|h|b> is zero, returns true.
Definition TensorOperator.cpp:18
virtual DiracSpinor radial_rhs(const int kappa_a, const DiracSpinor &Fb) const
radial_int = Fa * radial_rhs(a, Fb) (a needed for angular factor)
Definition TensorOperator.cpp:108
virtual void updateRank(int)
Updates the rank of operator (rarely used). Generally also updates parity.
Definition TensorOperator.hpp:156
virtual double radialIntegral(const DiracSpinor &Fa, const DiracSpinor &Fb) const
Radial part of integral R_ab = (Fa|t|Fb).
Definition TensorOperator.cpp:153
int rank() const
Rank k of operator.
Definition TensorOperator.hpp:177
DiracSpinor reduced_rhs(const int ka, const DiracSpinor &Fb) const
<a||h||b> = Fa * reduced_rhs(a, Fb) (a needed for angular factor)
Definition TensorOperator.cpp:50
virtual void updateFrequency(const double)
Update frequency for frequency-dependant operators.
Definition TensorOperator.hpp:146
const std::vector< double > & getv() const
Returns a const ref to vector v.
Definition TensorOperator.hpp:166
TensorOperator(int rank_k, Parity pi, double constant=1.0, const std::vector< double > &vec={}, int diff_order=0, Realness RorI=Realness::real, bool freq_dep=false)
Constructs a tensor operator description.
Definition TensorOperator.hpp:84
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:42
constexpr int neg1pow_2(int two_a)
Evaluates (-1)^{two_a/2} (for integer a; two_a is even)
Definition Wigner369j.hpp:226
constexpr int triangle(int j1, int j2, int J)
Returns 1 if triangle rule is satisfied. nb: works with j OR twoj!
Definition Wigner369j.hpp:236
Dirac Operators: General + derived.
Definition GenerateOperator.cpp:3
void Pab_rhs(double pm, const std::vector< double > &t, DiracSpinor *dF, const DiracSpinor &Fb, double a)
Pab_rhs function: dF_ab += A * t(r) * (g, pm*f) , pm=+/-1 (usually). NOTE: uses +=,...
Definition TensorOperator.cpp:239
double Vab(const std::vector< double > &t, const DiracSpinor &Fa, const DiracSpinor &Fb)
Vab function: Int[ (fa*gb ) * t(r) , dr].
Definition TensorOperator.cpp:258
double Gab(const std::vector< double > &t, const DiracSpinor &Fa, const DiracSpinor &Fb)
Gab function: Int[ (ga*gb ) * t(r) , dr].
Definition TensorOperator.cpp:277
double Rab(double pm, const std::vector< double > &t, const DiracSpinor &Fa, const DiracSpinor &Fb)
Rab function: Int[ (fa*fb + pm*ga*gb) * t(r) , dr]. pm = +/-1 (usually)
Definition TensorOperator.cpp:227
double Wab(const std::vector< double > &t, const DiracSpinor &Fa, const DiracSpinor &Fb)
Wab function: Int[ (ga*fb ) * t(r) , dr].
Definition TensorOperator.cpp:268
Realness parse_Realness(const std::string &s)
Convert string to Realness.
Definition TensorOperator.cpp:401
MatrixElementType
Type of matrix element returned.
Definition TensorOperator.hpp:34
void Rab_rhs(double pm, const std::vector< double > &t, DiracSpinor *dF, const DiracSpinor &Fb, double a)
Rab_rhs function: dF_ab += A * t(r) * (f, pm*g) , pm=+/-1 (usually). NOTE: uses +=,...
Definition TensorOperator.cpp:249
Parity
Parity of operator.
Definition TensorOperator.hpp:19
Parity parse_Parity(const std::string &s)
Convert string to Parity.
Definition TensorOperator.cpp:378
Realness
Realness of matrix element; impacts symmetry only.
Definition TensorOperator.hpp:22
double Pab(double pm, const std::vector< double > &t, const DiracSpinor &Fa, const DiracSpinor &Fb)
Pab function: Int[ (fa*gb + pm*ga*fb) * t(r) , dr]. pm = +/-1 (usually)
Definition TensorOperator.cpp:213
MatrixElementType parse_MatrixElementType(const std::string &s)
Convert string to MatrixElementType.
Definition TensorOperator.cpp:424
Used to pass generic parameters to update() function.
Definition TensorOperator.hpp:104