Thursday, June 11, 2026
HomeData Modelling & AIConvert a Polynomial to Hermite Series Using NumPy

Convert a Polynomial to Hermite Series Using NumPy

In this article, we will discuss how to convert a Polynomial to Hermite series using NumPy.

Example:

Polynomial: [4 2 3 6]

Coefficients of the converted equivalent Hermite series : [5.5  5.5  0.75 0.75]

To convert a polynomial to Hermite series we need to use numpy methods hermite.poly2herm(). We can get the hermite series coefficient from polynomial by using np.poly2herm() method.

Syntax : np.poly2herm(polynomial)
Return : Return the coefficient of hermite series.

Example 1: Convert to Physicist’s Hermite Series

Python3




# Import required libraries
import numpy as np
from numpy.polynomial import hermite
 
# Now define a polynomial you want to convert
pol = np.array([4, 2, 3, 6])
 
# Now convert the polynomial to a Hermite
# Series (Physicist's Hermite Series)
converted = hermite.poly2herm(pol)
 
# Now print the results
print("Coefficients of the defined polynomial:", pol)
print("Converting by Physicist's Hermite series..")
print("Coefficients of the converted\
equivalent Hermite series :", converted)


 Output:

Coefficients of the defined polynomial: [4 2 3 6]

Converting by Physicist’s Hermite series..

Coefficients of the converted equivalent Hermite series : [5.5  5.5  0.75 0.75]

Example 2: Convert to Probabilist’s Hermite Series

Python3




# Import required libraries
import numpy as np
from numpy.polynomial import hermite_e
 
# Now define a polynomial you want to convert
pol = np.array([4, 2, 3, 6])
 
# Now convert the polynomial to
# a Hermite Series (Probabilist's Hermite Series)
converted = hermite_e.poly2herme(pol)
 
# Now print the results
print("Coefficients of the defined polynomial:", pol)
print("Converting by Probabilist's Hermite series..")
print("Coefficients of the converted \
equivalent Hermite series :", converted)


Output: 

Coefficients of the defined polynomial: [4 2 3 6]

Converting by Probabilist’s Hermite series..

Coefficients of the converted equivalent Hermite series : [ 7. 20.  3.  6.]

Feeling lost in the world of random DSA topics, wasting time without progress? It’s time for a change! Join our DSA course, where we’ll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!

Commit to GfG’s Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.

Last Updated :
25 Apr, 2022
Like Article
Save Article


Previous

<!–

8 Min Read | Java

–>


Next


<!–

8 Min Read | Java

–>

Share your thoughts in the comments

Previous article
Next article
RELATED ARTICLES

Most Popular

Dominic
32515 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6896 POSTS0 COMMENTS
Nicole Veronica
12012 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12109 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6963 POSTS0 COMMENTS