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 r