83 Gaunt_coefficients(
int lmax1__,
int lmax3__,
int lmax2__, std::function<T(
int,
int,
int,
int,
int,
int)> get__)
98 for (
int l1 = 0, lm1 = 0; l1 <=
lmax1_; l1++) {
99 for (
int m1 = -l1; m1 <= l1; m1++, lm1++) {
100 for (
int l2 = 0, lm2 = 0; l2 <=
lmax2_; l2++) {
101 for (
int m2 = -l2; m2 <= l2; m2++, lm2++) {
102 for (
int l3 = 0, lm3 = 0; l3 <=
lmax3_; l3++) {
103 for (
int m3 = -l3; m3 <= l3; m3++, lm3++) {
105 T gc = get__(l1, l3, l2, m1, m3, m2);
106 if (std::abs(gc) > 1e-12) {
128 assert(lm3 >= 0 && lm3 <
lmmax3_);
149 assert(lm3 >= 0 && lm3 <
lmmax3_);
173 inline auto sum_L3_gaunt(
int lm1,
int lm2, std::complex<double>
const* v)
const
175 std::complex<double> zsum(0, 0);
199 inline std::vector<gaunt_L3<T>>
const&
gaunt_vector(
int lm1,
int lm2)
const
209 for (
int lm2 = 0; lm2 <
lmmax2_; lm2++) {
210 for (
int lm1 = 0; lm1 <
lmmax1_; lm1++) {
Compact storage of non-zero Gaunt coefficients .
int lmmax2_
lmmax of |lm2>
auto get_full_set_L3() const
Return the full tensor of Gaunt coefficients <R_{L1}|R_{L3}|R_{L2}> with a (L3, L1,...
sddk::mdarray< std::vector< gaunt_L3< T > >, 2 > gaunt_packed_L3_
List of non-zero Gaunt coefficients for each combination of lm1, lm2.
auto sum_L3_gaunt(int lm1, int lm2, std::complex< double > const *v) const
Return a sum over L3 (lm3) index of Gaunt coefficients and a complex vector.
int num_gaunt(int lm3) const
Return number of non-zero Gaunt coefficients for a given lm3.
int lmax3_
lmax of inner real or complex spherical harmonic
int lmmax1_
lmmax of <lm1|
std::vector< gaunt_L3< T > > const & gaunt_vector(int lm1, int lm2) const
Return vector of non-zero Gaunt coefficients for a given combination of lm1 and lm2.
gaunt_L3< T > const & gaunt(int lm1, int lm2, int idx) const
Return a structure containing {lm3, coef} for a given lm1, lm2 and index.
int lmmax3_
lmmax of inner real or complex spherical harmonic
int num_gaunt(int lm1, int lm2) const
Return number of non-zero Gaunt coefficients for a combination of lm1 and lm2.
T sum_L3_gaunt(int lm1, int lm2, double const *v) const
Return a sum over L3 (lm3) index of Gaunt coefficients and a real vector.
Gaunt_coefficients(int lmax1__, int lmax3__, int lmax2__, std::function< T(int, int, int, int, int, int)> get__)
Class constructor.
gaunt_L1_L2< T > const & gaunt(int lm3, int idx) const
Return a structure containing {lm1, lm2, coef} for a given lm3 and index.
sddk::mdarray< std::vector< gaunt_L1_L2< T > >, 1 > gaunt_packed_L1_L2_
List of non-zero Gaunt coefficients for each lm3.
Multidimensional array with the column-major (Fortran) order.
void zero(memory_t mem__, size_t idx0__, size_t n__)
Zero n elements starting from idx0.
Memory management functions and classes.
int lmmax(int lmax)
Maximum number of combinations for a given .
Namespace of the SIRIUS library.
Used in the {lm1, lm2, coefficient} : {lm3} way of grouping non-zero Gaunt coefficients.
Used in the {lm1, lm2} : {lm3, coefficient} way of grouping non-zero Gaunt coefficients.
Contains typedefs, enums and simple descriptors.