Hex  2.2
Hydrogen-electron collision solver
Public Member Functions | Static Public Member Functions
RadialIntegrals Class Reference

Class that calculates and manages the radial integrals for given B-spline bases. More...

#include <radial.h>

Public Member Functions

 RadialIntegrals (Bspline const &bspline_x, Bspline const &bspline_y, int Nlambdas)
 Constructor. More...
 
void setupOneElectronIntegrals (bool sharedscratch=false, bool iammaster=true)
 Calculate one-electron integral matrices. More...
 
void setupOneElectronIntegrals (Parallel const &par, CommandLine const &cmd)
 Calculate one-electron integral matrices. More...
 
void setupTwoElectronIntegrals (Parallel const &par, CommandLine const &cmd)
 Calculate the two-electron integral matrix. More...
 
void verbose (bool v)
 Verbosity control. More...
 
int maxlambda () const
 Maximal multipole moment. More...
 
Complex computeOverlapMatrixElement_iknot (Bspline const &bspline, GaussLegendre const &g, int i, int j, CCFunction func, int iknot) const
 
Complex computeOverlapMatrixElement (Bspline const &bspline, GaussLegendre const &g, int i, int j, CCFunction func) const
 
SymBandMatrix< Complex > computeOverlapMatrix (Bspline const &bspline, CCFunction func) const
 
Complex computeD_iknot (Bspline const &bspline, GaussLegendre const &g, int i, int j, int iknot) const
 Partial derivative overlap. More...
 
Complex computeD (Bspline const &bspline, GaussLegendre const &g, int i, int j) const
 Derivative overlap. More...
 
Complex computeM_iknot (Bspline const &bspline, GaussLegendre const &g, int a, int i, int j, int iknot, Real rmin, Real rmax, Real scale) const
 Partial integral moment. More...
 
Complex computeM (Bspline const &bspline, GaussLegendre const &g, int a, int i, int j, Real rmin, Real rmax, bool scale=false) const
 Integral moments. More...
 
Complex computeM (Bspline const &bspline, GaussLegendre const &g, int a, int i, int j, int begin_knot, int end_knot, Real rmin, Real rmax, bool scale=false) const
 Integral moments. More...
 
cArray computeMi (Bspline const &bspline, GaussLegendre const &g, int a, Real rmin, Real rmax) const
 Partial integral moments. More...
 
Complex computeR (int lambda, int i, int j, int k, int l) const
 Two-electron integral for multipole \( lambda \). More...
 
void diagonalR (int lambda)
 
void coupledR (int lambda)
 
Complex computeRtri (int lambda, Bspline const &xspline, GaussLegendre const &xg, int k, int l, int iknotx, Real tx1, Real tx2, Bspline const &yspline, GaussLegendre const &yg, int m, int n, int iknoty, Real ty1, Real ty2) const
 Triangular R-integral. More...
 
SymBandMatrix< Complex > calc_R_tr_dia_block (unsigned lambda, int i, int k) const
 Calculate particular sub-matrix of the radial integrals matrix. More...
 
void apply_R_matrix (unsigned int lambda, Complex a, const cArrayView src, Complex b, cArrayView dst, int x_row_limit=-1, int y_row_limit=-1) const
 Multiply vector by matrix of two-electron integrals. More...
 
cArray overlap (Bspline const &bspline, GaussLegendre const &g, CCFunction funct) const
 Compute B-spline overlaps of arbitrary one-dimensional function. More...
 
cArray overlap (Bspline const &bsplinex, GaussLegendre const &gx, Bspline const &bspliney, GaussLegendre const &gy, C2CFunction funct) const
 Compute B-spline overlaps of arbitrary two-dimensional function. More...
 
cArray overlapj (Bspline const &bspline, GaussLegendre const &g, int maxell, const rArrayView vk, bool fast_bessel=false) const
 Compute j-overlaps. More...
 
Bspline const & bspline () const
 
Bspline const & bspline_x () const
 
Bspline const & bspline_y () const
 
GaussLegendre const & gaussleg () const
 
GaussLegendre const & gaussleg_x () const
 
GaussLegendre const & gaussleg_y () const
 
 OneElectronMatrixAccessors (D) OneElectronMatrixAccessors(S) OneElectronMatrixAccessors(Mm1) OneElectronMatrixAccessors(Mm2) OneElectronMatrixArrayAccessors(Mtr_L) OneElectronMatrixArrayAccessors(Mtr_mLm1) OneElectronPartialMatrixAccessors(Mitr_L) OneElectronPartialMatrixAccessors(Mitr_mLm1) BlockSymBandMatrix< Complex > const &R_tr_dia(unsigned i) const
 
CsrMatrix< LU_int_t, Complex > const & R_coupled (unsigned i) const
 

Static Public Member Functions

static CsrMatrix< LU_int_t, Complex > computeOverlapMatrix (Bspline const &bspline1, Bspline const &bspline2, Real R_left, Real R_right)
 Compute overlap matrix of two B-spline bases. More...
 
static cArray overlapP (Bspline const &bspline, GaussLegendre const &g, Real Z, int n, int l)
 Compute P-overlaps. More...
 

Detailed Description

This class contains important routines for calculation of overlap matrices and matrix elements of various functions for given B-spline bases. The calculation of the overlaps uses Gauss-Legendre quadrature, that is to be specified in a form of a preallocated GaussLegendre object.

The overlaps considered are one-electron integrals of various one-dimensional functions (or given arbitrary function) and two-electron overlaps of the multipole elements (or given adbitrary function).

There are two variants of the B-spline basis specified for every axis: the inner basis and the full basis. These bases can be identical, when no channel reduction is used in the solution of the scattering equations (typically for above-ionization energies). However, the inner and outer bases can be different, when the channel reduction will take place. The inner basis then contains real B-spline knots only and will be used for the full-channel calculation of the inner problem. The full basis contains the inner basis knots but is generally much longer and terminated by the ECS complex grid section. This basis is used for solution of energy-allowed channels. The energy-forbidden channels are thus solved only in the inner basis, which is all right, because the energy-forbidden channel functions exponentially decrease with the radial distance.

Constructor & Destructor Documentation

◆ RadialIntegrals()

RadialIntegrals::RadialIntegrals ( Bspline const &  bspline_x,
Bspline const &  bspline_y,
int  Nlambdas 
)

This constructor will initialize the RadialIntegrals object with different B-spline bases for every axis.

Member Function Documentation

◆ apply_R_matrix()

void RadialIntegrals::apply_R_matrix ( unsigned int  lambda,
Complex  a,
const cArrayView  src,
Complex  b,
cArrayView  dst,
int  x_row_limit = -1,
int  y_row_limit = -1 
) const

This routine will multiply several source vectors by the matrix of two-electron integrals for given multipole 'lambda'. The matrix elements are computed anew and applied directly to the vectors to minimize memory requirements. This method - instead of caching the whole integral matrix in memory or on disk - is used in the 'lightweight' mode, which can be requested by the command line option –lightweight.

◆ bspline()

Bspline const& RadialIntegrals::bspline ( ) const
inline

◆ bspline_x()

Bspline const& RadialIntegrals::bspline_x ( ) const
inline

◆ bspline_y()

Bspline const& RadialIntegrals::bspline_y ( ) const
inline

◆ calc_R_tr_dia_block()

SymBandMatrix< Complex > RadialIntegrals::calc_R_tr_dia_block ( unsigned  lambda,
int  i,
int  k 
) const

Calculate particular sub-matrix of the radial integrals matrix (with block indices "i" and "k") and return it in a form of a dense array (copying structure of the overlap matrix).

◆ computeD()

Complex RadialIntegrals::computeD ( Bspline const &  bspline,
GaussLegendre const &  g,
int  i,
int  j 
) const

Compute derivative overlap for B-splines \( B_i \) and \( B_j \).

Parameters
iB-spline index.
jB-spline index.

◆ computeD_iknot()

Complex RadialIntegrals::computeD_iknot ( Bspline const &  bspline,
GaussLegendre const &  g,
int  i,
int  j,
int  iknot 
) const

Compute derivative overlap of B-splines \( B_i \) and \( B_j \) over the knot "iknot", using Gauss-Legendre integration.

Parameters
iB-spline index.
jB-spline index.
iknotInterval index.

◆ computeM() [1/2]

Complex RadialIntegrals::computeM ( Bspline const &  bspline,
GaussLegendre const &  g,
int  a,
int  i,
int  j,
Real  rmin,
Real  rmax,
bool  scale = false 
) const

Compute integral moment of coordinate power between the B-splines \( B_i \) and \( B_j \)

Parameters
aExponent.
iB-spline index.
jB-spline index.

◆ computeM() [2/2]

Complex RadialIntegrals::computeM ( Bspline const &  bspline,
GaussLegendre const &  g,
int  a,
int  i,
int  j,
int  begin_knot,
int  end_knot,
Real  rmin,
Real  rmax,
bool  scale = false 
) const

Compute integral moment of coordinate power between the B-splines \( B_i \) and \( B_j \)

Parameters
aExponent.
iB-spline index.
jB-spline index.

◆ computeM_iknot()

Complex RadialIntegrals::computeM_iknot ( Bspline const &  bspline,
GaussLegendre const &  g,
int  a,
int  i,
int  j,
int  iknot,
Real  rmin,
Real  rmax,
Real  scale 
) const

Compute integral moment of coordinate power between the B-splines \( B_i \) and \( B_j \) over the knot "iknot", using Gauss-Legendre integration.

Parameters
aExponent.
iB-spline index.
jB-spline index.
iknotInterval index.
RPotential truncation point.

◆ computeMi()

cArray RadialIntegrals::computeMi ( Bspline const &  bspline,
GaussLegendre const &  g,
int  a,
Real  rmin,
Real  rmax 
) const

Compute logarithms of integral moment of degree "a" for every B-spline pair and every interknot sub-interval. Store in 1-D array of shape

[ Nspline × Nspline × Nintval ]
Parameters
aMoment degree.

◆ computeOverlapMatrix() [1/2]

SymBandMatrix< Complex > RadialIntegrals::computeOverlapMatrix ( Bspline const &  bspline,
CCFunction  func 
) const

◆ computeOverlapMatrix() [2/2]

CsrMatrix< LU_int_t, Complex > RadialIntegrals::computeOverlapMatrix ( Bspline const &  bspline1,
Bspline const &  bspline2,
Real  R_left,
Real  R_right 
)
static

This function returns a matrix of B-spline overlaps across two bases. The overlap integrals are calculated only between the given bounds R_left and R_right (these are the real parts of the potentially complex coordinates). Both bounds must be aligned to some B-spline knot.

◆ computeOverlapMatrixElement()

Complex RadialIntegrals::computeOverlapMatrixElement ( Bspline const &  bspline,
GaussLegendre const &  g,
int  i,
int  j,
CCFunction  func 
) const

◆ computeOverlapMatrixElement_iknot()

Complex RadialIntegrals::computeOverlapMatrixElement_iknot ( Bspline const &  bspline,
GaussLegendre const &  g,
int  i,
int  j,
CCFunction  func,
int  iknot 
) const

◆ computeR()

Complex RadialIntegrals::computeR ( int  lambda,
int  i,
int  j,
int  k,
int  l 
) const

Compute the two-electron (Slater-type) four-B-spline integral. Uses the "diagonal" contribution from diagonalR and the off-diagonal contributions calculated from products of the partial moments.

◆ computeRtri()

Complex RadialIntegrals::computeRtri ( int  lambda,
Bspline const &  xspline,
GaussLegendre const &  xg,
int  k,
int  l,
int  iknotx,
Real  tx1,
Real  tx2,
Bspline const &  yspline,
GaussLegendre const &  yg,
int  m,
int  n,
int  iknoty,
Real  ty1,
Real  ty2 
) const

Calculates integral

\[ R_{klmn}^{\lambda\triangle} = \int\limits_{t_i}^{t_{i+1}} B_k(r_1) B_l(r_1) \frac{1}{r_1} \left( \int\limits_{t_i}^{r_1} \left(\frac{r_2}{r_1}\right)^\lambda B_m(r_2) B_n(r_2) \mathrm{d}r_2 \right) \mathrm{d}r_1 \,, \]

which is used to calculate a diagonal contribution to the full R-integral, see computeRdiag. Inner integrand is a polynomial, so a simple Gauss-Legendre quadrature is used (with a sufficient order). The outer integral is polynomial only when the integration starts from zero ( \( t_i = 0 \)). In such case it has degree equal to the combined order of the B-splines. It is assumed that also elsewhere the integrand can be well approximated by a polynomial of the same degree.

Uses functions R_outer_integrand and R_inner_integrand.

Parameters
lambdaThe multipole ( \( \lambda \)).
kFirst B-spline index.
lSecond B-spline index.
iknotxIntegration interval (tx[iknotx] ... tx[iknotx+1]).
tx1Left integration bound.
tx2Right integration bound.
mThird B-spline index.
nFourth B-spline index.
iknotyIntegration interval (ty[iknoty] ... ty[iknoty+1]).
ty1Left integration bound.
ty2Right integration bound.

◆ coupledR()

void RadialIntegrals::coupledR ( int  lambda)

◆ diagonalR()

void RadialIntegrals::diagonalR ( int  lambda)

◆ gaussleg()

GaussLegendre const& RadialIntegrals::gaussleg ( ) const
inline

◆ gaussleg_x()

GaussLegendre const& RadialIntegrals::gaussleg_x ( ) const
inline

◆ gaussleg_y()

GaussLegendre const& RadialIntegrals::gaussleg_y ( ) const
inline

◆ maxlambda()

int RadialIntegrals::maxlambda ( ) const
inline

Returns maximal multipole (also known as "angular momentum transfer"), for which there are precomputed two-electron integrals.

◆ OneElectronMatrixAccessors()

RadialIntegrals::OneElectronMatrixAccessors ( ) const &
inline

◆ overlap() [1/2]

cArray RadialIntegrals::overlap ( Bspline const &  bspline,
GaussLegendre const &  g,
CCFunction  funct 
) const
Parameters
bsplineB-spline basis.
gGauss-Legendre integrator adapted to the B-spline basis.
functSome one-dimensional function (Complex -> Complex).

◆ overlap() [2/2]

cArray RadialIntegrals::overlap ( Bspline const &  bsplinex,
GaussLegendre const &  gx,
Bspline const &  bspliney,
GaussLegendre const &  gy,
C2CFunction  funct 
) const
Parameters
bsplinexB-spline basis for x-axis.
gxGauss-Legendre integrator adapted to the B-spline basis for x-axis.
bsplineyB-spline basis for y-axis.
gyGauss-Legendre integrator adapted to the B-spline basis for y-axis.
functSome one-dimensional function (Complex x Complex -> Complex).

◆ overlapj()

cArray RadialIntegrals::overlapj ( Bspline const &  bspline,
GaussLegendre const &  g,
int  maxell,
const rArrayView  vk,
bool  fast_bessel = false 
) const

Compute B-spline overlap integrals for Riccati-Bessel function.

Parameters
maxellMaximal degree of the Riccati-Bessel function.
vkArray containing linear momenta.
Returns
Array of shape [vk.size() × (maxell + 1) × Nspline] in column-major format.

◆ overlapP()

cArray RadialIntegrals::overlapP ( Bspline const &  bspline,
GaussLegendre const &  g,
Real  Z,
int  n,
int  l 
)
static

Compute overlap vector of B-splines vs. hydrogen Pnl function.

Parameters
bsplineB-spline basis.
gGauss-Legendre integrator adapted to the B-spline basis.
nPrincipal quantum number.
lOrbital quantum number.

◆ R_coupled()

CsrMatrix<LU_int_t,Complex> const& RadialIntegrals::R_coupled ( unsigned  i) const
inline

◆ setupOneElectronIntegrals() [1/2]

void RadialIntegrals::setupOneElectronIntegrals ( bool  sharedscratch = false,
bool  iammaster = true 
)

This function will calculate the common one-electron overlap matrices S, D, Mm1, Mm2. The parameters sharedscratch and iammaster are used when writing the results to disk to avoid multiple processes writing the same file.

◆ setupOneElectronIntegrals() [2/2]

void RadialIntegrals::setupOneElectronIntegrals ( Parallel const &  par,
CommandLine const &  cmd 
)

This function calls the other setupOneElectronIntegrals with the appropriate parameters.

◆ setupTwoElectronIntegrals()

void RadialIntegrals::setupTwoElectronIntegrals ( Parallel const &  par,
CommandLine const &  cmd 
)

This function will calculate the two-electron multipole overlap matrices.

◆ verbose()

void RadialIntegrals::verbose ( bool  v)
inline

Setting this to false will inhibit standard output messages from this class.


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