2#include "Angular/include.hpp"
3#include "Wavefunction/DiracSpinor.hpp"
20 std::vector<double> &ykab,
const std::size_t maxi = 0);
30 const std::vector<double> &ykbd);
38 const std::vector<double> &ykbd);
42 const std::vector<double> &ykbd);
59 const DiracSpinor &d,
int tma,
int tmb,
int tmc,
int tmd);
66bool Qk_abcd_SR(
int k,
int ka,
int kb,
int kc,
int kd);
73bool Pk_abcd_SR(
int k,
int ka,
int kb,
int kc,
int kd);
105 return std::make_pair(std::abs(tja - tjb) / 2, (tja + tjb) / 2);
114 auto &min_k = minmax.first;
115 auto &max_k = minmax.second;
116 if ((a.
l() + b.
l() + min_k) % 2 != 0) {
119 if ((a.
l() + b.
l() + max_k) % 2 != 0) {
129 auto &min_k = minmax.first;
130 auto &max_k = minmax.second;
133 if ((la + lb + min_k) % 2 != 0) {
136 if ((la + lb + max_k) % 2 != 0) {
151 const auto k_even_ac = (a.
l() + c.l()) % 2 == 0;
152 const auto k_even_bd = (b.
l() + d.
l()) % 2 == 0;
153 if (k_even_ac != k_even_bd) {
161 return {std::max(l1, l2), std::min(u1, u2)};
168inline std::pair<int, int>
k_minmax_Q(
int kap_a,
int kap_b,
int kap_c,
173 if (k_even_ac != k_even_bd) {
181 return {std::max(l1, l2), std::min(u1, u2)};
207static int twojk(
const A &a) {
208 if constexpr (std::is_same_v<A, DiracSpinor>) {
211 static_assert(std::is_same_v<A, int>);
217static std::optional<int> twojknull(
const A &a) {
218 if constexpr (std::is_same_v<A, DiracSpinor>) {
220 }
else if constexpr (std::is_same_v<A, int>) {
221 static_assert(std::is_same_v<A, int>);
228template <
class A,
class B,
class C,
class D,
class E,
class F>
229static double sixj(
const A &a,
const B &b,
const C &c,
const D &d,
const E &e,
235template <
class A = std::optional<
int>,
class B = std::optional<
int>,
236 class C = std::optional<
int>,
class D = std::optional<
int>,
237 class E = std::optional<
int>,
class F = std::optional<
int>>
238static bool sixjTriads(
const A &a,
const B &b,
const C &c,
const D &d,
239 const E &e,
const F &f) {
241 twojknull(d), twojknull(e), twojknull(f));
244template <
class A,
class B,
class C>
245static bool triangle(
const A &a,
const B &b,
const C &c) {
Stores radial Dirac spinor: F_nk = (f, g)
Definition DiracSpinor.hpp:44
int twoj() const
2j (twice the total angular momentum)
Definition DiracSpinor.hpp:97
int l() const
Orbital angular momentum Q number.
Definition DiracSpinor.hpp:93
double sixj_2(int two_j1, int two_j2, int two_j3, int two_j4, int two_j5, int two_j6)
Wigner 6j symbol {j1 j2 j3 | j4 j5 j6}. Inputs are 2*j as integers.
Definition Wigner369j.hpp:431
constexpr int l_k(int ka)
returns l given kappa
Definition Wigner369j.hpp:44
int twojk(const A &a)
Returns 2*k if a is an integer, or 2*j if a is a DiracSpinor.
Definition SixJTable.hpp:34
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:249
bool sixjTriads(std::optional< int > a, std::optional< int > b, std::optional< int > c, std::optional< int > d, std::optional< int > e, std::optional< int > f)
Checks 6j triangle conditions with optional arguments (wildcards). Inputs are 2*j.
Definition Wigner369j.hpp:395
constexpr int twoj_k(int ka)
returns 2j given kappa
Definition Wigner369j.hpp:46
Functions (+classes) for computing Coulomb integrals.
Definition CoulombBreit.cpp:13
std::pair< int, int > k_minmax_tj(int tja, int tjb)
Returns min and max k (multipolarity) allowed for Triangle(k,a,b), NOT accounting for parity (2j only...
Definition CoulombIntegrals.hpp:104
DiracSpinor Qkv_bcd(const int k, const int kappa_a, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
Calculates Q^k(v)_bcd for given k,kappa_v. From scratch (calculates y) [see YkTable version if alread...
Definition CoulombIntegrals.cpp:331
bool Pk_abcd_SR(int k, int ka, int kb, int kc, int kd)
Just selection rule for Pk_abcd.
Definition CoulombIntegrals.cpp:321
std::pair< int, int > k_minmax_Ck(const DiracSpinor &a, const DiracSpinor &b)
Returns min and max k (multipolarity) allowed for C^k_ab, accounting for parity (used by k_minmax_Q)
Definition CoulombIntegrals.hpp:111
double g_abcd(const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d, int tma, int tmb, int tmc, int tmd)
Calculates g from scratch - not used often.
Definition CoulombIntegrals.cpp:424
double Rk_abcd(const int k, const DiracSpinor &Fa, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
Calculates R^k_abcd for given k. From scratch (calculates y)
Definition CoulombIntegrals.cpp:233
double Qk_abcd(const int k, const DiracSpinor &Fa, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
Calculates Q^k_abcd for given k. From scratch (calculates y) [see YkTable version if already have YkT...
Definition CoulombIntegrals.cpp:290
DiracSpinor Rkv_bcd(const int k, const int kappa_a, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
"Right-hand-side" R^k{v}_bcd [i.e., without Fv integral]
Definition CoulombIntegrals.cpp:253
int number_below_Fermi(const DiracSpinor &i, const DiracSpinor &j, const DiracSpinor &k, const DiracSpinor &l, double eFermi)
Returns number of orbitals that are below Fermi level. Used for Qk selection.
Definition CoulombIntegrals.cpp:452
bool Qk_abcd_SR(int k, int ka, int kb, int kc, int kd)
Just selection rule for Qk_abcd.
Definition CoulombIntegrals.cpp:312
double Pk_abcd(const int k, const DiracSpinor &Fa, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
Exchange only version of W (W-Q): W = Q + P [see Qk above].
Definition CoulombIntegrals.cpp:361
std::pair< int, int > k_minmax_P(const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d)
Returns min and max k (multipolarity) allowed for P^k_abcd. DOES NOT contain parity rules (6j only) -...
Definition CoulombIntegrals.cpp:472
DiracSpinor Pkv_bcd(const int k, int kappa_a, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
Exchange only version of W (W-Q): W = Q + P [see Qk above].
Definition CoulombIntegrals.cpp:382
double Wk_abcd(const int k, const DiracSpinor &Fa, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
Calculates W^k_abcd for given k. From scratch (calculates y)
Definition CoulombIntegrals.cpp:417
std::pair< int, int > k_minmax_W(const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d)
Returns min and max k (multipolarity) allowed for W^k_abcd. DOES NOT contain parity rules (6j only) -...
Definition CoulombIntegrals.cpp:492
std::pair< int, int > k_minmax_Q(const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d)
Returns min and max k (multipolarity) allowed for Q^k_abcd. Parity rule is included,...
Definition CoulombIntegrals.hpp:146
std::vector< double > yk_ab(const int k, const DiracSpinor &Fa, const DiracSpinor &Fb, const std::size_t maxi)
Calculates Hartree Screening functions .
Definition CoulombIntegrals.cpp:191