ampsci
c++ program for high-precision atomic structure calculations of single-valence systems
M1.hpp
1 #pragma once
2 #include "DiracOperator/TensorOperator.hpp"
3 #include "IO/InputBlock.hpp"
4 #include "Wavefunction/Wavefunction.hpp"
5 #include "jls.hpp"
6 
7 namespace DiracOperator {
8 
10 
20 class M1 final : public TensorOperator {
21 public:
22  M1(const Grid &gr, const double alpha, const double omega = 0.0)
23  : TensorOperator(1, Parity::even, +0.0, {}, 0, Realness::real, true),
24  m_r(gr.r()),
25  m_alpha(alpha) {
26  updateFrequency(omega);
27  }
28  M1 &operator=(const M1 &) = delete;
29  M1(const M1 &) = default;
30  ~M1() = default;
31  std::string name() const override final { return std::string("M1"); }
32  std::string units() const override final { return std::string("|mu_B|"); }
33 
34  double angularF(const int ka, const int kb) const override final {
35  return (ka + kb) * Angular::Ck_kk(1, -ka, kb);
36  }
37  double angularCff(int, int) const override final { return 0.0; }
38  double angularCgg(int, int) const override final { return 0.0; }
39  double angularCfg(int, int) const override final { return 1.0; }
40  double angularCgf(int, int) const override final { return 1.0; }
41 
42  void updateFrequency(const double omega) override final {
43  if (std::abs(omega) > 1.0e-10) {
44  m_constant = -3.0 / std::abs((m_alpha * m_alpha * omega));
45  m_vec =
46  SphericalBessel::fillBesselVec_kr(1, std::abs(omega) * m_alpha, m_r);
47  } else {
48  // j1(kr) -> (r*k)/3, for k<<1
49  m_constant = -1.0 / (m_alpha);
50  m_vec = m_r;
51  }
52  }
53 
54 private:
55  const std::vector<double> m_r; // store radial vector (copy)
56  const double m_alpha;
57 };
58 
59 //==============================================================================
61 class M1nr final : public TensorOperator {
62 public:
63  M1nr() : TensorOperator(1, Parity::even, 1.0) {}
64  std::string name() const override final { return "M1nr"; }
65  std::string units() const override final { return "|mu_B|"; }
66 
67  double angularF(const int, const int) const override final {
68  // angular factor included in L and S
69  return 1.0;
70  }
71 
72  DiracSpinor radial_rhs(const int kappa_a,
73  const DiracSpinor &Fb) const override final {
74  return m_l.reduced_rhs(kappa_a, Fb) + 2.0 * m_s.reduced_rhs(kappa_a, Fb);
75  }
76 
77  double radialIntegral(const DiracSpinor &Fa,
78  const DiracSpinor &Fb) const override final {
79  // nb: faster not to do this, but nicer this way
80  return Fa * radial_rhs(Fa.kappa(), Fb);
81  }
82 
83 private:
84  DiracOperator::s m_s{};
85  DiracOperator::l m_l{};
86 };
87 
88 //------------------------------------------------------------------------------
89 inline std::unique_ptr<DiracOperator::TensorOperator>
90 generate_M1(const IO::InputBlock &input, const Wavefunction &wf) {
91  using namespace DiracOperator;
92  input.check({{"", "No input options"}});
93  if (input.has_option("help")) {
94  return nullptr;
95  }
96  return std::make_unique<M1>(wf.grid(), wf.alpha(), 0.0);
97 }
98 
99 inline std::unique_ptr<DiracOperator::TensorOperator>
100 generate_M1nr(const IO::InputBlock &input, const Wavefunction &) {
101  using namespace DiracOperator;
102  input.check({{"", "No input options"}});
103  if (input.has_option("help")) {
104  return nullptr;
105  }
106  return std::make_unique<M1nr>();
107 }
108 
109 } // namespace DiracOperator
Magnetic dipole operator: <a||M1||b>
Definition: M1.hpp:20
std::string name() const override final
Returns "name" of operator (e.g., 'E1')
Definition: M1.hpp:31
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: M1.hpp:34
std::string units() const override final
Returns units of operator (usually au, may be MHz, etc.)
Definition: M1.hpp:32
void updateFrequency(const double omega) override final
Update frequency for frequency-dependant operators.
Definition: M1.hpp:42
Magnetic dipole operator, in non-relativistic form: M1 = L + 2S.
Definition: M1.hpp:61
std::string name() const override final
Returns "name" of operator (e.g., 'E1')
Definition: M1.hpp:64
DiracSpinor radial_rhs(const int kappa_a, const DiracSpinor &Fb) const override final
radial_int = Fa * radial_rhs(a, Fb) (a needed for angular factor)
Definition: M1.hpp:72
double radialIntegral(const DiracSpinor &Fa, const DiracSpinor &Fb) const override final
Defined via <a||h||b> = angularF(a,b) * radialIntegral(a,b) (Note: if radial_rhs is overridden,...
Definition: M1.hpp:77
std::string units() const override final
Returns units of operator (usually au, may be MHz, etc.)
Definition: M1.hpp:65
double angularF(const int, const int) const override final
angularF: links radiation integral to RME. RME = <a||h||b> = angularF(a,b) * radial_int(a,...
Definition: M1.hpp:67
General operator (virtual base class); operators derive from this.
Definition: TensorOperator.hpp:110
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
l (orbital angular momentum) operator
Definition: jls.hpp:27
s (spin) operator
Definition: jls.hpp:50
Stores radial Dirac spinor: F_nk = (f, g)
Definition: DiracSpinor.hpp:41
Holds grid, including type + Jacobian (dr/du)
Definition: Grid.hpp:31
const std::vector< double > & r() const
Grid points, r.
Definition: Grid.hpp:75
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
const Grid & grid() const
Returns a const reference to the radial grid.
Definition: Wavefunction.hpp:81
double alpha() const
Local value of fine-structure constant.
Definition: Wavefunction.hpp:87
double Ck_kk(int k, int ka, int kb)
Reduced (relativistic) angular ME: <ka||C^k||kb> [takes k and kappa].
Definition: Wigner369j.hpp:267
Dirac Operators: General + derived.
Definition: GenerateOperator.cpp:12