Expand description
Bessel functions and radial jets with analytic argument derivatives.
Cylindrical and spherical Bessel functions of every kind (bessel), regular and
singular radial jets (spherical_radial, cylindrical_radial), and their
broadcasting residual. They use AMOS (the complex_bessel crate), small-argument
power series, and a qualified positive-real outgoing Hankel recurrence.
Upstream: treams.special.jv, yv, hankel1, hankel2, spherical_jn and
spherical_yn (scipy’s functions), and jv_d, yv_d, hankel1_d, hankel2_d,
spherical_hankel1, spherical_hankel2 and their _d derivatives (_bessel.pyx).
Structs§
- Bessel
Residual - What
bessel_arraysaves for its pullback: the orders, the arguments and the function. Only the arguments get gradients. - Radial
Jet - A radial function and its first two argument derivatives: a second-order jet in one
complex variable, unlike the crate’s first-order jets
numerics::Jetin several.
Enums§
- Bessel
- Cylindrical Bessel solution, also used at half order for spherical functions.
- Radial
- Radial kind of multipole waves: regular or singular.
Constants§
- PARALLEL 🔒
- Elementwise Bessel evaluations and pullbacks run in parallel from this many elements.
- SERIES_
TERMS 🔒 - Terms of the small-argument power series of
spherical_radialandcylindrical_radial. Below|z| = SERIES_RADIUS(0.5) each term is at most1/(16 q^2)of its predecessor, so the last one is below 1e-40 of the first.
Functions§
- amos_
error 🔒 - bessel
- Bessel value or one of its first two complex-argument derivatives.
- bessel_
array - Evaluate elementwise Bessel functions, broadcasting either scalar input.
- bessel_
raw 🔒 - One AMOS evaluation of a cylindrical function, or of a spherical one at order + 1/2.
- checked 🔒
jet, or an overflow error where one of its parts is not finite. Near zero the prefactorsqrt(pi / 2z)and the derivatives’ powers of1/zoverflow where AMOS does not, as forh_0below|z| = 1e-103.- cylindrical_
radial - Integer-order cylindrical J (regular) or outgoing H1 (singular), with its first two derivatives.
- even_
series 🔒 - The even power series
sum_q t_qwitht_0 = leading z^powerandt_q = factor(q) z^2 t_(q-1), differentiated term by term: every term reuses its predecessor’s powers. - hankel_
below 🔒 - Outgoing cylindrical functions
[H_(m-1)(z), H_m(z)]from one AMOS sequence, withH_-1 = -H_1: the derivativeu^m H_(m-1)(u)ofu^m H_m(u)without the cancelling product rule. - jet_
from_ 🔒next_ order - Derivatives of a spherical function from the next order,
f' = (l/z) f - f_(l+1), and the spherical Bessel equation. - pair 🔒
- The two values of a two-term sequence.
- radial_
jet 🔒 - A spherical or cylindrical radial function of integer
orderat a jet argument: without derivatives a single value-only Bessel evaluation, otherwise the value and first derivative fromspherical_radialorcylindrical_radial. - sequence 🔒
- Cylindrical functions of orders
start, start + 1, ...from one AMOS recurrence. - spherical_
hankels 🔒 - Spherical Hankel functions
h_p(z)of the first kind forp = first..=lastat a nonzero argument. Real positive arguments use the elementary outgoing seed and upward recurrence (DLMF 10.49.6, 10.51.1). Unlike regular J, H contains the dominant irregular solution, so this direction is stable below the turning point too. The bounded domain keeps every intermediate finite and agrees with AMOS to the existing 1e-13 sequence tolerance; other arguments retain one AMOS sequence. - spherical_
pair 🔒 - Spherical functions of orders
orderandorder + 1. Hankel functions share one AMOS sequence, which agrees with single evaluations to 2e-14 relative. J and Y sequences differ from single evaluations by up to 1e-12, so these stay single. - spherical_
prefactor 🔒 sqrt(pi / 2z), which turns cylindrical functions of orderl + 1/2into spherical functions of orderl.- spherical_
radial - Evaluate a spherical radial function and its first two derivatives:
j_lfor regular andh1_lfor singular waves. - spherical_
radial_ 🔒sequence spherical_radialjets of every degree0..=orderat one argument. Regular jets share power-series terms or single AMOS J evaluations. Singular jets share onespherical_hankelssequence, using its positive-real recurrence where qualified and AMOS elsewhere. Against 30-digit values at|Im z| <= 5, the AMOS sequence stays within 2e-13 relative up to order 80 (two-term sequences: 8e-14); belowIm z = 0it loses up to a digit to two-term sequences, still within 1e-13 of each jet’s size up to order 40.