Skip to content

Commit

Permalink
g.Order().sage() is only added to the list if it is finite
Browse files Browse the repository at this point in the history
  • Loading branch information
amanmoon committed Jan 1, 2024
1 parent b390e75 commit 28427c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sage/groups/abelian_gps/abelian_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,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()
(6, 0)
(3, 2, 0)
sage: F.gens()
(a, b^2, c)
sage: F.order()
Expand All @@ -1710,7 +1710,8 @@ def __init__(self, ambient, gens, names="f", category=None):
H = libgap(ambient).Subgroup(H_gens)

invs = H.TorsionSubgroup().AbelianInvariants().sage()
gens_orders = [g.Order().sage() for g in H.TorsionSubgroup().GeneratorsOfGroup()]
gens_orders = [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
Expand Down

0 comments on commit 28427c4

Please sign in to comment.