# Group elements in terms of its generators

I created a permutation group with generators [(4,5,6,7,8), (1,2,3)]. The order of this group is shown as 15. c,f in Cayley_table() corresponds to these generators. Is there a way to print these 15 elements a,b,c.....m,n,o in terms of these generators c,f?

edit retag close merge delete

Sort by » oldest newest most voted

Given an element g of your group G, you can write it as a product of the generators of G by using the word_problem method:

sage: G = PermutationGroup([(4,5,6,7,8), (1,2,3)])
sage: g = G.an_element() ; g
(1,2,3)(4,5,6,7,8)
sage: g.word_problem(G.gens())
x2*x1
[['(1,2,3)', 1], ['(4,5,6,7,8)', 1]]
('x2*x1', '(1,2,3)*(4,5,6,7,8)')


If you want to get the decomposition for every element of G, you can do something like:

sage: for i in G:
....:     print('{} can be written as {}'.format(i, i.word_problem(G.gens(), as_list=True, display=None)))
....:
() can be written as [['<identity ...>', 1]]
(4,8,7,6,5) can be written as [['(4,5,6,7,8)', -1]]
(4,7,5,8,6) can be written as [['(4,5,6,7,8)', -2]]
(4,6,8,5,7) can be written as [['(4,5,6,7,8)', 2]]
(4,5,6,7,8) can be written as [['(4,5,6,7,8)', 1]]
(1,3,2) can be written as [['(1,2,3)', -1]]
(1,3,2)(4,8,7,6,5) can be written as [['(1,2,3)', -1], ['(4,5,6,7,8)', -1]]
(1,3,2)(4,7,5,8,6) can be written as [['(1,2,3)', -1], ['(4,5,6,7,8)', -2]]
(1,3,2)(4,6,8,5,7) can be written as [['(4,5,6,7,8)', 2], ['(1,2,3)', -1]]
(1,3,2)(4,5,6,7,8) can be written as [['(1,2,3)', -1], ['(4,5,6,7,8)', 1]]
(1,2,3) can be written as [['(1,2,3)', 1]]
(1,2,3)(4,8,7,6,5) can be written as [['(1,2,3)', 1], ['(4,5,6,7,8)', -1]]
(1,2,3)(4,7,5,8,6) can be written as [['(1,2,3)', 1], ['(4,5,6,7,8)', -2]]
(1,2,3)(4,6,8,5,7) can be written as [['(4,5,6,7,8)', 2], ['(1,2,3)', 1]]
(1,2,3)(4,5,6,7,8) can be written as [['(1,2,3)', 1], ['(4,5,6,7,8)', 1]]

more

Ok great! Thanks a lot.

( 2021-05-09 07:26:25 +0200 )edit