SIRIUS 7.5.0
Electronic structure library and applications
Public Member Functions | Private Attributes | List of all members
sirius::Gaunt_coefficients< T > Class Template Reference

Compact storage of non-zero Gaunt coefficients \( \langle \ell_1 m_1 | \ell_3 m_3 | \ell_2 m_2 \rangle \). More...

#include <gaunt.hpp>

Public Member Functions

 Gaunt_coefficients (int lmax1__, int lmax3__, int lmax2__, std::function< T(int, int, int, int, int, int)> get__)
 Class constructor. More...
 
int num_gaunt (int lm3) const
 Return number of non-zero Gaunt coefficients for a given lm3. More...
 
gaunt_L1_L2< T > const & gaunt (int lm3, int idx) const
 Return a structure containing {lm1, lm2, coef} for a given lm3 and index. More...
 
int num_gaunt (int lm1, int lm2) const
 Return number of non-zero Gaunt coefficients for a combination of lm1 and lm2. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
auto get_full_set_L3 () const
 Return the full tensor of Gaunt coefficients <R_{L1}|R_{L3}|R_{L2}> with a (L3, L1, L2) order of indices. More...
 

Private Attributes

int lmax1_
 lmax of <lm1| More...
 
int lmmax1_
 lmmax of <lm1| More...
 
int lmax3_
 lmax of inner real or complex spherical harmonic More...
 
int lmmax3_
 lmmax of inner real or complex spherical harmonic More...
 
int lmax2_
 lmax of |lm2> More...
 
int lmmax2_
 lmmax of |lm2> More...
 
sddk::mdarray< std::vector< gaunt_L1_L2< T > >, 1 > gaunt_packed_L1_L2_
 List of non-zero Gaunt coefficients for each lm3. More...
 
sddk::mdarray< std::vector< gaunt_L3< T > >, 2 > gaunt_packed_L3_
 List of non-zero Gaunt coefficients for each combination of lm1, lm2. More...
 

Detailed Description

template<typename T>
class sirius::Gaunt_coefficients< T >

Compact storage of non-zero Gaunt coefficients \( \langle \ell_1 m_1 | \ell_3 m_3 | \ell_2 m_2 \rangle \).

Very important! The following notation is adopted and used everywhere: lm1 and lm2 represent 'bra' and 'ket' spherical harmonics of the Gaunt integral and lm3 represent the inner spherical harmonic.

Definition at line 57 of file gaunt.hpp.

Constructor & Destructor Documentation

◆ Gaunt_coefficients()

template<typename T >
sirius::Gaunt_coefficients< T >::Gaunt_coefficients ( int  lmax1__,
int  lmax3__,
int  lmax2__,
std::function< T(int, int, int, int, int, int)>  get__ 
)
inline

Class constructor.

Definition at line 83 of file gaunt.hpp.

Member Function Documentation

◆ num_gaunt() [1/2]

template<typename T >
int sirius::Gaunt_coefficients< T >::num_gaunt ( int  lm3) const
inline

Return number of non-zero Gaunt coefficients for a given lm3.

Definition at line 126 of file gaunt.hpp.

◆ gaunt() [1/2]

template<typename T >
gaunt_L1_L2< T > const & sirius::Gaunt_coefficients< T >::gaunt ( int  lm3,
int  idx 
) const
inline

Return a structure containing {lm1, lm2, coef} for a given lm3 and index.

Example:

for (int lm3 = 0; lm3 < lmmax3; lm3++)
{
for (int i = 0; i < gaunt_coefs.num_gaunt(lm3); i++) {
int lm1 = gaunt_coefs.gaunt(lm3, i).lm1;
int lm2 = gaunt_coefs.gaunt(lm3, i).lm2;
double coef = gaunt_coefs.gaunt(lm3, i).coef;
// do something with lm1,lm2,lm3 and coef
}
}

Definition at line 147 of file gaunt.hpp.

◆ num_gaunt() [2/2]

template<typename T >
int sirius::Gaunt_coefficients< T >::num_gaunt ( int  lm1,
int  lm2 
) const
inline

Return number of non-zero Gaunt coefficients for a combination of lm1 and lm2.

Definition at line 155 of file gaunt.hpp.

◆ gaunt() [2/2]

template<typename T >
gaunt_L3< T > const & sirius::Gaunt_coefficients< T >::gaunt ( int  lm1,
int  lm2,
int  idx 
) const
inline

Return a structure containing {lm3, coef} for a given lm1, lm2 and index.

Definition at line 161 of file gaunt.hpp.

◆ sum_L3_gaunt() [1/2]

template<typename T >
auto sirius::Gaunt_coefficients< T >::sum_L3_gaunt ( int  lm1,
int  lm2,
std::complex< double > const *  v 
) const
inline

Return a sum over L3 (lm3) index of Gaunt coefficients and a complex vector.

The following operation is performed:

\[ \sum_{\ell_3 m_3} \langle \ell_1 m_1 | \ell_3 m_3 | \ell_2 m_2 \rangle v_{\ell_3 m_3} \]

Result is assumed to be complex.

Definition at line 173 of file gaunt.hpp.

◆ sum_L3_gaunt() [2/2]

template<typename T >
T sirius::Gaunt_coefficients< T >::sum_L3_gaunt ( int  lm1,
int  lm2,
double const *  v 
) const
inline

Return a sum over L3 (lm3) index of Gaunt coefficients and a real vector.

The following operation is performed:

\[ \sum_{\ell_3 m_3} \langle \ell_1 m_1 | \ell_3 m_3 | \ell_2 m_2 \rangle v_{\ell_3 m_3} \]

Result is assumed to be of the same type as Gaunt coefficients.

Definition at line 189 of file gaunt.hpp.

◆ gaunt_vector()

template<typename T >
std::vector< gaunt_L3< T > > const & sirius::Gaunt_coefficients< T >::gaunt_vector ( int  lm1,
int  lm2 
) const
inline

Return vector of non-zero Gaunt coefficients for a given combination of lm1 and lm2.

Definition at line 199 of file gaunt.hpp.

◆ get_full_set_L3()

template<typename T >
auto sirius::Gaunt_coefficients< T >::get_full_set_L3 ( ) const
inline

Return the full tensor of Gaunt coefficients <R_{L1}|R_{L3}|R_{L2}> with a (L3, L1, L2) order of indices.

Definition at line 205 of file gaunt.hpp.

Member Data Documentation

◆ lmax1_

template<typename T >
int sirius::Gaunt_coefficients< T >::lmax1_
private

lmax of <lm1|

Definition at line 61 of file gaunt.hpp.

◆ lmmax1_

template<typename T >
int sirius::Gaunt_coefficients< T >::lmmax1_
private

lmmax of <lm1|

Definition at line 63 of file gaunt.hpp.

◆ lmax3_

template<typename T >
int sirius::Gaunt_coefficients< T >::lmax3_
private

lmax of inner real or complex spherical harmonic

Definition at line 66 of file gaunt.hpp.

◆ lmmax3_

template<typename T >
int sirius::Gaunt_coefficients< T >::lmmax3_
private

lmmax of inner real or complex spherical harmonic

Definition at line 68 of file gaunt.hpp.

◆ lmax2_

template<typename T >
int sirius::Gaunt_coefficients< T >::lmax2_
private

lmax of |lm2>

Definition at line 71 of file gaunt.hpp.

◆ lmmax2_

template<typename T >
int sirius::Gaunt_coefficients< T >::lmmax2_
private

lmmax of |lm2>

Definition at line 73 of file gaunt.hpp.

◆ gaunt_packed_L1_L2_

template<typename T >
sddk::mdarray<std::vector<gaunt_L1_L2<T> >, 1> sirius::Gaunt_coefficients< T >::gaunt_packed_L1_L2_
private

List of non-zero Gaunt coefficients for each lm3.

Definition at line 76 of file gaunt.hpp.

◆ gaunt_packed_L3_

template<typename T >
sddk::mdarray<std::vector<gaunt_L3<T> >, 2> sirius::Gaunt_coefficients< T >::gaunt_packed_L3_
private

List of non-zero Gaunt coefficients for each combination of lm1, lm2.

Definition at line 79 of file gaunt.hpp.


The documentation for this class was generated from the following file: