Let $\Z[\Z/n]$ denote the integral group ring of the cyclic group $\Z/n$. How would you create $\Z[\Z/n]$ in Sage so that you could easily multiply elements?

First, if you've already assigned a group to the variable 'A', then

1 |
R = GroupAlgebra(A,ZZ) |

will give you the corresponding group ring and store it in the variable 'R'. The first argument of 'GroupAlgebra(-,-)' is the group and the second is the coefficient ring. Sage uses 'ZZ' to denote the integers, 'QQ' to denote the rationals, etc.

So how do you specify the cyclic group $A$? The first posibility is to use the construction:

1 |
A = CyclicPermutationGroup(n) |

where you'd replace 'n' by the actual number that you want there. This is useful if you want to work with other permutation groups, because the elements of 'A' are stored as permutations:

1 2 3 |
A = CyclicPermutationGroup(10) for i in A: print(i) |

The output to this snippet is:

1 2 3 4 5 6 7 8 9 10 |
() (1,2,3,4,5,6,7,8,9,10) (1,3,5,7,9)(2,4,6,8,10) (1,4,7,10,3,6,9,2,5,8) (1,5,9,3,7)(2,6,10,4,8) (1,6)(2,7)(3,8)(4,9)(5,10) (1,7,3,9,5)(2,8,4,10,6) (1,8,5,2,9,6,3,10,7,4) (1,9,7,5,3)(2,10,8,6,4) (1,10,9,8,7,6,5,4,3,2) |