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: sage-6.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:

Status badges

Description (last modified by Frédéric Chapoton)

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)

trac_14720_pade_approximants-fc.patch (2.9 KB) - added by Frédéric Chapoton 9 years ago.

Download all attachments as: .zip

Change History (19)

Changed 9 years ago by Frédéric Chapoton

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

Authors: Frédéric Chapoton
Cc: Sage Combinat CC user added
Description: modified (diff)
Status: newneeds_review

comment:2 Changed 9 years ago by Christian Nassau

Keywords: pade added; padé removed
Summary: Padé approximantsPade approximants

comment:3 Changed 9 years ago by Christian Nassau

I've taken the liberty to remove the UTF-8 characters from title and summary - currently the patchbots choke on this (see #14707)

comment:4 Changed 9 years ago by Frédéric Chapoton

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 Christian Nassau

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 Jeroen Demeyer

Milestone: sage-5.11sage-5.12

comment:7 Changed 9 years ago by Frédéric Chapoton

Branch: u/chapoton/14720
Commit: 006d168a12754ff039777f64b049bb74137bba01

New commits:

006d168trac 14720 pade approximation of formal power series

comment:8 Changed 9 years ago by Marc Mezzarobba

  • 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 for sage.rings.polynomial.polynomial_zmod_flint.Polynomial_zmod_flint.rational_reconstruct in the case of series over Z/nZ.)

comment:9 Changed 9 years ago by git

Commit: 006d168a12754ff039777f64b049bb74137bba01acd43fb6b349d8047c5359102d417a97a31a6ff1

Branch pushed to git repo; I updated commit sha1. New commits:

acd43fbtrac #14720 minor changes

comment:10 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:11 Changed 9 years ago by Marc Mezzarobba

Hi Frédéric,

I had a look at your new version and started changing a few things in u/mmezzarobba/14720-pade, but I stopped midstream. (I'm intentionally not setting the ticket's branch field to my branch, because it is half-broken.)

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 the ValueError by changing the definition of polyring to self.parent()._poly_ring(), but this is not enough: the degrees of the resulting polynomials are wrong due to round-off 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 Marc Mezzarobba

Status: needs_reviewneeds_work

comment:13 Changed 9 years ago by git

Commit: acd43fb6b349d8047c5359102d417a97a31a6ff1c664343845530cb0fc3150d4bf9b4a22b2d20a06

Branch pushed to git repo; I updated commit sha1. New commits:

e30a7dctrac #14720 enhancements, to be continued
c664343Merge branch 'develop' into 14720

comment:14 Changed 9 years ago by git

Commit: c664343845530cb0fc3150d4bf9b4a22b2d20a06bd93f3a6a543bc6368960067b649ea5448c52206

Branch pushed to git repo; I updated commit sha1. New commits:

6a8cac8trac 14720 pade approximation of formal power series
e47ca08trac #14720 minor changes
77fedfatrac #14720 enhancements, to be continued
bd93f3atrac #14720 truncation added to handle the case of real coefficients

comment:15 Changed 9 years ago by Frédéric Chapoton

Status: needs_workneeds_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 Marc Mezzarobba

Branch: u/chapoton/14720u/mmezzarobba/14720-pade
Commit: bd93f3a6a543bc6368960067b649ea5448c522069a3765b9842c6f01aa9b687242eba62e3ce58cb0
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:

9a3765bpade(): minor docstring changes

comment:17 Changed 9 years ago by Frédéric Chapoton

Status: needs_reviewpositive_review

ok, looks good to me. Thanks for the review !

comment:18 Changed 9 years ago by Volker Braun

Branch: u/mmezzarobba/14720-pade9a3765b9842c6f01aa9b687242eba62e3ce58cb0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.