ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 22 Jan 2020 11:16:56 +0100symmetric group: get back conjugacy class from its generatorshttps://ask.sagemath.org/question/49641/symmetric-group-get-back-conjugacy-class-from-its-generators/The function below returns a list `r` of elements of the symmetric group that leave a certain polynomial `f` fixed.
I know (by the properties of `f` that I'm not specifiying here) that the list of `g`'s that leave it fixed generate one of the 11 conjugacy subclasses of S(4).
What is the best way to output from my code below a number between 1 and 11 that corresponds to such subclass?
R = PolynomialRing(QQ, 4, ["q1","q2","q3","q4"])
q1,q2,q3,q4 = R.gens()
f = 1 + q1 +q2 # in general, it is a polynomial with unit coefficients in the ring R
G = SymmetricGroup(4)
cl = G.conjugacy_classes_subgroups()
r = []
for g in G:
if (f * g) == f: r.append(g)
return rrue82Wed, 22 Jan 2020 11:16:56 +0100https://ask.sagemath.org/question/49641/