ampsci
High-precision calculations for one- and two-valence atomic systems
Loading...
Searching...
No Matches
Coulomb Namespace Reference

Functions (+classes) for computing Coulomb integrals. More...

Classes

class  CoulombTable
 Base (pure virtual) class to store Coulomb integrals, and similar. 3 derived classes, which account for symmetry. More...
 
class  meTable
 Look-up table for matrix elements. Note: does not assume any symmetry: (a,b) is stored independantly of (b,a). In general, maps a pair of DiracSpinors to a single value (of any type, T). More...
 
class  YkTable
 Calculates + stores Hartree Y functions + Angular (w/ look-up), taking advantage of symmetry. More...
 

Typedefs

using nk2Index = uint32_t
 index type for set of 2 orbitals {nk,nk} -> nk4Index
 
using Real = double
 Data type used to store integrals.
 
using nk4Index = uint64_t
 index type for set of 4 orbitals {nk,nk,nk,nk} -> nk4Index
 
using nkIndex = uint16_t
 index type for each {nk} (orbital)
 
using CoulombFunction = std::function< double(int, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d)>
 Function type for calculating Coulomb(-like) integrals. Takes k and 4 DiracSpinors, returns a double.
 
using SelectionRules = std::function< bool(int, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d)>
 Function type for determining Coulomb(-like) integral selection rules. Takes k and 4 DiracSpinors, returns a true if integral is allowed.
 
using QkTable = CoulombTable< Symmetry::Qk >
 Stores Coulomb(-like) integrals, assuming Q-like symmetry.
 
using WkTable = CoulombTable< Symmetry::Wk >
 Stores Coulomb(-like) integrals, assuming W-like symmetry.
 
using LkTable = CoulombTable< Symmetry::Lk >
 Stores Coulomb(-like) integrals, assuming L-like symmetry.
 
using NkTable = CoulombTable< Symmetry::none >
 Stores Coulomb(-like) integrals, assuming no symmetry.
 

Enumerations

enum class  Symmetry { Qk , Wk , Lk , none }
 Symmetry (state index order) for tables. More...
 

Functions

std::vector< double > yk_ab (const int k, const DiracSpinor &Fa, const DiracSpinor &Fb, const std::size_t maxi=0)
 Calculates Hartree Screening functions \(y^k_{ab}(r)\).
 
void yk_ab (const int k, const DiracSpinor &Fa, const DiracSpinor &Fb, std::vector< double > &ykab, const std::size_t maxi=0)
 Overload: does not allocate ykab.
 
void bk_ab (const int k, const DiracSpinor &Fa, const DiracSpinor &Fb, std::vector< double > &b0, std::vector< double > &binf, const std::size_t maxi=0)
 Breit b^k function: (0,r) and (r,inf) part stored sepperately (in/out)
 
void gk_ab (const int k, const DiracSpinor &Fa, const DiracSpinor &Fb, std::vector< double > &g0, std::vector< double > &ginf, const std::size_t maxi=0)
 Breit g^k function: (0,r) + (r,inf) part stored together (in/out)
 
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)
 
double Rk_abcd (const DiracSpinor &Fa, const DiracSpinor &Fc, const std::vector< double > &ykbd)
 Overload for when y^k_bd already exists [much faster].
 
DiracSpinor Rkv_bcd (const int k, const int kappa_v, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
 "Right-hand-side" R^k{v}_bcd [i.e., without Fv integral]
 
DiracSpinor Rkv_bcd (const int kappa_v, const DiracSpinor &Fc, const std::vector< double > &ykbd)
 Overload for when y^k_bd already exists [much faster].
 
void Rkv_bcd (DiracSpinor *const Rkv, const DiracSpinor &Fc, const std::vector< double > &ykbd)
 Overload for when spinor exists. Rkv is overwritten.
 
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 YkTable].
 
bool Qk_abcd_SR (int k, int ka, int kb, int kc, int kd)
 Just selection rule for Qk_abcd.
 
bool Qk_abcd_SR (int k, const DiracSpinor &Fa, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
 Just selection rule for Qk_abcd.
 
bool Pk_abcd_SR (int k, int ka, int kb, int kc, int kd)
 Just selection rule for Pk_abcd.
 
bool Pk_abcd_SR (int k, const DiracSpinor &Fa, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
 Just selection rule for Pk_abcd.
 
DiracSpinor Qkv_bcd (const int k, int kappa_v, 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 already have YkTable].
 
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].
 
DiracSpinor Pkv_bcd (const int k, int kappa_v, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
 Exchange only version of W (W-Q): W = Q + P [see Qk above].
 
DiracSpinor Wkv_bcd (const int k, int kappa_v, const DiracSpinor &Fb, const DiracSpinor &Fc, const DiracSpinor &Fd)
 
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)
 
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.
 
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)
 
std::pair< int, int > k_minmax_Ck (int kappa_a, int kappa_b)
 Returns min and max k (multipolarity) allowed for C^k_ab, accounting for parity (used by k_minmax_Q)
 
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, not kappa/l) (used by k_minmax_P,W)
 
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, so you may safely call k+=2. Guaranteed to be non-zero at min and max, and every 2nd inbetween.
 
std::pair< int, int > k_minmax_Q (int kappa_a, int kappa_b, int kappa_c, int kappa_d)
 Returns min and max k (multipolarity) allowed for Q^k_abcd. Parity rule is included, so you may safely call k+=2. Guaranteed to be non-zero at min and max, and every 2nd inbetween.
 
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) - so NOT safe to call k+=2. Guaranteed to be non-zero at min and max.
 
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) - so NOT safe to call k+=2. Cannot guarantee non-zero, since when a=b or c=d, sometimes have P=-Q. But when a!=b and c!=d, guaranteed to be non-zero at min and max.
 

Detailed Description

Functions (+classes) for computing Coulomb integrals.

Typedef Documentation

◆ nk2Index

using Coulomb::nk2Index = typedef uint32_t

index type for set of 2 orbitals {nk,nk} -> nk4Index

◆ Real

using Coulomb::Real = typedef double

Data type used to store integrals.

◆ nk4Index

using Coulomb::nk4Index = typedef uint64_t

index type for set of 4 orbitals {nk,nk,nk,nk} -> nk4Index

◆ nkIndex

using Coulomb::nkIndex = typedef uint16_t

index type for each {nk} (orbital)

◆ CoulombFunction

using Coulomb::CoulombFunction = typedef std::function<double(int, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d)>

Function type for calculating Coulomb(-like) integrals. Takes k and 4 DiracSpinors, returns a double.

◆ SelectionRules

using Coulomb::SelectionRules = typedef std::function<bool(int, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d)>

Function type for determining Coulomb(-like) integral selection rules. Takes k and 4 DiracSpinors, returns a true if integral is allowed.

◆ QkTable

using Coulomb::QkTable = typedef CoulombTable<Symmetry::Qk>

Stores Coulomb(-like) integrals, assuming Q-like symmetry.

◆ WkTable

using Coulomb::WkTable = typedef CoulombTable<Symmetry::Wk>

Stores Coulomb(-like) integrals, assuming W-like symmetry.

◆ LkTable

using Coulomb::LkTable = typedef CoulombTable<Symmetry::Lk>

Stores Coulomb(-like) integrals, assuming L-like symmetry.

◆ NkTable

using Coulomb::NkTable = typedef CoulombTable<Symmetry::none>

Stores Coulomb(-like) integrals, assuming no symmetry.

Enumeration Type Documentation

◆ Symmetry

enum class Coulomb::Symmetry
strong

Symmetry (state index order) for tables.

Function Documentation

◆ yk_ab() [1/2]

std::vector< double > Coulomb::yk_ab ( const int  k,
const DiracSpinor Fa,
const DiracSpinor Fb,
const std::size_t  maxi = 0 
)

Calculates Hartree Screening functions \(y^k_{ab}(r)\).

maxi is max point to calculate; blank or zero means all the way

◆ yk_ab() [2/2]

void Coulomb::yk_ab ( const int  k,
const DiracSpinor Fa,
const DiracSpinor Fb,
std::vector< double > &  vabk,
const std::size_t  maxi 
)

Overload: does not allocate ykab.

◆ bk_ab()

void Coulomb::bk_ab ( const int  k,
const DiracSpinor Fa,
const DiracSpinor Fb,
std::vector< double > &  b0,
std::vector< double > &  binf,
std::size_t  maxi 
)

Breit b^k function: (0,r) and (r,inf) part stored sepperately (in/out)

◆ gk_ab()

void Coulomb::gk_ab ( const int  k,
const DiracSpinor Fa,
const DiracSpinor Fb,
std::vector< double > &  g0,
std::vector< double > &  ginf,
const std::size_t  maxi 
)

Breit g^k function: (0,r) + (r,inf) part stored together (in/out)

◆ Rk_abcd() [1/2]

double Coulomb::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)

◆ Rk_abcd() [2/2]

double Coulomb::Rk_abcd ( const DiracSpinor Fa,
const DiracSpinor Fc,
const std::vector< double > &  yk_bd 
)

Overload for when y^k_bd already exists [much faster].

◆ Rkv_bcd() [1/3]

DiracSpinor Coulomb::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]

◆ Rkv_bcd() [2/3]

DiracSpinor Coulomb::Rkv_bcd ( const int  kappa_a,
const DiracSpinor Fc,
const std::vector< double > &  ykbd 
)

Overload for when y^k_bd already exists [much faster].

◆ Rkv_bcd() [3/3]

void Coulomb::Rkv_bcd ( DiracSpinor *const  Rkv,
const DiracSpinor Fc,
const std::vector< double > &  ykbd 
)

Overload for when spinor exists. Rkv is overwritten.

◆ Qk_abcd()

double Coulomb::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 YkTable].

◆ Qk_abcd_SR() [1/2]

bool Coulomb::Qk_abcd_SR ( int  k,
int  ka,
int  kb,
int  kc,
int  kd 
)

Just selection rule for Qk_abcd.

◆ Qk_abcd_SR() [2/2]

bool Coulomb::Qk_abcd_SR ( int  k,
const DiracSpinor a,
const DiracSpinor b,
const DiracSpinor c,
const DiracSpinor d 
)

Just selection rule for Qk_abcd.

◆ Pk_abcd_SR() [1/2]

bool Coulomb::Pk_abcd_SR ( int  k,
int  ka,
int  kb,
int  kc,
int  kd 
)

Just selection rule for Pk_abcd.

◆ Pk_abcd_SR() [2/2]

bool Coulomb::Pk_abcd_SR ( int  k,
const DiracSpinor a,
const DiracSpinor b,
const DiracSpinor c,
const DiracSpinor d 
)

Just selection rule for Pk_abcd.

◆ Qkv_bcd()

DiracSpinor Coulomb::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 already have YkTable].

◆ Pk_abcd()

double Coulomb::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].

◆ Pkv_bcd()

DiracSpinor Coulomb::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].

◆ Wk_abcd()

double Coulomb::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)

\[ W^k_{abcd} = Q^k_{abcd} + \sum_l [k] \begin{Bmatrix}a&c&k\\b&d&l\end{Bmatrix} * Q^l_{abdc} \]

\[ W^k_{abcd} = Q^k_{abcd} + P^k_{abcd} \]

◆ g_abcd()

double Coulomb::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.

◆ k_minmax_Ck() [1/2]

std::pair< int, int > Coulomb::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)

◆ k_minmax_Ck() [2/2]

std::pair< int, int > Coulomb::k_minmax_Ck ( int  kappa_a,
int  kappa_b 
)

Returns min and max k (multipolarity) allowed for C^k_ab, accounting for parity (used by k_minmax_Q)

◆ k_minmax_tj()

std::pair< int, int > Coulomb::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, not kappa/l) (used by k_minmax_P,W)

◆ k_minmax_Q() [1/2]

std::pair< int, int > Coulomb::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, so you may safely call k+=2. Guaranteed to be non-zero at min and max, and every 2nd inbetween.

◆ k_minmax_Q() [2/2]

std::pair< int, int > Coulomb::k_minmax_Q ( int  kap_a,
int  kap_b,
int  kap_c,
int  kap_d 
)

Returns min and max k (multipolarity) allowed for Q^k_abcd. Parity rule is included, so you may safely call k+=2. Guaranteed to be non-zero at min and max, and every 2nd inbetween.

◆ k_minmax_P()

std::pair< int, int > Coulomb::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) - so NOT safe to call k+=2. Guaranteed to be non-zero at min and max.

◆ k_minmax_W()

std::pair< int, int > Coulomb::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) - so NOT safe to call k+=2. Cannot guarantee non-zero, since when a=b or c=d, sometimes have P=-Q. But when a!=b and c!=d, guaranteed to be non-zero at min and max.