Skip to content

Commit

Permalink
reverted changes from sagemath#36986
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmoon committed Apr 22, 2024
1 parent 15fcf52 commit 0e36fde
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/sage/groups/abelian_gps/abelian_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,10 +981,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()))
[<class 'sage.rings.integer.Integer'>,
Expand Down Expand Up @@ -1665,7 +1661,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])
Expand All @@ -1690,7 +1686,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()
Expand All @@ -1716,20 +1712,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):
"""
Expand Down

0 comments on commit 0e36fde

Please sign in to comment.