Skip to content
fn

hermite_polynomial_h

→Tensor
hermite_polynomial_h(x: TensorOrScalar, n: TensorOrScalar)

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

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

Parameters

xTensor | Scalar
Where HnH_n is evaluated, of any real dtype.
nTensor | Scalar
Degree of HnH_n, for every element or one per element; truncated toward zero, and a negative degree gives 0.

Returns

Tensor

Hn(x)H_n(x) element-wise, broadcast over x and n.

Notes

Rodrigues formula and recurrence:

Hn(x)=(−1)nex2dndxne−x2,Hk+1(x)=2x Hk(x)−2k Hk−1(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(2 x)H_n(x) = 2^{n/2} He_n(\sqrt{2}\, x).

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., -0., -4.])

Used by 1