Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Change order of multiplication/composition in SymmetricGroup

How can I change the order of multiplication/composition of elements in the symmetric group?

Example:

sage: S=SymmetricGroup(4)
sage: a=S((1,2))
sage: b=S((2,3))
sage: c=S((3,4))
sage: a*b*c
(1,4,3,2)

How can I change this behavior so that I can execute a*b*c and the output will be (1,2,3,4)? I want to keep using the star *, not an inconvenient command like a.__rmul__(b).__rmul__(c), otherwise I would have to rewrite all my code.