scipy.special.sph_harm_y_all#

scipy.special.sph_harm_y_all(n, m, theta, phi, \*, diff_n=0) = <scipy.special._multiufuncs.MultiUFunc object>[source]#

All spherical harmonics up to the specified degree n, order m, and all derivatives up to order diff_n.

Parameters:
nint

Degree of the harmonics. Must have n >= 0. This is often denoted by l (lower case L) in descriptions of spherical harmonics.

mint

Order of the harmonics.

thetaarray_like

Polar (colatitudinal) coordinate; must be in [0, pi].

phiarray_like

Azimuthal (longitudinal) coordinate; must be in [0, 2*pi].

diff_nint, optional

A non-negative integer. Compute and return all derivatives up to order diff_n. Default is 0.

Returns:
ndarray or tuple of ndarray

Returns a tuple of length diff_n + 1 (if diff_n > 0). The first entry corresponds to the spherical harmonics, the second entry (if diff_n >= 1) to the gradient, and the third entry (if diff_n >= 2) to the Hessian matrix. Each entry is an array of shape (n + 1, 2 * m + 1, ...), where the entry at (i, j) corresponds to degree i and order j for all 0 <= i <= n and -m <= j <= m.

See also

sph_harm_y

Notes

Array API Standard Support

sph_harm_y_all has support for Python Array API Standard compatible backends in addition to NumPy. The following combinations of backend and device (or other capability) are supported.

Library

CPU

GPU

NumPy

✅

n/a

CuPy

n/a

⛔

PyTorch

✅

⛔

JAX

⚠️ no JIT

⛔

Dask

⛔

n/a

See Array API coverage for more information.