torch.special.spherical_bessel_j0
function spherical_bessel_j0<S extends Shape>(input: Tensor<S, 'float32'>, _options?: SpecialUnaryOptions<S>): Tensor<S, 'float32'>Computes the spherical Bessel function of the first kind of order 0, j₀(x) = sin(x)/x.
Spherical Bessel functions solve the spherical Bessel equation x²y'' + 2xy' + (x² - n(n+1))y = 0, arising naturally in solutions to wave equations in spherical coordinates (separation of variables). Unlike cylindrical Bessel functions (J₀, Y₀, I₀, K₀), spherical Bessel functions have elementary closed-form expressions: j₀(x) = sin(x)/x, y₀(x) = -cos(x)/x. They appear in all spherically symmetric problems and are fundamental to scattering theory. Essential for:
- Quantum scattering: partial wave analysis (s-wave, p-wave scattering)
- Acoustic and electromagnetic radiation: spherical wavefronts, microphone/antenna patterns
- Quantum wells and boxes: particle in a sphere, spherical cavity resonances
- Diffusion equations: spherically symmetric heat/particle diffusion
- Optics: Fresnel diffraction, spherical aberration analysis
- Atomic physics: electron wavefunctions near nuclei (hydrogen atom radial parts)
Key Properties:
- j₀(x) = sin(x)/x (elementary closed form!)
- j₀(0) = 1 (well-defined at origin)
- Oscillatory with 1/x envelope: amplitude ∝ 1/x as x → ∞
- Zeros at x = nπ for n = 1, 2, 3, ... (locations where sin(x)=0 except x=0)
- j₀(-x) = j₀(x) (even function)
- Related: j₁(x) = sin(x)/x² - cos(x)/x, j₂(x) = more complex
- Recurrence: (2n+1)jₙ = x(jₙ₋₁ + jₙ₊₁) (similar to cylindrical Bessel)
- Closed form: j₀(x) = sin(x)/x (unlike cylindrical J₀ which needs numerics)
- Even function: j₀(-x) = j₀(x), symmetric behavior
- Well-defined at origin: j₀(0) = 1, no singularities like Y₀
- Regular solution: Used for interior/regular domain problems
- Oscillatory decay: sin(x) oscillations with 1/x envelope
- Zeros: At x = π, 2π, 3π, ... (plus geometric multiples)
- Recurrence: Connects to j₁, j₂, j₃ through standard recurrence
- Complementary: y₀(x) = -cos(x)/x is complementary (second kind)
- Element-wise computation: sin(x)/x computed directly, no special functions needed
- Oscillations: Can have many oscillations for large |x|, requires fine sampling
- 1/x decay: Slowly decaying oscillations (compare to exponential decay of K₀)
- Linear coefficient: Different from cylindrical (2xy' vs xy' in equation)
Parameters
inputTensor<S, 'float32'>- Input tensor with real values x (any range, typically [-50, 50])
_optionsSpecialUnaryOptions<S>optional
Returns
Tensor<S, 'float32'>– Tensor with j₀(x) values = sin(x)/xExamples
// Elementary function: sin(x)/x with oscillations
const x = torch.tensor([0, Math.PI, 2*Math.PI, 3*Math.PI]);
const j0 = torch.special.spherical_bessel_j0(x); // [1, 0, -1/2π, 0]
// j₀(0)=1 (by limit), zeros at π, 2π, 3π (where sin(x)=0)// Scattering amplitude: partial wave analysis
const k = torch.linspace(0.01, 10, 100); // Wavenumber (scattering energy)
const a = 1.0; // Scattering length/radius
const phase_shift = torch.special.spherical_bessel_j0(k * a); // S-wave phase shift (simplified)
// In actual scattering: phase depends on j₀ and y₀ at ka// Spherical cavity resonances (particle in a sphere)
const r = torch.linspace(0, 1, 100); // Normalized radius
const mode = 1; // Mode number (frequency = c * mode * π / R)
const radius_R = 1.0;
const wavefunction = torch.special.spherical_bessel_j0(r.mul(mode * Math.PI / radius_R));
// Wavefunction inside sphere (j₀ regular at r=0)// Monopole acoustic radiation from sphere
const r = torch.linspace(0.1, 10, 100); // Distance from source
const freq_r = r.mul(1.0); // kr (frequency parameter)
const pressure = torch.special.spherical_bessel_j0(freq_r); // Monopole field
// At far field, decays as 1/r through both j₀ amplitude and 1/r geometric factorSee Also
- PyTorch torch.special.spherical_bessel_j0()
- torch.special.bessel_j0 - Cylindrical J₀ (different equation, no closed form)
- torch.special.spherical_bessel_j1 - Order 1 spherical Bessel
- torch.special.airy_ai - Different oscillatory special function