torch.special.laguerre_polynomial_l
function laguerre_polynomial_l<S extends Shape>(x: Tensor<S, 'float32'>, n: number | Tensor, _options?: SpecialPolynomialOptions<S>): Tensor<S, 'float32'>Computes Laguerre polynomial L_n(x).
The Laguerre polynomials L_n(x) are orthogonal on [0, ∞) with weight exp(-x). Natural for:
- Quantum mechanics: hydrogen atom radial wavefunctions (associated Laguerre), Rydberg formula
- Exponential decay problems: reliability, survival analysis, failure rates, waiting times
- Signal processing: exponentially decaying signals, radioactive decay, pharmacokinetics
- Approximation on [0, ∞): function expansion with exponential weight preferred at origin
- Probability models: exponential distribution, Poisson processes, gamma distributions
- Orthogonal polynomial methods: natural basis for [0, ∞) problems without explicit boundary conditions
Domain [0, ∞): Unlike Chebyshev/Hermite, Laguerre is on semi-infinite half-line. Weight exp(-x) suppresses oscillations at large x; zeros are all positive.
Quantum Hydrogen: Radial part of hydrogen atom solution uses associated Laguerre polynomials; Laguerre polynomials with n=2l + 1 (related to principal quantum number) define allowed orbits.
- Semi-infinite domain: [0, ∞), not bounded interval like Chebyshev or Hermite
- Exponential weight: Orthogonal with weight exp(-x), not 1; natural for decay problems
- Positive roots: All n zeros of L_n are in (0, ∞); no negative roots
- Recurrence efficiency: Three-term recurrence with rational coefficients (n+1 denominator)
- Boundary behavior: L_n(0) = 1 for all n; L_n(x) → -∞ or oscillates for large x (weight suppresses)
- Norm is 1: Orthogonality integral = δ_mn (not n! like Hermite or 2^n n! √π like Chebyshev physicist)
- Hydrogen atom: Associated Laguerre L_n^(k)(x) used in hydrogen; standard Laguerre special case
- Semi-infinite: Domain [0, ∞); behavior for x 0 not physical (polynomial extrapolation)
- Recurrence numerically sensitive: Denominator n+1 can cause issues for large n; forward recurrence stable
- Associated Laguerre needed for hydrogen: Standard Laguerre is special case (k=0); use library for L_n^(k)
Parameters
xTensor<S, 'float32'>- Input tensor with values ≥ 0 (semi-infinite domain; diverges for x → ∞, but weight exp(-x) suppresses)
nnumber | Tensor- Polynomial degree (non-negative integer). Can be scalar or Tensor
_optionsSpecialPolynomialOptions<S>optional
Returns
Tensor<S, 'float32'>– Tensor with L_n(x) valuesExamples
// Basic evaluation
const x = torch.linspace(0, 5, 5);
const L_0 = torch.special.laguerre_polynomial_l(x, 0); // [1, 1, 1, 1, 1]
const L_1 = torch.special.laguerre_polynomial_l(x, 1); // 1 - x
const L_2 = torch.special.laguerre_polynomial_l(x, 2); // 1 - 2*x + 0.5*x^2
// Hydrogen atom radial wavefunctions
const r = torch.linspace(0, 20, 100); // Radial coordinate (in Bohr radii)
const n_level = 2; // Principal quantum number
const l_orbital = 0; // Angular momentum (s-orbital)
// Associated Laguerre L_{n-l-1}^{2l+1}(2*r/n) appears in R_nl(r)
// For simplicity, using standard Laguerre:
const L_basis = torch.special.laguerre_polynomial_l(r, 2 * l_orbital + 1);
// Multiplied by r^l * exp(-r/n) * (normalization) gives radial wavefunction
// Exponential decay modeling
const t = torch.linspace(0, 10, 50); // Time
const lambda = 0.1; // Decay rate
const x_decay = lambda.mul(t); // Scaled time
const L_3 = torch.special.laguerre_polynomial_l(x_decay, 3);
// Laguerre polynomials weight naturally with exp(-λt) behavior
// Recurrence verification
const x_test = torch.tensor([2.0]);
const L_0_t = torch.special.laguerre_polynomial_l(x_test, 0); // 1
const L_1_t = torch.special.laguerre_polynomial_l(x_test, 1); // 1 - 2 = -1
const L_2_t = torch.special.laguerre_polynomial_l(x_test, 2); // 1 - 2*2 + 0.5*4 = 1
// L_2 = (3*L_1 - 2*L_0) / 2 = (3*(-1) - 2*1)/2 = -5/2 ... verification needed
// Approximation on [0, ∞)
const x_aprox = torch.linspace(0, 5, 100);
const n_terms = 5;
const laguerre_basis = [];
for (let i = 0; i < n_terms; i++) {
laguerre_basis.push(torch.special.laguerre_polynomial_l(x_aprox, i));
}
// Forms orthogonal basis for [0, ∞) with exp(-x) weightSee Also
- PyTorch torch.special.laguerre_polynomial_l()
- torch.special.hermite_polynomial_h - Hermite on (-∞, ∞) with exp(-x²) weight
- torch.special.hermite_polynomial_he - Probabilist's Hermite with Gaussian weight
- torch.special.legendre_polynomial_p - Legendre on [-1, 1] with constant weight