How to represent a product of cycles in matrix form?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I have a permutation a
in a product of disjoint cycles form as follows
$a = (1,9,3,7)(2,11,6)(4,8,5,10)$
I want to represent it in a matrix form A
such that
$A = beginpmatrix1&2&3&4&5&6&7&8&9&10&11\9&11&7&8&10&2&1&5&3&4&6
endpmatrix$
I believe a
can be defined in Mathematica as
a = Cycles[1, 9, 3, 7, 2, 11, 6, 4, 8, 5, 10]
How do I convert a
to A
?
permutation group-theory products
New contributor
add a comment |Â
up vote
3
down vote
favorite
I have a permutation a
in a product of disjoint cycles form as follows
$a = (1,9,3,7)(2,11,6)(4,8,5,10)$
I want to represent it in a matrix form A
such that
$A = beginpmatrix1&2&3&4&5&6&7&8&9&10&11\9&11&7&8&10&2&1&5&3&4&6
endpmatrix$
I believe a
can be defined in Mathematica as
a = Cycles[1, 9, 3, 7, 2, 11, 6, 4, 8, 5, 10]
How do I convert a
to A
?
permutation group-theory products
New contributor
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I have a permutation a
in a product of disjoint cycles form as follows
$a = (1,9,3,7)(2,11,6)(4,8,5,10)$
I want to represent it in a matrix form A
such that
$A = beginpmatrix1&2&3&4&5&6&7&8&9&10&11\9&11&7&8&10&2&1&5&3&4&6
endpmatrix$
I believe a
can be defined in Mathematica as
a = Cycles[1, 9, 3, 7, 2, 11, 6, 4, 8, 5, 10]
How do I convert a
to A
?
permutation group-theory products
New contributor
I have a permutation a
in a product of disjoint cycles form as follows
$a = (1,9,3,7)(2,11,6)(4,8,5,10)$
I want to represent it in a matrix form A
such that
$A = beginpmatrix1&2&3&4&5&6&7&8&9&10&11\9&11&7&8&10&2&1&5&3&4&6
endpmatrix$
I believe a
can be defined in Mathematica as
a = Cycles[1, 9, 3, 7, 2, 11, 6, 4, 8, 5, 10]
How do I convert a
to A
?
permutation group-theory products
permutation group-theory products
New contributor
New contributor
New contributor
asked 51 mins ago
Heisenberg
1162
1162
New contributor
New contributor
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
mat = Sort @ #, # & @ PermutationList[a];
MatrixForm @ mat // TeXForm
$ left(
beginarrayccccccccccc
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 \
9 & 11 & 7 & 8 & 10 & 2 & 1 & 5 & 3 & 4 & 6 \
endarray
right)$
add a comment |Â
up vote
2
down vote
One idea is to overload MatrixForm
so that it does this for you automatically:
Unprotect[MatrixForm];
MatrixForm /: MakeBoxes[MatrixForm[cyc_Cycles], StandardForm] := With[
list=PermutationList[cyc],
ToBoxes[MatrixForm[Range@Length@list, list], StandardForm]
]
Protect[MatrixForm];
Then:
Cycles[1, 9, 3, 7, 2, 11, 6, 4, 8, 5, 10] //MatrixForm
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
mat = Sort @ #, # & @ PermutationList[a];
MatrixForm @ mat // TeXForm
$ left(
beginarrayccccccccccc
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 \
9 & 11 & 7 & 8 & 10 & 2 & 1 & 5 & 3 & 4 & 6 \
endarray
right)$
add a comment |Â
up vote
3
down vote
mat = Sort @ #, # & @ PermutationList[a];
MatrixForm @ mat // TeXForm
$ left(
beginarrayccccccccccc
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 \
9 & 11 & 7 & 8 & 10 & 2 & 1 & 5 & 3 & 4 & 6 \
endarray
right)$
add a comment |Â
up vote
3
down vote
up vote
3
down vote
mat = Sort @ #, # & @ PermutationList[a];
MatrixForm @ mat // TeXForm
$ left(
beginarrayccccccccccc
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 \
9 & 11 & 7 & 8 & 10 & 2 & 1 & 5 & 3 & 4 & 6 \
endarray
right)$
mat = Sort @ #, # & @ PermutationList[a];
MatrixForm @ mat // TeXForm
$ left(
beginarrayccccccccccc
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 \
9 & 11 & 7 & 8 & 10 & 2 & 1 & 5 & 3 & 4 & 6 \
endarray
right)$
answered 44 mins ago
kglr
162k8185385
162k8185385
add a comment |Â
add a comment |Â
up vote
2
down vote
One idea is to overload MatrixForm
so that it does this for you automatically:
Unprotect[MatrixForm];
MatrixForm /: MakeBoxes[MatrixForm[cyc_Cycles], StandardForm] := With[
list=PermutationList[cyc],
ToBoxes[MatrixForm[Range@Length@list, list], StandardForm]
]
Protect[MatrixForm];
Then:
Cycles[1, 9, 3, 7, 2, 11, 6, 4, 8, 5, 10] //MatrixForm
add a comment |Â
up vote
2
down vote
One idea is to overload MatrixForm
so that it does this for you automatically:
Unprotect[MatrixForm];
MatrixForm /: MakeBoxes[MatrixForm[cyc_Cycles], StandardForm] := With[
list=PermutationList[cyc],
ToBoxes[MatrixForm[Range@Length@list, list], StandardForm]
]
Protect[MatrixForm];
Then:
Cycles[1, 9, 3, 7, 2, 11, 6, 4, 8, 5, 10] //MatrixForm
add a comment |Â
up vote
2
down vote
up vote
2
down vote
One idea is to overload MatrixForm
so that it does this for you automatically:
Unprotect[MatrixForm];
MatrixForm /: MakeBoxes[MatrixForm[cyc_Cycles], StandardForm] := With[
list=PermutationList[cyc],
ToBoxes[MatrixForm[Range@Length@list, list], StandardForm]
]
Protect[MatrixForm];
Then:
Cycles[1, 9, 3, 7, 2, 11, 6, 4, 8, 5, 10] //MatrixForm
One idea is to overload MatrixForm
so that it does this for you automatically:
Unprotect[MatrixForm];
MatrixForm /: MakeBoxes[MatrixForm[cyc_Cycles], StandardForm] := With[
list=PermutationList[cyc],
ToBoxes[MatrixForm[Range@Length@list, list], StandardForm]
]
Protect[MatrixForm];
Then:
Cycles[1, 9, 3, 7, 2, 11, 6, 4, 8, 5, 10] //MatrixForm
answered 32 mins ago
Carl Woll
58.4k275150
58.4k275150
add a comment |Â
add a comment |Â
Heisenberg is a new contributor. Be nice, and check out our Code of Conduct.
Heisenberg is a new contributor. Be nice, and check out our Code of Conduct.
Heisenberg is a new contributor. Be nice, and check out our Code of Conduct.
Heisenberg is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182592%2fhow-to-represent-a-product-of-cycles-in-matrix-form%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password