- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Compute the roots of a Hermite series with given complex roots in Python

To compute the roots of a Hermite series., use the hermite.hermroots() method in Python Numpy. The method returns an array of the roots of the series. If all the roots are real, then out is also real, otherwise it is complex. The parameter, c is a 1-D array of coefficients.

The root estimates are obtained as the eigenvalues of the companion matrix, Roots far from the origin of the complex plane may have large errors due to the numerical instability of the series for such values. Roots with multiplicity greater than 1 will also show larger errors as the value of the series near such points is relatively insensitive to errors in the roots. Isolated roots near the origin can be improved by a few iterations of Newton’s method.

## Steps

At first, import the required library −

from numpy.polynomial import hermite as H

To compute the roots of a Hermite series., use the hermite.hermroots() method in Python Numpy −

j = complex(0,1) print("Result...\n",H.hermroots((-j, j)))

Get the datatype −

print("\nType...\n",H.hermroots((-j, j)).dtype)

Get the shape −

print("\nShape...\n",H.hermroots((-j, j)).shape)

## Example

from numpy.polynomial import hermite as H # To compute the roots of a Hermite series., use the hermite.hermroots() method in Python Numpy. # The method returns an array of the roots of the series. If all the roots are real, then out is also real, otherwise it is complex.. # The parameter, c is a 1-D array of coefficients. j = complex(0,1) print("Result...\n",H.hermroots((-j, j))) # Get the datatype print("\nType...\n",H.hermroots((-j, j)).dtype) # Get the shape print("\nShape...\n",H.hermroots((-j, j)).shape)

## Output

Result... [0.5+0.j] Type... complex128 Shape... (1,)

- Related Questions & Answers
- Compute the roots of a Chebyshev series with given complex roots in Python
- Compute the roots of a Laguerre series with given complex roots in Python
- Compute the roots of a Legendre series with given complex roots in Python
- Compute the roots of a Hermite_e series with given complex roots in Python
- Generate a Hermite series with given complex roots in Python
- Compute the roots of a polynomial with given complex roots in Python
- Compute the roots of a Hermite series in Python
- Generate a Hermite series with given roots in Python
- Generate a Chebyshev series with given complex roots in Python
- Generate a Laguerre series with given complex roots in Python
- Generate a Legendre series with given complex roots in Python
- Generate a Hermite_e series with given complex roots in Python
- Compute the roots of a Chebyshev series in Python
- Compute the roots of a Laguerre series in Python
- Compute the roots of a Legendre series in Python