Skip to content
fn

hermite_polynomial_he

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

Probabilist's Hermite polynomial Hen(x)\mathit{He}_n(x).

Probabilists' Hermite polynomials are orthogonal on (−∞,∞)(-\infty, \infty) with weight e−x2/2/2πe^{-x^2/2} / \sqrt{2\pi} — the standard normal density — and are the natural basis for Hermite-expansions of functions against a Gaussian measure (Wiener chaos, Gauss-Hermite quadrature with weight 1).

Parameters

xTensor | Scalar
Where Hen\mathit{He}_n is evaluated, of any real dtype.
nTensor | Scalar
Degree of Hen\mathit{He}_n, for every element or one per element; truncated toward zero, and a negative degree gives 0.

Returns

Tensor

Hen(x)\mathit{He}_n(x) element-wise, broadcast over x and n.

Notes

Recurrence:

He0(x)=1,He1(x)=x,Hek+1(x)=x Hek(x)−k Hek−1(x).\mathit{He}_0(x) = 1, \quad \mathit{He}_1(x) = x, \quad \mathit{He}_{k+1}(x) = x\, \mathit{He}_k(x) - k\, \mathit{He}_{k-1}(x).

Connection to physicists' Hermite: Hen(x)=2−n/2Hn(x/2)\mathit{He}_n(x) = 2^{-n/2} H_n(x/\sqrt 2).

Examples

>>> import lucid
>>> from lucid.special import hermite_polynomial_he
>>> hermite_polynomial_he(lucid.tensor([-1.0, 0.0, 1.0]), n=3)
tensor([2., -0., -2.])

Used by 1