§ <ˆj¢Í ã ó° — d Z ddlZddlmZ ddlmZ ddlm Z ddlmZ g d¢Z e j Zd„ Zd „ Z ej d dg¦ « Z ej dg¦ « Z ej dg¦ « Z ej ddg¦ « Zd„ Zd„ Zd „ Zd„ Zd„ Zd„ Zd„ Zd(d„Zd)d„Zdg dddfd„Z d*d„Z!d„ Z"d„ Z#d„ Z$d„ Z%d„ Z&d„ Z'd„ Z(d+d „Z)d!„ Z*d"„ Z+d#„ Z,d$„ Z-d%„ Z. G d&„ d'e¦ « Z/dS ),a. =================================================================== HermiteE Series, "Probabilists" (:mod:`numpy.polynomial.hermite_e`) =================================================================== This module provides a number of objects (mostly functions) useful for dealing with Hermite_e series, including a `HermiteE` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in the docstring for its "parent" sub-package, `numpy.polynomial`). Classes ------- .. autosummary:: :toctree: generated/ HermiteE Constants --------- .. autosummary:: :toctree: generated/ hermedomain hermezero hermeone hermex Arithmetic ---------- .. autosummary:: :toctree: generated/ hermeadd hermesub hermemulx hermemul hermediv hermepow hermeval hermeval2d hermeval3d hermegrid2d hermegrid3d Calculus -------- .. autosummary:: :toctree: generated/ hermeder hermeint Misc Functions -------------- .. autosummary:: :toctree: generated/ hermefromroots hermeroots hermevander hermevander2d hermevander3d hermegauss hermeweight hermecompanion hermefit hermetrim hermeline herme2poly poly2herme See also -------- `numpy.polynomial` é N)Únormalize_axis_indexé )Ú polyutils)ÚABCPolyBase)Ú hermezeroÚhermeoneÚhermexÚhermedomainÚ hermelineÚhermeaddÚhermesubÚ hermemulxÚhermemulÚhermedivÚhermepowÚhermevalÚhermederÚhermeintÚ herme2polyÚ poly2hermeÚhermefromrootsÚhermevanderÚhermefitÚ hermetrimÚ hermerootsÚHermiteEÚ hermeval2dÚ hermeval3dÚhermegrid2dÚhermegrid3dÚ hermevander2dÚ hermevander3dÚhermecompanionÚ hermegaussÚhermeweightc óÊ — t j | g¦ « \ } t | ¦ « dz }d}t |dd¦ « D ]%}t t |¦ « | | ¦ « }Œ&|S )aŠ poly2herme(pol) Convert a polynomial to a Hermite series. Convert an array representing the coefficients of a polynomial (relative to the "standard" basis) ordered from lowest degree to highest, to an array of the coefficients of the equivalent Hermite series, ordered from lowest to highest degree. Parameters ---------- pol : array_like 1-D array containing the polynomial coefficients Returns ------- c : ndarray 1-D array containing the coefficients of the equivalent Hermite series. See Also -------- herme2poly Notes ----- The easy way to do conversions between polynomial basis sets is to use the convert method of a class instance. Examples -------- >>> from numpy.polynomial.hermite_e import poly2herme >>> poly2herme(np.arange(4)) array([ 2., 10., 2., 3.]) r r éÿÿÿÿ)ÚpuÚ as_seriesÚlenÚranger r )ÚpolÚdegÚresÚis úQ/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/polynomial/hermite_e.pyr r a sg € õL ŒL˜#˜ÑÔ�E€SÝ ˆc‰(Œ(�Q‰,€CØ €CÝ �3˜˜BÑ Ô ð /ð /ˆÝ•y ‘~”~ s¨1¤vÑ.Ô.ˆˆØ€Jó c ó^ — ddl m}m}m} t j | g¦ « \ } t | ¦ « }|dk r| S |dk r| S | d }| d }t |dz dd¦ « D ]4}|} || |dz ||dz z ¦ « } || ||¦ « ¦ « }Œ5 || ||¦ « ¦ « S )a Convert a Hermite series to a polynomial. Convert an array representing the coefficients of a Hermite series, ordered from lowest degree to highest, to an array of the coefficients of the equivalent polynomial (relative to the "standard" basis) ordered from lowest to highest degree. Parameters ---------- c : array_like 1-D array containing the Hermite series coefficients, ordered from lowest order term to highest. Returns ------- pol : ndarray 1-D array containing the coefficients of the equivalent polynomial (relative to the "standard" basis) ordered from lowest order term to highest. See Also -------- poly2herme Notes ----- The easy way to do conversions between polynomial basis sets is to use the convert method of a class instance. Examples -------- >>> from numpy.polynomial.hermite_e import herme2poly >>> herme2poly([ 2., 10., 2., 3.]) array([0., 1., 2., 3.]) r )ÚpolyaddÚpolysubÚpolymulxé éþÿÿÿr' )Ú polynomialr3 r4 r5 r( r) r* r+ ) Úcr3 r4 r5 ÚnÚc0Úc1r/ Útmps r0 r r � sé € ðL 7Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6Ð6å Œ,˜�sÑ Ô �C€Q݈A‰Œ€A؈A‚v€v؈؈A‚v€vØˆà ˆrŒUˆØ ˆrŒUˆå�q˜1‘u˜a Ñ$Ô$ð ,ð ,ˆA؈CØ�˜˜1˜q™5œ 2 q¨1¡u¡:Ñ.Ô.ˆBØ�˜˜h˜h r™lœlÑ+Ô+ˆBˆB؈w�r˜8˜8 B™<œ<Ñ(Ô(Ð(r1 r' c ód — |dk rt j | |g¦ « S t j | g¦ « S )aõ Hermite series whose graph is a straight line. Parameters ---------- off, scl : scalars The specified line is given by ``off + scl*x``. Returns ------- y : ndarray This module's representation of the Hermite series for ``off + scl*x``. See Also -------- numpy.polynomial.polynomial.polyline numpy.polynomial.chebyshev.chebline numpy.polynomial.legendre.legline numpy.polynomial.laguerre.lagline numpy.polynomial.hermite.hermline Examples -------- >>> from numpy.polynomial.hermite_e import hermeline >>> from numpy.polynomial.hermite_e import hermeline, hermeval >>> hermeval(0,hermeline(3, 2)) 3.0 >>> hermeval(1,hermeline(3, 2)) 5.0 r )ÚnpÚarray)ÚoffÚscls r0 r r Ù s2 € ðB ˆa‚x€xÝŒx˜˜c˜ Ñ#Ô#Ð#åŒx˜˜‰ŒÐr1 c óB — t j t t | ¦ « S )at Generate a HermiteE series with given roots. The function returns the coefficients of the polynomial .. math:: p(x) = (x - r_0) * (x - r_1) * ... * (x - r_n), in HermiteE form, where the `r_n` are the roots specified in `roots`. If a zero has multiplicity n, then it must appear in `roots` n times. For instance, if 2 is a root of multiplicity three and 3 is a root of multiplicity 2, then `roots` looks something like [2, 2, 2, 3, 3]. The roots can appear in any order. If the returned coefficients are `c`, then .. math:: p(x) = c_0 + c_1 * He_1(x) + ... + c_n * He_n(x) The coefficient of the last term is not generally 1 for monic polynomials in HermiteE form. Parameters ---------- roots : array_like Sequence containing the roots. Returns ------- out : ndarray 1-D array of coefficients. If all roots are real then `out` is a real array, if some of the roots are complex, then `out` is complex even if all the coefficients in the result are real (see Examples below). See Also -------- numpy.polynomial.polynomial.polyfromroots numpy.polynomial.legendre.legfromroots numpy.polynomial.laguerre.lagfromroots numpy.polynomial.hermite.hermfromroots numpy.polynomial.chebyshev.chebfromroots 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]) )r( Ú _fromrootsr r )Úrootss r0 r r s € õj Œ=�¥H¨eÑ4Ô4Ð4r1 c ó, — t j | |¦ « S )að Add one Hermite series to another. Returns the sum of two Hermite series `c1` + `c2`. The arguments are sequences of coefficients ordered from lowest order term to highest, i.e., [1,2,3] represents the series ``P_0 + 2*P_1 + 3*P_2``. Parameters ---------- c1, c2 : array_like 1-D arrays of Hermite series coefficients ordered from low to high. Returns ------- out : ndarray Array representing the Hermite series of their sum. See Also -------- hermesub, hermemulx, hermemul, hermediv, hermepow Notes ----- Unlike multiplication, division, etc., the sum of two Hermite series is a Hermite series (without having to "reproject" the result onto the basis set) so addition, just like that of "standard" polynomials, is simply "component-wise." Examples -------- >>> from numpy.polynomial.hermite_e import hermeadd >>> hermeadd([1, 2, 3], [1, 2, 3, 4]) array([2., 4., 6., 4.]) )r( Ú_add©r<