Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #20056: Rename AsymptoticRing.singularity_analysis to coefficien…
Browse files Browse the repository at this point in the history
…ts_generating_function
  • Loading branch information
cheuberg committed Feb 15, 2016
1 parent 8bb9046 commit 40b6e2e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/sage/rings/asymptotic/asymptotic_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -3728,7 +3728,7 @@ def ngens(self):
return len(self.growth_group.gens_monomial())


def singularity_analysis(self, function, singularities, precision=None,
def coefficients_of_generating_function(self, function, singularities, precision=None,
return_singular_expansions=False):
r"""
Return the asymptotic growth of the coefficients of some
Expand Down Expand Up @@ -3769,10 +3769,10 @@ def singularity_analysis(self, function, singularities, precision=None,
sage: def catalan(z):
....: return (1-(1-4*z)^(1/2))/(2*z)
sage: B.<n> = AsymptoticRing('QQ^n * n^QQ', QQ)
sage: B.singularity_analysis(catalan, (1/4,), precision=3)
sage: B.coefficients_of_generating_function(catalan, (1/4,), precision=3)
1/sqrt(pi)*4^n*n^(-3/2) - 9/8/sqrt(pi)*4^n*n^(-5/2)
+ 145/128/sqrt(pi)*4^n*n^(-7/2) + O(4^n*n^(-4))
sage: B.singularity_analysis(catalan, (1/4,), precision=2,
sage: B.coefficients_of_generating_function(catalan, (1/4,), precision=2,
....: return_singular_expansions=True)
SingularityAnalysisResult(asymptotic_expansion=1/sqrt(pi)*4^n*n^(-3/2)
- 9/8/sqrt(pi)*4^n*n^(-5/2) + O(4^n*n^(-3)),
Expand All @@ -3783,15 +3783,15 @@ def singularity_analysis(self, function, singularities, precision=None,
sage: def logarithmic(z):
....: return -log(1-z)
sage: B.singularity_analysis(logarithmic, (1,), precision=5)
sage: B.coefficients_of_generating_function(logarithmic, (1,), precision=5)
n^(-1) + O(n^(-3))
Harmonic numbers::
sage: def harmonic(z):
....: return -log(1-z)/(1-z)
sage: B.<n> = AsymptoticRing('QQ^n * n^QQ * log(n)^QQ', QQ)
sage: ex = B.singularity_analysis(harmonic, (1,), precision=13); ex
sage: ex = B.coefficients_of_generating_function(harmonic, (1,), precision=13); ex
log(n) + euler_gamma + 1/2*n^(-1) - 1/12*n^(-2) + 1/120*n^(-4)
+ O(n^(-6))
sage: ex.has_same_summands(asymptotic_expansions.HarmonicNumber(
Expand All @@ -3802,7 +3802,7 @@ def singularity_analysis(self, function, singularities, precision=None,
sage: def f(z):
....: return z/(1-z)
sage: B.singularity_analysis(f, (1,), precision=3)
sage: B.coefficients_of_generating_function(f, (1,), precision=3)
Traceback (most recent call last):
...
NotImplementedOZero: The error term in the result is O(0)
Expand Down

0 comments on commit 40b6e2e

Please sign in to comment.