|
ampsci
High-precision calculations for one- and two-valence atomic systems
|
Base (pure virtual) class to store Coulomb integrals, and similar. 3 derived classes, which account for symmetry. More...
#include <QkTable.hpp>
Public Member Functions | |
| void | fill (const std::vector< DiracSpinor > &basis, const YkTable &yk, int k_cut=-1, bool print=true) |
| Takes a constructed YkTable, and fills Coulomb table with all possible non-zero Qk Coulomb integrals, accounting for symmetry (only allowed for QkTable), up to maximum k, k_cut (set k_cut to <=0 to use all k) | |
| void | fill_if (const std::vector< DiracSpinor > &basis, const YkTable &yk, const SelectionRules &SelectionFunction, int k_cut=-1, bool print=true) |
| Takes a constructed YkTable, and fills Coulomb table with all possible non-zero Qk Coulomb integrals that are allowed by the SelectionFunction, accounting for symmetry (only allowed for QkTable), up to maximum k, k_cut (set k_cut to <=0 to use all k) | |
| void | fill (const std::vector< DiracSpinor > &basis, const CoulombFunction &Fk, const SelectionRules &Fk_SR, int k_cut=-1, bool print=true) |
| auto | operator-> () |
| Gives arrow access to all underlying vector<unordered_map> functions. | |
| void | summary () const |
| For testing: prints details of coulomb integrals stored. | |
| std::size_t | count () const |
| Returns number of stored integrals. | |
| void | add (int k, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d, Real value) |
| adds a new value. Note: does nothing if {k,a,b,c,d} already exists | |
| void | add (int k, nkIndex a, nkIndex b, nkIndex c, nkIndex d, Real value) |
| adds a new value. Note: does nothing if {k,a,b,c,d} already exists | |
| void | add (int k, nk4Index index, Real value) |
| adds a new value. Note: does nothing if {k,a,b,c,d} already exists | |
| void | update (int k, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d, Real value) |
| Updates value in table. If not present, adds new value. | |
| void | update (int k, nkIndex a, nkIndex b, nkIndex c, nkIndex d, Real value) |
| Updates value in table. If not present, adds new value. | |
| void | update (int k, nk4Index index, Real value) |
| Updates value in table. If not present, adds new value. | |
| bool | contains (int k, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d) const |
| Checks if given {k,a,b,c,d} is in the table. | |
| bool | contains (int k, nkIndex a, nkIndex b, nkIndex c, nkIndex d) const |
| Checks if given {k,a,b,c,d} is in the table. | |
| bool | contains (int k, nk4Index index) const |
| Checks if given {k,a,b,c,d} is in the table. | |
| bool | emptyQ () const |
| Returns true if table is empty. | |
| Real | Q (int k, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d) const |
| Retrieve a stored Q. If not present, returns 0. (Returns exactly as stored in table.) | |
| Real | Q (int k, nkIndex a, nkIndex b, nkIndex c, nkIndex d) const |
| Retrieve a stored Q. If not present, returns 0. (Returns exactly as stored in table.) | |
| Real | Q (int k, nk4Index index) const |
| Retrieve a stored Q. If not present, returns 0. (Returns exactly as stored in table.) | |
| Real | R (int k, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d) const |
| Returns 'R', defined via: R := Q / (angular_coef) | |
| Real | R (int k, nkIndex a, nkIndex b, nkIndex c, nkIndex d) const |
| Returns 'R', defined via: R := Q / (angular_coef) | |
| Real | P (int k, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d, const Angular::SixJTable *const sj=nullptr) const |
| 'Exchange-only', defined via W = Q + P. Optionally, takes pointer to 6J table (faster eval of 6J symbols) | |
| Real | P (int k, nkIndex a, nkIndex b, nkIndex c, nkIndex d, const Angular::SixJTable *const sj=nullptr) const |
| 'Exchange-only', defined via W = Q + P. Optionally, takes pointer to 6J table (faster eval of 6J symbols) | |
| Real | P2 (int k, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d, const Angular::SixJTable &sj, const std::vector< double > &fk) const |
| 'Exchange-only', defined via W = Q + P. Optionally, takes pointer to 6J table (faster eval of 6J symbols) - with screening | |
| Real | W (int k, const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d, const Angular::SixJTable *const sj=nullptr) const |
| W^k_abcd = Q^k_abcd + \sum_l [k] 6j * Q^l_abdc. Optionally, takes pointer to 6J table (faster eval of 6J symbols) | |
| Real | W (int k, nkIndex a, nkIndex b, nkIndex c, nkIndex d, const Angular::SixJTable *const sj=nullptr) const |
| W^k_abcd = Q^k_abcd + \sum_l [k] 6j * Q^l_abdc. Optionally, takes pointer to 6J table (faster eval of 6J symbols) | |
| Real | g (const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d, int tma, int tmb, int tmc, int tmd) const |
| Returns 'g_abcd'. | |
| nk4Index | NormalOrder (const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d) const |
| Creates single 'nk4Index' corresponding to 'NormalOrder' symmetry of {a,b,c,d}. | |
| nk4Index | NormalOrder (nkIndex a, nkIndex b, nkIndex c, nkIndex d) const |
| Creates single 'nk4Index' corresponding to 'NormalOrder' symmetry of {a,b,c,d}. | |
| bool | is_NormalOrdered (nkIndex a, nkIndex b, nkIndex c, nkIndex d) const |
| Checks if set {a,b,c,d} are already in NormalOrder. | |
| bool | is_NormalOrdered (const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d) const |
| Checks if set {a,b,c,d} are already in NormalOrder. | |
| void | write (const std::string &fname) const |
| Writes coulomb integrals to disk. | |
| bool | read (const std::string &fname) |
| Reads coulomb integrals to disk. Returns false if none read in. | |
| double * | get (int k, nk4Index index) |
| Directly gets one of the stored elements, given normal-ordered nk4Index. | |
| nk4Index | CurrentOrder (const DiracSpinor &a, const DiracSpinor &b, const DiracSpinor &c, const DiracSpinor &d) const |
| Creates single 'nk4Index', WITHOUT accounting for 'NormalOrder'. Can be used to check if {a,b,c,d} are already in 'NormalOrder'. | |
| nk4Index | CurrentOrder (nkIndex a, nkIndex b, nkIndex c, nkIndex d) const |
| Creates single 'nk4Index', WITHOUT accounting for 'NormalOrder'. Can be used to check if {a,b,c,d} are already in 'NormalOrder'. | |
| std::array< nkIndex, 4 > | UnFormIndex (const nk4Index &index) const |
| Breaks nk4Index back into {ia,ib,ic,id}. Not used. | |
Static Public Member Functions | |
| static nk4Index | FormIndex (nkIndex a, nkIndex b, nkIndex c, nkIndex d) |
| Converts given set of nkIndex's (in any order) to nk4Index. | |
Base (pure virtual) class to store Coulomb integrals, and similar. 3 derived classes, which account for symmetry.
Mostly, a wrapper for std::unordered_map. Stores data in a std::vector of maps, each element (map) for each k (multipolarity). The symmetry is taken into account by defining a "Normal Ordering" of set of orbitals {a,b,c,d}. How this is defined depends on the specific symmetry in question. Qk symmetry: {abcd} = cbad = adcb = cdab = badc = bcda = dabc = dcba. Normal ordering: i = min(a,b,c,d) is first index. Two options (second and fourth may be swapped): choose 2nd to be smallest Wk symmetry (same as g): {abcd} = badc = cdab = dcba Lk symmetry: {abcd} = badc
| void Coulomb::CoulombTable< S >::fill | ( | const std::vector< DiracSpinor > & | basis, |
| const YkTable & | yk, | ||
| int | k_cut = -1, |
||
| bool | print = true |
||
| ) |
Takes a constructed YkTable, and fills Coulomb table with all possible non-zero Qk Coulomb integrals, accounting for symmetry (only allowed for QkTable), up to maximum k, k_cut (set k_cut to <=0 to use all k)
| void Coulomb::CoulombTable< S >::fill_if | ( | const std::vector< DiracSpinor > & | basis, |
| const YkTable & | yk, | ||
| const SelectionRules & | SelectionFunction, | ||
| int | k_cut = -1, |
||
| bool | print = true |
||
| ) |
Takes a constructed YkTable, and fills Coulomb table with all possible non-zero Qk Coulomb integrals that are allowed by the SelectionFunction, accounting for symmetry (only allowed for QkTable), up to maximum k, k_cut (set k_cut to <=0 to use all k)
|
inline |
Gives arrow access to all underlying vector<unordered_map> functions.
| void Coulomb::CoulombTable< S >::summary | ( | ) | const |
For testing: prints details of coulomb integrals stored.
| std::size_t Coulomb::CoulombTable< S >::count | ( | ) | const |
Returns number of stored integrals.
| void Coulomb::CoulombTable< S >::add | ( | int | k, |
| const DiracSpinor & | a, | ||
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d, | ||
| Real | value | ||
| ) |
adds a new value. Note: does nothing if {k,a,b,c,d} already exists
| void Coulomb::CoulombTable< S >::add | ( | int | k, |
| nkIndex | a, | ||
| nkIndex | b, | ||
| nkIndex | c, | ||
| nkIndex | d, | ||
| Real | value | ||
| ) |
adds a new value. Note: does nothing if {k,a,b,c,d} already exists
| void Coulomb::CoulombTable< S >::add | ( | int | k, |
| nk4Index | index, | ||
| Real | value | ||
| ) |
adds a new value. Note: does nothing if {k,a,b,c,d} already exists
| void Coulomb::CoulombTable< S >::update | ( | int | k, |
| const DiracSpinor & | a, | ||
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d, | ||
| Real | value | ||
| ) |
Updates value in table. If not present, adds new value.
| void Coulomb::CoulombTable< S >::update | ( | int | k, |
| nkIndex | a, | ||
| nkIndex | b, | ||
| nkIndex | c, | ||
| nkIndex | d, | ||
| Real | value | ||
| ) |
Updates value in table. If not present, adds new value.
| void Coulomb::CoulombTable< S >::update | ( | int | k, |
| nk4Index | index, | ||
| Real | value | ||
| ) |
Updates value in table. If not present, adds new value.
| bool Coulomb::CoulombTable< S >::contains | ( | int | k, |
| const DiracSpinor & | a, | ||
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d | ||
| ) | const |
Checks if given {k,a,b,c,d} is in the table.
| bool Coulomb::CoulombTable< S >::contains | ( | int | k, |
| nkIndex | a, | ||
| nkIndex | b, | ||
| nkIndex | c, | ||
| nkIndex | d | ||
| ) | const |
Checks if given {k,a,b,c,d} is in the table.
| bool Coulomb::CoulombTable< S >::contains | ( | int | k, |
| nk4Index | index | ||
| ) | const |
Checks if given {k,a,b,c,d} is in the table.
|
inline |
Returns true if table is empty.
| double Coulomb::CoulombTable< S >::Q | ( | int | k, |
| const DiracSpinor & | a, | ||
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d | ||
| ) | const |
Retrieve a stored Q. If not present, returns 0. (Returns exactly as stored in table.)
| double Coulomb::CoulombTable< S >::Q | ( | int | k, |
| nkIndex | a, | ||
| nkIndex | b, | ||
| nkIndex | c, | ||
| nkIndex | d | ||
| ) | const |
Retrieve a stored Q. If not present, returns 0. (Returns exactly as stored in table.)
| double Coulomb::CoulombTable< S >::Q | ( | int | k, |
| nk4Index | index | ||
| ) | const |
Retrieve a stored Q. If not present, returns 0. (Returns exactly as stored in table.)
| double Coulomb::CoulombTable< S >::R | ( | int | k, |
| const DiracSpinor & | a, | ||
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d | ||
| ) | const |
Returns 'R', defined via: R := Q / (angular_coef)
| double Coulomb::CoulombTable< S >::R | ( | int | k, |
| nkIndex | a, | ||
| nkIndex | b, | ||
| nkIndex | c, | ||
| nkIndex | d | ||
| ) | const |
Returns 'R', defined via: R := Q / (angular_coef)
| double Coulomb::CoulombTable< S >::P | ( | int | k, |
| const DiracSpinor & | a, | ||
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d, | ||
| const Angular::SixJTable *const | sj = nullptr |
||
| ) | const |
'Exchange-only', defined via W = Q + P. Optionally, takes pointer to 6J table (faster eval of 6J symbols)
| double Coulomb::CoulombTable< S >::P | ( | int | k, |
| nkIndex | a, | ||
| nkIndex | b, | ||
| nkIndex | c, | ||
| nkIndex | d, | ||
| const Angular::SixJTable *const | sj = nullptr |
||
| ) | const |
'Exchange-only', defined via W = Q + P. Optionally, takes pointer to 6J table (faster eval of 6J symbols)
| double Coulomb::CoulombTable< S >::P2 | ( | int | k, |
| const DiracSpinor & | a, | ||
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d, | ||
| const Angular::SixJTable & | sj, | ||
| const std::vector< double > & | fk | ||
| ) | const |
'Exchange-only', defined via W = Q + P. Optionally, takes pointer to 6J table (faster eval of 6J symbols) - with screening
| double Coulomb::CoulombTable< S >::W | ( | int | k, |
| const DiracSpinor & | a, | ||
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d, | ||
| const Angular::SixJTable *const | sj = nullptr |
||
| ) | const |
W^k_abcd = Q^k_abcd + \sum_l [k] 6j * Q^l_abdc. Optionally, takes pointer to 6J table (faster eval of 6J symbols)
| double Coulomb::CoulombTable< S >::W | ( | int | k, |
| nkIndex | a, | ||
| nkIndex | b, | ||
| nkIndex | c, | ||
| nkIndex | d, | ||
| const Angular::SixJTable *const | sj = nullptr |
||
| ) | const |
W^k_abcd = Q^k_abcd + \sum_l [k] 6j * Q^l_abdc. Optionally, takes pointer to 6J table (faster eval of 6J symbols)
| double Coulomb::CoulombTable< S >::g | ( | const DiracSpinor & | a, |
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d, | ||
| int | tma, | ||
| int | tmb, | ||
| int | tmc, | ||
| int | tmd | ||
| ) | const |
Returns 'g_abcd'.
| nk4Index Coulomb::CoulombTable< S >::NormalOrder | ( | const DiracSpinor & | a, |
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d | ||
| ) | const |
Creates single 'nk4Index' corresponding to 'NormalOrder' symmetry of {a,b,c,d}.
| nk4Index Coulomb::CoulombTable< S >::NormalOrder | ( | nkIndex | a, |
| nkIndex | b, | ||
| nkIndex | c, | ||
| nkIndex | d | ||
| ) | const |
Creates single 'nk4Index' corresponding to 'NormalOrder' symmetry of {a,b,c,d}.
|
inline |
Checks if set {a,b,c,d} are already in NormalOrder.
|
inline |
Checks if set {a,b,c,d} are already in NormalOrder.
| void Coulomb::CoulombTable< S >::write | ( | const std::string & | fname | ) | const |
Writes coulomb integrals to disk.
| bool Coulomb::CoulombTable< S >::read | ( | const std::string & | fname | ) |
Reads coulomb integrals to disk. Returns false if none read in.
| double * Coulomb::CoulombTable< S >::get | ( | int | k, |
| nk4Index | index | ||
| ) |
Directly gets one of the stored elements, given normal-ordered nk4Index.
| nk4Index Coulomb::CoulombTable< S >::CurrentOrder | ( | const DiracSpinor & | a, |
| const DiracSpinor & | b, | ||
| const DiracSpinor & | c, | ||
| const DiracSpinor & | d | ||
| ) | const |
Creates single 'nk4Index', WITHOUT accounting for 'NormalOrder'. Can be used to check if {a,b,c,d} are already in 'NormalOrder'.
| nk4Index Coulomb::CoulombTable< S >::CurrentOrder | ( | nkIndex | a, |
| nkIndex | b, | ||
| nkIndex | c, | ||
| nkIndex | d | ||
| ) | const |
Creates single 'nk4Index', WITHOUT accounting for 'NormalOrder'. Can be used to check if {a,b,c,d} are already in 'NormalOrder'.
|
static |
Converts given set of nkIndex's (in any order) to nk4Index.
| std::array< nkIndex, 4 > Coulomb::CoulombTable< S >::UnFormIndex | ( | const nk4Index & | index | ) | const |
Breaks nk4Index back into {ia,ib,ic,id}. Not used.