diff --git a/src/doc/de/tutorial/tour_groups.rst b/src/doc/de/tutorial/tour_groups.rst index 0f27fb297a6..5ec70286dfb 100644 --- a/src/doc/de/tutorial/tour_groups.rst +++ b/src/doc/de/tutorial/tour_groups.rst @@ -35,7 +35,7 @@ erhalten: :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) - sage: latex(G.character_table()) + sage: latex(G.character_table()) # random \left(\begin{array}{rrrr} 1 & 1 & 1 & 1 \\ 1 & -\zeta_{3} - 1 & \zeta_{3} & 1 \\ diff --git a/src/doc/en/constructions/rep_theory.rst b/src/doc/en/constructions/rep_theory.rst index c9c5233136f..d45399e4434 100644 --- a/src/doc/en/constructions/rep_theory.rst +++ b/src/doc/en/constructions/rep_theory.rst @@ -23,14 +23,14 @@ interface to the GAP command ``CharacterTable``. sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3,4)]]) sage: G.order() 8 - sage: G.character_table() + sage: G.character_table() # random [ 1 1 1 1 1] [ 1 -1 -1 1 1] [ 1 -1 1 -1 1] [ 1 1 -1 -1 1] [ 2 0 0 0 -2] sage: CT = libgap(G).CharacterTable() - sage: CT.Display() + sage: CT.Display() # random CT1 2 3 2 2 2 3 @@ -50,7 +50,7 @@ Here is another example: :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) - sage: G.character_table() + sage: G.character_table() # random [ 1 1 1 1] [ 1 -zeta3 - 1 zeta3 1] [ 1 zeta3 -zeta3 - 1 1] @@ -58,7 +58,7 @@ Here is another example: sage: G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G Group([ (1,2)(3,4), (1,2,3) ]) sage: T = G.CharacterTable() - sage: T.Display() + sage: T.Display() # random CT2 2 2 . . 2 @@ -85,12 +85,12 @@ Python command. This makes the output look much nicer. :: - sage: irr = G.Irr(); irr - [ Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, 1, 1 ] ), - Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3)^2, E(3), 1 ] ), - Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3), E(3)^2, 1 ] ), - Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 3, 0, 0, -1 ] ) ] - sage: irr.Display() + sage: irr = G.Irr(); sorted(irr) + [Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, 1, 1 ] ), + Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3)^2, E(3), 1 ] ), + Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3), E(3)^2, 1 ] ), + Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 3, 0, 0, -1 ] )] + sage: irr.Display() # random [ [ 1, 1, 1, 1 ], [ 1, E(3)^2, E(3), 1 ], [ 1, E(3), E(3)^2, 1 ], @@ -101,9 +101,9 @@ Python command. This makes the output look much nicer. (2,4,3)^G sage: g = gamma.Representative(); g (2,4,3) - sage: chi = irr[1]; chi + sage: chi = irr[1]; chi # random Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3)^2, E(3), 1 ] ) - sage: g^chi + sage: g^chi # random E(3) This last quantity is the value of the character ``chi`` at the group @@ -188,7 +188,7 @@ The example below using the GAP interface illustrates the syntax. [ 1, 1, 1, 1 ], [ 3, -1, 0, 0 ] ] sage: T = G.CharacterTable() - sage: T.Display() + sage: T.Display() # random CT3 2 2 . . 2 diff --git a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst index 6831d95af90..ee89abb04fc 100644 --- a/src/doc/en/thematic_tutorials/lie/weyl_groups.rst +++ b/src/doc/en/thematic_tutorials/lie/weyl_groups.rst @@ -127,7 +127,7 @@ and whose values are the roots, you may use the inverse family:: The Weyl group is implemented as a GAP matrix group. You therefore can display its character table as follows:: - sage: WeylGroup("D4").character_table() + sage: WeylGroup("D4").character_table() # random CT1 2 6 4 5 1 3 5 5 4 3 3 1 4 6 @@ -224,8 +224,8 @@ this as follows:: sage: [s1,s2] = W.simple_reflections() sage: def bi(u,v) : return [t for t in W if u.bruhat_le(t) and t.bruhat_le(v)] ... - sage: bi(s1,s1*s2*s1) - [s1*s2, s2*s1, s1, s1*s2*s1] + sage: sorted(bi(s1,s1*s2*s1)) + [s1*s2*s1, s1*s2, s2*s1, s1] This would not be a good definition since it would fail if `W` is affine and be inefficient of `W` is large. Sage has a Bruhat interval diff --git a/src/doc/en/tutorial/tour_groups.rst b/src/doc/en/tutorial/tour_groups.rst index 60f9a0dbd49..2142d682fc7 100644 --- a/src/doc/en/tutorial/tour_groups.rst +++ b/src/doc/en/tutorial/tour_groups.rst @@ -33,7 +33,7 @@ You can also obtain the character table (in LaTeX format) in Sage: :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) - sage: latex(G.character_table()) + sage: latex(G.character_table()) # random \left(\begin{array}{rrrr} 1 & 1 & 1 & 1 \\ 1 & -\zeta_{3} - 1 & \zeta_{3} & 1 \\ diff --git a/src/doc/es/tutorial/tour_groups.rst b/src/doc/es/tutorial/tour_groups.rst index 70845eb05c2..8fb39d3bddd 100644 --- a/src/doc/es/tutorial/tour_groups.rst +++ b/src/doc/es/tutorial/tour_groups.rst @@ -38,7 +38,7 @@ código LaTeX): :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) - sage: latex(G.character_table()) + sage: latex(G.character_table()) # random \left(\begin{array}{rrrr} 1 & 1 & 1 & 1 \\ 1 & -\zeta_{3} - 1 & \zeta_{3} & 1 \\ diff --git a/src/doc/fr/tutorial/tour_groups.rst b/src/doc/fr/tutorial/tour_groups.rst index 3cd92ef2ce7..d017cf906b5 100644 --- a/src/doc/fr/tutorial/tour_groups.rst +++ b/src/doc/fr/tutorial/tour_groups.rst @@ -34,7 +34,7 @@ On peut obtenir la table des caractères (au format LaTeX) à partir de Sage : :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) - sage: latex(G.character_table()) + sage: latex(G.character_table()) # random \left(\begin{array}{rrrr} 1 & 1 & 1 & 1 \\ 1 & -\zeta_{3} - 1 & \zeta_{3} & 1 \\ diff --git a/src/doc/ja/tutorial/tour_groups.rst b/src/doc/ja/tutorial/tour_groups.rst index 1b067df06c0..064d12c333c 100644 --- a/src/doc/ja/tutorial/tour_groups.rst +++ b/src/doc/ja/tutorial/tour_groups.rst @@ -35,7 +35,7 @@ Sageを使えば(LaTeX形式で)指標表を作ることもできる: :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) - sage: latex(G.character_table()) + sage: latex(G.character_table()) # random \left(\begin{array}{rrrr} 1 & 1 & 1 & 1 \\ 1 & -\zeta_{3} - 1 & \zeta_{3} & 1 \\ diff --git a/src/doc/pt/tutorial/tour_groups.rst b/src/doc/pt/tutorial/tour_groups.rst index b86e52d3d52..5e5e5762a2d 100644 --- a/src/doc/pt/tutorial/tour_groups.rst +++ b/src/doc/pt/tutorial/tour_groups.rst @@ -35,7 +35,7 @@ Sage: :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) - sage: latex(G.character_table()) + sage: latex(G.character_table()) # random \left(\begin{array}{rrrr} 1 & 1 & 1 & 1 \\ 1 & -\zeta_{3} - 1 & \zeta_{3} & 1 \\ diff --git a/src/doc/ru/tutorial/tour_groups.rst b/src/doc/ru/tutorial/tour_groups.rst index 1e1ca3b382e..0f2c44d5b64 100644 --- a/src/doc/ru/tutorial/tour_groups.rst +++ b/src/doc/ru/tutorial/tour_groups.rst @@ -33,7 +33,7 @@ Sage поддерживает вычисления с группами пере :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) - sage: latex(G.character_table()) + sage: latex(G.character_table()) # random \left(\begin{array}{rrrr} 1 & 1 & 1 & 1 \\ 1 & -\zeta_{3} - 1 & \zeta_{3} & 1 \\ diff --git a/src/doc/zh/constructions/rep_theory.rst b/src/doc/zh/constructions/rep_theory.rst index 1e6cb9f2161..480d094b176 100644 --- a/src/doc/zh/constructions/rep_theory.rst +++ b/src/doc/zh/constructions/rep_theory.rst @@ -20,14 +20,14 @@ sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3,4)]]) sage: G.order() 8 - sage: G.character_table() + sage: G.character_table() # random [ 1 1 1 1 1] [ 1 -1 -1 1 1] [ 1 -1 1 -1 1] [ 1 1 -1 -1 1] [ 2 0 0 0 -2] sage: CT = libgap(G).CharacterTable() - sage: CT.Display() + sage: CT.Display() # random CT1 2 3 2 2 2 3 @@ -47,7 +47,7 @@ :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) - sage: G.character_table() + sage: G.character_table() # random [ 1 1 1 1] [ 1 -zeta3 - 1 zeta3 1] [ 1 zeta3 -zeta3 - 1 1] @@ -55,7 +55,7 @@ sage: G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G Group([ (1,2)(3,4), (1,2,3) ]) sage: T = G.CharacterTable() - sage: T.Display() + sage: T.Display() # random CT2 2 2 . . 2 @@ -81,12 +81,12 @@ :: - sage: irr = G.Irr(); irr - [ Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, 1, 1 ] ), - Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3)^2, E(3), 1 ] ), - Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3), E(3)^2, 1 ] ), - Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 3, 0, 0, -1 ] ) ] - sage: irr.Display() + sage: irr = G.Irr(); sorted(irr) + [Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, 1, 1 ] ), + Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3)^2, E(3), 1 ] ), + Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3), E(3)^2, 1 ] ), + Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 3, 0, 0, -1 ] )] + sage: irr.Display() # random [ [ 1, 1, 1, 1 ], [ 1, E(3)^2, E(3), 1 ], [ 1, E(3), E(3)^2, 1 ], @@ -97,9 +97,9 @@ (2,4,3)^G sage: g = gamma.Representative(); g (2,4,3) - sage: chi = irr[1]; chi + sage: chi = irr[1]; chi # random Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3)^2, E(3), 1 ] ) - sage: g^chi + sage: g^chi # random E(3) 最后一个量是特征 ``chi`` 在群元素 ``g`` 处的值。 @@ -181,7 +181,7 @@ GAP 中的布劳尔特征标表尚未具有“原生”接口。 [ 1, 1, 1, 1 ], [ 3, -1, 0, 0 ] ] sage: T = G.CharacterTable() - sage: T.Display() + sage: T.Display() # random CT3 2 2 . . 2 diff --git a/src/doc/zh/tutorial/tour_groups.rst b/src/doc/zh/tutorial/tour_groups.rst index 446501a4e78..d137eb49cdf 100644 --- a/src/doc/zh/tutorial/tour_groups.rst +++ b/src/doc/zh/tutorial/tour_groups.rst @@ -30,7 +30,7 @@ Sage 支持置换群、有限经典群(例如 `SU(n,q)`)、有限矩阵群 :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) - sage: latex(G.character_table()) + sage: latex(G.character_table()) # random \left(\begin{array}{rrrr} 1 & 1 & 1 & 1 \\ 1 & -\zeta_{3} - 1 & \zeta_{3} & 1 \\ diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py index 76595ccfc91..907089aafd1 100644 --- a/src/sage/algebras/fusion_rings/fusion_double.py +++ b/src/sage/algebras/fusion_rings/fusion_double.py @@ -58,28 +58,28 @@ class FusionDouble(CombinatorialFreeModule): sage: for x in H.basis(): ....: print ("%s : %s"%(x,x^2)) ....: - s0 : s0 - s1 : s0 + s0 : s1 + s1 : s1 s2 : s0 + s1 + s3 s3 : s0 + s1 + s2 - s4 : s0 + s2 + s3 + s6 + s7 + s8 + s9 + s10 + s11 + s12 + s13 + s14 + s15 - s5 : s0 + s2 + s3 + s6 + s7 + s8 + s9 + s10 + s11 + s12 + s13 + s14 + s15 - s6 : s0 + s1 + s11 - s7 : s0 + s1 + s13 - s8 : s0 + s1 + s15 - s9 : s0 + s1 + s12 - s10 : s0 + s1 + s14 - s11 : s0 + s1 + s6 - s12 : s0 + s1 + s9 - s13 : s0 + s1 + s7 - s14 : s0 + s1 + s10 - s15 : s0 + s1 + s8 + s4 : s0 + s1 + s13 + s5 : s0 + s1 + s10 + s6 : s0 + s1 + s12 + s7 : s0 + s1 + s9 + s8 : s0 + s1 + s11 + s9 : s0 + s1 + s7 + s10 : s0 + s1 + s5 + s11 : s0 + s1 + s8 + s12 : s0 + s1 + s6 + s13 : s0 + s1 + s4 + s14 : s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10 + s11 + s12 + s13 + s15 : s1 + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10 + s11 + s12 + s13 sage: s4*s5 - s1 + s2 + s3 + s6 + s7 + s8 + s9 + s10 + s11 + s12 + s13 + s14 + s15 + s2 + s9 sage: s4.ribbon() - 1 + -zeta5^3 - zeta5^2 - zeta5 - 1 sage: s5.ribbon() - -1 + 1 sage: s8.ribbon() zeta5^3 @@ -131,7 +131,7 @@ class FusionDouble(CombinatorialFreeModule): sage: G = SmallPermutationGroup(16,9) sage: F = FusionDouble(G, prefix='b', inject_variables=True) sage: b13^2 # long time (4s) - b0 + b3 + b4 + b0 + b3 + b37 """ @staticmethod def __classcall_private__(cls, G, prefix='s', inject_variables=False): @@ -175,8 +175,8 @@ def __init__(self, G, prefix='s') -> None: self._chi = {} self._unit_index = None # index of the unit element count = ZZ.zero() - for g in G.conjugacy_classes_representatives(): - for chi in G.centralizer(g).irreducible_characters(): + for g in sorted(G.conjugacy_classes_representatives(), key=str): + for chi in sorted(G.centralizer(g).irreducible_characters(), key=lambda chi:str(chi.values())): # NOTE: the trivial char is not necessarily the first one self._names[count] = "%s%s" % (prefix, count) self._elt[count] = g @@ -288,9 +288,9 @@ def s_ijconj(self, i, j, unitary=False, base_coercion=True): sage: P = FusionDouble(CyclicPermutationGroup(3),prefix='p',inject_variables=True) sage: P.s_ij(p1,p3) - zeta3 + 1 sage: P.s_ijconj(p1,p3) - -zeta3 - 1 + 1 """ return self.s_ij(i, j, unitary=unitary, base_coercion=base_coercion).conjugate() @@ -309,23 +309,23 @@ def s_matrix(self, unitary=False, base_coercion=True): EXAMPLES:: sage: FusionDouble(SymmetricGroup(3)).s_matrix() - [ 1 1 2 3 3 2 2 2] [ 1 1 2 -3 -3 2 2 2] + [ 1 1 2 3 3 2 2 2] [ 2 2 4 0 0 -2 -2 -2] - [ 3 -3 0 3 -3 0 0 0] - [ 3 -3 0 -3 3 0 0 0] - [ 2 2 -2 0 0 4 -2 -2] + [-3 3 0 3 -3 0 0 0] + [-3 3 0 -3 3 0 0 0] [ 2 2 -2 0 0 -2 -2 4] [ 2 2 -2 0 0 -2 4 -2] + [ 2 2 -2 0 0 4 -2 -2] sage: FusionDouble(SymmetricGroup(3)).s_matrix(unitary=True) - [ 1/6 1/6 1/3 1/2 1/2 1/3 1/3 1/3] [ 1/6 1/6 1/3 -1/2 -1/2 1/3 1/3 1/3] + [ 1/6 1/6 1/3 1/2 1/2 1/3 1/3 1/3] [ 1/3 1/3 2/3 0 0 -1/3 -1/3 -1/3] - [ 1/2 -1/2 0 1/2 -1/2 0 0 0] - [ 1/2 -1/2 0 -1/2 1/2 0 0 0] - [ 1/3 1/3 -1/3 0 0 2/3 -1/3 -1/3] + [-1/2 1/2 0 1/2 -1/2 0 0 0] + [-1/2 1/2 0 -1/2 1/2 0 0 0] [ 1/3 1/3 -1/3 0 0 -1/3 -1/3 2/3] [ 1/3 1/3 -1/3 0 0 -1/3 2/3 -1/3] + [ 1/3 1/3 -1/3 0 0 2/3 -1/3 -1/3] """ b = self.basis() return matrix([[self.s_ij(b[x], b[y], unitary=unitary, @@ -351,7 +351,7 @@ def N_ijk(self, i, j, k): sage: A = FusionDouble(AlternatingGroup(4),prefix='a',inject_variables=True) sage: [A.N_ijk(a10,a11,x) for x in A.basis()] - [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] + [1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0] TESTS:: @@ -546,11 +546,11 @@ def r_matrix(self, i, j, k, base_coercion=True): sage: c4*c5 c3 + c4 sage: [C.r_matrix(c4,c5,k) for k in [c3,c4]] - [-zeta24^6, 1] + [-zeta24^6 + zeta24^2, -zeta24^4] sage: c6^2 c0 + c1 + c6 sage: [C.r_matrix(c6,c6,k) for k in [c0,c1,c6]] - [zeta3, -zeta3, -zeta3 - 1] + [-1, 1, 1] """ if self.Nk_ij(i, j, k) == 0: return self.field().zero() if (not base_coercion) or (self._basecoer is None) else self.fvars_field().zero() @@ -667,15 +667,15 @@ def dual(self, i): sage: K = FusionDouble(CyclicPermutationGroup(3),prefix='k') sage: [(x,K.dual(x)) for x in K.basis()] - [(k0, k0), - (k1, k2), - (k2, k1), - (k3, k6), - (k4, k8), - (k5, k7), - (k6, k3), - (k7, k5), - (k8, k4)] + [(k0, k2), + (k1, k1), + (k2, k0), + (k3, k8), + (k4, k7), + (k5, k6), + (k6, k5), + (k7, k4), + (k8, k3)] sage: all(K.dual(x)==x.dual() for x in K.basis()) True """ @@ -697,11 +697,11 @@ def product_on_basis(self, a, b): sage: Q = FusionDouble(SymmetricGroup(3),prefix='q',inject_variables=True) sage: q3*q4 - q1 + q2 + q5 + q6 + q7 + q0 + q2 + q5 + q6 + q7 sage: Q._names {0: 'q0', 1: 'q1', 2: 'q2', 3: 'q3', 4: 'q4', 5: 'q5', 6: 'q6', 7: 'q7'} sage: Q.product_on_basis(3,4) - q1 + q2 + q5 + q6 + q7 + q0 + q2 + q5 + q6 + q7 """ d = {k.support_of_term(): val for k in self.basis() if (val := self.N_ijk(self.monomial(a), self.monomial(b), @@ -785,9 +785,9 @@ class representative `g` and an irreducible character `\chi` of sage: G = DihedralGroup(5) sage: H = FusionDouble(G, prefix='f', inject_variables=True) sage: f10.g() - (1,2,3,4,5) + (1,3,5,2,4) sage: f10.char() - Character of Subgroup generated by [(1,2,3,4,5)] of + Character of Subgroup generated by [(1,3,5,2,4), (1,2,3,4,5)] of (Dihedral group of order 10 as a permutation group) """ return self.parent()._chi[self.support_of_term()] @@ -800,7 +800,7 @@ def ribbon(self, base_coercion=True): sage: H = FusionDouble(CyclicPermutationGroup(3)) sage: [i.ribbon() for i in H.basis()] - [1, 1, 1, 1, zeta3, -zeta3 - 1, 1, -zeta3 - 1, zeta3] + [1, 1, 1, -zeta3 - 1, 1, zeta3, zeta3, 1, -zeta3 - 1] """ i = self.support_of_term() P = self.parent() @@ -822,9 +822,9 @@ def twist(self, reduced=True): sage: Q = FusionDouble(CyclicPermutationGroup(3)) sage: [x.twist() for x in Q.basis()] - [0, 0, 0, 0, 2/3, 4/3, 0, 4/3, 2/3] + [0, 0, 0, 4/3, 0, 2/3, 2/3, 0, 4/3] sage: [x.ribbon() for x in Q.basis()] - [1, 1, 1, 1, zeta3, -zeta3 - 1, 1, -zeta3 - 1, zeta3] + [1, 1, 1, -zeta3 - 1, 1, zeta3, zeta3, 1, -zeta3 - 1] TESTS:: @@ -855,7 +855,7 @@ def dual(self): sage: G = CyclicPermutationGroup(4) sage: H = FusionDouble(G, prefix='j') sage: [x for x in H.basis() if x == x.dual()] - [j0, j1, j8, j9] + [j0, j2, j8, j10] TESTS:: diff --git a/src/sage/algebras/lie_algebras/bgg_resolution.py b/src/sage/algebras/lie_algebras/bgg_resolution.py index 906f8d43f95..396d149df52 100644 --- a/src/sage/algebras/lie_algebras/bgg_resolution.py +++ b/src/sage/algebras/lie_algebras/bgg_resolution.py @@ -133,13 +133,13 @@ def module_order(self, i): sage: La = g.cartan_type().root_system().weight_lattice().fundamental_weights() sage: L = g.simple_module(La[1]) sage: res = L.bgg_resolution() - sage: [res.module_order(i) for i in range(7)] + sage: [sorted(res.module_order(i)) for i in range(7)] [[1], [s2, s1], [s2*s1, s1*s2], - [s1*s2*s1, s2*s1*s2], - [s1*s2*s1*s2, s2*s1*s2*s1], - [s1*s2*s1*s2*s1, s2*s1*s2*s1*s2], + [s2*s1*s2, s1*s2*s1], + [s2*s1*s2*s1, s1*s2*s1*s2], + [s2*s1*s2*s1*s2, s1*s2*s1*s2*s1], [s2*s1*s2*s1*s2*s1]] """ if i not in self._module_order: @@ -171,7 +171,7 @@ def build_differentials(W): sage: D, O = build_differentials(W) sage: D {0: [], - 1: [-1 1], + 1: [ 1 -1], 2: [1 1] [1 1], 3: [ 1 -1] @@ -181,16 +181,16 @@ def build_differentials(W): 5: []} sage: O {0: [1], - 1: [s2, s1], - 2: [s2*s1, s1*s2], - 3: [s2*s1*s2, s1*s2*s1], + 1: [s1, s2], + 2: [s1*s2, s2*s1], + 3: [s1*s2*s1, s2*s1*s2], 4: [s2*s1*s2*s1]} """ from itertools import combinations w0 = W.long_element() maxlen = w0.length() module_order = {i: [] for i in range(maxlen+1)} - for w in W: + for w in sorted(W): module_order[w.length()].append(w) one = ZZ.one() diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py index 5d87a3dfa8d..75b0b7e2afd 100644 --- a/src/sage/combinat/root_system/hecke_algebra_representation.py +++ b/src/sage/combinat/root_system/hecke_algebra_representation.py @@ -357,7 +357,7 @@ def Tw(self, word, signs=None, scalar=None): sage: K = QQ['q1,q2'].fraction_field() sage: q1, q2 = K.gens() sage: KW = W.algebra(K) - sage: x = KW.an_element(); x + sage: x = KW.an_element(); x # random 123 + 3*2312 + 2*31 + e sage: T = KW.demazure_lusztig_operators(q1,q2) @@ -752,16 +752,15 @@ def Y_eigenvectors(self): Now we can compute all eigenvectors:: - sage: [E[w] for w in W] - [2121 - 121 - 212 + 12 + 21 - 1 - 2 + , + sage: [E[w] for w in sorted(W)] + [2121, + -2121 + 121, -2121 + 212, - (q2/(q1-q2))*2121 + (q2/(-q1+q2))*121 + (q2/(-q1+q2))*212 - 12 - (q2/(-q1+q2))*21 + 2, - -(q2^2/(-q1^2+q1*q2-q2^2))*2121 - 121 + (q2^2/(-q1^2+q1*q2-q2^2))*212 + 21, - -((q1^2+q2^2)/(q1^2-q1*q2+q2^2))*2121 - ((q1^2+q2^2)/(-q1^2+q1*q2-q2^2))*121 - - (q2^2/(-q1^2+q1*q2-q2^2))*212 + (q2^2/(-q1^2+q1*q2-q2^2))*12 - 21 + 1, - 2121, (q2/(-q1+q2))*2121 - (q2/(-q1+q2))*121 - 212 + 12, - -2121 + 121] + -(q2^2/(-q1^2+q1*q2-q2^2))*2121 - 121 + (q2^2/(-q1^2+q1*q2-q2^2))*212 + 21, + -((q1^2+q2^2)/(q1^2-q1*q2+q2^2))*2121 - ((q1^2+q2^2)/(-q1^2+q1*q2-q2^2))*121 - (q2^2/(-q1^2+q1*q2-q2^2))*212 + (q2^2/(-q1^2+q1*q2-q2^2))*12 - 21 + 1, + (q2/(q1-q2))*2121 + (q2/(-q1+q2))*121 + (q2/(-q1+q2))*212 - 12 - (q2/(-q1+q2))*21 + 2, + 2121 - 121 - 212 + 12 + 21 - 1 - 2 + ] """ if not self.cartan_type().is_affine(): raise ValueError("The Cherednik operators are only defined for representations of affine Hecke algebra") diff --git a/src/sage/combinat/root_system/root_system.py b/src/sage/combinat/root_system/root_system.py index 06210a749e7..2a4afc6f673 100644 --- a/src/sage/combinat/root_system/root_system.py +++ b/src/sage/combinat/root_system/root_system.py @@ -206,15 +206,15 @@ class RootSystem(UniqueRepresentation, SageObject): sage: # needs sage.graphs sage.libs.gap sage.libs.pari sage: W = L.weyl_group() sage: S3 = [ w.action(id) for w in W.classical() ] - sage: [L.classical()(x) for x in S3] - [(1, 2, 3), (3, 1, 2), (2, 3, 1), (2, 1, 3), (1, 3, 2), (3, 2, 1)] + sage: sorted([L.classical()(x) for x in S3]) + [(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)] And the action of `s_0` on these yields:: sage: # needs sage.graphs sage.libs.gap sage.libs.pari sage: s = W.simple_reflections() - sage: [L.classical()(s[0].action(x)) for x in S3] - [(0, 2, 4), (-1, 1, 6), (-2, 3, 5), (0, 1, 5), (-1, 3, 4), (-2, 2, 6)] + sage: sorted([L.classical()(s[0].action(x)) for x in S3]) + [(-2, 2, 6), (-2, 3, 5), (-1, 1, 6), (-1, 3, 4), (0, 1, 5), (0, 2, 4)] We can also plot various components of the ambient spaces:: diff --git a/src/sage/combinat/root_system/weyl_group.py b/src/sage/combinat/root_system/weyl_group.py index ac18e338019..405360b47c5 100644 --- a/src/sage/combinat/root_system/weyl_group.py +++ b/src/sage/combinat/root_system/weyl_group.py @@ -419,7 +419,7 @@ def character_table(self): EXAMPLES:: - sage: WeylGroup(['A',3]).character_table() + sage: WeylGroup(['A',3]).character_table() # random CT1 2 3 2 2 . 3 diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py index 83f5f455f3a..98dbaa7d7b8 100644 --- a/src/sage/combinat/symmetric_group_algebra.py +++ b/src/sage/combinat/symmetric_group_algebra.py @@ -119,7 +119,7 @@ def SymmetricGroupAlgebra(R, W, category=None): Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space) sage: SGA.an_element() - s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1 + s1*s2*s3 + ... + 1 The preferred way to construct the symmetric group algebra is to go through the usual ``algebra`` method:: diff --git a/src/sage/combinat/tiling.py b/src/sage/combinat/tiling.py index f68a000e3a9..55f117c43e7 100644 --- a/src/sage/combinat/tiling.py +++ b/src/sage/combinat/tiling.py @@ -312,36 +312,36 @@ def ncube_isometry_group(n, orientation_preserving=True): EXAMPLES:: sage: from sage.combinat.tiling import ncube_isometry_group - sage: ncube_isometry_group(2) + sage: sorted(ncube_isometry_group(2)) [ - [1 0] [ 0 1] [-1 0] [ 0 -1] - [0 1], [-1 0], [ 0 -1], [ 1 0] + [-1 0] [ 0 -1] [ 0 1] [1 0] + [ 0 -1], [ 1 0], [-1 0], [0 1] ] - sage: ncube_isometry_group(2, orientation_preserving=False) + sage: sorted(ncube_isometry_group(2, orientation_preserving=False)) [ - [1 0] [ 0 -1] [ 1 0] [ 0 1] [0 1] [-1 0] [ 0 -1] [-1 0] - [0 1], [-1 0], [ 0 -1], [-1 0], [1 0], [ 0 -1], [ 1 0], [ 0 1] + [-1 0] [-1 0] [ 0 -1] [ 0 -1] [ 0 1] [0 1] [ 1 0] [1 0] + [ 0 -1], [ 0 1], [-1 0], [ 1 0], [-1 0], [1 0], [ 0 -1], [0 1] ] There are 24 orientation preserving isometries of the 3-cube:: - sage: ncube_isometry_group(3) + sage: sorted(ncube_isometry_group(3)) [ - [1 0 0] [ 1 0 0] [ 1 0 0] [ 0 1 0] [0 1 0] [ 0 0 1] - [0 1 0] [ 0 0 1] [ 0 0 -1] [-1 0 0] [0 0 1] [ 0 -1 0] - [0 0 1], [ 0 -1 0], [ 0 1 0], [ 0 0 1], [1 0 0], [ 1 0 0], + [-1 0 0] [-1 0 0] [-1 0 0] [-1 0 0] [ 0 -1 0] [ 0 -1 0] + [ 0 -1 0] [ 0 0 -1] [ 0 0 1] [ 0 1 0] [-1 0 0] [ 0 0 -1] + [ 0 0 1], [ 0 -1 0], [ 0 1 0], [ 0 0 -1], [ 0 0 -1], [ 1 0 0], - [-1 0 0] [ 0 -1 0] [-1 0 0] [-1 0 0] [ 0 -1 0] [ 0 0 -1] - [ 0 -1 0] [ 0 0 -1] [ 0 0 -1] [ 0 1 0] [ 0 0 1] [ 1 0 0] - [ 0 0 1], [ 1 0 0], [ 0 -1 0], [ 0 0 -1], [-1 0 0], [ 0 -1 0], + [ 0 -1 0] [ 0 -1 0] [ 0 0 -1] [ 0 0 -1] [ 0 0 -1] [ 0 0 -1] + [ 0 0 1] [ 1 0 0] [-1 0 0] [ 0 -1 0] [ 0 1 0] [ 1 0 0] + [-1 0 0], [ 0 0 1], [ 0 1 0], [-1 0 0], [ 1 0 0], [ 0 -1 0], - [ 0 1 0] [ 0 0 1] [0 0 1] [ 0 -1 0] [ 0 0 -1] [-1 0 0] - [ 1 0 0] [ 0 1 0] [1 0 0] [ 1 0 0] [ 0 1 0] [ 0 0 1] - [ 0 0 -1], [-1 0 0], [0 1 0], [ 0 0 1], [ 1 0 0], [ 0 1 0], + [ 0 0 1] [ 0 0 1] [ 0 0 1] [0 0 1] [ 0 1 0] [ 0 1 0] + [-1 0 0] [ 0 -1 0] [ 0 1 0] [1 0 0] [-1 0 0] [ 0 0 -1] + [ 0 -1 0], [ 1 0 0], [-1 0 0], [0 1 0], [ 0 0 1], [-1 0 0], - [ 0 -1 0] [ 0 0 -1] [ 0 0 1] [ 1 0 0] [ 0 0 -1] [ 0 1 0] - [-1 0 0] [-1 0 0] [-1 0 0] [ 0 -1 0] [ 0 -1 0] [ 0 0 -1] - [ 0 0 -1], [ 0 1 0], [ 0 -1 0], [ 0 0 -1], [-1 0 0], [-1 0 0] + [0 1 0] [ 0 1 0] [ 1 0 0] [ 1 0 0] [ 1 0 0] [1 0 0] + [0 0 1] [ 1 0 0] [ 0 -1 0] [ 0 0 -1] [ 0 0 1] [0 1 0] + [1 0 0], [ 0 0 -1], [ 0 0 -1], [ 0 1 0], [ 0 -1 0], [0 0 1] ] TESTS:: diff --git a/src/sage/groups/class_function.py b/src/sage/groups/class_function.py index 24a56fb7c1a..cc993e85cfb 100644 --- a/src/sage/groups/class_function.py +++ b/src/sage/groups/class_function.py @@ -745,11 +745,11 @@ def adams_operation(self, k): EXAMPLES:: sage: G = groups.permutation.Alternating(5) - sage: chars = G.irreducible_characters() + sage: chars = sorted(G.irreducible_characters(), key=lambda chi:str(chi.values())) sage: [chi.adams_operation(2).values() for chi in chars] [[1, 1, 1, 1, 1], - [3, 3, 0, -zeta5^3 - zeta5^2, zeta5^3 + zeta5^2 + 1], [3, 3, 0, zeta5^3 + zeta5^2 + 1, -zeta5^3 - zeta5^2], + [3, 3, 0, -zeta5^3 - zeta5^2, zeta5^3 + zeta5^2 + 1], [4, 4, 1, -1, -1], [5, 5, -1, 0, 0]] sage: chars[4].adams_operation(2).decompose() diff --git a/src/sage/groups/libgap_mixin.py b/src/sage/groups/libgap_mixin.py index b4a06ddd5fc..a6054fb0371 100644 --- a/src/sage/groups/libgap_mixin.py +++ b/src/sage/groups/libgap_mixin.py @@ -737,14 +737,18 @@ def character_table(self): EXAMPLES:: - sage: MatrixGroup(SymmetricGroup(2)).character_table() # needs sage.rings.number_field + sage: ct = MatrixGroup(SymmetricGroup(2)).character_table(); ct # random, needs sage.rings.number_field [ 1 -1] [ 1 1] - sage: MatrixGroup(SymmetricGroup(3)).character_table() # needs sage.rings.number_field + sage: sorted(ct, key=str) # needs sage.rings.number_field + [(1, -1), (1, 1)] + sage: ct = MatrixGroup(SymmetricGroup(3)).character_table(); ct # random, needs sage.rings.number_field [ 1 1 -1] [ 2 -1 0] [ 1 1 1] - sage: MatrixGroup(SymmetricGroup(5)).character_table() # long time + sage: sorted(ct, key=str) # needs sage.rings.number_field + [(1, 1, -1), (1, 1, 1), (2, -1, 0)] + sage: ct = MatrixGroup(SymmetricGroup(5)).character_table(); ct # random, long time [ 1 -1 -1 1 -1 1 1] [ 4 0 1 -1 -2 1 0] [ 5 1 -1 0 -1 -1 1] @@ -752,6 +756,10 @@ def character_table(self): [ 5 -1 1 0 1 -1 1] [ 4 0 -1 -1 2 1 0] [ 1 1 1 1 1 1 1] + sage: sorted(ct, key=str) # long time + [(1, -1, -1, 1, -1, 1, 1), (1, 1, 1, 1, 1, 1, 1), + (4, 0, -1, -1, 2, 1, 0), (4, 0, 1, -1, -2, 1, 0), + (5, -1, 1, 0, 1, -1, 1), (5, 1, -1, 0, -1, -1, 1), (6, 0, 0, 1, 0, 0, -2)] """ # code from function in permgroup.py, but modified for # how gap handles these groups. diff --git a/src/sage/groups/matrix_gps/finitely_generated_gap.py b/src/sage/groups/matrix_gps/finitely_generated_gap.py index 70f409b2b54..d5f78610089 100644 --- a/src/sage/groups/matrix_gps/finitely_generated_gap.py +++ b/src/sage/groups/matrix_gps/finitely_generated_gap.py @@ -526,7 +526,7 @@ def molien_series(self, chi=None, return_series=True, prec=20, variable='t'): sage: # needs sage.rings.number_field sage: i = GF(7)(3) sage: G = MatrixGroup([[i^3,0, 0,-i^3], [i^2,0, 0,-i^2]]) - sage: chi = G.character(G.character_table()[4]) + sage: chi = G.character(sorted(G.character_table())[3]) sage: G.molien_series(chi) 3*t^5 + 6*t^11 + 9*t^17 + 12*t^23 + O(t^25) """ @@ -641,12 +641,12 @@ def reynolds_operator(self, poly, chi=None): sage: # needs sage.groups sage.rings.number_field sage: G = MatrixGroup(CyclicPermutationGroup(4)) - sage: chi = G.character(G.character_table()[3]) + sage: chi = G.character(sorted(G.character_table())[1]) sage: K. = CyclotomicField(4) sage: R. = K[] sage: G.reynolds_operator(x, chi) 1/4*x + (1/4*v)*y - 1/4*z + (-1/4*v)*w - sage: chi = G.character(G.character_table()[2]) + sage: chi = G.character(sorted(G.character_table())[0]) sage: R. = QQ[] sage: G.reynolds_operator(x*y, chi) 1/4*x*y + (-1/4*zeta4)*y*z + (1/4*zeta4)*x*w - 1/4*z*w @@ -656,7 +656,7 @@ def reynolds_operator(self, poly, chi=None): sage: # needs sage.groups sage.rings.number_field sage: K. = CyclotomicField(4) sage: G = MatrixGroup(CyclicPermutationGroup(3)) - sage: chi = G.character(G.character_table()[1]) + sage: chi = G.character(sorted(G.character_table())[0]) sage: R. = K[] sage: G.reynolds_operator(x*y^5, chi) 1/3*x*y^5 + (-2/3*izeta3^3 - izeta3^2 - 8/3*izeta3 - 4/3)*x^5*z @@ -886,7 +886,7 @@ def invariants_of_degree(self, deg, chi=None, R=None): sage: # needs sage.groups sage.rings.number_field sage: K. = CyclotomicField(4) sage: G = MatrixGroup(CyclicPermutationGroup(3)) - sage: chi = G.character(G.character_table()[1]) + sage: chi = G.character(sorted(G.character_table())[0]) sage: R. = K[] sage: sorted(G.invariants_of_degree(2, R=R, chi=chi)) [x*y + (-2*izeta3^3 - 3*izeta3^2 - 8*izeta3 - 4)*x*z @@ -898,7 +898,7 @@ def invariants_of_degree(self, deg, chi=None, R=None): sage: # needs sage.groups sage.rings.number_field sage: S3 = MatrixGroup(SymmetricGroup(3)) - sage: chi = S3.character(S3.character_table()[0]) + sage: chi = S3.character(sorted(S3.character_table(), key=str)[0]) sage: sorted(S3.invariants_of_degree(5, chi=chi)) [x0^3*x1^2 - x0^2*x1^3 - x0^3*x2^2 + x1^3*x2^2 + x0^2*x2^3 - x1^2*x2^3, x0^4*x1 - x0*x1^4 - x0^4*x2 + x1^4*x2 + x0*x2^4 - x1*x2^4] diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/permgroup.py index 943601fc72e..616e138becf 100644 --- a/src/sage/groups/perm_gps/permgroup.py +++ b/src/sage/groups/perm_gps/permgroup.py @@ -3496,11 +3496,16 @@ def character_table(self): sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) sage: G.order() 12 - sage: G.character_table() # needs sage.rings.number_field + sage: Gct = G.character_table(); Gct # random, needs sage.rings.number_field [ 1 1 1 1] [ 1 -zeta3 - 1 zeta3 1] [ 1 zeta3 -zeta3 - 1 1] [ 3 0 0 -1] + sage: sorted(Gct) # needs sage.rings.number_field + [(1, -zeta3 - 1, zeta3, 1), + (1, zeta3, -zeta3 - 1, 1), + (1, 1, 1, 1), + (3, 0, 0, -1)] sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) sage: CT = gap(G).CharacterTable() @@ -3511,12 +3516,14 @@ def character_table(self): sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3,4)]]) sage: G.order() 8 - sage: G.character_table() # needs sage.rings.number_field + sage: Gct = G.character_table(); Gct # random, needs sage.rings.number_field [ 1 1 1 1 1] [ 1 -1 -1 1 1] [ 1 -1 1 -1 1] [ 1 1 -1 -1 1] [ 2 0 0 0 -2] + sage: sorted(Gct, key=str) # needs sage.rings.number_field + [(1, -1, -1, 1, 1), (1, -1, 1, -1, 1), (1, 1, -1, -1, 1), (1, 1, 1, 1, 1), (2, 0, 0, 0, -2)] sage: CT = gap(G).CharacterTable() Again, type ``CT.Display()`` to display this nicely. @@ -3539,11 +3546,12 @@ def character_table(self): [ 5 1 1 -1 1 -1 0] [ 4 2 0 1 -1 0 -1] [ 1 1 1 1 1 1 1] - sage: list(AlternatingGroup(6).character_table()) - [(1, 1, 1, 1, 1, 1, 1), (5, 1, 2, -1, -1, 0, 0), (5, 1, -1, 2, -1, 0, 0), - (8, 0, -1, -1, 0, zeta5^3 + zeta5^2 + 1, -zeta5^3 - zeta5^2), + sage: sorted(AlternatingGroup(6).character_table(), key=str) + [(1, 1, 1, 1, 1, 1, 1), (10, -2, 1, 1, 0, 0, 0), + (5, 1, -1, 2, -1, 0, 0), (5, 1, 2, -1, -1, 0, 0), (8, 0, -1, -1, 0, -zeta5^3 - zeta5^2, zeta5^3 + zeta5^2 + 1), - (9, 1, 0, 0, 1, -1, -1), (10, -2, 1, 1, 0, 0, 0)] + (8, 0, -1, -1, 0, zeta5^3 + zeta5^2 + 1, -zeta5^3 - zeta5^2), + (9, 1, 0, 0, 1, -1, -1)] Suppose that you have a class function `f(g)` on `G` and you know the values `v_1, \ldots, v_n` on diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py index 10c9373d3dd..d0c139469e6 100644 --- a/src/sage/groups/perm_gps/permgroup_named.py +++ b/src/sage/groups/perm_gps/permgroup_named.py @@ -2285,7 +2285,7 @@ class PrimitiveGroup(PermutationGroup_unique): sage: PrimitiveGroup(2^12,1) Traceback (most recent call last): ... - GAPError: Error, Primitive groups of degree 4096 are not known! + GAPError: Error... """ def __init__(self, d, n): @@ -2375,10 +2375,10 @@ def PrimitiveGroups(d=None): The database is currently limited:: - sage: PrimitiveGroups(2^12).cardinality() + sage: PrimitiveGroups(2^13).cardinality() Traceback (most recent call last): ... - GAPError: Error, Primitive groups of degree 4096 are not known! + GAPError: Error... .. TODO:: @@ -2606,10 +2606,10 @@ def cardinality(self): sage: PrimitiveGroups(2500).cardinality() 34 - sage: PrimitiveGroups(2^12).cardinality() + sage: PrimitiveGroups(2^13).cardinality() Traceback (most recent call last): ... - GAPError: Error, Primitive groups of degree 4096 are not known! + GAPError: Error... """ if self._degree <= 1: # gap.NrPrimitiveGroups(0) fails, so Sage needs to handle this @@ -3517,13 +3517,15 @@ class SmallPermutationGroup(PermutationGroup_generic): Group of order 12 and GAP Id 4 as a permutation group sage: G.gens() ((4,5), (1,2), (3,4,5)) - sage: G.character_table() # needs sage.rings.number_field + sage: Gct = G.character_table(); Gct # random, needs sage.rings.number_field [ 1 1 1 1 1 1] [ 1 -1 1 -1 1 -1] [ 1 -1 1 1 -1 1] [ 1 1 1 -1 -1 -1] [ 2 0 -1 -2 0 1] [ 2 0 -1 2 0 -1] + sage: sorted(Gct, key=str) # needs sage.rings.number_field + [(1, -1, 1, -1, 1, -1), (1, -1, 1, 1, -1, 1), (1, 1, 1, -1, -1, -1), (1, 1, 1, 1, 1, 1), (2, 0, -1, -2, 0, 1), (2, 0, -1, 2, 0, -1)] sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n)) sage: # verify at most five n and k, randomly, to save time sage: from random import sample diff --git a/src/sage/modules/with_basis/representation.py b/src/sage/modules/with_basis/representation.py index 457ed5dd92a..7fbbc8d36e7 100644 --- a/src/sage/modules/with_basis/representation.py +++ b/src/sage/modules/with_basis/representation.py @@ -944,7 +944,7 @@ def _acted_upon_(self, scalar, self_on_left=False): sage: G = groups.misc.WeylGroup(['B',2], prefix='s') sage: R = G.regular_representation() sage: s1,s2 = G.gens() - sage: x = R.an_element(); x + sage: x = 2*R(s2*s1*s2) + R(s1*s2) + 3*R(s2) + R(G[0]); x 2*s2*s1*s2 + s1*s2 + 3*s2 + 1 sage: 2 * x 4*s2*s1*s2 + 2*s1*s2 + 6*s2 + 2 @@ -956,7 +956,7 @@ def _acted_upon_(self, scalar, self_on_left=False): sage: G = groups.misc.WeylGroup(['B',2], prefix='s') sage: R = G.regular_representation(side='right') sage: s1,s2 = G.gens() - sage: x = R.an_element(); x + sage: x = 2*R(s2*s1*s2) + R(s1*s2) + 3*R(s2) + R(G[0]); x 2*s2*s1*s2 + s1*s2 + 3*s2 + 1 sage: x * s1 2*s2*s1*s2*s1 + s1*s2*s1 + 3*s2*s1 + s1 @@ -969,7 +969,7 @@ def _acted_upon_(self, scalar, self_on_left=False): Integer Ring sage: A = G.algebra(ZZ) sage: s1,s2 = A.algebra_generators() - sage: x = R.an_element(); x + sage: x = 2*R(s2*s1*s2) + R(s1*s2) + 3*R(s2) + R(G[0]); x 2*s2*s1*s2 + s1*s2 + 3*s2 + 1 sage: s1 * x 2*s2*s1*s2*s1 + 3*s1*s2 + s1 + s2