Fast, vectorized computation of prolate and oblate spheroidal wave functions using native Fortran kernels.
The package supports real and complex spheroidal parameters, double and quad precision, angular and radial functions, eigenvalues, accuracy estimates, derivatives, and inverse eigenvalue calculations.
import Pkg
Pkg.add("SpheroidalWaves")Prebuilt backends are downloaded automatically on supported platforms.
using SpheroidalWaves
# Angular function and derivative at several points
angular = smn(1, 2, 1.5, [-0.5, 0.0, 0.5])
angular.value
angular.derivative
# Radial function of the first kind
radial = rmn(1, 2, 1.5, [1.1, 1.2, 1.3]; kind=1)
# Oblate geometry
oblate = smn(1, 2, 1.5, [-0.5, 0.0, 0.5]; spheroid=:oblate)
# Complex spheroidal parameter
complex_result = smn(1, 2, 1.5 + 0.5im, [-0.5, 0.0, 0.5])
# Quad-precision backend
quad_result = rmn(1, 2, 1.5, [1.1, 1.2]; precision=:quad)
# Characteristic value
lambda = eigenvalue(1, 2, 1.5)Pass arrays to smn and rmn for batch evaluation. Calls are thread-safe.
smn: angular function and derivativermn: radial function and derivativeeigenvalueandeigenvalue_sweep: characteristic valuesaccuracy: estimated numerical accuracyradial_wronskian: radial Wronskianjacobian_eigen,jacobian_smn, andjacobian_rmn: derivatives with respect to parametersfind_c_for_eigenvalue: inverse characteristic-value calculation
The main options are spheroid=:prolate or :oblate, precision=:double or :quad, and radial kind=1:4.
For basis conversion and connection formulas, dmn, kmn, and amn provide expansion and normalization quantities.
See the documentation for definitions, argument restrictions, normalization, and complete examples.
The numerical kernels are based on the spheroidal-wave-function implementations by Arnie Lee Van Buren and Jeffrey Boisvert:
Use the Zenodo record to cite SpheroidalWaves.jl. The package is available under the GPL-3.0 License. The logo artwork incorporates Julia's dots and is licensed separately under CC BY-NC-SA 4.0.