Legendre polynomial .
The Legendre polynomials are orthogonal on with uniform weight, and serve as the angular eigenfunctions of the Laplacian on the sphere (spherical harmonics with ) and as a basis for Gauss-Legendre quadrature.
Parameters
Argument tensor; any floating-point dtype. Customarily
evaluated on .
nintNon-negative polynomial degree.
Returns
Tensor element-wise, same shape and dtype as x.
Notes
Bonnet recurrence:
On , with boundary values
, . Raises
ValueError for n < 0.
Examples
>>> import lucid
>>> from lucid.special import legendre_polynomial_p
>>> legendre_polynomial_p(lucid.tensor([-1.0, 0.0, 0.5, 1.0]), n=3)
tensor([-1., -0., -0.4375, 1.])