-
-
Notifications
You must be signed in to change notification settings - Fork 838
Bug in AbelianGroup.Subgroup #36974
Copy link
Copy link
Closed
Labels
Description
Steps To Reproduce
sage: G, (g0, g1) = AbelianGroup(2, [48, 0]).objgens()
....: print(G, g0, g1)
....: assert g0.order() == 48 and g1.order() == oo
....:
....: G0 = G.subgroup([g0])
....: print(G0, G0.gens(), G0.gens_orders())
....: print(len(G0.gens()) == len(G0.gens_orders()))
Multiplicative Abelian group isomorphic to C48 x Z f0 f1
Multiplicative Abelian subgroup isomorphic to C3 x C16 generated by {f0} (f0,) (3, 16)
FalseProblem: The length of G0.gens() and G0.gens_orders() should be the same.
Additional Information
The Subgroup is computed here. The issue seems to be that the GAP functions AbelianInvariants doesn't actually return the orders of the generators in GeneratorsOfGroup, as demonstrated below:
sage: G, (g0, g1) = AbelianGroup(2, [48, 0]).objgens()
....: H = libgap(G).Subgroup(gens)
....: H_invs = H.AbelianInvariants().sage()
....: H_gens = H.GeneratorsOfGroup()
....: print(H, H_invs, H_gens)
Pcp-group with orders [ 48 ] [3, 16] [ g1 ]The obvious fix would be to replace .AbelianInvariants on line 1710 with, well, [g.Order().sage() for g in H.GeneratorsOfGroup()] or something like that. If any GAP users have a better solution that returns the order of all (finite?) generators, please suggest it, since I haven't used GAP before.
Reactions are currently unavailable