Skip to content

Commit

Permalink
sagemathgh-38093: add doc on egf_to_ogf and inverse
Browse files Browse the repository at this point in the history
    
Just adding a little comment in the doc on the link to Borel and Laplace
formal transforms.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have updated the documentation and checked the documentation
preview.
    
URL: sagemath#38093
Reported by: Frédéric Chapoton
Reviewer(s): Matthias Köppe
  • Loading branch information
Release Manager committed May 31, 2024
2 parents c4507b9 + c92a11d commit dfb90d0
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/sage/rings/power_series_ring_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2764,9 +2764,13 @@ cdef class PowerSeries(AlgebraElement):
def egf_to_ogf(self):
r"""
Return the ordinary generating function power series,
assuming self is an exponential generating function power series.
assuming ``self`` is an exponential generating function power series.
This function is known as ``serlaplace`` in PARI/GP.
This is a formal Laplace transform.
This function is known as :pari:`serlaplace` in PARI/GP.
.. SEEALSO:: :meth:`ogf_to_egf` for the inverse method.
EXAMPLES::
Expand All @@ -2775,23 +2779,27 @@ cdef class PowerSeries(AlgebraElement):
sage: f.egf_to_ogf()
t + t^2 + 2*t^3
"""
return self.parent()([self[i] * arith.factorial(i) for i in range(self.degree()+1)])
return self.parent()([self[i] * arith.factorial(i) for i in range(self.degree() + 1)])

def ogf_to_egf(self):
r"""
Return the exponential generating function power series,
assuming self is an ordinary generating function power series.
assuming ``self`` is an ordinary generating function power series.
This is a formal Borel transform.
This can also be computed as ``serconvol(f,exp(t))`` in PARI/GP.
.. SEEALSO:: :meth:`egf_to_ogf` for the inverse method.
EXAMPLES::
sage: R.<t> = PowerSeriesRing(QQ)
sage: f = t + t^2 + 2*t^3
sage: f.ogf_to_egf()
t + 1/2*t^2 + 1/3*t^3
"""
return self.parent()([self[i] / arith.factorial(i) for i in range(self.degree()+1)])
return self.parent()([self[i] / arith.factorial(i) for i in range(self.degree() + 1)])

def __pari__(self):
"""
Expand Down

0 comments on commit dfb90d0

Please sign in to comment.