Skip to content

Commit

Permalink
add explict doctest and additional example to AsymptoticRing.coeffici…
Browse files Browse the repository at this point in the history
…ents_of_generating_function
  • Loading branch information
behackl committed Nov 12, 2024
1 parent 0f9ecbd commit 82f7c17
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/sage/groups/misc_gps/argument_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -1461,6 +1461,15 @@ def __pow__(self, exponent):
1
sage: S(-1)^3 # indirect doctest
-1
Check that the results may live in other parents too::
sage: x = SR.var('x')
sage: elem = S(-1)^x; elem # indirect doctest
(-1)^x
sage: elem.parent()
Symbolic Ring
"""
result = self._element_ ** exponent
P = self.parent()
Expand Down
10 changes: 10 additions & 0 deletions src/sage/rings/asymptotic/asymptotic_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -4415,6 +4415,16 @@ def coefficients_of_generating_function(self, function, singularities, precision
....: 'n', precision=5))
True
Positive and negative singularities::
sage: def permutations_odd_cycles(z):
....: return sqrt((1+z) / (1-z))
sage: ex = B.coefficients_of_generating_function(
....: permutations_odd_cycles, (1, -1,), precision=2,
....: ); ex
sqrt(2)/sqrt(pi)*n^(-1/2) - 1/2*sqrt(1/2)/sqrt(pi)*n^(-3/2)*(-1)^n
+ O(n^(-5/2))
.. WARNING::
Once singular expansions around points other than infinity
Expand Down

0 comments on commit 82f7c17

Please sign in to comment.