Opened 9 years ago
Closed 9 years ago
#14720 closed enhancement (fixed)
Pade approximants
Reported by:  Frédéric Chapoton  Owned by:  Alex Ghitza 

Priority:  major  Milestone:  sage6.2 
Component:  algebra  Keywords:  pade approximant, power series 
Cc:  Sage Combinat CC user  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  Marc Mezzarobba 
Report Upstream:  N/A  Work issues:  
Branch:  9a3765b (Commits, GitHub, GitLab)  Commit:  9a3765b9842c6f01aa9b687242eba62e3ce58cb0 
Dependencies:  Stopgaps: 
Description (last modified by )
It would be good to have Padé approximants for formal power series
sage: z = PowerSeriesRing(QQ, 'z').gen() sage: exp(z).pade(4,0) 1/24*z^4 + 1/6*z^3 + 1/2*z^2 + z + 1 sage: exp(z).pade(3,1) (1/144*z^3 + 1/24*z^2 + 1/8*z + 1/6)/(1/24*z + 1/6)
Apply:
Attachments (1)
Change History (19)
Changed 9 years ago by
Attachment:  trac_14720_pade_approximantsfc.patch added 

comment:1 Changed 9 years ago by
Authors:  → Frédéric Chapoton 

Cc:  Sage Combinat CC user added 
Description:  modified (diff) 
Status:  new → needs_review 
comment:2 Changed 9 years ago by
Keywords:  pade added; padé removed 

Summary:  Padé approximants → Pade approximants 
comment:3 Changed 9 years ago by
comment:4 Changed 9 years ago by
Thanks for your interest. But the patchbot is wrong and the correct name is Padé and should always be written as such when possible (namely everywhere except in the name of the function)
comment:5 Changed 9 years ago by
Yes, the patchbot is wrong. But if you write "Padé" in the title of a Sage ticket then
 your ticket will not be tested
 the patchbot that tried to test your ticket will stop
I suggest to revert to the proper "Padé" after ticket #14707 has been fixed. Maybe you can help to get somebody interested in actually fixing it.
comment:6 Changed 9 years ago by
Milestone:  sage5.11 → sage5.12 

comment:7 Changed 9 years ago by
Branch:  → u/chapoton/14720 

Commit:  → 006d168a12754ff039777f64b049bb74137bba01 
New commits:
006d168  trac 14720 pade approximation of formal power series 
comment:8 Changed 9 years ago by
 You might want to call the variable
anneau
something else.  The existing
sage.matrix.berlekamp_massey.berlekamp_massey
more or less computes the same thing and may be faster. (The same goes forsage.rings.polynomial.polynomial_zmod_flint.Polynomial_zmod_flint.rational_reconstruct
in the case of series overZ/nZ
.)
comment:9 Changed 9 years ago by
Commit:  006d168a12754ff039777f64b049bb74137bba01 → acd43fb6b349d8047c5359102d417a97a31a6ff1 

Branch pushed to git repo; I updated commit sha1. New commits:
acd43fb  trac #14720 minor changes

comment:10 Changed 9 years ago by
Milestone:  sage6.1 → sage6.2 

comment:11 Changed 9 years ago by
Hi Frédéric,
I had a look at your new version and started changing a few things in u/mmezzarobba/14720pade
, but I stopped midstream. (I'm intentionally not setting the ticket's branch field to my branch, because it is halfbroken.)
Here are some remaining issues.
 The code does not work over
RR
:sage: R.<z> = RR[[]] sage: f = exp(2*z) sage: f.pade(3,3) ... ValueError: variable names must be alphanumeric, but one is '0.000000000000000 + 1.00000000000000*z' which is not.
I fixed theValueError
by changing the definition ofpolyring
toself.parent()._poly_ring()
, but this is not enough: the degrees of the resulting polynomials are wrong due to roundoff errors.  The doc should mention how large the order of
self
needs to be (and/or the function should raise a meaningful error when it is too small).
comment:12 Changed 9 years ago by
Status:  needs_review → needs_work 

comment:13 Changed 9 years ago by
Commit:  acd43fb6b349d8047c5359102d417a97a31a6ff1 → c664343845530cb0fc3150d4bf9b4a22b2d20a06 

comment:14 Changed 9 years ago by
Commit:  c664343845530cb0fc3150d4bf9b4a22b2d20a06 → bd93f3a6a543bc6368960067b649ea5448c52206 

comment:15 Changed 9 years ago by
Status:  needs_work → needs_review 

I have added a truncation to the polynomials computed as determinants, in order to ensure they have the right degree. This probably means that the algorithm is not very well suited to handle the case of real coefficients, but, well, in the absence of another algorithm..
comment:16 Changed 9 years ago by
Branch:  u/chapoton/14720 → u/mmezzarobba/14720pade 

Commit:  bd93f3a6a543bc6368960067b649ea5448c52206 → 9a3765b9842c6f01aa9b687242eba62e3ce58cb0 
Reviewers:  → Marc Mezzarobba 
Looks good to me. I pushed some minor changes; please set the ticket to positive review if you agree.
Thanks for your work!
New commits:
9a3765b  pade(): minor docstring changes

comment:17 Changed 9 years ago by
Status:  needs_review → positive_review 

ok, looks good to me. Thanks for the review !
comment:18 Changed 9 years ago by
Branch:  u/mmezzarobba/14720pade → 9a3765b9842c6f01aa9b687242eba62e3ce58cb0 

Resolution:  → fixed 
Status:  positive_review → closed 
I've taken the liberty to remove the UTF8 characters from title and summary  currently the patchbots choke on this (see #14707)