PermutationList

PermutationList[perm]

returns a permutation list representation of permutation perm.

PermutationList[perm,len]

returns a permutation list of length len.

Details

  • The input permutation perm can be given as a permutation list or in disjoint cyclic form.
  • For cyclic input Cycles[{cyc1,cyc2,}] the cycles cyci 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.
  • 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 {p1,p2,,pm} the resulting permutation list has point pi+1 at position pi and p1 at position pm.
  • PermutationList also works with SparseArray objects.

Examples

open allclose all

Basic Examples  (2)

Convert permutation cycles to a permutation list:

Explicit length specification:

Scope  (3)

Action on cyclic permutations:

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

On permutation lists the input is returned unchanged:

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

PermutationList works efficiently with large inputs:

Properties & Relations  (3)

A simple Wolfram Language implementation of PermutationList, but which requires the presence of singletons:

PermutationList and PermutationCycles are inverse functions:

PermutationList returns the list of images of a sorted range of integers:

The same result can be obtained with the more general function PermutationReplace:

Possible Issues  (2)

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

Permutation lists must have machine-sized length:

Neat Examples  (1)

Illustrate how points get moved under increasing permutations:

Introduced in 2010
 (8.0)
 |
Updated in 2012
 (9.0)