Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverted changes from #36986 #37850

Merged
merged 2 commits into from
Jun 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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()))
[<class 'sage.rings.integer.Integer'>,
Expand Down Expand Up @@ -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])
Expand All @@ -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()
Expand All @@ -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):
"""
Expand Down
Loading