HypersphericalBesselOlver Module Source file:hyperspherical_bessels_olver


Approximate calculation of ultraspherical Bessel functions for non-flat universe
Uses the Olver approximation to relate to normal spherical bessels,
with fallback where not reliable to next order Olver/Airy approx or recursion.
Precision target 1e-4 of peak, with max error < 2e-4.

Subroutines
  • compute_olver_z_amp(l, K, nu, achi, sin_k, z, amp)
    Leading Olver map chi -> z: the flat coordinate whose Liouville-Green action from the turning point matches the curved one, with the amplitude amp = (dz/dchi)^(-1/2) so that u(chi) = amp * z j_l(nu z). sin_k = S_K(achi) is supplied by the caller, which needs it anyway.
    • integer intent(in) :: l
    • integer intent(in) :: K
    • real(dl) intent(in) :: nu
    • real(dl) intent(in) :: achi
    • real(dl) intent(in) :: sin_k
    • real(dl) intent(out) :: z
    • real(dl) intent(out), optional :: amp
  • compute_olver_z_amp_smallchi(l, K, nu, chi, z, amp)
    Small-chi curvature expansion for the Olver action map. This solves the differentiated Liouville-Green map perturbatively for small curvature across the interval, (dz/dchi)^2 * (alpha^2 - 1/z^2) = alpha^2 - 1/S_K(chi)^2, through O((K/alpha^2)^3), writing z = chi * F(alpha*chi,K/alpha^2). For this local curvature expansion the exact centrifugal coefficient sqrt(l(l+1)) is more accurate than the Langer parameter at low ell, and is indistinguishable from it at high ell. The full cached Olver map uses the same coefficient in compute_olver_z_amp.
    • integer intent(in) :: l
    • integer intent(in) :: K
    • real(dl) intent(in) :: nu
    • real(dl) intent(in) :: chi
    • real(dl) intent(out) :: z
    • real(dl) intent(out) :: amp
Functions
  • real(dl)
    fallback_reduced(l, K, nu, achi, sin_k, symm)
    The Olver gates above are unchanged; within their recursive fallback region, use validated faster approximations where available before falling back to phi_recurs.
    • integer intent(in) :: l
    • integer intent(in) :: K
    • real(dl) intent(in) :: nu
    • real(dl) intent(in) :: achi
    • real(dl) intent(in) :: sin_k
    • real(dl) intent(in) :: symm
  • real(dl)
    olver_reduced(l, K, nu, achi, sin_k, symm)
    Reduced u for K = +-1 and l >= 3: pick the near-flat small-chi map, the recurrence-class fallback, or the leading Olver map, then map the flat solution z j_l(nu z) back with the Liouville-Green amplitude.
    • integer intent(in) :: l
    • integer intent(in) :: K
    • real(dl) intent(in) :: nu
    • real(dl) intent(in) :: achi
    • real(dl) intent(in) :: sin_k
    • real(dl) intent(in) :: symm
  • real(dl)
    olver_value(l, K, nu, chi, reduced)
    Shared driver for phi_olver/u_olver: fold chi into the fundamental domain, dispatch the special cases, and convert between phi and u using the single S_K(achi) evaluation that the Olver map needs anyway.
    • integer intent(in) :: l
    • integer intent(in) :: K
    • real(dl) intent(in) :: nu
    • real(dl) intent(in) :: chi
    • logical intent(in) :: reduced
  • real(dl)
    phi_olver(l, K, nu, chi)
    phi_l^nu(chi). Assumes l >= 0, chi >= 0, and for K = 1 an integer nu > l (so nu > sqrt(l(l+1)) and the turning point asin(sqrt(l(l+1))/nu) exists); the Python wrapper validates both.
    • integer intent(in) :: l
    • integer intent(in) :: K
    • real(dl) intent(in) :: nu
    • real(dl) intent(in) :: chi
  • real(dl)
    u_olver(l, K, nu, chi)
    Reduced function u = S_K(chi) phi_l^nu(chi). Same input assumptions as phi_olver.
    • integer intent(in) :: l
    • integer intent(in) :: K
    • real(dl) intent(in) :: nu
    • real(dl) intent(in) :: chi
  • logical
    use_airy_fallback(l, K, nu, achi)
    Second-order Olver/Airy patch: validated only well away from low l.
    • integer intent(in) :: l
    • integer intent(in) :: K
    • real(dl) intent(in) :: nu
    • real(dl) intent(in) :: achi