hermite — SciPy v1.15.2 Manual (original) (raw)
scipy.special.
scipy.special.hermite(n, monic=False)[source]#
Physicist’s Hermite polynomial.
Defined by
\[H_n(x) = (-1)^ne^{x^2}\frac{d^n}{dx^n}e^{-x^2};\]
\(H_n\) is a polynomial of degree \(n\).
Parameters:
nint
Degree of the polynomial.
monicbool, optional
If True, scale the leading coefficient to be 1. Default is_False_.
Returns:
Horthopoly1d
Hermite polynomial.
Notes
The polynomials \(H_n\) are orthogonal over \((-\infty, \infty)\) with weight function \(e^{-x^2}\).
Examples
from scipy import special import matplotlib.pyplot as plt import numpy as np
p_monic = special.hermite(3, monic=True) p_monic poly1d([ 1. , 0. , -1.5, 0. ]) p_monic(1) -0.49999999999999983 x = np.linspace(-3, 3, 400) y = p_monic(x) plt.plot(x, y) plt.title("Monic Hermite polynomial of degree 3") plt.xlabel("x") plt.ylabel("H_3(x)") plt.show()