# Group element multiplication in symmetric group

I think this is elementary, but how do we just multiply two elements in the symmetric group. For example, I have a list of elements as

G=SymmetricGroup(5)
A=[(1,2), (1,3,2), (1,4), (1,4)(2,3),(2,4),(2,4,3),(3,4),(2,3,4)]
b=[G(1,5)*G(a) for a in A]
b


When I implement in the above code on the compiler, I get the error 'tuple' object is not callable. Anyway to overcome this error and multiply two elements in the group, or, in any other group? Thanks beforehand.

edit retag close merge delete

Sort by ยป oldest newest most voted

When you define A, the (1,4)(2,3) looks using the tuple (1,4) as a function to be called at (2,3), which explains your error.

If you want A be a list of elements of G you must make it explicit:

sage: A=[G((1,2)), G((1,3,2)), G((1,4)), G([(1,4),(2,3)]),G((2,4)),G((2,4,3)),G((3,4)),G((2,3,4))]

sage: A
[(1,2), (1,3,2), (1,4), (1,4)(2,3), (2,4), (2,4,3), (3,4), (2,3,4)]


Then, you can do:

sage: b=[G((1,5))*a for a in A]
sage: b
[(1,5,2),
(1,5,3,2),
(1,5,4),
(1,5,4)(2,3),
(1,5)(2,4),
(1,5)(2,4,3),
(1,5)(3,4),
(1,5)(2,3,4)]

more