Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
PermutationMatrix
  • See Also
    • Cycles
    • PermutationCycles
    • PermutationList
    • Permute
    • LUDecomposition
    • QRDecomposition
  • Related Guides
    • Structured Arrays
    • See Also
      • Cycles
      • PermutationCycles
      • PermutationList
      • Permute
      • LUDecomposition
      • QRDecomposition
    • Related Guides
      • Structured Arrays

PermutationMatrix[permv]

represents the permutation matrix given by permutation vector permv as a structured array.

PermutationMatrix[pmat]

converts a permutation matrix pmat to a structured array.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Options  
TargetStructure  
WorkingPrecision  
Applications  
Properties & Relations  
Neat Examples  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • Cycles
    • PermutationCycles
    • PermutationList
    • Permute
    • LUDecomposition
    • QRDecomposition
  • Related Guides
    • Structured Arrays
    • See Also
      • Cycles
      • PermutationCycles
      • PermutationList
      • Permute
      • LUDecomposition
      • QRDecomposition
    • Related Guides
      • Structured Arrays

PermutationMatrix

PermutationMatrix[permv]

represents the permutation matrix given by permutation vector permv as a structured array.

PermutationMatrix[pmat]

converts a permutation matrix pmat to a structured array.

Details and Options

  • 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 P〚i,j〛=TemplateBox[{{i, ,, {p, _, j}}}, KroneckerDeltaSeq]. 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.TemplateBox[{P}, Transpose].
  • A permutation matrix is an orthogonal matrix, where the inverse is equivalent to the transpose P^(-1)=TemplateBox[{P}, 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:
  • Dettime
    Dottime
    Inversetime
    LinearSolvetime
  • 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.
  • The following options can be given:
  • TargetStructure Automaticthe structure of the returned matrix
    WorkingPrecision Infinityprecision at which to create entries
  • Possible settings for TargetStructure include:
  • Automaticautomatically choose the representation returned
    "Dense"represent the matrix as a dense matrix
    "Orthogonal"represent the matrix as an orthogonal matrix
    "Sparse"represent the matrix as a sparse array
    "Structured"represent the matrix as a structured array
    "Unitary"represent the matrix as a unitary matrix
  • PermutationMatrix[…,TargetStructureAutomatic] is equivalent to PermutationMatrix[…,TargetStructure"Structured"].

Examples

open all close all

Basic Examples  (2)

Construct a permutation matrix from a permutation vector:

Show the elements:

Get the normal representation:

Represent a permutation matrix as a structured array:

Show the elements:

Compute the determinant:

Scope  (7)

Construct a permutation matrix from a disjoint cycle representation:

Show the elements:

Get the normal representation:

Specify the dimension of the permutation matrix:

Show the elements:

Construct a permutation matrix from a TwoWayRule (an interchange permutation):

Show the elements:

Get the normal representation:

Specify the dimension of the permutation matrix:

Show the elements:

Construct a permutation matrix from an explicit matrix:

Show the elements:

Get the normal representation:

PermutationMatrix objects include properties that give information about the array:

"PermutationCycles" gives the disjoint cycle representation of the underlying permutation:

"PermutationList" gives the permutation list representation:

"WorkingPrecision" gives the precision of the matrix entries:

The "Summary" property gives a brief summary of information about the array:

The "StructuredAlgorithms" property lists the functions that have structured algorithms:

Structured algorithms are typically faster:

Compute the determinant:

Compute the inverse:

Compute the eigenvalues:

When appropriate, structured algorithms return another PermutationMatrix object:

The inverse allows you to easily get the inverse permutation:

Verify the inverse relationship:

This is equivalent to the result of InversePermutation:

Generate a random 104×104 permutation vector:

The representation and computation are efficient for the structured array:

The normal representation is dramatically bigger (80 KB vs. 800 MB) and slower:

The inverse needs 2.4 GB of storage:

Options  (2)

TargetStructure  (1)

Return the permutation matrix as a dense matrix:

Return the permutation matrix as a structured array:

Return the permutation matrix as a sparse array:

Return the permutation matrix as an orthogonal matrix:

Return the permutation matrix as a unitary matrix:

WorkingPrecision  (1)

Specify the working precision for the permutation matrix:

The normal representation returns a full matrix with finite precision elements:

Applications  (4)

A function for computing the LU decomposition of a matrix:

Compute the decomposition:

Verify the decomposition:

Generate permutation matrices corresponding to the elements of a permutation group:

Compute a multiplication table for the group:

This is equivalent to the result of GroupMultiplicationTable:

Define the vec operator, which stacks the columns of a matrix into a single vector:

Define the vec-permutation matrix, also called the commutation matrix:

The vec-permutation matrix relates the result of applying the vec operator to a matrix and its transpose:

The vec-permutation matrix can be used to express the relationship between the Kronecker product of two given matrices and the Kronecker product of the same matrices in reverse order:

The efficiency of the fast Fourier transform (FFT) relies on being able to form a larger Fourier matrix from two smaller ones. Generate two small Fourier matrices of sizes p and q:

The Fourier matrix of size p q can be expressed as a product of four simpler matrices:

Show that the resulting matrix is equivalent to the result of FourierMatrix:

The discrete Fourier transform of a vector can be computed by successively multiplying the factors of the Fourier matrix to the vector:

The result is equivalent to applying Fourier to the vector:

Properties & Relations  (6)

Convert an identity matrix to a permutation matrix:

Show the disjoint cycle representation:

PermutationMatrix[p<->q] is equivalent to PermutationMatrix[Cycles[{{p,q}}]]:

Use SparseArray[PermutationMatrix[…]] to get a representation as a SparseArray:

Generate a random permutation list:

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:

The determinant of a permutation matrix is equal to the signature of the corresponding permutation list:

The permanent of the product of a permutation matrix and a general matrix is equal to the permanent of the original matrix:

Neat Examples  (1)

An upper bidiagonal matrix:

Generate a symmetric block matrix with bidiagonal blocks (a Jordan–Wielandt matrix):

Define the "perfect shuffle" permutation:

Use the perfect shuffle to transform the Jordan–Wielandt matrix into a tridiagonal matrix (a Golub–Kahan tridiagonal matrix):

Compute the singular values of a numerical upper bidiagonal matrix:

These are equivalent to the positive eigenvalues of the Golub–Kahan tridiagonal matrix:

See Also

Cycles  PermutationCycles  PermutationList  Permute  LUDecomposition  QRDecomposition

Related Guides

    ▪
  • Structured Arrays

History

Introduced in 2022 (13.1) | Updated in 2023 (13.3) ▪ 2024 (14.0)

Wolfram Research (2022), PermutationMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/PermutationMatrix.html (updated 2024).

Text

Wolfram Research (2022), PermutationMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/PermutationMatrix.html (updated 2024).

CMS

Wolfram Language. 2022. "PermutationMatrix." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/PermutationMatrix.html.

APA

Wolfram Language. (2022). PermutationMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PermutationMatrix.html

BibTeX

@misc{reference.wolfram_2025_permutationmatrix, author="Wolfram Research", title="{PermutationMatrix}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/PermutationMatrix.html}", note=[Accessed: 01-March-2026]}

BibLaTeX

@online{reference.wolfram_2025_permutationmatrix, organization={Wolfram Research}, title={PermutationMatrix}, year={2024}, url={https://reference.wolfram.com/language/ref/PermutationMatrix.html}, note=[Accessed: 01-March-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English