Functions

Hermite approximation

Functions

template<class Real >
Real Normal_Hermite_Ftns (Real r, unsigned int n, Real PI)
template<class Real >
Real Potential_QAGI (Real t, void *params)
template<class Real >
int Hermite_Potential (Hermite_data< Real > &data, TNT::Matrix< Real > &P)
template<class Real >
void Hermite_Kinetic (TNT::Matrix< Real > &K)
template<class Real >
void Hermite_Moment (int ell, TNT::Matrix< Real > &P)

Function Documentation

template<class Real >
Real Normal_Hermite_Ftns ( Real  r,
unsigned int  n,
Real  PI 
)

The non-normalized Hermite functions $ h_n $ have a numerically stable implemenation via the three-term recursion

\begin{eqnarray*} h_0(r) & = & \exp(-r^2/2), \\ h_{n+1}(r) & = & 2r h_n(r) - 2n h_{n-1}(r), \qquad n=0,1,\ldots. \end{eqnarray*}

The normalization factors are computed, likewise recursively, from the relationships

\begin{eqnarray*} \int h_0^2~dr & = & \sqrt{\pi}, \\ \int h_{n+1}^2~dr & = & 2(n+1) \int h_n^2~dr, \qquad n=0,1,\ldots. \end{eqnarray*}

See [1] for more details.

The value $ \pi $ (of the template parameter type) is passed as a parameter since it is required to compute the normalization factors.

template<class Real >
Real Potential_QAGI ( Real  t,
void *  params 
)

An integral on the real line is transformed to an integral over the interval $ (0, 1] $ via the following variable transformation:

\[ \int_{-\infty}^\infty F(t)~dt = \int_0^1 \left[ F\left(\frac{1-t}{t}\right) + F\left(\frac{t-1}{t}\right) \right] \frac{1}{t^2}~dt. \]

Potential_QAGI defines the integrand

\[ F(t) = \phi_m(t) \phi_n(t) f(t), \]

where the function $ f $ as well as the indices $ m, n $ are passed in the structure Hermite_data as parameters.

template<class Real >
int Hermite_Potential ( Hermite_data< Real > &  data,
TNT::Matrix< Real > &  P 
)

The coefficients of the "potential" energy matrix,

\[ P_{mn} = P_{mn} + \int \phi_m \phi_n V~dr, \]

are computed via numerical quadrature.The integrand $ V, $ together with quadrature parameters, are passed in the structure Hermite_data.

template<class Real >
void Hermite_Kinetic ( TNT::Matrix< Real > &  K  ) 

The coefficients of the "kinetic" energy matrix,

\[ K_{mn} = K_{mn} + \int \phi_m' \phi_n'~dr \]

can be computed explicitly:

\begin{eqnarray*} K_{mm} & = & (2m + 3)/2, \\ K_{m,m+2} & = & - ((m+1)(m+2))^{1/2} / 2. \end{eqnarray*}

template<class Real >
void Hermite_Moment ( int  ell,
TNT::Matrix< Real > &  P 
)

Assembles the projection matrix $ P $ of the polynomial $ V(r) = r^\ell $ onto the basis of Hermite polynomials. The coefficients

\[ P_{m,m},\; P_{m,m+1}, \ldots, P_{m,m+\ell}, \qquad m=0,1,\ldots, \]

coincide with the coefficients $ c_k $ in the expansion

\[ r^\ell H_m(r) = \cdots + c_m H_m(r) + \cdots + c_{m+\ell} H_{m+\ell}(r). \]

This is a linear system of equations in $ c_0, \ldots, c_{m+\ell} $ whose coefficients are those of the $ H_0, \ldots, H_{m+\ell} $ and which can be solved via back-substitution.