Macaulay2 » Documentation
Packages » InvariantRing :: permutationMatrix
next | previous | forward | backward | up | index | toc

permutationMatrix -- convert a one-line notation or cyclic notation of a permutation to a matrix representation

Description

This function is provided by the package InvariantRing.

The following example converts the one-line notation of a transposition into a matrix representation.

i1 : M = permutationMatrix [2, 1, 3]

o1 = | 0 1 0 |
     | 1 0 0 |
     | 0 0 1 |

              3       3
o1 : Matrix ZZ  <-- ZZ

The following example converts the cyclic notation of the same transposition into a matrix representation.

i2 : M = permutationMatrix(3,{[1,2]})

o2 = | 0 1 0 |
     | 1 0 0 |
     | 0 0 1 |

              3       3
o2 : Matrix ZZ  <-- ZZ

The following example converts the cyclic notation of a permutation of 4 into a matrix representation.

i3 : M = permutationMatrix(4,{[1,2],[3,4]})

o3 = | 0 1 0 0 |
     | 1 0 0 0 |
     | 0 0 0 1 |
     | 0 0 1 0 |

              4       4
o3 : Matrix ZZ  <-- ZZ

The cycles representing a permutation are multiplied from right to left.

i4 : permutationMatrix(3,{[1,2],[2,3]}) == permutationMatrix(3,{[1,2,3]})

o4 = true

Ways to use permutationMatrix:

  • permutationMatrix(Array)
  • permutationMatrix(ZZ,List)

For the programmer

The object permutationMatrix is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.11+ds/M2/Macaulay2/packages/InvariantRing/FiniteGroupsDoc.m2:352:0.