Skip to content

Commit 362a0af

Browse files
committed
move single_valued method of MZV to auxiliary F ring
1 parent fbb4127 commit 362a0af

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

src/sage/modular/multiple_zeta.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,13 +1108,7 @@ def single_valued(self):
11081108
sage: Z(5,3).single_valued() == 14*Z(3)*Z(5)
11091109
True
11101110
"""
1111-
phi_im = self.phi()
1112-
zin = phi_im.parent()
1113-
phi_no_f2 = phi_im.without_f2()
1114-
sv = zin.sum_of_terms(((0, w), cf)
1115-
for (a, b), cf in phi_no_f2.coproduct()
1116-
for w in shuffle(a[1], b[1].reversal(), False))
1117-
return rho_inverse(sv)
1111+
return rho_inverse(self.phi().single_valued())
11181112

11191113
def simplify(self):
11201114
"""

src/sage/modular/multiple_zeta_F_algebra.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from sage.combinat.free_module import CombinatorialFreeModule
3232
from sage.combinat.words.words import Words
3333
from sage.combinat.words.finite_word import FiniteWord_class
34+
from sage.combinat.words.shuffle_product import ShuffleProduct_w1w2 as shuffle
3435
from sage.misc.cachefunc import cached_method
3536
from sage.misc.lazy_attribute import lazy_attribute
3637
from sage.sets.integer_range import IntegerRange
@@ -721,3 +722,24 @@ def without_f2(self):
721722
"""
722723
F = self.parent()
723724
return F._from_dict({(0, w): cf for (p, w), cf in self if not p})
725+
726+
def single_valued(self):
727+
"""
728+
Return the single-valued version of ``self``.
729+
730+
EXAMPLES::
731+
732+
sage: from sage.modular.multiple_zeta_F_algebra import F_algebra
733+
sage: F = F_algebra(QQ)
734+
sage: t = 4*F("2")+F("3")
735+
sage: t.single_valued()
736+
2*f3
737+
sage: t = 4*F("35")+F("27")
738+
sage: t.single_valued()
739+
8*f3f5 + 8*f5f3
740+
"""
741+
F = self.parent()
742+
no_f2 = self.without_f2()
743+
return F.sum_of_terms(((0, w), cf)
744+
for (a, b), cf in no_f2.coproduct()
745+
for w in shuffle(a[1], b[1].reversal(), False))

0 commit comments

Comments
 (0)