Hermite Polynomials
Polynomials in Hermite polynomial basis basis.
Polynomial results are returned in Hermite polynomial basis \(H\), if not stated otherwise.
Integers are used where possible, for multiplications and for divisions like in hermantider. Fractions are used where this was not possible, for example when a rational value has to be defined in hermx.
creation
H0 = (1,)
H1 = (0, 2)
H2 = (-2, 0, 4)
herm(n, method='iterative')
Return the n-th Hermite polynomial in standard monomial basis.
Available methods are
Notes
numpy.polynomial.hermite.herm2poly(vecbasis(n)) differs at \(n\geq29\).
See also
- constants:
H0,H1,H2 - implementations:
herm_recursive,herm_iterative,herm_explicit - for all Hermite polynomials:
herms
Source code in poly\hermite\creation.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
herm_recursive(n)
Return the n-th Hermite polynomial in standard monomial basis.
Uses the recurrence relation \(H_n(x)=2xH_{n-1}(x)-2(n-1)H_{n-2}(x)\) recursively.
Cached, therefore fast if used repeatedly.
See also
- for any implementation:
herm - other implementations:
herm_iterative,herm_explicit
Source code in poly\hermite\creation.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
herm_iterative(n)
Return the n-th Hermite polynomial in standard monomial basis.
Uses the recurrence relation \(H_n(x)=2xH_{n-1}(x)-2(n-1)H_{n-2}(x)\) iteratively.
See also
- for any implementation:
herm - other implementations:
herm_recursive,herm_explicit - uses:
herms
Source code in poly\hermite\creation.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
herm_explicit(n)
Return the n-th Hermite polynomial in standard monomial basis.
Uses the explicit expression \(H_n(x)=n!\sum_{m=0}^{\lfloor\frac{n}{2}\rfloor}\frac{(-1)^m}{m!(n-2m)!}(2x)^{n-2m}\).
Notes
The leading coefficient of the \(n\)-th Hermite polynomial is \(2^n\).
Every second coefficient is zero.
Every other one is set by \(n!\sum_{m=0}^{\lfloor\frac{n}{2}\rfloor}\frac{(-1)^m}{m!(n-2m)!}(2x)^{n-2m}\) resulting in
and following the recursion relation
which allows setting the coefficients in descending order iteratively without factorials.
See also
- for any implementation:
herm - other implementations:
herm_recursive,herm_iterative
Source code in poly\hermite\creation.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
herms()
Yield the Hermite polynomials in standard monomial basis.
Uses the recurrence relation \(H_n(x)=2xH_{n-1}(x)-2(n-1)H_{n-2}(x)\) iteratively.
See also
- used in:
herm_iterative
Source code in poly\hermite\creation.py
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | |
hermzero = veczero
Zero Hermite polynomial series.
An empty tuple: ().
See also
- other constants:
hermone,hermx - for any monomial:
hermmono - wraps:
vector.veczero
References
numpyequivalent:numpy.polynomial.hermite.hermzero
hermone = (1,)
Constant one Hermite polynomial series.
A tuple with a single one: (1,).
Notes
A Fraction tuple ((Fraction(1), )) would be more consitent with hermx, but would then require Fraction arithmetic for multiplicative functions, (hermmul, hermpow).
References
numpyequivalent:numpy.polynomial.hermite.hermone
hermx = (Fraction(0), Fraction(1, 2))
Identity Hermite polynomial series.
A tuple with a zero and a half: (0, 1/2).
References
numpyequivalent:numpy.polynomial.hermite.hermx
hermmono(n, method='explicit')
Return x^n as Hermite polynomial series.
The result is a tuple of Fractions.
Available methods are:
See also
- constants:
hermzero,hermone,hermx - implementations:
hermmono_recursive,hermmono_iterative,hermmono_explicit - for all monomials:
hermmonos
Source code in poly\hermite\creation.py
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | |
hermmono_recursive(n)
Return x^n as Hermite polynomial series.
Uses hermmulx recursively.
Cached, therefore fast if used repeatedly.
The result is a tuple of Fractions.
See also
- for any implementation:
hermmono - other implementations:
hermmono_iterative,hermmono_explicit
Source code in poly\hermite\creation.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |
hermmono_iterative(n)
Return x^n as Hermite polynomial series.
Uses hermmulx iteratively.
The result is a tuple of Fractions.
See also
- for any implementation:
hermmono - other implementations:
hermmono_recursive,hermmono_explicit - uses:
hermmonos
Source code in poly\hermite\creation.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
hermmono_explicit(n)
Return x^n as Hermite polynomial series.
Uses the explicit expression \(x^n=\frac{n!}{2^n}\sum_{m=0}^{\lfloor\frac{n}{2}\rfloor}\frac{1}{m!(n-2m)!}H_{n-2m}(x)\).
The result is a tuple of Fractions.
Notes
The leading coefficient is \(\frac{1}{2^n}\).
Every second coefficient is zero.
Every other one is set by \(x^n=\frac{n!}{2^n}\sum_{m=0}^{\lfloor\frac{n}{2}\rfloor}\frac{H_{n-2m}(x)}{m!(n-2m)!}\) resulting in
and following the recursion relation
which allows setting the coefficients in descending order iteratively without factorials.
See also
- for any implementation:
hermmono - other implementations:
hermmono_recursive,hermmono_explicit
Source code in poly\hermite\creation.py
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | |
hermmonos(start=0)
Yield standard monomials x^n as Hermite polynomial series.
Uses hermmulx iteratively.
See also
- used in:
hermmono_iterative
Source code in poly\hermite\creation.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |
hermrand(n)
Return a random Hermite polynomial series of degree n.
The coefficients are sampled from a uniform distribution in [0, 1[.
See also
- wraps:
vector.vecrand
Source code in poly\hermite\creation.py
445 446 447 448 449 450 451 452 453 454 455 456 457 458 | |
hermrandn(n, normed=True, mu=0, sigma=1)
Return a random Hermite polynomial series of degree n.
The coefficients are sampled from a normal distribution.
Normed with respect to the Hermite polynomial norm \(\int_\mathbb{R}h^2(x)e^{-x^2}\,\mathrm{d}x\).
See also
- wraps:
vector.vecrandn
Source code in poly\hermite\creation.py
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | |
hermfromroots(*xs)
Return the Hermite polynomial series with the given roots.
Source code in poly\hermite\creation.py
477 478 479 480 481 482 483 484 | |
utility
hermdeg(h)
Return the degree of a Hermite polynomial series.
\(\deg(0)=-1\) is used for the empty zero Hermite polynomial series.
Doesn't handle leading zeros, use
hermtrim if needed.
Notes
\(\deg(0)=-\infty\) is more commonly used but the expected return type is an
int and -math.inf is of type float. Therefore the \(\deg(0)=-1\)
convention was choosen to keep the return type consistent.
See also
- wraps:
vector.veclen
Source code in poly\hermite\utility.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
hermeq(g, h)
Return if two Hermite polynomial series are equal.
See also
- wraps:
vector.veceq
Source code in poly\hermite\utility.py
37 38 39 40 41 42 43 44 45 46 47 48 | |
hermtrim(h, tol=1e-09)
Remove all leading near zero (abs(h_i)<=tol) coefficients.
See also
- wraps:
vector.vectrim
References
numpyequivalent:numpy.polynomial.hermite.hermtrim
Source code in poly\hermite\utility.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
evaluation
hermval(h, x, method='clenshaw')
Return the value of Hermite polynomial series h evaluated at point x.
Available methods are
See also
- implementations:
hermval_naive,hermval_iterative,hermval_clenshaw - in standard monomial basis:
polyval
References
numpyequivalent:numpy.polynomial.hermite.hermval
Source code in poly\hermite\evaluation.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
hermval_naive(h, x)
Return the value of Hermite polynomial series h evaluated at point x.
Converts \(h\) to standard monomial basis and evaluates with polyval.
See also
- for any implementation:
hermval - other implementations:
hermval_iterative,hermval_clenshaw - in standard monomial basis:
polyval_naive
Source code in poly\hermite\evaluation.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
hermval_iterative(h, x)
Return the value of Hermite polynomial series h evaluated at point x.
Uses iterative \(H_n(x)\) generation.
See also
- for any implementation:
hermval - other implementations:
hermval_naive,hermval_clenshaw - uses:
hermvals - in standard monomial basis:
polyval_iterative
Source code in poly\hermite\evaluation.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
hermval_clenshaw(h, x)
Return the value of Hermite polynomial series h evaluated at point x.
Uses the Clenshaw algorithm.
h must be reversible.
See also
- for any implementation:
hermval - other implementations:
hermval_naive,hermval_iterative - in standard monomial basis:
polyval_horner
References
Source code in poly\hermite\evaluation.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
hermvals(x)
Yield the values of Hermite polynomials evaluated at point x.
Uses the recurrence relation \(H_n(x)=2xH_{n-1}(x)-2(n-1)H_{n-2}(x)\) iteratively.
See also
- used in:
hermval_iterative
Source code in poly\hermite\evaluation.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
hermvalzeros()
Yield the values of Hermite polynomials evaluated at point 0.
Notes
See also
- for any series:
hermvalzero
Source code in poly\hermite\evaluation.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
hermvalzero(h, zero=0)
Return the value of Hermite polynomial series h evaluated at point 0.
More efficient than hermval(h, 0).
See also
- for any point:
hermval
Source code in poly\hermite\evaluation.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
hilbert_space
hermweight(n)
Return the normalisation factor of Hermite polynomials.
See also
- for the integral factor:
hermweighti - for all normalisation factors:
hermweights
Source code in poly\hermite\hilbert_space.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
hermweights(start=0)
Yield the normalisation factors of Hermite polynomials.
See also
- for the integral factors:
hermweightis - for a single normalisation factor:
hermweight
Source code in poly\hermite\hilbert_space.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
hermweighti(n)
Return the integral factor of the normalisation factor of Hermite polynomials.
See also
- for the full normalisation factor:
hermweight - for all normalisation factors:
hermweightis
Source code in poly\hermite\hilbert_space.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
hermweightis(start=0)
Yield the integral factors of the normalisation factors of Hermite polynomials.
See also
- for all full normalisation factors:
hermweights - for a single normalisation factor:
hermweighti
Source code in poly\hermite\hilbert_space.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
hermabs(h, conjugate=False, zero=0)
Return the norm of a Hermite polynomial series.
See also
- for the norm squared:
hermabsq - similar to:
vector.vecabs
Source code in poly\hermite\hilbert_space.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
hermabsq(h, conjugate=False, zero=0)
Return squared norm of a Hermite polynomial series.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(n+1\) scalar conjugations (
conjugate) (if selected), - \(n+1\)/\(2(n+1)\) scalar multiplications (
mul) without/with weights & - \(\begin{cases}n&n\ge1\\0&n\le1\end{cases}\) scalar additions (
add).
See also
- for the norm:
hermabs - for the integral factor:
hermabsqi - similar to:
vector.vecabsq
Source code in poly\hermite\hilbert_space.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
hermabsqi(h, conjugate=False, zero=0)
Return the integral factor of the norm squared of a Hermite polynomial series.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(n+1\) scalar conjugations (
conjugate) (if selected), - \(\begin{cases}n&n\ge0\\0&n\le0\end{cases}\) scalar additions (
add) & - \(2(n+1)\) scalar multiplications (
mul) without/with weights.
See also
- for the full norm squared:
hermabsq - wraps:
vector.vecabsq
Source code in poly\hermite\hilbert_space.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
hermdot(g, h, conjugate=False, zero=0)
Return the inner product with respect to the Hermite polynomial weight function.
Complexity
For two Hermite polynomial series of degrees \(n\) & \(m\) there will be
- \(\min\{n, m\}+1\) scalar conjugations (
conjugate) (if selected), - \(\begin{cases}n&n\ge0\\0&n\le0\end{cases}\) scalar additions (
add) & - \(2(n+1)\) scalar multiplications (
mul) without/with weights.
See also
- for the integral factor:
hermdoti
Source code in poly\hermite\hilbert_space.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
hermdoti(g, h, conjugate=False, zero=0)
Return the integral factor of the inner product with respect to the Hermite polynomial weight function.
See also
- for the full inner product:
hermdot - wraps:
vector.vecdot
Source code in poly\hermite\hilbert_space.py
193 194 195 196 197 198 199 200 201 202 203 204 205 | |
arithmetic
hermpos(h)
Return the Hermite polynomial series with the unary positive operator applied.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(n+1\) scalar unary plus operations (
pos).
See also
- wraps:
vector.vecpos
Source code in poly\hermite\arithmetic.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
hermneg(h)
Return the Hermite polynomial series with the unary negative operator applied.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(n+1\) scalar negations (
neg).
See also
- wraps:
vector.vecneg
Source code in poly\hermite\arithmetic.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
hermadd(*hs)
Return the sum of Hermite polynomial series.
Complexity
For two Hermite polynomial series of degrees \(n\) & \(m\) there will be
- \(\min\{n, m\}+1\) scalar additions (
add).
See also
- for single coefficient summand (\(cH_n\)):
hermaddc - wraps:
vector.vecadd numpyequivalent:numpy.polynomial.hermite.hermadd
Source code in poly\hermite\arithmetic.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
hermaddc(h, c, n=0)
Return the sum of Hermite polynomial series h and the n-th Hermite polynomial.
More efficient than hermadd(h, vecbasis(n, c)).
Complexity
There will be
- one scalar addition (
add) if \(n\le\deg h\) or - one unary plus operations (
pos) otherwise.
See also
- for series summand:
hermadd - wraps:
vector.vecaddc
Source code in poly\hermite\arithmetic.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
hermsub(g, h)
Return the difference of two Hermite polynomial series.
Complexity
For two Hermite polynomial series of degrees \(n\) & \(m\) there will be
- \(\min\{n, m\}+1\) scalar subtractions (
sub) & - \(\begin{cases}m-n&m\ge n\\0&m\le n\end{cases}\) negations (
neg).
See also
- for single coefficient subtrahend (\(cH_n\)):
hermaddc - wraps:
vector.vecsub numpyequivalent:numpy.polynomial.hermite.hermsub
Source code in poly\hermite\arithmetic.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
hermsubc(h, c, n=0)
Return the difference of Hermite polynomial series h and the n-th Hermite polynomial.
More efficient than hermsub(h, vecbasis(n, c)).
Complexity
There will be
- one scalar subtraction (
sub) if \(n\le\deg h\) or - one scalar negation (
neg) otherwise.
See also
- for series minuend:
hermsub - wraps:
vector.vecsubc
Source code in poly\hermite\arithmetic.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
hermscalarmul(a, h)
Return the product of a scalar and a Hermite polynomial series.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(n+1\) scalar multiplications (
rmul).
See also
- wraps:
vector.vecmul
Source code in poly\hermite\arithmetic.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
hermscalartruediv(h, a)
Return the true division of a Hermite polynomial series and a scalar.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(n+1\) scalar true divisions (
truediv).
See also
- wraps:
vector.vectruediv
Source code in poly\hermite\arithmetic.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
hermscalarfloordiv(h, a)
Return the floor division of a Hermite polynomial series and a scalar.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(n+1\) scalar floor divisions (
floordiv).
See also
- wraps:
vector.vecmfloordiv
Source code in poly\hermite\arithmetic.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
hermscalarmod(h, a)
Return the elementwise mod of a Hermite polynomial series and a scalar.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(n+1\) scalar modulos (
mod).
See also
- wraps:
vector.vecmod
Source code in poly\hermite\arithmetic.py
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
hermscalardivmod(h, a)
Return the elementwise divmod of a polynomial and a scalar.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(n+1\) scalar divmods (
divmod).
See also
- wraps:
vector.vecdivmod
Source code in poly\hermite\arithmetic.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | |
hermmul(*hs, method='naive', one=1)
Return the product of Hermite polynomial series.
Available methods are
TODO: Karatsuba possible?
See also
- implementations:
hermmul_naive - for monomial factor:
hermmulx - for Hermite polynomial factor:
hermmulHn
References
numpyequivalent:numpy.polynomial.hermite.hermmul
Source code in poly\hermite\arithmetic.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
hermmul_naive(g, h)
Return the product of two Hermite polynomials series.
Uses naive multiplication and summation.
h must be a sequence.
Complexity
For two Hermite polynomial series of degrees \(n\) & \(m\) (let \(N=\min\{n, m\}\), \(M=\max\{n, m\}\)) there will be
- \(\begin{cases}\frac{(N+1)(N+2)(3M+3-N)}{6}-(n+m+1) & n\geq0\land m\geq0 \\ 0 & n<0\lor m<0 \end{cases}\) scalar additions (
add) & - \(\begin{cases}\frac{(N+1)(N+2)(3M+3-N)}{3} & n\geq0\land m\geq0 \\ 0 & n<0\lor m<0 \end{cases}\) scalar multiplications (
mul).
Notes
From [1] eq. A.8 we know that
Therefore we have
See also
- for any implementation:
hermmul
References
- [1] Zhi-yuan Huang & Jia-an Yan: Introduction to Infinite Dimensional Stochastic Analysis. 10.1007/978-94-011-4108-6
- Wikipedia - Hermite polynomials - Definition
Source code in poly\hermite\arithmetic.py
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
hermmulx(h, zero=0)
Return the product of Hermite polynomial series h and a monomial of degree n.
More efficient than hermmul(h, hermx).
Complexity
For a Hermite function series of degree \(n\) there will be
- \(\begin{cases}n-1 & n<0 \\ 0 & n\leq0 \end{cases}\) scalar additions (
add), - \(\begin{cases}n-1 & n<0 \\ 0 & n\leq0 \end{cases}\) scalar multiplications (
mul) & - \(n+1\) scalar divisions (
truediv) by two.
Notes
For a single Hermite polynomial
and therefore for a series
See also
- for Hermite polynomial series as factor:
hermmul numpyequivalent:numpy.polynomial.hermite.hermmulx
Source code in poly\hermite\arithmetic.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | |
hermmulHn(h, n, zero=0)
Return the product of Hermite polynomial series h and the n-th Hermite polynomial.
More efficient than hermmul(h, vecbasis(n)).
TODO: Complexity
See also
- for a Hermite polynomial series factor:
hermmul
Source code in poly\hermite\arithmetic.py
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | |
hermpow(h, n, method='binary')
Return the Hermite polynomial series h raised to the nonnegative n-th power.
h must be a sequence.
Available methods are
See also
- implementations:
hermpow_naive,hermpow_binary, numpyequivalent:numpy.polynomial.hermite.hermpow
Source code in poly\hermite\arithmetic.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | |
hermpow_naive(h, n, one=1)
Return the Hermite polynomial series h raised to the nonnegative n-th power.
Uses repeated multiplication.
h must be a sequence.
See also
- for any implementation:
hermpow - other implementations:
hermpow_binary
Source code in poly\hermite\arithmetic.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | |
hermpow_binary(h, n, one=1)
Return the Hermite polynomial series h raised to the nonnegative n-th power.
Uses exponentiation by squaring.
h must be a sequence.
See also
- for any implementations:
hermpow - other implementations
hermpow_naive
References
Source code in poly\hermite\arithmetic.py
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 | |
hermmulpow(alpha, one=1)
Return product of Hermite Polynomials.
Source code in poly\hermite\arithmetic.py
486 487 488 489 490 491 492 493 494 495 496 | |
hermpows(h, start=0, one=1)
Yield the powers of the Hermite polynomial series h.
Uses iterative multiplication to calculate powers consecutively.
h must be a sequence.
See also
- used by:
hermpow_naive - for scalar arguments:
hermvals
Source code in poly\hermite\arithmetic.py
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 | |
calculus
hermder(h, k=1)
Return the k-th derivative of Hermite polynomial series h.
Notes
For Hermite polynomials:
And for Hermite polynomial series:
Where \((n)_k\) is the Falling factorial
and \({}_nP_k\) is the number of k-permutations of n
with \((n)_k=\frac{n!}{(n-k)!}={}_nP_k\) (falling factorials are
used because their definition appears in the derivation; permutations are
used because a fast implementation is provided by math.perm).
See also
- in standard monomial basis:
polyder numpyequivalent:numpy.polynomial.hermite.hermder
Source code in poly\hermite\calculus.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
hermantider(h, b=0, c=0)
Return the antiderivative of Hermite polynomial series h.
TODO: higher antiderivatives, complexity
Notes
Let
Then we have for Hermite polynomials:
For Hermite polynomials series:
See also
- in standard monomial basis:
polyantider numpyequivalent:numpy.polynomial.hermite.hermint
Source code in poly\hermite\calculus.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
conversion
herm2poly(h, method='iterative')
Return a Hermite polynomial series in standard monomial basis.
Available methods are
See also
- implementations:
herm2poly_naive,herm2poly_iterative,herm2poly_clenshaw
References
numpyequivalent:numpy.polynomial.hermite.herm2poly
Source code in poly\hermite\conversion.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
herm2poly_naive(h)
Return a Hermite polynomial series in standard monomial basis.
Uses naive Hermite polynomial creation by herm_explicit.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(\frac{n(n+1)}{2}\) scalar additions (
add) & - \(\frac{(n+1)(n+2)}{2}\) scalar multiplications (
mul).
See also
- for any implementation:
herm2poly - other implementations:
herm2poly_iterative,herm2poly_clenshaw
Source code in poly\hermite\conversion.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
herm2poly_iterative(h)
Return a Hermite polynomial series in standard monomial basis.
Uses iterative Hermite polynomial creation like
herm_iterative.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(\frac{n(n+1)}{2}\) scalar additions (
add) & - \(\frac{(n+1)(n+2)}{2}\) scalar multiplications (
mul).
See also
- for any implementation:
herm2poly - other implementations:
herm2poly_naive,herm2poly_clenshaw - uses:
herms
Source code in poly\hermite\conversion.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
herm2poly_clenshaw(h)
Return a Hermite polynomial series in standard monomial basis.
Uses the Clenshaw algorithm like
hermval_clenshaw.
Complexity
For a Hermite polynomial series of degree \(n\) there will be
- \(n+1\) scalar additions (
add), - \(\begin{cases}\frac{n(n-1)}{2} & n\geq0 \\ 0 & n\leq0\end{cases}\) scalar subtractions (
sub) & - \(\begin{cases}n^2 & n\geq0 \\ 0 & n\leq0\end{cases}\) scalar multiplications (
mul).
See also
- for any implementation:
herm2poly - other implementations
herm2poly_naive,herm2poly_iterative
Source code in poly\hermite\conversion.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
poly2herm(p, method='iterative')
Return a standard monomial basis polynomials as a Hermite polynomial series.
Available methods are
See also
- implementations:
poly2herm_naive,poly2herm_iterative,poly2herm_horner
References
numpyequivalent:numpy.polynomial.hermite.poly2herm
Source code in poly\hermite\conversion.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
poly2herm_naive(p)
Return a standard monomial basis polynomials as a Hermite polynomial series.
Uses naive monomial as Hermite polynomial series creation by the default
method of hermmono.
See also
- any implementation:
poly2herm - other implementations:
poly2herm_iterative,poly2herm_horner
Source code in poly\hermite\conversion.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
poly2herm_iterative(p)
Return a standard monomial basis polynomials as a Hermite polynomial series.
Uses iterative monomial creation of hermmonos.
See also
- for any implementation:
poly2herm - other implementations:
poly2herm_iterative,poly2herm_horner
Source code in poly\hermite\conversion.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
poly2herm_horner(p)
Return a standard monomial basis polynomials as a Hermite polynomial series.
Uses Horner's method.
p must be reversible.
See also
- for any implementation:
poly2herm - other implementations:
poly2herm_iterative,poly2herm_horner
References
Source code in poly\hermite\conversion.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |
hermsympify(h, x=x)
Return the Hermite polynomial series h as a sympy.Poly.
Source code in poly\hermite\conversion.py
226 227 228 | |