From c49562e54907d8425d09590436eea30795c79ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Fri, 26 Apr 2024 18:31:37 -0300 Subject: [PATCH] gap: fix doctests for gap 4.13 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. --- .../algebras/fusion_rings/fusion_double.py | 2 +- src/sage/categories/simplicial_sets.py | 26 +++++++++---------- src/sage/groups/finitely_presented.py | 22 ++++++++-------- src/sage/groups/perm_gps/permgroup_named.py | 18 ++++++------- 4 files changed, 33 insertions(+), 35 deletions(-) diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py index d87a7a782a7..7df091d3ca9 100644 --- a/src/sage/algebras/fusion_rings/fusion_double.py +++ b/src/sage/algebras/fusion_rings/fusion_double.py @@ -132,7 +132,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 diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py index 7b7bbf827af..0864dc30af2 100644 --- a/src/sage/categories/simplicial_sets.py +++ b/src/sage/categories/simplicial_sets.py @@ -593,9 +593,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 @@ -675,10 +675,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) [] @@ -843,29 +843,29 @@ def twisted_homology(self, n, reduced=False): 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] diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py index a6ef6bb7395..b5a4b3a1edc 100644 --- a/src/sage/groups/finitely_presented.py +++ b/src/sage/groups/finitely_presented.py @@ -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 < | > @@ -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, [], []) @@ -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() ([], []) @@ -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: []} diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py index c000d2cf105..765626e1752 100644 --- a/src/sage/groups/perm_gps/permgroup_named.py +++ b/src/sage/groups/perm_gps/permgroup_named.py @@ -3451,16 +3451,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)]) @@ -3469,11 +3467,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)] """