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

Commit

Permalink
more work on multiple zeta values
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Jan 2, 2020
1 parent 67d78cc commit 4e22cc3
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions src/sage/functions/multizeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ def __init__(self):
EXAMPLES::
sage: maxima(hypergeometric)
hypergeometric
sage: from sage.functions.multizeta import multizeta
sage: pari(multizeta)
zetamult
"""
BuiltinFunction.__init__(self, 'multizeta', nargs=1,
conversions={'pari': 'zetamult'})
Expand All @@ -36,6 +37,28 @@ def __call__(self, a):
sage: from sage.functions.multizeta import multizeta
sage: multizeta((4,2))
multizeta((4, 2))
TESTS::
sage: multizeta(5)
Traceback (most recent call last):
...
TypeError: parameter must be a tuple
sage: multizeta([1/2, 1])
Traceback (most recent call last):
...
TypeError: arguments must be integers
sage: multizeta([3, 0])
Traceback (most recent call last):
...
ValueError: arguments must be positive integers
sage: multizeta([1, 2])
Traceback (most recent call last):
...
ValueError: first argument must be at least 2
"""
return BuiltinFunction.__call__(self, SR._force_pyobject(a))

Expand All @@ -61,13 +84,13 @@ def _eval_(self, a):
multizeta((3, 3, 2))
"""
if not isinstance(a, tuple):
raise TypeError("The parameters must be of type tuple")
raise TypeError("parameter must be a tuple")
if not all(isinstance(y, Integer) for y in a):
raise TypeError('arguments must be integers')
if not all(y >= 1 for y in a):
raise TypeError('arguments must be positive integers')
raise ValueError('arguments must be positive integers')
if a[0] == 1:
raise ValueError('divergence')
raise ValueError('first argument must be at least 2')

def _evalf_(self, a, parent, algorithm=None):
"""
Expand All @@ -82,7 +105,7 @@ def _evalf_(self, a, parent, algorithm=None):
1.20205690315959
"""
if not isinstance(a, tuple):
raise TypeError("The first parameters must be of type tuple")
raise TypeError("parameter must be a tuple")

if algorithm is None:
algorithm = "pari"
Expand Down

0 comments on commit 4e22cc3

Please sign in to comment.