Thursday, September 4, 2025
HomeLanguagesEvaluate a Hermite_e series at points x when coefficients are multi-dimensional in...

Evaluate a Hermite_e series at points x when coefficients are multi-dimensional in Python

In this article, we will discuss how to evaluate a Hermite_e series at points x when coefficients are multi-dimensional in Python

We use the hermite.hermeval() function from the numpy module.

Syntax: hermite_e.hermeval(x,Arr)

Parameters :

  • x (required parameter): ‘x’ can be a single number or list of numbers but the only condition is the ‘x’ or the elements in ‘x’ should support the operations like addition and multiplication among themselves and with the elements in ‘Arr’
    (which is the second parameter to be passed). ‘x’ will be transformed to ndarray if it is a tuple or a list, otherwise it will consider as a scaler.
  • Arr (required parameter): ‘Arr’ is an array of coefficients that is sorted in such a way that the coefficients for terms of degree n 
    are present in Arr[n]. In our case the array is multi-dimensional array of coefficients.

Stepwise Implementation

Step 1: Import NumPy and hermite_e libraries :

import numpy as np
from numpy.polynomial import hermite_e as H

Step 2: Now we have to create a multidimensional array ‘Arr’ of coefficients with any of style as shown below :

Arr = np.arange(4).reshape(2,2)

OR

Arr = np.matrix([[0,1],[2,3]])

OR

Arr = [[0,1],[2,3]]

Step 3: To evaluate a Hermite_e series at points x for multidimensional coefficients, use the hermite.hermeval() method in Numpy module as shown below : 

print(H.hermeval([1,2],Arr))

Example 1 :

Python3




# import numpy and hermite_e libraries
import numpy as np
from numpy.polynomial import hermite_e as HE
 
# Create a multidimensional array 'Arr'
# of coefficients
Arr = np.matrix([[1, 3], [4, 5]])
 
# To evaluate a Hermite_e series at points
# x for multidimensional coefficient array 'Arr',
# use the hermite.hermeval() method in
# Python Numpy
print(HE.hermeval([2, 3], Arr))


Output :

[[ 9. 13.]
 [13. 18.]]

Example 2 :

Python3




# import hermite_e library
from numpy.polynomial import hermite_e as H
 
# create a multidimensional array
Mul_Array = [[2, 2], [4, 3]]
 
# evaluate hermite_e series and print
# the result
print(H.hermeval([2, 1], Mul_Array))


Output :

[[10.  6.]
 [ 8.  5.]]
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32261 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6626 POSTS0 COMMENTS
Nicole Veronica
11797 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11855 POSTS0 COMMENTS
Shaida Kate Naidoo
6748 POSTS0 COMMENTS
Ted Musemwa
7024 POSTS0 COMMENTS
Thapelo Manthata
6696 POSTS0 COMMENTS
Umr Jansen
6716 POSTS0 COMMENTS