numpy.polynomial.hermite_e.hermefromroots

numpy.polynomial.hermite_e.hermefromroots(roots)

Generate a Hermite series with the given roots.

Return the array of coefficients for the P-series whose roots (a.k.a. “zeros”) are given by roots. The returned array of coefficients is ordered from lowest order “term” to highest, and zeros of multiplicity greater than one must be included in roots a number of times equal to their multiplicity (e.g., if 2 is a root of multiplicity three, then [2,2,2] must be in roots).

Parameters :

roots : array_like

Sequence containing the roots.

Returns :

out : ndarray

1-d array of the Hermite series coefficients, ordered from low to high. If all roots are real, out.dtype is a float type; otherwise, out.dtype is a complex type, even if all the coefficients in the result are real (see Examples below).

See also

polyfromroots, chebfromroots

Notes

What is returned are the c_i such that:

\sum_{i=0}^{n} c_i*P_i(x) = \prod_{i=0}^{n} (x - roots[i])

where n == len(roots) and P_i(x) is the i-th Hermite (basis) polynomial over the domain [-1,1]. Note that, unlike polyfromroots, due to the nature of the Hermite basis set, the above identity does not imply c_n = 1 identically (see Examples).

Examples

>>> from numpy.polynomial.hermite_e import hermefromroots, hermeval
>>> coef = hermefromroots((-1, 0, 1))
>>> hermeval((-1, 0, 1), coef)
array([ 0.,  0.,  0.])
>>> coef = hermefromroots((-1j, 1j))
>>> hermeval((-1j, 1j), coef)
array([ 0.+0.j,  0.+0.j])

Previous topic

numpy.polynomial.hermite_e.hermeroots

Next topic

numpy.polynomial.hermite_e.hermefit

This Page