A modified "elements" of group Package:<a href='http://www.mapleprimes.com/files/1512_elements.txt'>elems</a>
This proc "elems" can not only generate the elements of a permutation group but also show you every element's factors.
for example:
> with(group):
> pg:=elems({5,x=[[2,3,1]],y=[[2,3]],z=[[2,4]]}):
> pg[[[2,3,4]]];
> mulperms([[2,3]],[[2,4]]);
> pg[[[1,4],[2,3]]];
> foldl(mulperms, [[2,3]], [[2,4]], [[2,3]], [[2,3,1]], [[2,4]]);
"yz"
[[2, 3, 4]]
"yzyxz"
[[1, 4], [2, 3]]
More details?
Can you give more details of what you did there?
Some details
Thank you for your interest in my gadget.I wrote it just for playing the puzzle M12:-)
In group package,the function "elements" returns the elements of the permutation group generated by set of permutations in disjoint cycle notation.In fact,the command "elements" create a table whose indices are all the elements of the permutation group by using Dimino's algorithm,then return those indices in curly brackets.It is a pity that we cannot determine or indicate explicitly the factors of each element with the generators(I do not know whether there is a function in maple which can do this).So,I create another table in my function "elems" which can record the factorization of the permutation at the time of generating a new permutation.After using "elems", you can get a table whose indices are all the elements of the permutation group in disjoint cycle notation,and whose entries are the factorizations of corresponding indices in string type.
Calling Sequence
elems(pg)
elems(gens)
Parameters
pg - permutation group
gens - set of permutations in disjoint cycle notation,like {[[2,3,1]],[[2,3]],[[2,4]]} or{5,x=[[2,3,1]],y=[[2,3]],z=[[2,4]]} ,5 is the degree of the permutation group
You can find the code here.
After running the code,you can use the function elems like
> with(group):
> pg1:=elems({5,x=[[2,3,1]],y=[[2,3]],z=[[2,4]]}):
[2, 3, 1, 4, 5], be defined as, "x"
[1, 3, 2, 4, 5], be defined as, "y"
[1, 4, 3, 2, 5], be defined as, "z"
> pg1[[[2,3,4]]];
> mulperms([[2,3]],[[2,4]]);
"yz"
[[2, 3, 4]]
> pg1[[[1,4],[2,3]]];
> foldl(mulperms, [[2,3]], [[2,4]], [[2,3]], [[2,3,1]], [[2,4]]);
"yzyxz"
[[1, 4], [2, 3]]
> print(pg1);
table([[[1, 2]] = "yx", [[1, 4, 3, 2]] = "yzxz",[[1, 3, 4]] = "yzyxy", [[1, 3, 2]] = "yxy",[[1, 2], [3, 4]] = "yzx", [[1, 4, 2, 3]] = "xz",[[1, 2, 4, 3]] = "zx", [[1, 3], [2, 4]] = "zxy",[[2, 3, 4]] = "yz", [] = "yy", [[1, 2, 4]] = "zyx",[[1, 2, 3]] = "x", [[2, 4]] = "z", [[1, 3, 4, 2]] = "yzxy",[[1, 3]] = "xy", [[1, 4, 2]] = "yxz", [[1, 3, 2, 4]] = "zyxy" , [[1, 4, 3]] = "zxz", [[2, 3]] = "y", [[1, 2, 3, 4]] = "yzyx", [[2, 4, 3]] = "zy",[[1, 4], [2, 3]] = "yzyxz", [[3, 4]] = "yzy",[[1, 4]] = "zyxz" ])
> pg2:=elems({[[2,1]],[[2,3]]}):
[1, 3, 2], be defined as, "a"
[2, 1, 3], be defined as, "b"
> indices(pg2);
[[[1, 2]]], [[[1, 3, 2]]], [[]], [[[1, 2, 3]]], [[[1, 3]]], [[[2, 3]]]
> entries(pg2);
["b"], ["ba"], ["aa"], ["ab"], ["aba"], ["a"]
> pg3:=elems(permgroup(5, {a=[[1,2],[4,5]], b=[[5,4,3,2,1]]})):
[2, 1, 3, 5, 4], be defined as, "a"
[5, 1, 2, 3, 4], be defined as, "b"