Ask Your Question
1

Order of elements in group multiplication?

asked 2012-10-04 07:28:52 +0100

Thruston gravatar image

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

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-10-04 11:10:18 +0100

I'm not sure why this doesn't work, but you can force the multiplication to take place in the larger group G by replacing h with G(h), like this:

sage: [(G(h)*g) for h in H for g in G]
edit flag offensive delete link more

Comments

thank you.

Thruston gravatar imageThruston ( 2012-10-05 11:00:07 +0100 )edit
0

answered 2012-10-04 12:41:38 +0100

kcrisman gravatar image

I've made this Trac 13569. Interestingly, sometimes this multiplication works - it's only if you repeat it that it eventually fails. Weird.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-10-04 07:28:52 +0100

Seen: 1,029 times

Last updated: Oct 04 '12