DIPELM  2.0
dipelm_special_functions Module Reference

Orthogonal polynomials, rotation matrices, angular momentum algebra, etc. More...

Data Types

type  time
 

Functions/Subroutines

subroutine tic (this)
 
subroutine toc (this)
 
integer function binomial (n, k)
 
recursive real(kind=idp) function jacobi (n, a, b, x)
 Calculate the Jacobi polynomials using recurrence relations. More...
 
recursive real(idp) function flm (l, m)
 
subroutine a_legendre_p (lmax, beta, Plm)
 
subroutine a_sp_harm (lmax, theta, phi, Ylm)
 
subroutine a_re_sp_harm (lmax, theta, phi, Ylm)
 
subroutine grid_theta_phi (steps, arange, theta_grid, phi_grid)
 
subroutine grid_sp_harm (lmax, steps, arange, Ylm_grid, basis_type)
 
subroutine grid_wigner_D (lmax, steps, arange, D_grid, basis_type)
 
real(kind=kind(1.d0)) function wigner_small_d (beta, j, m, n)
 Compute the value of the Wigner d matrix. More...
 
complex(kind=idp) function wigner_d (alpha, beta, gamma, j, m, n)
 Calculate the wigner D function. More...
 
real(idp) function re_wigner_d (alpha, beta, gamma, j, m, n)
 
real(idp) function azim_fn (theta, m)
 
subroutine a_wigner_d (jmax, alpha, beta, gamma, Djmn)
 
subroutine a_re_wigner_d (jmax, alpha, beta, gamma, Djmn)
 
complex(kind=idp) function sp_harm (j, m, theta, phi)
 Calculate spherical harmonic using wigner small d. More...
 
real(kind=idp) function re_sp_harm (j, m, theta, phi)
 
complex(rk) function sph_basis_transform_elm (l, m, mp, basis_type)
 
subroutine sph_basis_transform_matrix (U, lmax, basis_type)
 
integer function lm2i (l, m)
 
subroutine i2lm (i, l, m)
 
recursive real(rk) function binom (n, r)
 
real(rk) function cleb (j1, m1, j2, m2, j, m)
 
real(rk) function threej (j1, m1, j2, m2, j, m)
 
function cphaz (l, eta, iwrite)
 
subroutine linspace (from, to, no_steps, array, include_end_point)
 

Variables

integer, parameter rk = idp
 

Detailed Description

Orthogonal polynomials, rotation matrices, angular momentum algebra, etc.

Author
Alex Harvey
Date
2019

Contains:

  • Spherical harmonics, Legendre polynomials and associated functions.
  • Wigner 3j and Clebsch-Gordan coefficients
  • Wigner D matrices (real and complex forms)
  • Coulomb phase function.
  • Various indexing functions and other misc. functions.

Function/Subroutine Documentation

◆ a_legendre_p()

subroutine dipelm_special_functions::a_legendre_p ( integer  lmax,
real(idp)  beta,
real(idp), dimension(:), allocatable  Plm 
)
Here is the call graph for this function:

◆ a_re_sp_harm()

subroutine dipelm_special_functions::a_re_sp_harm ( integer  lmax,
real(idp)  theta,
real(idp)  phi,
complex(idp), dimension(:), allocatable  Ylm 
)
Here is the call graph for this function:

◆ a_re_wigner_d()

subroutine dipelm_special_functions::a_re_wigner_d ( integer, intent(in)  jmax,
real(idp), intent(in)  alpha,
real(idp), intent(in)  beta,
real(idp), intent(in)  gamma,
complex(idp), dimension(:,:), intent(inout), allocatable  Djmn 
)
Here is the call graph for this function:

◆ a_sp_harm()

subroutine dipelm_special_functions::a_sp_harm ( integer  lmax,
real(idp)  theta,
real(idp)  phi,
complex(idp), dimension(:), allocatable  Ylm 
)
Here is the call graph for this function:

◆ a_wigner_d()

subroutine dipelm_special_functions::a_wigner_d ( integer, intent(in)  jmax,
real(kind=idp), intent(in)  alpha,
real(kind=idp), intent(in)  beta,
real(kind=idp), intent(in)  gamma,
complex(kind=idp), dimension(:,:), intent(inout), allocatable  Djmn 
)
Here is the call graph for this function:

◆ azim_fn()

real(idp) function dipelm_special_functions::azim_fn ( real(kind=idp), intent(in)  theta,
integer, intent(in)  m 
)
Here is the call graph for this function:

◆ binom()

recursive real(rk) function dipelm_special_functions::binom ( integer  n,
integer  r 
)

◆ binomial()

integer function dipelm_special_functions::binomial ( integer, intent(in)  n,
integer, intent(in)  k 
)

◆ cleb()

real(rk) function dipelm_special_functions::cleb ( integer  j1,
integer  m1,
integer  j2,
integer  m2,
integer  j,
integer  m 
)
Here is the call graph for this function:

◆ cphaz()

function dipelm_special_functions::cphaz (   l,
  eta,
  iwrite 
)

◆ flm()

recursive real(idp) function dipelm_special_functions::flm ( integer  l,
integer  m 
)

◆ grid_sp_harm()

subroutine dipelm_special_functions::grid_sp_harm ( integer  lmax,
integer, dimension(:)  steps,
real(idp), dimension(:)  arange,
complex(idp), dimension(:,:), allocatable  Ylm_grid,
character(len=3)  basis_type 
)
Here is the call graph for this function:

◆ grid_theta_phi()

subroutine dipelm_special_functions::grid_theta_phi ( integer, dimension(:)  steps,
real(idp), dimension(:)  arange,
real(idp), dimension(:), allocatable  theta_grid,
real(idp), dimension(:), allocatable  phi_grid 
)

◆ grid_wigner_D()

subroutine dipelm_special_functions::grid_wigner_D ( integer  lmax,
integer, dimension(:)  steps,
real(idp), dimension(:)  arange,
complex(idp), dimension(:,:,:), allocatable  D_grid,
character(len=3)  basis_type 
)
Here is the call graph for this function:

◆ i2lm()

subroutine dipelm_special_functions::i2lm ( integer  i,
integer  l,
integer  m 
)

◆ jacobi()

recursive real(kind=idp) function dipelm_special_functions::jacobi ( integer, intent(in)  n,
integer, intent(in)  a,
integer, intent(in)  b,
real(kind=idp), intent(in)  x 
)

Calculate the Jacobi polynomials using recurrence relations.

\begin{align} P^{(a,b)}_0(x) &= 1 \\ P^{(a,b)}_1(x) &= \frac{(2+a+b)x+(a-b)}{2} \\ P^{(a,b)}_n(x) &= (2n+a+b-1)((a^2-b^2) + (2n+a+b)(2n+a+b-2)x)P^{(a,b)}_{n-1}(x) - \frac{2(n-1+a)(n-1+b)(2n+a+b))}{(2n(n+a+b)(2n-2+a+b))}P^{(a,b)}_{n-2}(x) \end{align}

◆ linspace()

subroutine dipelm_special_functions::linspace ( real(idp), intent(in)  from,
real(idp), intent(in)  to,
integer  no_steps,
real(idp), dimension(:), allocatable  array,
logical, optional  include_end_point 
)

◆ lm2i()

integer function dipelm_special_functions::lm2i ( integer  l,
integer  m 
)

◆ re_sp_harm()

real(kind=idp) function dipelm_special_functions::re_sp_harm ( integer, intent(in)  j,
integer, intent(in)  m,
real(kind=idp), intent(in)  theta,
real(kind=idp), intent(in)  phi 
)
Here is the call graph for this function:

◆ re_wigner_d()

real(idp) function dipelm_special_functions::re_wigner_d ( real(idp), intent(in)  alpha,
real(idp), intent(in)  beta,
real(idp), intent(in)  gamma,
integer, intent(in)  j,
integer, intent(in)  m,
integer, intent(in)  n 
)
Here is the call graph for this function:

◆ sp_harm()

complex(kind=idp) function dipelm_special_functions::sp_harm ( integer, intent(in)  j,
integer, intent(in)  m,
real(kind=idp), intent(in)  theta,
real(kind=idp), intent(in)  phi 
)

Calculate spherical harmonic using wigner small d.

The relation used is:

\begin{align} Y_{jm}(\theta, \phi) &= \sqrt\frac{2j+1}{4\pi}d^j_{|m|0}(\theta) e^{im\phi} \qquad m \geq 0 \\ &= (-1)^m \sqrt\frac{2j+1}{4\pi}d^j_{|m|0}(\theta) e^{im\phi} \qquad m < 0 \\ \end{align}

Here is the call graph for this function:

◆ sph_basis_transform_elm()

complex(rk) function dipelm_special_functions::sph_basis_transform_elm ( integer, intent(in)  l,
integer, intent(in)  m,
integer, intent(in)  mp,
character(3)  basis_type 
)
Here is the call graph for this function:

◆ sph_basis_transform_matrix()

subroutine dipelm_special_functions::sph_basis_transform_matrix ( complex(rk), dimension(:,:), intent(inout), allocatable  U,
integer, intent(in)  lmax,
character(3)  basis_type 
)
Here is the call graph for this function:

◆ threej()

real(rk) function dipelm_special_functions::threej ( integer  j1,
integer  m1,
integer  j2,
integer  m2,
integer  j,
integer  m 
)
Here is the call graph for this function:

◆ tic()

subroutine dipelm_special_functions::tic ( class(time this)

◆ toc()

subroutine dipelm_special_functions::toc ( class(time this)

◆ wigner_d()

complex(kind=idp) function dipelm_special_functions::wigner_d ( real(kind=idp), intent(in)  alpha,
real(kind=idp), intent(in)  beta,
real(kind=idp), intent(in)  gamma,
integer, intent(in)  j,
integer, intent(in)  m,
integer, intent(in)  n 
)

Calculate the wigner D function.

Rotation matrix elements for the complex spherical harmonics. They have the form:

Here is the call graph for this function:

◆ wigner_small_d()

real(kind=kind(1.d0)) function dipelm_special_functions::wigner_small_d ( real(kind=idp), intent(in)  beta,
integer, intent(in)  j,
integer, intent(in)  m,
integer, intent(in)  n 
)

Compute the value of the Wigner d matrix.

The explicit expression involving Jacobi Polynomials is used:

\[ d^{j}_{mn}(\beta)=(-1)^{\lambda} \binom{2j-k}{k+a}^{\frac{1}{2}} \binom{k+b}{b}^{-\frac{1}{2}} \left(\sin\frac{\beta}{2}\right)^a \left(\cos\frac{\beta}{2}\right)^b P^{(a,b)}_k(\cos\beta) \]

where \( k = \min(j+n, j-n, j+m, j-m). \)

\( a \) and \( \lambda \) depend on the form of \( k \) and are given by

\[ k = \begin{cases} j+n: & a=m-n;\quad \lambda=m-n\\ j-n: & a=n-m;\quad \lambda= 0 \\ j+m: & a=n-m;\quad \lambda= 0 \\ j-m: & a=m-n;\quad \lambda=m-n \\ \end{cases} \]

and \( b=2j-2k-a \)

See also
wigner_d
Todo:
Implement recurrence relation approach to calculating wigner d
Here is the call graph for this function:

Variable Documentation

◆ rk

integer, parameter dipelm_special_functions::rk = idp