Overview#

spheroidal is a python library for computing spin weighted spheroidal harmonics along with their eigenvalues and derivatives. It supports both integer and half integer spin weights. The library provides implementations of the spherical expansion method described in (Hughes, 2000) and the continued fraction method from (Leaver, 1985). Also included is code for computing spin weighted spherical harmonics and spherical-spheroidal mixing coefficients. Some example code for visualizing and animating the harmonics is available on the Visualization page.

_images/s-2.png

Installation#

Install using Anaconda

conda install -c conda-forge spheroidal

or using pip

pip install spheroidal

Basic Usage#

import spheroidal
from math import pi

# Compute the spin weighted spheroidal eigenvalue with s = -2, l = 2, m = 2, gamma = 1.5
spheroidal.eigenvalue(-2, 2, 2, 1.5)
# -5.5776273646788255

# Compute the corresponding spin weighted spheroidal harmonic
S = spheroidal.harmonic(-2, 2, 2, 1.5)

# Evaluate at theta = pi/2, phi = 0
S(pi/2, 0)
# (0.06692950919170575+0j)

# Compute the derivative wrt theta at the same point
spheroidal.harmonic_deriv(-2, 2, 2, 1.5)(pi/2, 0)
# (-0.20852146386265577+0j)

API Reference#

eigenvalue(s, ell, m, g[, method, ...])

Computes the spin-weighted spheroidal eigenvalue with spin-weight s, degree l, order m, and spheroidicity g.

harmonic(s, ell, m, g[, method, num_terms, ...])

Computes the spin-weighted spheroidal harmonic with spin-weight s, degree l, order m, and spheroidicity g.

harmonic_deriv(s, ell, m, g[, n_theta, ...])

Computes the derivative of the spin-weighted spheroidal harmonic with spin-weight s, degree l, order m, and spheroidicity g.

spherical

Module containing functions for computing spin weighted spherical harmonics and spherical-spheroidal mixing coefficients.

leaver

Module containing functions for computing spin-weighted spheroidal harmonics using Leaver's method.

spectral

Module containing functions for computing spin-weighted spheroidal harmonics using the spherical expansion method.

Indices and tables#