ampsci
High-precision calculations for one- and two-valence atomic systems
Ek.hpp
1#pragma once
2#include "DiracOperator/TensorOperator.hpp"
3#include "IO/InputBlock.hpp"
4#include "Wavefunction/Wavefunction.hpp"
5
6namespace DiracOperator {
7
8//==============================================================================
9//! E^k (electric multipole) operator, length form, with qr<<1 (static) approximation
10/*! @details
11 \f[
12 h_k = -|e|r^k = -e r^k
13 \f]
14 \f[
15 \redmatel{a}{h_k}{b} = R C^k_{ab}
16 \f]
17 \f[
18 R = -e \int r^k (f_a f_b + g_a g_b) \, dr
19 \f]
20
21 - This has \f$ qr \\ 1\f$ (static) approximation;
22 - That is, no bessel functions
23 - See @ref EM_multipole operator for full operators
24*/
25class Ek : public TensorOperator {
26public:
27 Ek(const Grid &gr, const int k)
28 : TensorOperator(k, Angular::evenQ(k) ? Parity::even : Parity::odd, -1.0,
29 gr.rpow(k)),
30 m_k(k) {}
31
32 std::string name() const override {
33 return std::string("E") + std::to_string(m_k);
34 }
35 std::string units() const override {
36 return m_k == 1 ? "|e|aB" : std::string("|e|aB^") + std::to_string(m_k);
37 }
38
39 double angularF(const int ka, const int kb) const override final {
40 return Angular::Ck_kk(m_k, ka, kb);
41 }
42
43 static std::unique_ptr<TensorOperator> generate(const IO::InputBlock &input,
44 const Wavefunction &wf) {
45 input.check({{"k", "Rank: k=1 for E1, =2 for E2 etc. [1]"}});
46 if (input.has_option("help"))
47 return nullptr;
48 const auto k = input.get("k", 1);
49 return std::make_unique<Ek>(wf.grid(), k);
50 }
51
52private:
53 int m_k;
54};
55
56//==============================================================================
57//! Electric dipole operator: -|e|r = -er
58/*! @details
59\f[<a||d||b> = R (-1)^{ja+1/2} \sqrt{[ja][jb]} \, tjs(ja,jb,1, -1/2,1/2,0)\f]
60\f[<a||d||b> = R <k_a||C^k||k_b>\f]
61\f[R = -e \int r(f_a f_b + g_a g_b) \, dr\f]
62*/
63class E1 final : public Ek {
64public:
65 E1(const Grid &gr) : Ek(gr, 1) {}
66
67 static std::unique_ptr<TensorOperator> generate(const IO::InputBlock &input,
68 const Wavefunction &wf) {
69 input.check({{"no options", ""}});
70 if (input.has_option("help"))
71 return nullptr;
72 return std::make_unique<E1>(wf.grid());
73 }
74};
75
76//==============================================================================
77//! Odd-parity rank-0 operator with radial function r (sigma_r)
78class sigma_r final : public ScalarOperator {
79public:
80 sigma_r(const Grid &rgrid) : ScalarOperator(Parity::odd, -1.0, rgrid.r()) {}
81 std::string name() const override final { return "s.r"; }
82 std::string units() const override final { return "aB"; }
83
84 static std::unique_ptr<TensorOperator> generate(const IO::InputBlock &input,
85 const Wavefunction &wf) {
86 input.check({{"no options", ""}});
87 if (input.has_option("help"))
88 return nullptr;
89 return std::make_unique<sigma_r>(wf.grid());
90 }
91};
92
93//==============================================================================
94//! @brief Electric dipole operator, v-form:
95//! \f$ \frac{ie}{\omega \alpha} \vec{\alpha}\f$
96/*! @details
97\f[ <a||d_v||b> = R \f]
98\f[ R = -\frac{2e}{\omega \alpha}
99\int( f_ag_b <ka||s||-kb> - g_af_b <-ka||s||kb>)\,dr \f]
100*/
101class E1v final : public TensorOperator
102// d_v = (ie/w alpha) v{alpha} [v{a} = g0v{g}]\f$
103// <a||dv||b> = -2e/(w alpha) Int[ fagb <ka||s||-kb> - gafb <-ka||s||kb>]
104{
105public:
106 E1v(const double alpha, const double omega = 0.0)
107 : TensorOperator(1, Parity::odd, -0.0, {}, Realness::real, true),
108 m_alpha(alpha) {
109 updateFrequency(omega);
110 }
111 std::string name() const override final { return "E1v"; }
112 std::string units() const override final { return "|e|aB"; }
113
114 double angularF(const int ka, const int kb) const override final {
115 // return 1;
116 return Angular::Ck_kk(1, ka, kb);
117 }
118
119 double angularCff(int, int) const override final { return 0; }
120 double angularCgg(int, int) const override final { return 0; }
121 double angularCfg(int ka, int kb) const override final {
122 // return Angular::S_kk(ka, -kb);
123 return ka - kb - 1;
124 }
125 double angularCgf(int ka, int kb) const override final {
126 // return -Angular::S_kk(-ka, kb);
127 return ka - kb + 1;
128 }
129
130 //! @note At omega=0 (static limit) falls back to m_constant = -1.0;
131 //! the velocity-form operator diverges as 1/omega and is not physically
132 //! meaningful at zero frequency.
133 void updateFrequency(const double omega) override final {
134 // m_constant = std::abs(omega) > 1.0e-10 ? -2.0 / (m_alpha * omega) : 1.0;
135 m_constant = std::abs(omega) > 1.0e-10 ? -1.0 / (m_alpha * omega) : -1.0;
136 }
137
138 static std::unique_ptr<TensorOperator> generate(const IO::InputBlock &input,
139 const Wavefunction &wf) {
140 input.check({{"no options", ""}});
141 if (input.has_option("help"))
142 return nullptr;
143 return std::make_unique<E1v>(wf.alpha(), 0.0);
144 }
145
146private:
147 double m_alpha; // (including var-alpha)
148};
149
150//==============================================================================
151//! @brief i\vec{\alpha} matrix element: propto Electric dipole operator.
152//! i factored so that ME is real
153class ialpha final : public TensorOperator {
154public:
155 ialpha() : TensorOperator(1, Parity::odd, 1.0, {}, Realness::real, true) {}
156
157 std::string name() const override final { return "i*alpha"; }
158 std::string units() const override final { return "au"; }
159
160 double angularF(const int ka, const int kb) const override final {
161 return Angular::Ck_kk(1, ka, kb);
162 }
163
164 double angularCff(int, int) const override final { return 0; }
165 double angularCgg(int, int) const override final { return 0; }
166 double angularCfg(int ka, int kb) const override final { return ka - kb - 1; }
167 double angularCgf(int ka, int kb) const override final { return ka - kb + 1; }
168
169 static std::unique_ptr<TensorOperator> generate(const IO::InputBlock &input,
170 const Wavefunction &) {
171 input.check({{"no options", ""}});
172 if (input.has_option("help"))
173 return nullptr;
174 return std::make_unique<ialpha>();
175 }
176};
177
178//==============================================================================
179//! @brief Electric quadrupole operator: -|e|r^2
180class E2 final : public Ek {
181public:
182 E2(const Grid &gr) : Ek(gr, 2) {}
183
184 static std::unique_ptr<TensorOperator> generate(const IO::InputBlock &input,
185 const Wavefunction &wf) {
186 input.check({{"no options", ""}});
187 if (input.has_option("help"))
188 return nullptr;
189 return std::make_unique<E2>(wf.grid());
190 }
191};
192
193} // namespace DiracOperator
Electric dipole operator: -|e|r = -er.
Definition Ek.hpp:63
Electric dipole operator, v-form: .
Definition Ek.hpp:104
double angularCgg(int, int) const override final
Angular coefficient C_gg for the g_a*g_b term of the radial integral.
Definition Ek.hpp:120
double angularF(const int ka, const int kb) const override final
Angular factor A_ab linking the radial integral to the RME.
Definition Ek.hpp:114
std::string name() const override final
Returns "name" of operator (e.g., 'E1')
Definition Ek.hpp:111
double angularCfg(int ka, int kb) const override final
Angular coefficient C_fg for the f_a*g_b term of the radial integral.
Definition Ek.hpp:121
double angularCgf(int ka, int kb) const override final
Angular coefficient C_gf for the g_a*f_b term of the radial integral.
Definition Ek.hpp:125
std::string units() const override final
Returns units of operator as a string (usually au, may be MHz, etc.)
Definition Ek.hpp:112
double angularCff(int, int) const override final
Angular coefficient C_ff for the f_a*f_b term of the radial integral.
Definition Ek.hpp:119
E^k (electric multipole) operator, length form, with qr<<1 (static) approximation.
Definition Ek.hpp:25
std::string name() const override
Returns "name" of operator (e.g., 'E1')
Definition Ek.hpp:32
double angularF(const int ka, const int kb) const override final
Angular factor A_ab linking the radial integral to the RME.
Definition Ek.hpp:39
std::string units() const override
Returns units of operator as a string (usually au, may be MHz, etc.)
Definition Ek.hpp:35
Rank-0 (scalar) tensor operator; derives from TensorOperator with k=0.
Definition TensorOperator.hpp:561
General tensor operator (virtual base class); all single-particle (one-body) tenosor operators derive...
Definition TensorOperator.hpp:198
virtual void updateFrequency(const double)
Updates the operator for a new frequency omega.
Definition TensorOperator.hpp:296
Odd-parity rank-0 operator with radial function r (sigma_r)
Definition Ek.hpp:78
std::string name() const override final
Returns "name" of operator (e.g., 'E1')
Definition Ek.hpp:81
std::string units() const override final
Returns units of operator as a string (usually au, may be MHz, etc.)
Definition Ek.hpp:82
Non-uniform radial grid with Jacobian, suitable for atomic structure calculations.
Definition Grid.hpp:85
const std::vector< double > & r() const
Full grid vector r.
Definition Grid.hpp:131
std::vector< double > rpow(double k) const
Returns a vector of r^k for each grid point.
Definition Grid.cpp:120
Holds a named list of key=value options and nested InputBlocks.
Definition InputBlock.hpp:154
bool check(std::initializer_list< std::string > blocks, const std::vector< std::pair< std::string, std::string > > &list, bool print=false) const
Validates options and sub-blocks against an allowed list.
Definition InputBlock.hpp:649
bool has_option(std::string_view key) const
Returns true if key is present in this block's option list, even if unset.
Definition InputBlock.hpp:247
T get(std::string_view key, T default_value) const
Returns the value of key, or default_value if not found.
Definition InputBlock.hpp:471
Stores Wavefunction (set of valence orbitals, grid, HF etc.)
Definition Wavefunction.hpp:37
const Grid & grid() const
Returns a const reference to the radial grid.
Definition Wavefunction.hpp:82
double alpha() const
Local value of fine-structure constant.
Definition Wavefunction.hpp:88
constexpr bool evenQ(int a)
Returns true if a is even - for integer values.
Definition Wigner369j.hpp:233
double Ck_kk(int k, int ka, int kb)
Reduced relativistic angular ME: <ka||C^k||kb>. Takes kappa values.
Definition Wigner369j.hpp:486
Dirac operators: TensorOperator base class and derived implementations for single-particle (one-body)...
Definition GenerateOperator.cpp:6
std::unique_ptr< DiracOperator::TensorOperator > generate(std::string_view operator_name, const IO::InputBlock &input, const Wavefunction &wf)
Constructs and returns a TensorOperator by name.
Definition GenerateOperator.cpp:10
Parity
Parity of operator.
Definition TensorOperator.hpp:57