# cycle_index as element of PolynomialRing

How do I get the cycle_index of a group as an element of PolynomialRing(QQ,...)? For example I tried

G=SymmetricGroup(3)
p=G.cycle_index()


But I want p as an element of PolynomialRing(QQ,3,"xyz").

edit retag close merge delete

How can it be on x,y,z ? you want x for the 1-cycle class, y for the 2-cycle class and z for the 3-cycle one ?

( 2013-07-11 06:38:43 +0200 )edit

Sort by » oldest newest most voted

(first try) what you want might be the following

sage: G = SymmetricGroup(3)
sage: p = G.cycle_index()
sage: p.expand(2)
x0^3 + x0^2*x1 + x0*x1^2 + x1^3 + x0^2*x2 + x0*x1*x2 + x1^2*x2 + x0*x2^2 + x1*x2^2 + x2^3


It is not x,y,z but x0,x1,x2.

(second try) In order to obtain the same polynomial as in GAP, you may define a morphism from symmetric functions to the polynomial ring in x,y,z. Hopefully, it is not that hard as you only need to define it on the basis.

The following defines the polynomial ring as well as a function that given a partition returns the associated monomial in R

R.<x,y,z> = PolynomialRing(QQ,'x,y,z')
def partition_to_xyz(p):
e = p.to_exp_dict()
return x^e.get(1,0) * y^e.get(2,0) * z^e.get(3,0)


you can check

sage: partition_to_xyz(Partition([3]))
z
sage: partition_to_xyz(Partition([1,1,1]))
x^3


then to define the morphism, simply do

sage: Sym = SymmetricFunctions(QQ).power()
sage: phi = Sym.module_morphism(on_basis=partition_to_xyz, codomain=R)


and then

sage: G = SymmetricGroup(3)
sage: p = G.cycle_index()
sage: phi(p)
1/6*x^3 + 1/2*x*y + 1/3*z


You may have a look at the documentation of symmetric functions.

more

But gap.CycleIndex(G) tells me something different.

( 2013-07-11 07:20:30 +0200 )edit

There are plenty of different possible basis. The gap answer is the same as Sage: you only need to replace p[1,1,1] by x_1^3, p[2,1] by x_2 x_1 and p[3] by x_3.

( 2013-07-11 08:03:02 +0200 )edit

But I don't want to do it by hand. I would like to have the result of GAP, but as an element of PolynomialRing(QQ,3,"xyz").

( 2013-07-11 08:10:11 +0200 )edit

( 2013-07-11 09:39:09 +0200 )edit