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