represents the permutation matrix given by permutation vector permv as a structured array.
converts a permutation matrix pmat to a structured array.
- Permutation matrices, when represented as structured arrays, allow for efficient storage and more efficient operations, including Det, Inverse and LinearSolve.
- Permutation matrices typically occur in the output from matrix decomposition algorithms to represent row or column permutations (usually termed pivoting in that context).
- Given a permutation vector , the resulting permutation matrix is given by . This corresponds to a matrix that has a one in column of row and zeros elsewhere.
- A permutation matrix can be used to permute rows by multiplying from the left or permute columns by multiplying its transpose from the right .
- A permutation matrix is an orthogonal matrix, where the inverse is equivalent to the transpose .
- Permutation matrices are closed under matrix multiplication, so is again a permutation matrix.
- The determinant of a permutation matrix is either or 1 and equals Signature[permv].
- Operations that are accelerated for PermutationMatrix include:
Det time Dot time Inverse time LinearSolve time
- The option WorkingPrecision can be used to specify the precision of matrix elements.
- For a PermutationMatrix sa, the following properties "prop" can be accessed as sa["prop"]:
"PermutationCycles" disjoint cycle representation of the permutation matrix "PermutationList" permutation list representation of the permutation matrix "WorkingPrecision" precision used internally "Properties" list of supported properties "Structure" type of structured array "StructuredData" internal data stored by the structured array "StructuredAlgorithms" list of functions with special methods for the structured array "Summary" summary information, represented as a Dataset
- Normal[PermutationMatrix[…]] gives the permutation matrix as an ordinary matrix.
Examplesopen allclose all
Basic Examples (2)
Construct a permutation matrix from a TwoWayRule (an interchange permutation):
PermutationMatrix objects include properties that give information about the array:
When appropriate, structured algorithms return another PermutationMatrix object:
This is equivalent to the result of InversePermutation:
This is equivalent to the result of GroupMultiplicationTable:
Show that the resulting matrix is equivalent to the result of FourierMatrix:
The result is equivalent to applying Fourier to the vector:
Properties & Relations (5)
Premultiplication with a permutation matrix is equivalent to using Part with a permutation list:
Postmultiplication with a permutation matrix is equivalent to using Permute with a permutation list:
Neat Examples (1)
Wolfram Research (2022), PermutationMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/PermutationMatrix.html.
Wolfram Language. 2022. "PermutationMatrix." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PermutationMatrix.html.
Wolfram Language. (2022). PermutationMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PermutationMatrix.html