plegendre#

torchspin.plegendre(L, M_or_z=None, z_or_CSphase=None, CSphase_arg=None)[source]#

Compute associated Legendre polynomial \(P_L^M(z)\).

Parameters:
  • L (int) – Degree (non-negative integer, L >= 0).

  • M_or_z – If an integer and z_or_CSphase is also provided, this is the order M (|M| <= L). Otherwise this is the evaluation points z (with M=0).

  • z_or_CSphase – Evaluation points z (when M is given), or CSphase flag (when M is omitted). z must satisfy -1 <= z <= 1.

  • CSphase_arg – If True (default), include the Condon-Shortley phase \((-1)^M\).

Returns:

y – Associated Legendre polynomial values, same shape as z.

Return type:

ndarray