Skip to content

Commit

Permalink
gap: fix doctests for gap 4.13
Browse files Browse the repository at this point in the history
In gap 4.13 there are some improvements, e.g. converting fp groups to
permutation groups, computing abelianization of fp groups, which lead to
different generators.

This commit fixes doctests so they pass using gap 4.13.
  • Loading branch information
tornaria authored and dimpase committed Sep 15, 2024
1 parent 24698e7 commit 96f11e4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/sage/algebras/fusion_rings/fusion_double.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,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 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
b0 + b3 + b4
"""
@staticmethod
def __classcall_private__(cls, G, prefix='s', inject_variables=False):
Expand Down
26 changes: 13 additions & 13 deletions src/sage/categories/simplicial_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
sage: X = simplicial_sets.Torus()
sage: d = X._canonical_twisting_operator()
sage: d
{(s_0 v_0, sigma_1): f3, (sigma_1, s_0 v_0): f2*f3^-1, (sigma_1, sigma_1): f2}
{(s_0 v_0, sigma_1): f2, (sigma_1, s_0 v_0): f1*f2^-1, (sigma_1, sigma_1): f1}
sage: list(d.values())[0].parent()
Multivariate Laurent Polynomial Ring in f2, f3 over Integer Ring
Multivariate Laurent Polynomial Ring in f1, f2 over Integer Ring
sage: Y = simplicial_sets.RealProjectiveSpace(2)
sage: d2 = Y._canonical_twisting_operator()
sage: d2
Expand Down Expand Up @@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
sage: X = simplicial_sets.Torus()
sage: C = X.twisted_chain_complex()
sage: C.differential(1)
[ f3 - 1 f2*f3^-1 - 1 f2 - 1]
[ f2 - 1 f1*f2^-1 - 1 f1 - 1]
sage: C.differential(2)
[ 1 f2*f3^-1]
[ f3 1]
[ 1 f1*f2^-1]
[ f2 1]
[ -1 -1]
sage: C.differential(3)
[]
Expand Down Expand Up @@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
sage: # needs sage.graphs
sage: Y = simplicial_sets.Torus()
sage: Y.twisted_homology(1)
Quotient module by Submodule of Ambient free module of rank 5 over the integral domain Multivariate Polynomial Ring in f2, f2inv, f3, f3inv over Integer Ring
Quotient module by Submodule of Ambient free module of rank 5 over the integral domain Multivariate Polynomial Ring in f1, f1inv, f2, f2inv over Integer Ring
Generated by the rows of the matrix:
[ 1 0 0 0 0]
[ 0 1 0 0 0]
[ 0 0 1 0 0]
[ 0 0 0 1 0]
[ 0 0 0 0 1]
[f1*f1inv - 1 0 0 0 0]
[ 0 f1*f1inv - 1 0 0 0]
[ 0 0 f1*f1inv - 1 0 0]
[ 0 0 0 f1*f1inv - 1 0]
[ 0 0 0 0 f1*f1inv - 1]
[f2*f2inv - 1 0 0 0 0]
[ 0 f2*f2inv - 1 0 0 0]
[ 0 0 f2*f2inv - 1 0 0]
[ 0 0 0 f2*f2inv - 1 0]
[ 0 0 0 0 f2*f2inv - 1]
[f3*f3inv - 1 0 0 0 0]
[ 0 f3*f3inv - 1 0 0 0]
[ 0 0 f3*f3inv - 1 0 0]
[ 0 0 0 f3*f3inv - 1 0]
[ 0 0 0 0 f3*f3inv - 1]
sage: Y.twisted_homology(2)
Quotient module by Submodule of Ambient free module of rank 0 over the integral domain Multivariate Polynomial Ring in f2, f2inv, f3, f3inv over Integer Ring
Quotient module by Submodule of Ambient free module of rank 0 over the integral domain Multivariate Polynomial Ring in f1, f1inv, f2, f2inv over Integer Ring
Generated by the rows of the matrix:
[]
sage: Y.twisted_homology(1, reduced=True)
Quotient module by Submodule of Ambient free module of rank 5 over the integral domain Multivariate Polynomial Ring in f2, f2inv, f3, f3inv over Integer Ring
Quotient module by Submodule of Ambient free module of rank 5 over the integral domain Multivariate Polynomial Ring in f1, f1inv, f2, f2inv over Integer Ring
Generated by the rows of the matrix:
[1 0 0 0 0]
[0 1 0 0 0]
Expand Down
22 changes: 11 additions & 11 deletions src/sage/groups/finitely_presented.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,8 +1344,8 @@ def abelianization_map(self):
sage: H = G.quotient([g1^2, g2*g1*g2^(-1)*g1^(-1), g1*g3^(-2), g0^4])
sage: H.abelianization_map()
Group morphism:
From: Finitely presented group < g0, g1, g2, g3 | g1^2, g2*g1*g2^-1*g1^-1, g1*g3^-2, g0^4 >
To: Finitely presented group < f2, f3, f4 | f2^-1*f3^-1*f2*f3, f2^-1*f4^-1*f2*f4, f3^-1*f4^-1*f3*f4, f2^4, f3^4 >
From: Finitely presented group < g0, g1, g2, g3 | g1^2, g2*g1*g2^-1*g1^-1, g1*g3^-2, g0^4 >
To: Finitely presented group < f1, f2, f3 | f1^4, f2^-1*f1^-1*f2*f1, f2^4, f3^-1*f1^-1*f3*f1, f3^-1*f2^-1*f3*f2 >
sage: g = FreeGroup(0) / []
sage: g.abelianization_map()
Group endomorphism of Finitely presented group < | >
Expand Down Expand Up @@ -1394,10 +1394,10 @@ def abelianization_to_algebra(self, ring=QQ):
Defining g0, g1, g2, g3
sage: H = G.quotient([g1^2, g2*g1*g2^(-1)*g1^(-1), g1*g3^(-2), g0^4])
sage: H.abelianization_to_algebra()
(Finitely presented group < f2, f3, f4 | f2^-1*f3^-1*f2*f3, f2^-1*f4^-1*f2*f4,
f3^-1*f4^-1*f3*f4, f2^4, f3^4 >,
Multivariate Laurent Polynomial Ring in f2, f3, f4 over Rational Field,
[f2^4 - 1, f3^4 - 1], [f2^-1*f3^-2, f3^-2, f4, f3])
(Finitely presented group < f1, f2, f3 | f1^4, f2^-1*f1^-1*f2*f1, f2^4, f3^-1*f1^-1*f3*f1, f3^-1*f2^-1*f3*f2 >,
Multivariate Laurent Polynomial Ring in f1, f2, f3 over Rational Field,
[f1^4 - 1, f2^4 - 1],
[f1^3*f2^2, f2^2, f3, f2])
sage: g=FreeGroup(0) / []
sage: g.abelianization_to_algebra()
(Finitely presented group < | >, Rational Field, [], [])
Expand Down Expand Up @@ -1673,7 +1673,7 @@ def abelian_alexander_matrix(self, ring=QQ, simplified=True):
[]
sage: G = FreeGroup(3)/[(2, 1, 1), (1, 2, 2, 3, 3)]
sage: A, ideal = G.abelian_alexander_matrix(simplified=True); A
[-f3^2 - f3^4 - f3^6 f3^3 + f3^6]
[-f1^2 - f1^4 - f1^6 f1^3 + f1^6]
sage: g = FreeGroup(1) / []
sage: g.abelian_alexander_matrix()
([], [])
Expand Down Expand Up @@ -1773,11 +1773,11 @@ def characteristic_varieties(self, ring=QQ, matrix_ideal=None, groebner=False):
3: Ideal (1) of Multivariate Laurent Polynomial Ring in f1, f2 over Integer Ring}
sage: G = FreeGroup(2)/[(1,2,1,-2,-1,-2)]
sage: G.characteristic_varieties()
{0: Ideal (0) of Univariate Laurent Polynomial Ring in f2 over Rational Field,
1: Ideal (-1 + 2*f2 - 2*f2^2 + f2^3) of Univariate Laurent Polynomial Ring in f2 over Rational Field,
2: Ideal (1) of Univariate Laurent Polynomial Ring in f2 over Rational Field}
{0: Ideal (0) of Univariate Laurent Polynomial Ring in f1 over Rational Field,
1: Ideal (-1 + 2*f1 - 2*f1^2 + f1^3) of Univariate Laurent Polynomial Ring in f1 over Rational Field,
2: Ideal (1) of Univariate Laurent Polynomial Ring in f1 over Rational Field}
sage: G.characteristic_varieties(groebner=True)
{0: [0], 1: [-1 + f2, 1 - f2 + f2^2], 2: []}
{0: [0], 1: [-1 + f1, 1 - f1 + f1^2], 2: []}
sage: G = FreeGroup(2)/[3 * (1, ), 2 * (2, )]
sage: G.characteristic_varieties(groebner=True)
{0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2], 2: []}
Expand Down
18 changes: 8 additions & 10 deletions src/sage/groups/perm_gps/permgroup_named.py
Original file line number Diff line number Diff line change
Expand Up @@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
sage: G = SmallPermutationGroup(12,4); G
Group of order 12 and GAP Id 4 as a permutation group
sage: G.gens()
((1,2)(3,5)(4,10)(6,8)(7,12)(9,11),
(1,3)(2,5)(4,7)(6,9)(8,11)(10,12),
(1,4,8)(2,6,10)(3,7,11)(5,9,12))
((4,5), (1,2), (3,4,5))
sage: G.character_table() # 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]
[ 1 1 -1 1 -1 -1]
[ 2 0 -2 -1 0 1]
[ 2 0 2 -1 0 -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: all(SmallPermutationGroup(n,k).id() == [n,k]
....: for n in [1..64] for k in [1..numgps(n)])
Expand All @@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
sage: H.is_abelian()
False
sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
[Subgroup generated by [(1,2)(3,6)(4,5), (1,3,5)(2,4,6)] of
[Subgroup generated by [(1,3), (2,3)] of
(Group of order 6 and GAP Id 1 as a permutation group),
Subgroup generated by [(1,2)(3,6)(4,5)] of
Subgroup generated by [(2,3)] of
(Group of order 6 and GAP Id 1 as a permutation group),
Subgroup generated by [(1,3,5)(2,4,6), (1,5,3)(2,6,4)] of
Subgroup generated by [(1,2,3)] of
(Group of order 6 and GAP Id 1 as a permutation group)]
"""

Expand Down

0 comments on commit 96f11e4

Please sign in to comment.