Spin-weighted spheroidal harmonic module

Contents

Spin-weighted spheroidal harmonic module#

The spin-weighted spheroidal harmonics \(S_{sjm\gamma}(\theta)\) satisfy the equation

\[ \left[\frac{1}{\sin\theta}\frac{d}{d\theta}\left(\sin\theta \frac{d}{d\theta} \right) - \left(\gamma^2\sin^2\theta+\frac{(m+s\cos\theta)^2}{\sin^2\theta} +2\gamma s\cos\theta-s-2m\gamma-\lambda_{sjm\gamma} \right)\right]S_{sjm\gamma} = 0, \]
with eigenvalues \(\lambda_{sjm\gamma}\) and spheroidicity \(\gamma\). For the Teukolsky equation, \(\gamma = a\omega\).

API#

pybhpt.swsh.fac(n)[source]

Computes the factorial of a non-negative integer n.

Parameters:

n (int) – A non-negative integer.

Returns:

The factorial of n.

Return type:

float

pybhpt.swsh.Yslm(s, l, m, th, ph=None)[source]

Evaluate the spin-weighted spherical harmonic $Y_{s}^{lm}$ at a given angle theta.

Parameters:
  • s (int) – The spin weight of the harmonic.

  • l (int) – The angular number of the spherical harmonic.

  • m (int) – The azimuthal number of the spherical harmonic.

  • th (array_like) – The polar angle(s) at which to evaluate the spherical harmonic.

Returns:

The values of the spherical harmonic at the specified angles.

Return type:

array_like

pybhpt.swsh.Yslm_derivative(s, l, m, th, ph=None)[source]

Evaluate the derivative of the spin-weighted spherical harmonic $Y_{s}^{lm}$ at a given angle theta.

Parameters:
  • s (int) – The spin weight of the harmonic.

  • l (int) – The angular number of the spherical harmonic.

  • m (int) – The azimuthal number of the spherical harmonic.

  • th (array_like) – The polar angle(s) at which to evaluate the spherical harmonic.

Returns:

The derivatives of the spherical harmonic at the specified angles.

Return type:

array_like

pybhpt.swsh.Yslm_derivative2(s, l, m, th, ph=None)[source]

Evaluate the second derivative of the spin-weighted spherical harmonic $Y_{s}^{lm}$ at a given angle theta.

Parameters:
  • s (int) – The spin weight of the harmonic.

  • l (int) – The angular number of the spherical harmonic.

  • m (int) – The azimuthal number of the spherical harmonic.

  • th (array_like) – The polar angle(s) at which to evaluate the spherical harmonic.

Returns:

The second derivatives of the spherical harmonic at the specified angles.

Return type:

array_like

pybhpt.swsh.Yslm_eigenvalue(s, l, *args)[source]
pybhpt.swsh.clebsch(l1, l2, l3, m1, m2, m3)[source]

Compute the Clebsch-Gordon coefficient <l1,m1,l2,m2|l3,m3>.

Parameters:
  • l1 (int) – The angular number of the first state.

  • l2 (int) – The angular number of the second state.

  • l3 (int) – The angular number of the combined state.

  • m1 (int) – The azimuthal number of the first state.

  • m2 (int) – The azimuthal number of the second state.

  • m3 (int) – The azimuthal number of the combined state.

Returns:

The Clebsch-Gordon coefficient <l1,m1,l2,m2|l3,m3>.

Return type:

float

pybhpt.swsh.w3j(l1, l2, l3, m1, m2, m3)[source]
Compute the Wigner 3j-symbol
l1 l2 l3 |
m1 m2 m3 |
Parameters:
  • l1 (int) – The angular number of the first state.

  • l2 (int) – The angular number of the second state.

  • l3 (int) – The angular number of the combined state.

  • m1 (int) – The azimuthal number of the first state.

  • m2 (int) – The azimuthal number of the second state.

  • m3 (int) – The azimuthal number of the combined state.

Returns:

The Wigner 3j-symbol $ egin{pmatrix} l1 & l2 & l3 m1 & m2 & m3 end{pmatrix} $

Return type:

float

pybhpt.swsh.k1(s, l, j, m)[source]
pybhpt.swsh.k2(s, l, j, m)[source]
pybhpt.swsh.k2m2(s, l, m)[source]
pybhpt.swsh.k2m1(s, l, m)[source]
pybhpt.swsh.k2p0(s, l, m)[source]
pybhpt.swsh.k2p1(s, l, m)[source]
pybhpt.swsh.k2p2(s, l, m)[source]
pybhpt.swsh.k1m1(s, l, m)[source]
pybhpt.swsh.k1p0(s, l, m)[source]
pybhpt.swsh.k1p1(s, l, m)[source]
pybhpt.swsh.akm2(s, l, m, g)[source]
pybhpt.swsh.akm1(s, l, m, g)[source]
pybhpt.swsh.akp0(s, l, m, g)[source]
pybhpt.swsh.akp1(s, l, m, g)[source]
pybhpt.swsh.akp2(s, l, m, g)[source]
pybhpt.swsh.spectral_sparse_matrix(s, m, g, nmax)[source]
pybhpt.swsh.swsh_eigs(s, l, m, g, nmax=None, return_eigenvectors=True)[source]
pybhpt.swsh.swsh_coeffs(s, l, m, g, th)[source]
pybhpt.swsh.swsh_eigenvalue(s, l, m, g, nmax=None)[source]

Compute the eigenvalue of the spin-weighted spheroidal harmonic.

Parameters:
  • s (int) – The spin weight of the harmonic.

  • l (int) – The angular number of the harmonic.

  • m (int) – The azimuthal number of the harmonic.

  • g (float or complex) – The spheroidicity parameter.

  • nmax (int, optional) – The maximum number of basis functions to use in the computation. If None, a default value is chosen.

Returns:

The eigenvalue of the spin-weighted spheroidal harmonic.

Return type:

float or complex

class pybhpt.swsh.SWSHBase(*args)[source]

Bases: object

class pybhpt.swsh.SWSHSeriesBase(s, j, m, g)[source]

Bases: SWSHBase

sparse_matrix(nmax)[source]
eigs(nmax=None, **kwargs)[source]
generate_eigenvalue()[source]
generate_eigs()[source]
class pybhpt.swsh.SpinWeightedSpheroidalHarmonic(s, j, m, g)[source]

Bases: SWSHSeriesBase

A class for generating a spin-weighted spheroidal harmonic.

Parameters:
  • s (int) – The spin weight of the harmonic.

  • j (int) – The angular number of the harmonic.

  • m (int) – The azimuthal number of the harmonic.

  • g (float or complex) – The spheroidicity parameter.

Variables:

couplingcoefficients (array_like) – The coupling coefficients between the spin-weighted spheroidal harmonic and the spin-weighted spherical

property couplingcoefficients
couplingcoefficient(l)[source]
Yslm(l, th)[source]

Evaluate the spin-weighted spherical harmonic $Y_{s}^{lm}(theta)$ at a given angle theta.

Parameters:
  • l (int) – The angular number of the spherical harmonic.

  • th (array_like) – The polar angle(s) at which to evaluate the spherical harmonic.

Returns:

The values of the spherical harmonic at the specified angles.

Return type:

array_like

Yslm_derivative(l, th)[source]

Evaluate the derivative of the spin-weighted spherical harmonic $Y_{s}^{lm}(theta)$ at a given angle theta.

Parameters:
  • l (int) – The angular number of the spherical harmonic.

  • th (array_like) – The polar angle(s) at which to evaluate the derivative of the spherical harmonic.

Returns:

The values of the derivative of the spherical harmonic at the specified angles.

Return type:

array_like

Yslm_derivative2(l, th)[source]

Evaluate the second derivative of the spin-weighted spherical harmonic $Y_{s}^{lm}(theta)$ at a given angle theta.

Parameters:
  • l (int) – The angular number of the spherical harmonic.

  • th (array_like) – The polar angle(s) at which to evaluate the second derivative of the spherical harmonic.

Returns:

The values of the second derivative of the spherical harmonic at the specified angles.

Return type:

array_like

Sslm(*args)[source]

Evaluate the spin-weighted spheroidal harmonic $S_{s}^{lm}(theta)$ at a given angle theta.

Parameters:

th (array_like) – The polar angle(s) at which to evaluate the spheroidal harmonic.

Returns:

The values of the spheroidal harmonic at the specified angles.

Return type:

array_like

Sslm_derivative(*args)[source]

Evaluate the derivative of the spin-weighted spheroidal harmonic $S_{s}^{lm}(theta)$ at a given angle theta.

Parameters:

th (array_like) – The polar angle(s) at which to evaluate the spheroidal harmonic.

Returns:

The derivatives of the spheroidal harmonic at the specified angles.

Return type:

array_like

Sslm_derivative2(*args)[source]

Evaluate the second derivative of the spin-weighted spheroidal harmonic $S_{s}^{lm}(theta)$ at a given angle theta.

Parameters:

th (array_like) – The polar angle(s) at which to evaluate the spheroidal harmonic.

Returns:

The second derivatives of the spheroidal harmonic at the specified angles.

Return type:

array_like

__call__(th, ph=None, deriv=None)[source]

Call self as a function.

pybhpt.swsh.muCoupling(s, l)[source]

Eigenvalue for the spin-weighted spherical harmonic lowering operator Setting s -> -s gives the negative of the eigenvalue for the raising operator

pybhpt.swsh.Asjlm(s, j, l, m)[source]

Coupling coefficient between scalar and spin-weighted spherical harmonics

Parameters:
  • s (int) – The spin weight of the harmonic.

  • j (int) – The angular number of the scalar harmonic.

  • l (int) – The angular number of the spin-weighted harmonic.

  • m (int) – The azimuthal number of the harmonics.

Returns:

The coupling coefficient $A_{s}^{jlm}$

Return type:

float

pybhpt.swsh.spin_operator_normalization(s, ns, l)[source]