Skip to content

Commit

Permalink
sagemathgh-37850: Reverted changes from sagemath#36986
Browse files Browse the repository at this point in the history
    
Reverted changes made in sagemath#36986

The bug in sagemath#36974 remains unsolved. Efforts are being made in sagemath#37744 to
resolve the bug.

Fixes  sagemath#37744
### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies
    
URL: sagemath#37850
Reported by: Aman Moon
Reviewer(s):
  • Loading branch information
Release Manager committed Jun 7, 2024
2 parents a09048c + 26696ef commit eb319c9
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 @@ -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

0 comments on commit eb319c9

Please sign in to comment.