jax.scipy.special.lpmn_values

Contents

jax.scipy.special.lpmn_values#

jax.scipy.special.lpmn_values(m, n, z, is_normalized)[source]#

The associated Legendre functions (ALFs) of the first kind.

Unlike lpmn, this function only computes the values of ALFs. The ALFs of the first kind can be used in spherical harmonics. The spherical harmonic of degree l and order m can be written as \(Y_l^m(\theta, \phi) = N_l^m * P_l^m(\cos \theta) * \exp(i m \phi)\), where \(N_l^m\) is the normalization factor and θ and φ are the colatitude and longitude, respectively. \(N_l^m\) is chosen in the way that the spherical harmonics form a set of orthonormal basis function of \(L^2(S^2)\). Normalizing \(P_l^m\) avoids overflow/underflow and achieves better numerical stability.

Parameters:
  • m (int) – The maximum order of the associated Legendre functions.

  • n (int) – The maximum degree of the associated Legendre function, often called l in describing ALFs. Both the degrees and orders are [0, 1, 2, …, l_max], where l_max denotes the maximum degree.

  • z (Array) – A vector of type float32 or float64 containing the sampling points at which the ALFs are computed.

  • is_normalized (bool) – True if the associated Legendre functions are normalized. With normalization, \(N_l^m\) is applied such that the spherical harmonics form a set of orthonormal basis functions of \(L^2(S^2)\).

Return type:

Array

Returns:

A 3D array of shape (l_max + 1, l_max + 1, len(z)) containing the values of the associated Legendre functions of the first kind. The return type matches the type of z.

Raises:
  • TypeError if elements of array z are not in (float32, float64). –

  • ValueError if array z is not 1D. –

  • NotImplementedError if m!=n. –