({{, (RefLink[PermutationList, paclet:ref/PermutationList])[perm] 
returns a permutation list representation of permutation perm.}, {, (RefLink[PermutationList, paclet:ref/PermutationList])[perm,len]
returns a permutation list of length len.}})

OpenersNotesSection(Spacer1)Details

The input permutation perm can be given as a permutation list or in disjoint cyclic form.

For cyclic input (RefLink[Cycles, paclet:ref/Cycles])[{(Subscript[cyc, 1]),(Subscript[cyc, 2]),…}] the cycles (Subscript[cyc, i]) must be lists of positive integers representing the points of the domain in which the permutation perm acts. The cycles must have no common points.

(RefLink[PermutationList, paclet:ref/PermutationList]) returns a permutation list that is a reordering of the consecutive integers {1,2,…,len}. By default the length len is the largest integer present in the input perm.

For an input cycle {(Subscript[p, 1]),(Subscript[p, 2]),…,(Subscript[p, m])} the resulting permutation list has point (Subscript[p, i+1]) at position (Subscript[p, i]) and (Subscript[p, 1]) at position (Subscript[p, m]).

(RefLink[PermutationList, paclet:ref/PermutationList]) also works with (RefLink[SparseArray, paclet:ref/SparseArray]) objects.

OpenersPrimaryExamplesSection(Spacer1)Examples  (11)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Convert permutation cycles to a permutation list:

PermutationList[Cycles[{{3,2},{1,6,7}}]]

Explicit length specification:

PermutationList[Cycles[{{3,2},{1,6,7}}],9]

OpenersExampleSection1(Spacer1)Scope  (3)

Action on cyclic permutations:

PermutationList[Cycles[{{1,5},{2,9,3}}]]

The identity permutation can be given as an empty list or as a list of singletons:

PermutationList[Cycles[{}]]

PermutationList[Cycles[{}],10]

On permutation lists the input is returned unchanged:

PermutationList[{3,5,2,4,1}]

Pad the permutation list to a different length without changing its support:

PermutationList[{3,5,2,4,1},8]

(RefLink[PermutationList, paclet:ref/PermutationList]) works efficiently with large inputs:

PermutationCycles[list=RandomSample[Range[10000000]]];

PermutationList[%]===list// Timing

OpenersExampleSection3(Spacer1)Properties & Relations  (3)

A simple Wolfram Language implementation of (RefLink[PermutationList, paclet:ref/PermutationList]), but which requires the presence of singletons:

fromcycles[cycs_List]:=Map[Last,Sort[Transpose[Map[Flatten,{Map[RotateRight,cycs],cycs}]]]]

fromcycles[{{3,2},{4},{1,5,6}}]

%==PermutationList[Cycles[{{3,2},{1,5,6}}]]

(RefLink[PermutationList, paclet:ref/PermutationList]) and (RefLink[PermutationCycles, paclet:ref/PermutationCycles]) are inverse functions:

PermutationList[PermutationCycles[{6,3,5,4,2,7,8,1}]]

(RefLink[PermutationList, paclet:ref/PermutationList]) returns the list of images of a sorted range of integers:

PermutationList[Cycles[{{1,2,3},{4,5}}]]

The same result can be obtained with the more general function (RefLink[PermutationReplace, paclet:ref/PermutationReplace]):

PermutationReplace[Range[5],Cycles[{{1,2,3},{4,5}}]]

OpenersExampleSection4(Spacer1)Possible Issues  (2)

The required length must be equal to or greater than the largest point of the permutation support:

PermutationList[Cycles[{{1,2},{3,4,5}}],3]

PermutationList[{2,1,4,5,3},3]

Permutation lists must have machine-sized length:

PermutationList[Cycles[{{1,10^100}}]]

OpenersExampleSection5(Spacer1)Neat Examples  (1)

Illustrate how points get moved under increasing permutations:

ArrayPlot[PermutationList[#,90]& /@GroupElements[SymmetricGroup[90],Table[10^i,{i,0,138}]] , ColorFunction-> "RedBlueTones"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Cycles, paclet:ref/Cycles])  ▪  (RefLink[PermutationCycles, paclet:ref/PermutationCycles])  ▪  (RefLink[PermutationListQ, paclet:ref/PermutationListQ])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Permutation Lists, paclet:tutorial/PermutationLists])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Permutations, paclet:guide/Permutations])}})}})