bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / special / _multiufuncs / assoc_legendre_p
MultiUFunc
scipy.special._multiufuncs:assoc_legendre_p
source: build-install/usr/lib/python3.14/site-packages/scipy/special/_multiufuncs.py
Signature
def assoc_legendre_p(n, m, z, *, branch_cut = 2, norm = False, diff_n = 0)Summary
Associated Legendre polynomial of the first kind.
Extended Summary
Defined as
where is the Legendre polynomial.
This definition includes the Condon-Shortley phase .
Parameters
n: array_like of intsDegree of the associated Legendre polynomial. Must have
n >= 0.m: array_like of intsOrder of the associated Legendre polynomial.
z: array_likeInput value.
branch_cut: array_like of ints, optionalSelects branch cut. Must be 2 (default) or 3. 2: cut on the real axis
|z| > 13: cut on the real axis-1 < z < 1norm: bool, optionalIf
True, compute the normalized associated Legendre polynomial. Default isFalse.diff_n: int, optionalA non-negative integer. Compute and return all derivatives up to order
diff_n. Default is 0.
Returns
: ndarray or tuple of ndarrayAssociated Legendre polynomial with
diff_nderivatives.
Notes
The normalized counterpart of an (unnormalized) associated Legendre polynomial has the additional factor
Examples
Evaluate :math:`P_2^1(z)` on :math:`[-1, 1]`:import numpy as np from scipy.special import assoc_legendre_p z = np.linspace(-1, 1, 11) expected = -3 * z * np.sqrt(1 - z**2) np.allclose(assoc_legendre_p(2, 1, z), expected)✓
TrueCompute the normalized associated Legendre polynomial:
scale = np.sqrt(5/12) np.allclose(assoc_legendre_p(2, 1, z, norm=True), scale * expected)✓
True
Aliases
scipy.special.assoc_legendre_p