# How does the function CycleIndex work in GAP? ( undocumented in GAP )

Background: When I divide a hexagon in six triangles the group $D_6$ works on the triangles. The cycle index of the group action would be in this case $$p(x_1,x_2,x_3,x_6)=\frac{1}{12}(x_1^6 + 3x_1^2x_2^2 + 4x_2^3+2x_3^2+2x_6)$$

Question: How does CycleIndex work in GAP? The doc in GAP notes that CycleIndex is undocumented, but the function exists.

-
Perhaps the GAP forum could provide a better/faster response: forum@gap-system.org – William DeMeo Feb 28 '12 at 21:36
There are GAP experts here, they answered me before, this forum supports LaTeX and I can easily document all my questions in one system. We should ask all the GAP guys to come here, instead of sending people away. – nilo de roock Feb 28 '12 at 22:10
CycleIndex is documented in GAP 4.5. The implementation is in lib/oprt.gi and is the naive by the definition implementation, summing over the conjugacy classes. – Jack Schmidt Feb 29 '12 at 0:47
The code can also be seen using Print(CycleIndex,"\n"); – Douglas S. Stones Sep 19 '12 at 7:35
@DouglasS.Stones: PageSource(CycleIndex); will show you the file with the source code, so you will be able to see the comments in the code, too (if there are any). Note that the argument must be a function, so for operations etc. one has to use ApplicableMethod first. – Alexander Konovalov Apr 22 '13 at 15:38

Since GAP is an open-source system, one can easily examine the source code to see how it works. In GAP 4.5, new function PageSource (see ?PageSource) was introduced. It will show you the file with the source code, so you will be able to see the comments in the code, too (if there are any). Note that the argument must be a function, so for operations etc. one has to use ApplicableMethod first. Try the following examples from the GAP manual to see what happens:
PageSource(Combinations);