ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
hamilt::Nonlocal_maths< FPTYPE, Device > Class Template Reference

#include <nonlocal_maths.h>

Collaboration diagram for hamilt::Nonlocal_maths< FPTYPE, Device >:

Public Member Functions

 Nonlocal_maths (const pseudopot_cell_vnl *nlpp_in, const UnitCell *ucell_in)
 Nonlocal_maths (const ModuleBase::matrix &nhtol, const int lmax, const UnitCell *ucell_in)
std::vector< FPTYPE > cal_gk (int ik, const ModulePW::PW_Basis_K *pw_basis)
 this function prepares all the q (G+k) information in one contiguous memory block including the x, y and z components, its norm and the reciprocal of its norm
void cal_ylm (int lmax, int npw, const FPTYPE *gk_in, FPTYPE *ylm)
 calculate the real spherical harmonic functions on cpu (and optionally send to gpu, if gpu is available)
void cal_ylm_deri (int lmax, int npw, const FPTYPE *gk_in, FPTYPE *ylm_deri)
 calculate the derivate of the sperical bessel function for projections
std::vector< std::complex< FPTYPE > > cal_pref (int it, const int nh)
 calculate the (-i)^l factors
void cal_vkb (int it, int ia, int npw, const FPTYPE *vq_in, const FPTYPE *ylm_in, const std::complex< FPTYPE > *sk_in, const std::complex< FPTYPE > *pref_in, std::complex< FPTYPE > *vkb_out)
void cal_vkb_deri (int it, int ia, int npw, int ipol, int jpol, const FPTYPE *vq_in, const FPTYPE *vq_deri_in, const FPTYPE *ylm_in, const FPTYPE *ylm_deri_in, const std::complex< FPTYPE > *sk_in, const std::complex< FPTYPE > *pref_in, const FPTYPE *gk_in, std::complex< FPTYPE > *vkb_out)
 calculate the dvkb matrix for this atom
void prepare_vkb_ptr (int nbeta, double *nhtol, int nhtol_nc, int npw, int it, std::complex< FPTYPE > *vkb_out, std::complex< FPTYPE > **vkb_ptrs, FPTYPE *ylm_in, FPTYPE **ylm_ptrs, FPTYPE *vq_in, FPTYPE **vq_ptrs)
 calculate the ptr used in vkb_op
void cal_dvkb_index (const int nbeta, const double *nhtol, const int nhtol_nc, const int npw, const int it, const int ipol, const int jpol, int *indexes)

Static Public Member Functions

static void dylmr2 (const int nylm, const int ngy, const FPTYPE *gk, FPTYPE *dylm, const int ipol)
static FPTYPE Polynomial_Interpolation_nl (const ModuleBase::realArray &table, const int &dim1, const int &dim2, const FPTYPE &table_interval, const FPTYPE &x)
 polynomial interpolation tool for calculate derivate of vq

Private Attributes

ModuleBase::matrix nhtol_
int lmax_ = 0
const UnitCell * ucell_ = nullptr
Device * ctx = {}
base_device::DEVICE_CPU * cpu_ctx = {}
base_device::AbacusDevice_t device = {}

Constructor & Destructor Documentation

◆ Nonlocal_maths() [1/2]

template<typename FPTYPE, typename Device>
hamilt::Nonlocal_maths< FPTYPE, Device >::Nonlocal_maths ( const pseudopot_cell_vnl * nlpp_in,
const UnitCell * ucell_in )
Here is the call graph for this function:

◆ Nonlocal_maths() [2/2]

template<typename FPTYPE, typename Device>
hamilt::Nonlocal_maths< FPTYPE, Device >::Nonlocal_maths ( const ModuleBase::matrix & nhtol,
const int lmax,
const UnitCell * ucell_in )
Here is the call graph for this function:

Member Function Documentation

◆ cal_dvkb_index()

template<typename FPTYPE, typename Device>
void hamilt::Nonlocal_maths< FPTYPE, Device >::cal_dvkb_index ( const int nbeta,
const double * nhtol,
const int nhtol_nc,
const int npw,
const int it,
const int ipol,
const int jpol,
int * indexes )

calculate the indexes used in vkb_deri_op indexes save (lm, nb, dylm_lm_ipol, dylm_lm_jpol) for nh

Here is the caller graph for this function:

◆ cal_gk()

template<typename FPTYPE, typename Device>
std::vector< FPTYPE > hamilt::Nonlocal_maths< FPTYPE, Device >::cal_gk ( int ik,
const ModulePW::PW_Basis_K * pw_basis )

this function prepares all the q (G+k) information in one contiguous memory block including the x, y and z components, its norm and the reciprocal of its norm

Parameters
ikindex of k point
pw_basisthe plane wave basis
Returns
std::vector<FPTYPE> 1d contiguous memory block containing all the q information. The first 3*npw are data of x, y and z components, the next 2*npw are data of norm and 1/norm. This is beneficial for GPU memory access.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_pref()

template<typename FPTYPE, typename Device>
std::vector< std::complex< FPTYPE > > hamilt::Nonlocal_maths< FPTYPE, Device >::cal_pref ( int it,
const int nh )

calculate the (-i)^l factors

Here is the caller graph for this function:

◆ cal_vkb()

template<typename FPTYPE, typename Device>
void hamilt::Nonlocal_maths< FPTYPE, Device >::cal_vkb ( int it,
int ia,
int npw,
const FPTYPE * vq_in,
const FPTYPE * ylm_in,
const std::complex< FPTYPE > * sk_in,
const std::complex< FPTYPE > * pref_in,
std::complex< FPTYPE > * vkb_out )

calculate the vkb matrix for this atom vkb = sum_lm (-i)^l * ylm(g^) * vq(g^) * sk(g^)

◆ cal_vkb_deri()

template<typename FPTYPE, typename Device>
void hamilt::Nonlocal_maths< FPTYPE, Device >::cal_vkb_deri ( int it,
int ia,
int npw,
int ipol,
int jpol,
const FPTYPE * vq_in,
const FPTYPE * vq_deri_in,
const FPTYPE * ylm_in,
const FPTYPE * ylm_deri_in,
const std::complex< FPTYPE > * sk_in,
const std::complex< FPTYPE > * pref_in,
const FPTYPE * gk_in,
std::complex< FPTYPE > * vkb_out )

calculate the dvkb matrix for this atom

◆ cal_ylm()

template<typename FPTYPE, typename Device>
void hamilt::Nonlocal_maths< FPTYPE, Device >::cal_ylm ( int lmax,
int npw,
const FPTYPE * gk_in,
FPTYPE * ylm )

calculate the real spherical harmonic functions on cpu (and optionally send to gpu, if gpu is available)

Parameters
lmax[in] maximum angular momentum to calculate
npw[in] number of G+k vectors
gk_in[in] the G+k vectors
ylm[out] the spherical harmonic functions
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_ylm_deri()

template<typename FPTYPE, typename Device>
void hamilt::Nonlocal_maths< FPTYPE, Device >::cal_ylm_deri ( int lmax,
int npw,
const FPTYPE * gk_in,
FPTYPE * ylm_deri )

calculate the derivate of the sperical bessel function for projections

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dylmr2()

template<typename FPTYPE, typename Device>
void hamilt::Nonlocal_maths< FPTYPE, Device >::dylmr2 ( const int nylm,
const int ngy,
const FPTYPE * gk,
FPTYPE * dylm,
const int ipol )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Polynomial_Interpolation_nl()

template<typename FPTYPE, typename Device>
FPTYPE hamilt::Nonlocal_maths< FPTYPE, Device >::Polynomial_Interpolation_nl ( const ModuleBase::realArray & table,
const int & dim1,
const int & dim2,
const FPTYPE & table_interval,
const FPTYPE & x )
static

polynomial interpolation tool for calculate derivate of vq

◆ prepare_vkb_ptr()

template<typename FPTYPE, typename Device>
void hamilt::Nonlocal_maths< FPTYPE, Device >::prepare_vkb_ptr ( int nbeta,
double * nhtol,
int nhtol_nc,
int npw,
int it,
std::complex< FPTYPE > * vkb_out,
std::complex< FPTYPE > ** vkb_ptrs,
FPTYPE * ylm_in,
FPTYPE ** ylm_ptrs,
FPTYPE * vq_in,
FPTYPE ** vq_ptrs )

calculate the ptr used in vkb_op

Member Data Documentation

◆ cpu_ctx

template<typename FPTYPE, typename Device>
base_device::DEVICE_CPU* hamilt::Nonlocal_maths< FPTYPE, Device >::cpu_ctx = {}
private

◆ ctx

template<typename FPTYPE, typename Device>
Device* hamilt::Nonlocal_maths< FPTYPE, Device >::ctx = {}
private

◆ device

template<typename FPTYPE, typename Device>
base_device::AbacusDevice_t hamilt::Nonlocal_maths< FPTYPE, Device >::device = {}
private

◆ lmax_

template<typename FPTYPE, typename Device>
int hamilt::Nonlocal_maths< FPTYPE, Device >::lmax_ = 0
private

◆ nhtol_

template<typename FPTYPE, typename Device>
ModuleBase::matrix hamilt::Nonlocal_maths< FPTYPE, Device >::nhtol_
private

◆ ucell_

template<typename FPTYPE, typename Device>
const UnitCell* hamilt::Nonlocal_maths< FPTYPE, Device >::ucell_ = nullptr
private

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