Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Raise a Hermite_e series to a power in Python
To raise a Hermite_e series to a power, use the polynomial.hermite_e.hermepow() method in Python NumPy. The method returns a Hermite_e series raised to the specified power. The argument c is a sequence of coefficients ordered from low to high, i.e., [1,2,3] represents the series P_0 + 2*P_1 + 3*P_2.
Parameters
The hermepow() method accepts the following parameters ?
- c ? 1-D array of Hermite_e series coefficients ordered from low to high
- pow ? Power to which the series will be raised
- maxpower ? Maximum power allowed (default is 16) to limit series growth
Example
Let's create a Hermite_e series and raise it to the power of 3 ?
import numpy as np
from numpy.polynomial import hermite_e as H
# Create 1-D array of Hermite_e series coefficients
c = np.array([1, 2, 3])
# Display the coefficient array
print("Our coefficient Array...")
print(c)
# Check the dimensions
print("\nDimensions of our Array...")
print(c.ndim)
# Get the datatype
print("\nDatatype of our Array object...")
print(c.dtype)
# Get the shape
print("\nShape of our Array object...")
print(c.shape)
# Raise Hermite_e series to power 3
result = H.hermepow(c, 3)
print("\nResult after raising to power 3...")
print(result)
Our coefficient Array... [1 2 3] Dimensions of our Array... 1 Datatype of our Array object... int64 Shape of our Array object... (3,) Result after raising to power 3... [ 355. 642. 1119. 476. 387. 54. 27.]
Understanding the Result
The original series [1, 2, 3] represents P_0 + 2*P_1 + 3*P_2. When raised to the power of 3, the resulting coefficients are [355, 642, 1119, 476, 387, 54, 27], representing a higher-degree Hermite_e polynomial.
Conclusion
The hermepow() method efficiently raises Hermite_e series to any specified power. The maxpower parameter helps control computational complexity for large powers.
