25#include <boost/math/special_functions/bessel.hpp>
32namespace triqs::utility {
34 using namespace std::complex_literals;
35 using std::numbers::pi;
46 std::complex<double> res = (std::sqrt(2 * l + 1) / std::sqrt(2 * n + 1)) * std::exp(1i * (n + 0.5) * pi) * std::pow(1i, l)
47 * boost::math::cyl_bessel_j(l + 0.5, (n + 0.5) * pi);
50 return neg_n ? std::conj(res) : res;
58 if ((l + p) % 2 == 0 || p > l + 1)
return 0.0;
62 for (
int i = l + p - 1; (i > l - p + 1) && (i > 1); i--) f *= i;
63 for (
int i = p - 1; i > 1; i--) f /= i;
65 return std::pow(
double(-1),
double(p)) * 2 * std::sqrt(2 * l + 1) * f;
69 if (x == 0)
return (n == 0 ? 1.0 : 0);
70 return std::sqrt(pi / (2 * x)) * boost::math::cyl_bessel_i(n + 0.5, x);
std::complex< double > legendre_T(int n, int l)
Get the quantity from Eq.(E2) in the paper https://doi.org/10.1103/PhysRevB.84.075145.
double mod_cyl_bessel_i(int n, double x)
Get the modified spherical bessel function of the first kind of order evaluated at .
double legendre_t(int l, int p)
Get the quantity from Eq.(E8) in the paper https://doi.org/10.1103/PhysRevB.84.075145.
Provides Legendre polynomials and related functions.