Ask Your Question
1

Order of elements in group multiplication?

asked 12 years ago

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

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
0

answered 12 years ago

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]
Preview: (hide)
link

Comments

thank you.

Thruston gravatar imageThruston ( 12 years ago )
0

answered 12 years ago

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.

Preview: (hide)
link

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: 12 years ago

Seen: 1,080 times

Last updated: Oct 04 '12