Ask Your Question

Revision history [back]

Unfortunately the method conjugacy_classes_subgroups returns representatives, unlike GAP, which returns objects representing conjugacy classes. It would be nicer to have such objects in SageMath as well.

Fortunately we can still use the underlying interface to GAP:

H = G.subgroup(r)
gap_cl = G.gap().ConjugacyClassesSubgroups()
gap_H = H.gap()
cl_index_of_H = next(k for (k,gap_c) in enumerate(gap_cl) if gap_H in gap_c)

and then (using that the ordering of cl is the same as gap_cl):

sage: cl[cl_index_of_H]
Subgroup generated by [(3,4), (1,2)(3,4)] of (Symmetric group of order 4! as a permutation group)