fn

hermite_polynomial_h

Tensor
hermite_polynomial_h(x: Tensor, n: int)
source

Physicist's Hermite polynomial Hn(x)H_n(x).

The physicists' Hermite polynomials are orthogonal on (,)(-\infty, \infty) with weight ex2e^{-x^2} and form the eigenfunctions of the quantum harmonic oscillator (in conjunction with the Gaussian envelope).

Parameters

xTensor
Argument tensor; any floating-point dtype.
nint
Non-negative polynomial degree.

Returns

Tensor

Hn(x)H_n(x) element-wise, same shape and dtype as x.

Notes

Rodrigues formula and recurrence:

Hn(x)=(1)nex2dndxnex2,Hk+1(x)=2xHk(x)2kHk1(x).H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n} e^{-x^2}, \qquad H_{k+1}(x) = 2x\, H_k(x) - 2k\, H_{k-1}(x).

Starting values: H0(x)=1H_0(x) = 1, H1(x)=2xH_1(x) = 2x. Linked to the probabilists' Hermite polynomials by Hn(x)=2n/2Hen(2x)H_n(x) = 2^{n/2} He_n(\sqrt{2}\, x). Raises ValueError for n < 0.

Examples

>>> import lucid
>>> from lucid.special import hermite_polynomial_h
>>> hermite_polynomial_h(lucid.tensor([-1.0, 0.0, 1.0]), n=3)
Tensor([4.0000, 0.0000, -4.0000])