{ } Raw JSON

bundles / scipy 1.17.1 / scipy / special / _orthogonal / roots_hermite

function

scipy.special._orthogonal:roots_hermite

source: /scipy/special/_orthogonal.py :827

Signature

def   roots_hermite ( n mu = False )

Summary

Gauss-Hermite (physicist's) quadrature.

Extended Summary

Compute the sample points and weights for Gauss-Hermite quadrature. The sample points are the roots of the nth degree Hermite polynomial, . These sample points and weights correctly integrate polynomials of degree or less over the interval with weight function . See 22.2.14 in [AS] for details.

Parameters

n : int

quadrature order

mu : bool, optional

If True, return the sum of the weights, optional.

Returns

x : ndarray

Sample points

w : ndarray

Weights

mu : float

Sum of the weights

Notes

For small n up to 150 a modified version of the Golub-Welsch algorithm is used. Nodes are computed from the eigenvalue problem and improved by one step of a Newton iteration. The weights are computed from the well-known analytical formula.

For n larger than 150 an optimal asymptotic algorithm is applied which computes nodes and weights in a numerically stable manner. The algorithm has linear runtime making computation for very large n (several thousand or more) feasible.

See also

numpy.polynomial.hermite.hermgauss
roots_hermitenorm
scipy.integrate.fixed_quad

Aliases

  • scipy.special.h_roots