wcosmo.taylor.pade#

wcosmo.taylor.pade(an, m, n=None)[source]#

Return Pade approximation to a polynomial as the ratio of two polynomials.

Parameters:
an(N,) array_like

Taylor series coefficients.

mint

The order of the returned approximating polynomial q.

nint, optional

The order of the returned approximating polynomial p. By default, the order is len(an)-1-m.

Returns:
p, qPolynomial class

The Pade approximation of the polynomial defined by an is p(x)/q(x).

Notes

This code has been slightly edited from the scipy implementation to:

  • Use xp instead of np to support multiple backends

  • Directly use the fact that part of the matrix is Toeplitz