qrisp.gqsp.poly2cheb#

poly2cheb(poly: ArrayLike) Array[source]#

Convert a polynomial from monomial to Chebyshev basis. JAX version of numpy.polynomial.chebyshev.poly2cheb.

Convert an array representing the coefficients of a polynomial (relative to the monomial basis) ordered from lowest degree to highest, to an array of the coefficients of the equivalent Chebyshev series, ordered from lowest to highest degree.

Parameters:
polyArrayLike

1-D array containing the polynomial coefficients, ordered from lowest order term to highest.

Returns:
chebArray

1-D array containing the coefficients of the equivalent Chebyshev series ordered from lowest order term to highest.

Examples

>>> import jax.numpy as jnp
>>> from qrisp.gqsp import poly2cheb
>>> poly = jnp.array([-2., -8.,  4., 12.])
>>> cheb = poly2cheb(poly)
>>> cheb
[0., 1., 2., 3.]