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
|
|---|---|
| Returns : | out : ndarray
|
See also
polyfromroots, chebfromroots
Notes
What is returned are the
such that:
![\sum_{i=0}^{n} c_i*P_i(x) = \prod_{i=0}^{n} (x - roots[i])](../../_images/math/64481dc1feb088cc33ababc1331c7fd497ad5ee8.png)
where n == len(roots) and
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
identically (see
Examples).
Examples
>>> from numpy.polynomial.hermite import hermfromroots, hermval
>>> coef = hermfromroots((-1, 0, 1))
>>> hermval((-1, 0, 1), coef)
array([ 0., 0., 0.])
>>> coef = hermfromroots((-1j, 1j))
>>> hermval((-1j, 1j), coef)
array([ 0.+0.j, 0.+0.j])