xnn.gnn.featurizers.spherical_bessel.spherical_bessel_jn#
- xnn.gnn.featurizers.spherical_bessel.spherical_bessel_jn(l_max, x, n_terms=30)[source]#
Spherical Bessel functions of the first kind, orders 0 to
l_max.- Parameters:
- Returns:
j_l(x)stacked along a new last axis, shape(..., l_max + 1), in the dtype ofx.- Return type:
Tensor
Notes
Order
luses the power seriesx^l / (2l+1)!! * sum_k (-x^2/2)^k / (k! (2l+3)(2l+5)...(2l+2k+1))forx < l + 2and the upward recurrencej_{l+1} = (2l+1)/x j_l - j_{l-1}fromj_0 = sin x / xandj_1 = (sin x / x - cos x) / xbeyond; the recurrence loses digits forxbelow the order, the series needs more terms above it, and the switch atl + 2keeps both at double precision. The arithmetic is float64 internally.