Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Order of elements in group multiplication?

This is probably a very simple mistake on my part, but can anyone please explain this error in Sage?

If I do this...

sage: G = SymmetricGroup(3)
sage: H = AlternatingGroup(3)

then this works as expected:

sage: [(g*h) for h in H for g in G]
[(), (2,3), (1,2), (1,2,3), (1,3,2), (1,3), (1,2,3), (1,2), (1,3), (1,3,2), (), (2,3), (1,3,2), (1,3), (2,3), (), (1,2,3), (1,2)]

but if I reverse the order of h and g I get an error

sage: [(h*g) for h in H for g in G]
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Users/toby/<ipython console> in <module>()
/Applications/Sage-4.8-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/structure/element.so in sage.structure.element.MonoidElement.__mul__ (sage/structure/element.c:10197)()
/Applications/Sage-4.8-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/structure/element.so in sage.structure.element.MonoidElement.__mul__ (sage/structure/element.c:10056)()
/Applications/Sage-4.8-OSX-64bit-10.6.app/Contents/Resources/sage/local/lib/python2.6/site-packages/sage/structure/coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7467)()
TypeError: unsupported operand parent(s) for '*': 'Alternating group of order 3!/2 as a permutation group' and 'Symmetric group of order 3! as a permutation group'

Can anyone explain what I am doing wrong? Thanks Toby