Multivariate Pade approximation, recognizing rational function

asked 2023-10-18 17:04:20 +0100

JTS gravatar image

updated 2023-10-20 13:29:38 +0100

(Question edited)

Suppose that I have a taylor polynomial approximation of the taylor series of a rational function $f(x,y) =p(x,y)/q(x,y)$

that I want to recover.

1) If $f(x,y) \in Q[y][[x]]$ then the following approach seems to work: convert to $Q[y][[x]]$ which magically gets embedded into $Q(y)[[x]]$, and then standard pade approximation works.

S.<y> = QQ[]
R.<x> = S[]
U.<x> = PowerSeriesRing(S,default_prec=7)
p = x+y
q = (1-x)*(1-x*y)
fcorrect=U(p)/U(q)
fperturbed = fcorrect + U(x^7*y^7)
print(fperturbed)
print()
print(fperturbed.pade(3,3))

output:

y + (y^2 + y + 1)*x + (y^3 + y^2 + 2*y + 1)*x^2 + (y^4 + y^3 + 2*y^2 + 2*y + 1)*x^3 + (y^5 + y^4 + 2*y^3 + 2*y^2 + 
2*y + 1)*x^4 + (y^6 + y^5 + 2*y^4 + 2*y^3 + 2*y^2 + 2*y + 1)*x^5 + (y^7 + y^6 + 2*y^5 + 2*y^4 + 2*y^3 + 2*y^2 + 
2*y + 1)*x^6 + O(x^7)

(x + y)/(y*x^2 + (-y - 1)*x + 1)

2) On the other hand, for rational power series like $1/((1-x)(1-y))$ which, as power series in x, have coefficients that are rational functions in y rather than polynomials in y, I had to manually convert to $Q(y)[[x]]$:

b=(1-x)*(1-y)
V.<x> = PowerSeriesRing(S.fraction_field(),default_prec=9)
T.<x,y> = PowerSeriesRing(QQ,'x,y',default_prec=9)
W.<y> = PowerSeriesRing(QQ,'y',default_prec=9)

hcorrect = 1/T(b)
hperturbed = hcorrect + T(x^7*y^7)
print(hperturbed)
print()
hp = hperturbed.polynomial()
W.<y> = PowerSeriesRing(QQ,'y')

hconverted = add(V(x^k*W(hp.coefficient({x:k})).pade(2,2)) for k in range(9))
print(hconverted)
print()
print(hconverted.pade(2,2))

gives

1 + x + y + x^2 + x*y + y^2 + x^3 + x^2*y + x*y^2 + y^3 + x^4 + x^3*y + x^2*y^2 + x*y^3 + y^4 + x^5 + x^4*y + 
x^3*y^2 + x^2*y^3 + x*y^4 + y^5 + x^6 + x^5*y + x^4*y^2 + x^3*y^3 + x^2*y^4 + x*y^5 + y^6 + x^7 + x^6*y + 
x^5*y^2 + x^4*y^3 + x^3*y^4 + x^2*y^5 + x*y^6 + y^7 + x^8 + x^7*y + x^6*y^2 + x^5*y^3 + x^4*y^4 + x^3*y^5 + 
x^2*y^6 + x*y^7 + y^8 + O(x, y)^9

-1/(y - 1) + (-1/(y - 1))*x + (-1/(y - 1))*x^2 + (-1/(y - 1))*x^3 + (-1/(y - 1))*x^4 + (-1/(y - 1))*x^5 + (y^2 + y + 1)*x^6 + 
(y + 1)*x^7 + x^8

(1/(y - 1))/(x - 1)

The first case 1) is easy enough, and I appreciate the automagic conversion to $Q(y)[[x]]$. It is somewhat slow when the method is extended to several variables, though.

The second case 2) was very hard to get to work; is there an easier way? How do I speed up the calculations?

edit retag flag offensive close merge delete

Comments

EDIT : This comment was pertinent to a previous edition of the question, no longer available ; it bears but a very distant relation to the present (2023-10-21 10:08:00 CEST) question.

I don't believe that $f$ and $ĝ$ (the righ-hand-side of your supposed equality=) are even asymptotically equal : $g$ has poles for $x=1$ and $x=\frac{1}{y}$, which $f$ has not.

Numerical 3D plotting of $(f-g)$ also does not support this supposed asymptotic equality...

BTW, $f$ is a polynomial wrt both $x$ and $y$, whose "best" Pade approximant is the fraction with the polynomial as denominator and 1 as denominator (up to some arbitrary non-null multiple)...

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2023-10-18 18:58:01 +0100 )edit

Let me show my work so far.

S.<y> = QQ[]
R.<x> = S[]
T.<y,x> = PowerSeriesRing(QQ,default_prec=8)
U.<x> = PowerSeriesRing(S,default_prec=8)
 p = x+y
 q = (1-x)*(1-x*y)
 f=T(p)/T(q)
 print(f)

shows

$y + x + yx + x^2 + y^2x + 2yx^2 + x^3 + y^2x^2 + 2yx^3 + x^4 + y^3x^2 + 2y^2x^3 + 2yx^4 + x^5 + y^3x^3 + 2y^2x^4 + 2yx^5 + x^6 + y^4x^3 + 2y^3x^4 + 2y^2x^5 + 2yx^6 + x^7 + y^4x^4 + 2y^3x^5 + 2y^2x^6 + 2y*x^7 + x^8 + O(y, x)^9$

Now

 f.pade(3,3)

gives an error, however:

ff ...
(more)
JTS gravatar imageJTS ( 2023-10-19 13:30:14 +0100 )edit