ampsci
c++ program for high-precision atomic structure calculations of single-valence systems
jls.hpp
1 #pragma once
2 #include "Angular/Wigner369j.hpp"
3 #include "DiracOperator/TensorOperator.hpp"
4 #include "IO/InputBlock.hpp"
5 #include "Wavefunction/Wavefunction.hpp"
6 
7 namespace DiracOperator {
8 
9 //==============================================================================
11 class j : public TensorOperator {
12 public:
13  j() : TensorOperator(1, Parity::even) {}
14 
15  double angularF(const int ka, const int kb) const override final {
16  if (ka != kb)
17  return 0.0;
18  const auto tj = Angular::twoj_k(ka);
19  return std::sqrt(tj * (tj + 2) * (tj + 1)) / 2;
20  }
21  std::string name() const override { return std::string("j"); }
22  std::string units() const override { return "au"; }
23 };
24 
25 //==============================================================================
27 class l : public TensorOperator {
28 public:
29  l() : TensorOperator(1, Parity::even) {}
30 
31  double angularF(const int ka, const int kb) const override final {
32  const auto la = Angular::l_k(ka);
33  const auto lb = Angular::l_k(kb);
34  const auto tja = Angular::twoj_k(ka);
35  const auto tjb = Angular::twoj_k(kb);
36  if (la != lb)
37  return 0.0;
38  const auto sign = Angular::neg1pow_2(tjb + 2 * lb - 1);
39  const auto fact =
40  std::sqrt(double((tja + 1) * (tjb + 1) * (2 * la + 1) * la * (la + 1)));
41  const auto sjs = Angular::sixj_2(tjb, tja, 2, 2 * lb, 2 * lb, 1);
42  return sign * fact * sjs;
43  }
44  std::string name() const override { return std::string("l"); }
45  std::string units() const override { return "au"; }
46 };
47 
48 //==============================================================================
50 class s : public TensorOperator {
51 public:
52  s() : TensorOperator(1, Parity::even, 1.0) {}
53 
54  double angularF(const int ka, const int kb) const override final {
55  const auto la = Angular::l_k(ka);
56  const auto lb = Angular::l_k(kb);
57  const auto tja = Angular::twoj_k(ka);
58  const auto tjb = Angular::twoj_k(kb);
59  if (la != lb)
60  return 0.0;
61  const auto sign = Angular::neg1pow_2(tja + 2 * lb - 1);
62  const auto fact = std::sqrt((tja + 1) * (tjb + 1) * 1.5);
63  const auto sjs = Angular::sixj_2(tjb, tja, 2, 1, 1, 2 * la);
64  return sign * fact * sjs;
65  }
66  std::string name() const override { return std::string("s"); }
67  std::string units() const override { return "au"; }
68 };
69 
70 //==============================================================================
71 inline std::unique_ptr<DiracOperator::TensorOperator>
72 generate_l(const IO::InputBlock &input, const Wavefunction &) {
73  using namespace DiracOperator;
74  input.check({{"no options", ""}});
75  if (input.has_option("help")) {
76  return nullptr;
77  }
78  return std::make_unique<l>();
79 }
80 
81 inline std::unique_ptr<DiracOperator::TensorOperator>
82 generate_s(const IO::InputBlock &input, const Wavefunction &) {
83  using namespace DiracOperator;
84  input.check({{"no options", ""}});
85  if (input.has_option("help")) {
86  return nullptr;
87  }
88  return std::make_unique<s>();
89 }
90 
91 } // namespace DiracOperator
General operator (virtual base class); operators derive from this.
Definition: TensorOperator.hpp:110
j (total angular momentum) operator
Definition: jls.hpp:11
std::string units() const override
Returns units of operator (usually au, may be MHz, etc.)
Definition: jls.hpp:22
std::string name() const override
Returns "name" of operator (e.g., 'E1')
Definition: jls.hpp:21
double angularF(const int ka, const int kb) const override final
angularF: links radiation integral to RME. RME = <a||h||b> = angularF(a,b) * radial_int(a,...
Definition: jls.hpp:15
l (orbital angular momentum) operator
Definition: jls.hpp:27
std::string units() const override
Returns units of operator (usually au, may be MHz, etc.)
Definition: jls.hpp:45
std::string name() const override
Returns "name" of operator (e.g., 'E1')
Definition: jls.hpp:44
double angularF(const int ka, const int kb) const override final
angularF: links radiation integral to RME. RME = <a||h||b> = angularF(a,b) * radial_int(a,...
Definition: jls.hpp:31
s (spin) operator
Definition: jls.hpp:50
std::string units() const override
Returns units of operator (usually au, may be MHz, etc.)
Definition: jls.hpp:67
std::string name() const override
Returns "name" of operator (e.g., 'E1')
Definition: jls.hpp:66
double angularF(const int ka, const int kb) const override final
angularF: links radiation integral to RME. RME = <a||h||b> = angularF(a,b) * radial_int(a,...
Definition: jls.hpp:54
Holds list of Options, and a list of other InputBlocks. Can be initialised with a list of options,...
Definition: InputBlock.hpp:142
bool check(std::initializer_list< std::string > blocks, const std::vector< std::pair< std::string, std::string >> &list, bool print=false) const
Check all the options and blocks in this; if any of them are not present in 'list',...
Definition: InputBlock.hpp:594
bool has_option(std::string_view key) const
Check is option is present (even if not set) in current block.
Definition: InputBlock.hpp:201
Stores Wavefunction (set of valence orbitals, grid, HF etc.)
Definition: Wavefunction.hpp:36
double sixj_2(int two_j1, int two_j2, int two_j3, int two_j4, int two_j5, int two_j6)
6j symbol {j1 j2 j3 \ j4 j5 j6} - [takes 2*j as int]
Definition: Wigner369j.hpp:236
constexpr int l_k(int ka)
returns l given kappa
Definition: Wigner369j.hpp:12
constexpr int neg1pow_2(int two_a)
Evaluates (-1)^{two_a/2} (for integer a; two_a is even)
Definition: Wigner369j.hpp:121
constexpr int twoj_k(int ka)
returns 2j given kappa
Definition: Wigner369j.hpp:14
Dirac Operators: General + derived.
Definition: GenerateOperator.cpp:12