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

Commit

Permalink
More precise composition with complex numbers for Dirichlet series.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Sep 29, 2021
1 parent 8578585 commit ab6c1cd
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/sage/rings/lazy_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2549,6 +2549,17 @@ def __call__(self, p):
Return the series with the variable `s` replaced by a linear
polynomial `a\cdot s + b`, for positive `a`.
When `f` is an exact Dirichlet series, we can write
.. MATH::
f(s) = \sum_{n=1}^k a_n / n^s + C \zeta(s).
Thus we can evaluate this for `p \in \CC` by using the analytic
continuation of the Riemann `\zeta` function for `p \in \CC`
with the real part of `p` at most `1`. In the case `p = 1`,
this will return `\infty` if `C \neq 0`.
EXAMPLES::
sage: D = LazyDirichletSeriesRing(QQ, "s")
Expand All @@ -2566,6 +2577,10 @@ def __call__(self, p):
zeta(5)
sage: Z(1+I)
zeta(I + 1)
sage: Z(0)
-1/2
sage: Z(1)
Infinity
sage: f = D([1,2,-3,-4], valuation=2); f
1/(2^s) + 2/3^s - 3/4^s - 4/5^s
Expand All @@ -2574,22 +2589,26 @@ def __call__(self, p):
sage: 1/2^2 + 2/3^2 + -3/4^2 + -4/5^2
449/3600
sage: f(0)
0
-4
sage: f(1)
-23/60
sage: f(-2)
-126
sage: f = D([4,2,-3,2])
sage: f(0)
4
5
sage: f = D([1,2,-3,-4], constant=2)
sage: bool(f(2) == -1 + -5/3^2 + -6/4^2 + 2*zeta(2))
True
sage: f(0)
-13
sage: f(1)
Infinity
"""
P = self.parent()
coeff_stream = self._coeff_stream
if not p:
return self[1]

# Special behavior for finite series
if isinstance(coeff_stream, Stream_exact):
Expand Down

0 comments on commit ab6c1cd

Please sign in to comment.