ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
RadialProjection::RadialProjector Class Reference

RadialProjector is for projecting a function who has seperatable radial and angular parts: f(r) = f(|r|) * Ylm(theta, phi) onto planewave basis. More...

#include <radial_proj.h>

Collaboration diagram for RadialProjection::RadialProjector:

Public Member Functions

 RadialProjector (const bool realspace=false)
 Construct a new Radial Projector object.
 
 ~RadialProjector ()
 
void _build_sbt_tab (const int nr, const double *r, const std::vector< double * > &radials, const std::vector< int > &l, const int nq, const double &dq)
 make a interpolation table for the Spherical Bessel Transform of f(r)
 
void _build_sbt_tab (const std::vector< double > &r, const std::vector< std::vector< double > > &radials, const std::vector< int > &l, const int nq, const double &dq)
 
void _build_sbt_tab (const std::vector< int > &nproj, const std::vector< double > &r, const std::vector< std::vector< double > > &radials, const std::vector< int > &l, const int nq, const double &dq, const double &omega, const int npol, ModuleBase::realArray &tab, ModuleBase::matrix &nhtol)
 
void sbtft (const std::vector< ModuleBase::Vector3< double > > &qs, std::vector< std::complex< double > > &out, const char type='r', const double &omega=1.0, const double &tpiba=1.0)
 perform analytical version of the Fourier transform: F(q) = int(f(r)*exp(-iq.r) d^3r) = 4*pi/sqrt(omega) * (-i)^l * Jl[f](q) * Ylm(q) , where Ylm(q) is real spherical harmonic function, and Jl[f](q) is the Spherial Bessel Transform of f(r): Jl[f](q) = int(f(r)*j_l(q*r)*r^2 dr) , where j_l(q*r) is the spherical Bessel function of the first kind. . If use another notation, F(q) = <q|f>, this is denoted as type "r" for ket |>, and "l" for bra <|.
 
void sbfft ()
 

Static Public Member Functions

static void _build_backward_map (const std::vector< std::vector< int > > &it2iproj, const std::vector< int > &iproj2l, std::vector< int > &irow2it, std::vector< int > &irow2iproj, std::vector< int > &irow2m)
 
static void _build_forward_map (const std::vector< std::vector< int > > &it2ia, const std::vector< std::vector< int > > &it2iproj, const std::vector< int > &iproj2l, std::map< std::tuple< int, int, int, int >, int > &itiaiprojm2irow)
 

Private Attributes

std::unique_ptr< ModuleBase::CubicSplinecubspl_
 
std::vector< int > l_
 

Detailed Description

RadialProjector is for projecting a function who has seperatable radial and angular parts: f(r) = f(|r|) * Ylm(theta, phi) onto planewave basis.

Usage:

  1. classical way: reciprocal space integration
    ++
    RadialProjector rp(false);
    const int nq = 1000;
    const double dq = 0.01;
    // given `r` is the real space grid and `radials` is the collection of radial
    // functions, `l` is the angular momentum quantum number for each radial function
    // then the interpolation table can be rapidly built by calling SphericalBesselTransformer
    // and CubicSpline modules.
    rp._build_sbt_tab(r, radials, l, nq, dq);
    // then the set of q will used to calculate the Fourier transform
    rp.sbtft(qs, out, 'r', omega, tpiba);
    // in `out`, there will be the Fourier transform of the radial functions organized
    // in the same way as the input `radials` and `qs`, as row and column respectively.
    // but one should note for each radials, there are 2*l+1 components now instead of
    // just one.
    // one may find it is not easy to maintain such a large table, so here, also provides
    // a tool function to map the 2D index to 1D index, and vice versa. With the angular
    // momentum used in function _build_sbt_tab, one can easily build a map from
    // [irad][im] to 1D index, and use two functions _irad_m_to_idx and _idx_to_irad_m
    // to convert between 1D index and [irad][m] (instead of im!).
    std::vector<std::vector<int>> map_;
    rp._build_sbtft_map(l, map_);
    RadialProjector is for projecting a function who has seperatable radial and angular parts: f(r) = f(|...
    Definition radial_proj.h:67
  2. SBFFT: small box fast-fourier-transform (not implemented yet)

Constructor & Destructor Documentation

◆ RadialProjector()

RadialProjection::RadialProjector::RadialProjector ( const bool  realspace = false)
inline

Construct a new Radial Projector object.

Parameters
realspaceif perform integration in real space rather than reciprocal space , default is false
Attention
Currectly only reciprocal space method is implemented

◆ ~RadialProjector()

RadialProjection::RadialProjector::~RadialProjector ( )
inline

Member Function Documentation

◆ _build_backward_map()

void RadialProjection::RadialProjector::_build_backward_map ( const std::vector< std::vector< int > > &  it2iproj,
const std::vector< int > &  iproj2l,
std::vector< int > &  irow2it,
std::vector< int > &  irow2iproj,
std::vector< int > &  irow2m 
)
static

Notation of following two functions:

Given all the projectors are listed in a series, so the iproj is the index goes across all atomtypes, which means if for the first type, the iproj goes from 0 to 4, then the second atomtypes the iproj will start from 5, and so on... However, there is also another convention, like numerical atomic orbitals, developer always use "l" to index orbitals, here, in all output map, the iproj will start from 0, which

means in output the <tt>iproj</tt> is local index.

First, the following lists should be prepared as early as possible,

it2iproj: for given it, the index of atom type, return the list of index of projectors.

iproj2l: for given iproj, the index of projectors, return the l of this projector. More simply explaning, it is just the list of angular momentum of projectors.

it2ia: just a list that stolen information from UnitCell, for given it, the index of atom within the range of it. So this list is different from the it2iproj, iproj is the index across type but ia is the index within the type. So for each it2ia[it], the ia, in principle , always/can start from 0.

One may question that does the indexing support one atom type with multiple projectors? The answer is YES. Combining the it2iproj and it2ia, one can even support PART of atoms of one

type has multiple projectors.

Then the returned lists,

irow2it: for given irow, the index of row, return the it: the index of atom type.

irow2ia: for given irow, the index of row, return the ia: the index of atom within the range of it.

irow2iproj: for given irow, the index of row, return the iproj, the index of projectors, note that this iproj is the local index.

irow2m: for given irow, the index of row, return the m, the magnetic quantum number of this projector.

One may complain that cannot get l from the irow, but the truth is, not exactly. One can get the l starting from irow by:

++
const int iproj = irow2iproj[irow];
const int it = irow2it[irow];
const int iproj_g = it2iproj[it][iproj];
const int l = iproj2l[iproj_g];
Here is the caller graph for this function:

◆ _build_forward_map()

void RadialProjection::RadialProjector::_build_forward_map ( const std::vector< std::vector< int > > &  it2ia,
const std::vector< std::vector< int > > &  it2iproj,
const std::vector< int > &  iproj2l,
std::map< std::tuple< int, int, int, int >, int > &  itiaiprojm2irow 
)
static
Here is the caller graph for this function:

◆ _build_sbt_tab() [1/3]

void RadialProjection::RadialProjector::_build_sbt_tab ( const int  nr,
const double *  r,
const std::vector< double * > &  radials,
const std::vector< int > &  l,
const int  nq,
const double &  dq 
)

make a interpolation table for the Spherical Bessel Transform of f(r)

Parameters
nrnumber of grid points, shared by all radial functions
rradial grids, shared by all radial functions
radialsradial functions, each element is a radial function
langular momentum quantum number for each radial function
nqnumber of q-points
dqspace between q-points
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _build_sbt_tab() [2/3]

void RadialProjection::RadialProjector::_build_sbt_tab ( const std::vector< double > &  r,
const std::vector< std::vector< double > > &  radials,
const std::vector< int > &  l,
const int  nq,
const double &  dq 
)
Here is the call graph for this function:

◆ _build_sbt_tab() [3/3]

void RadialProjection::RadialProjector::_build_sbt_tab ( const std::vector< int > &  nproj,
const std::vector< double > &  r,
const std::vector< std::vector< double > > &  radials,
const std::vector< int > &  l,
const int  nq,
const double &  dq,
const double &  omega,
const int  npol,
ModuleBase::realArray tab,
ModuleBase::matrix nhtol 
)
Here is the call graph for this function:

◆ sbfft()

void RadialProjection::RadialProjector::sbfft ( )

◆ sbtft()

void RadialProjection::RadialProjector::sbtft ( const std::vector< ModuleBase::Vector3< double > > &  qs,
std::vector< std::complex< double > > &  out,
const char  type = 'r',
const double &  omega = 1.0,
const double &  tpiba = 1.0 
)

perform analytical version of the Fourier transform: F(q) = int(f(r)*exp(-iq.r) d^3r) = 4*pi/sqrt(omega) * (-i)^l * Jl[f](q) * Ylm(q) , where Ylm(q) is real spherical harmonic function, and Jl[f](q) is the Spherial Bessel Transform of f(r): Jl[f](q) = int(f(r)*j_l(q*r)*r^2 dr) , where j_l(q*r) is the spherical Bessel function of the first kind. . If use another notation, F(q) = <q|f>, this is denoted as type "r" for ket |>, and "l" for bra <|.

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

Member Data Documentation

◆ cubspl_

std::unique_ptr<ModuleBase::CubicSpline> RadialProjection::RadialProjector::cubspl_
private

◆ l_

std::vector<int> RadialProjection::RadialProjector::l_
private

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