diff --git a/src/sage/groups/abelian_gps/abelian_group.py b/src/sage/groups/abelian_gps/abelian_group.py index 07ca7c7444e..b13be80cc16 100644 --- a/src/sage/groups/abelian_gps/abelian_group.py +++ b/src/sage/groups/abelian_gps/abelian_group.py @@ -978,10 +978,6 @@ def gens_orders(self): TESTS:: - sage: G, (g0, g1) = AbelianGroup(2, [48, 0]).objgens() - sage: G0 = G.subgroup([g0]) # optional - gap_package_polycyclic - sage: len(G0.gens()) == len(G0.gens_orders()) # optional - gap_package_polycyclic - True sage: F = AbelianGroup(3, [2], names='abc') sage: list(map(type, F.gens_orders())) [, @@ -1661,7 +1657,7 @@ def __init__(self, ambient, gens, names="f", category=None): sage: B = A.subgroup([a^3, b, c, d, e^2]); B Multiplicative Abelian subgroup isomorphic to C4 x C5 x C5 x C7 generated by {b, c, d, e^2} sage: B.gens_orders() - (5, 5, 7, 4) + (4, 5, 5, 7) sage: A = AbelianGroup(4,[1009, 2003, 3001, 4001], names="abcd") sage: a,b,c,d = A.gens() sage: B = A.subgroup([a^3,b,c,d]) @@ -1686,7 +1682,7 @@ def __init__(self, ambient, gens, names="f", category=None): Multiplicative Abelian subgroup isomorphic to C2 x C3 x Z generated by {a, b^2, c} sage: F.gens_orders() - (3, 2, 0) + (2, 3, 0) sage: F.gens() (a, b^2, c) sage: F.order() @@ -1712,20 +1708,16 @@ def __init__(self, ambient, gens, names="f", category=None): H = libgap(ambient).Subgroup(H_gens) invs = H.TorsionSubgroup().AbelianInvariants().sage() - gens_orders = tuple([ZZ(order_sage) for g in H.GeneratorsOfGroup() - if (order_sage := g.Order().sage()) is not infinity]) - rank = len([1 for g in H.GeneratorsOfGroup() if g.Order().sage() is infinity]) invs += [0] * rank - gens_orders += (ZZ.zero(),) * rank self._abinvs = invs invs = tuple(ZZ(i) for i in invs) if category is None: category = Groups().Commutative().Subobjects() - AbelianGroup_class.__init__(self, gens_orders, names, category=category) + AbelianGroup_class.__init__(self, invs, names, category=category) def __contains__(self, x): """