# Coulomb Functions

CoulombFunctions.coulombsFunction
coulombs(x::AbstractVector, η, ℓ; kwargs...)

Convenience wrapper around coulombs! that preallocates output matrices of the appropriate dimensions.

coulombs(x::AbstractVector, η, ℓ; kwargs...)

Convenience wrapper around coulombs! that preallocates output matrices of the appropriate dimensions.

coulombs(r, Z, k::AbstractVector, ℓ; kwargs...)

Convenience wrapper around coulombs! that preallocates output matrices of the appropriate dimensions.

CoulombFunctions.coulombFsFunction
coulombFs(x::AbstractVector, η, ℓ; kwargs...)

Convenience wrapper around coulombs! that preallocates output matrices of the appropriate dimensions, only computing the regular functions $F_\ell(\eta,x)$ and $F_\ell'(\eta,x)$.

CoulombFunctions.coulombs!Function
coulombs!(F, F′, G, G′, x, η, ℓ)

Main routine that computes the continued fractions and the recurrence relations to generate the regular functions $F_\ell(\eta,x)$ and $F_\ell'(\eta,x)$ and the irregular functions $G_\ell(\eta,x)$ and $G_\ell'(\eta,x)$ (computation of the latter can be elided by passing nothing for G and G′).

coulombs!(F, F′, G, G′, x::AbstractVector, η, ℓ; kwargs...)

Loop through all values of x and compute all Coulomb functions, storing the results in the preallocated matrices F, F′, G, G′.

coulombs!(F, F′, G, G′, r, Z, k::AbstractVector, ℓ; kwargs...)

Loop through all values of k and compute all Coulomb functions, storing the results in the preallocated matrices F, F′, G, G′. x=k*r and η≡-Z/k, i.e. Z>0 for attractive potentials.

CoulombFunctions.coulomb_fraction1Function
coulomb_fraction1(x, η, n)

Evaluate the continued fraction for the logarithmic derivative of the Coulomb function

$$$\frac{F'_n(\eta,x)}{F_n(\eta,x)} = S_{n+1}(\eta,x) - \frac{R_{n+1}^2(\eta)}{T_{n+1}(\eta,x)-}\frac{R_{n+2}^2(\eta)}{T_{n+2}(\eta,x)-}...\frac{R_k^2(\eta)}{T_k(\eta,x)-...},$$$

where

\begin{aligned} R_k(\eta) &= \sqrt{1+\frac{\eta^2}{k^2}}, \qquad S_k(\eta,x) = \frac{k}{x} + \frac{\eta}{k}, \\ T_k(\eta,x) &= S_k(\eta,x) + S_{k+1}(\eta,x) = (2k+1)\left(\frac{1}{x} + \frac{\eta}{k^2+k}\right). \end{aligned}
CoulombFunctions.coulomb_fraction2Function
coulomb_fraction2(x, η, n, ω)

Evaluate the continued fraction for the logarithmic derivative of the Hankel function $H^\omega_\lambda(\eta,x) = G_\lambda(\eta,x) + \mathrm{i}\omega F_\lambda(\eta,x)$

$$$\frac{{H^{\omega}_n}'(\eta,x)}{H^\omega_n(\eta,x)} = p+\mathrm{i}q = \mathrm{i}\omega\left(1-\frac{\eta}{x}\right) + \frac{\mathrm{i}\omega}{x} \frac{ac}{2(x-\eta+\mathrm{i}\omega)+} \frac{(a+1)(c+1)}{2(x-\eta+2\mathrm{i}\omega)+...},$$$

where

\begin{aligned} a &= 1+n+\mathrm{i}\omega\eta, & b &= 2n + 2, & c &= -n + \mathrm{i}\omega\eta. \end{aligned}
CoulombFunctions.coulomb_downward_recurrence!Function
coulomb_downward_recurrence!(F, F′, x⁻¹, η, ℓ, cf1, s; large)

Given the logarithmic derivative cf1=F′[end]/F[end] (computed using coulomb_fraction1), and the sign s, fill in all lower orders using the downward recurrence

\begin{aligned} w_{n-1} &= (S_n w_n + w_n')/R_n, & w_{n-1}' &= S_nw_{n-1} - R_n w_n, \\ R_k &= \sqrt{1 + \frac{\eta^2}{k^2}}, & S_k &= \frac{k}{x} + \frac{\eta}{k}. \end{aligned}

If at any point during the recurrence, F[i]>large, renormalize F′[i:end] ./= F[i] and F[i:end] ./= F[i] to avoid overflow, and the continue the recurrence. This is very useful for small $|x|$ and large $\ell$.

CoulombFunctions.coulomb_upward_recurrence!Function
coulomb_upward_recurrence(G, G′, x⁻¹, η, ℓ)

Generate the irregular Coulomb functions using (stable) upward recurrence

\begin{aligned} w_{n+1} &= (S_{n+1} w_n - w_n')/R_{n+1}, & w_{n+1}' &= R_{n+1}w_n - S_{n+1} w_{n+1}, \end{aligned}

starting from G[1] and G′[1], which we find using the Wronskian

$$$F_\lambda'(\eta,z)G_\lambda(\eta,z) - F_\lambda(\eta,z)G_\lambda'(\eta,z) = 1$$$

and the logarithmic derivative of $G_\lambda(\eta,z) + \mathrm{i}F_\lambda(\eta,z)$ (see coulomb_fraction2).

CoulombFunctions.turning_pointFunction
turning_point(η, ℓ)

Computes the turning point $\rho_{\mathrm{TP}}$ of the Coulomb functions, which separates the monotonic region $\rho<\rho_{\mathrm{TP}}$ from the oscillatory region $\rho>\rho_{\mathrm{TP}}$.

See Eq. (2) of

• Barnett, A. (1982). COULFG: Coulomb and Bessel Functions and Their Derivatives, for Real Arguments, by Steed's Method. Computer Physics Communications, 27(2), 147–166. 10.1016/0010-4655(82)90070-4

or

• Barnett, A. R. (1996). The Calculation of Spherical Bessel and Coulomb Functions. In (Eds.), Computational Atomic Physics (pp. 181–202). : Springer Berlin Heidelberg.