Is there a way to easily invert the Pade approximation and get back the Taylor series it was derived from? In other words, if I have two polynomials $P_m(x)/Q_n(x)$ derived from an $(m+n)$th degree polynomial $f_{m+n}(x)$, can I get that polynomial back easily?
(specifically I'm looking for the inverse of the scipy function scipy.misc.pade
)
I found the Wikipedia link on power series of a rational function, but I'm having trouble figuring out how to convert it to a matrix equation to solve numerically... any help?
oh wait... the fog is beginning to clear here... if $\mathbf P$ and $\mathbf Q$ are the coefficients in column vector form e.g. $\mathbf P = \begin{bmatrix}p_0\\p_1\\ \vdots \\ p_m\end{bmatrix}$, then we have
$$\sum\limits_{k=0}^{m} p_kx^k = \left(\sum\limits_{k=0}^{m+n} a_kx^k\right)\left(\sum\limits_{k=0}^{n} q_kx^k\right)$$
which translates into matrix form as
$$ \begin{bmatrix}{\mathbf P} \\{\mathbf 0} \end{bmatrix} = {\mathbf K \mathbf A} = \begin{bmatrix} q_0 \\ q_1 & q_0 \\ q_2 & q_1 & q_0\\ q_3 & q_2 & q_1 & q_0\\ \vdots & \vdots & \vdots & \vdots & \ddots \\ q_n & q_{n-1} & q_{n-2} & q_{n-3} & \cdots & q_0 & \\ & q_{n} & q_{n-1} & q_{n-2} & \cdots & q_1 & q_0\\ && q_{n} & q_{n-1} & \cdots & q_2 & q_1 & q_0 \end{bmatrix} {\mathbf A}$$
where $\mathbf K$ is a Toeplitz matrix with $m+n+1$ rows and columns (looks like I can use
scipy.linalg.toeplitz
), and then I can solve for $\mathbf A$.Not sure I'm going to get back the same polynomial as the original power series, though.
a trial in Python:
which outputs
and this appears to work.