Ask Your Question

Revision history [back]

You can define the symmetric group on your set instead:

sage: P = SymmetricGroup(var('x,y,z')); P
Symmetric group of order 3! as a permutation group

The elements are displayed in cycle notation, evaluation is allowed and there is a group structure:

sage: P[2]
(x,y,z)
sage: P[2](x)
y
sage: P[2].tuple()
(y, z, x)
sage: P[3]
(y,z)
sage: P[2]*P[3]
(x,z)

Note that the product is opposite from the more usual one (here P[2]*P[3] is P[3] after P[2]).