ArticleslgStudy

mathematics

Commutation matrix

Commutation matrix is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Commutation matrix rather than just read about it. In short: In mathematics, especially in linear algebra and matrix theory, the commutation matrix is used for transforming the vectorized form of a matrix into the vectorized form of its transpose. Specifically, the commutation matrix K(m,n) is the nm × mn permutation matrix which, for any m × n matrix A, transforms vec(A) into vec(AT): K(m,n) vec(A) = vec(AT) .

Key takeaways

  • Commutation matrix belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Commutation matrix to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Commutation matrix from memory before moving on to harder problems.

Reference excerpt

In mathematics, especially in linear algebra and matrix theory, the commutation matrix is used for transforming the vectorized form of a matrix into the vectorized form of its transpose. Specifically, the commutation matrix K(m,n) is the nm × mn permutation matrix which, for any m × n matrix A, transforms vec(A) into vec(AT):

K(m,n) vec(A) = vec(AT) . Here vec(A) is the mn × 1 column vector obtain by stacking the columns of A on top of one another:

vec⁡(𝐀)=[𝐀1,1,…,𝐀m,1,𝐀1,2,…,𝐀m,2,…,𝐀1,n,…,𝐀m,n]T where A = [Ai,j]. In other words, vec(A) is the vector obtained by vectorizing A in column-major order. Similarly, vec(AT) is the vector obtaining by vectorizing A in row-major order. The cycles and other properties of this permutation have been heavily studied for in-place matrix transposition algorithms. In the context of quantum information theory, the commutation matrix is sometimes referred to as the swap matrix or swap operator

Properties The commutation matrix is a special type of permutation matrix, and is therefore orthogonal. In particular, K(m,n) is equal to 𝐏π, where π is the permutation over {1,…,mn} for which π(i+m(j−1))=j+n(i−1),i=1,…,m,j=1,…,n. The determinant of K(m,n) is (−1)14n(n−1)m(m−1). Replacing A with AT in the definition of the commutation matrix shows that K(m,n) = (K(n,m))T. Therefore, in the special case of m = n the commutation matrix is an involution and symmetric. The main use of the commutation matrix, and the source of its name, is to commute the Kronecker product: for every m × n matrix A and every r × q matrix B, 𝐊(r,m)(𝐀⊗𝐁)𝐊(n,q)=𝐁⊗𝐀. This property is often used in developing the higher order statistics of Wishart covariance matrices. The case of n=q=1 for the above equation states that for any column vectors v,w of sizes m,r respectively, 𝐊(r,m)(𝐯⊗𝐰)=𝐰⊗𝐯. This property is the reason that this matrix is referred to as the "swap operator" in the context of quantum information theory. Two explicit forms for the commutation matrix are as follows: if er,j denotes the j-th canonical vector of dimension r (i.e. the vector with 1 in the j-th coordinate and 0 elsewhere) then 𝐊(r,m)=∑i=1r∑j=1m(𝐞r,i𝐞m,jT)⊗(𝐞m,j𝐞r,iT)=∑i=1r∑j=1m(𝐞r,i⊗𝐞m,j)(𝐞m,j⊗𝐞r,i)T. The commutation matrix may be expressed as the following block matrix: 𝐊(m,n)=[𝐊1,1⋯𝐊1,n⋮⋱⋮𝐊m,1⋯𝐊m,n,], Where the p,q entry of n x m block-matrix Ki,j is given by 𝐊ij(p,q)={1i=q and j=p,0otherwise. For example, 𝐊(3,4)=[100000000000000100000000000000100000000000000100010000000000000010000000000000010000000000000010001000000000000001000000000000001000000000000001].

Code For both square and rectangular matrices of m rows and n columns, the commutation matrix can be generated by the code below.

Python

Alternatively, a version without imports:

MATLAB

R

Example Let A denote the following 3×2 matrix:

A=[142536]. A has the following column-major and row-major vectorizations (respectively):

𝐯col=vec⁡(A)=[123456],𝐯row=vec⁡(AT)=[142536]. The associated commutation matrix is

K=𝐊(3,2)=[1⋅⋅⋅⋅⋅⋅⋅⋅1⋅⋅⋅1⋅⋅⋅⋅⋅⋅⋅⋅1⋅⋅⋅1⋅⋅⋅⋅⋅⋅⋅⋅1], (where each ⋅ denotes a zero). As expected, the following holds:

KTK=KKT=𝐈6 K𝐯col=𝐯row

References

Jan R. Magnus and Heinz Neudecker (1988), Matrix Differential Calculus with Applications in Statistics and Econometrics, Wiley.

Worked examples

Example 1 — a first encounter with Commutation matrix

Start with the simplest possible case. Write down what Commutation matrix claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Commutation matrix before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Commutation matrix ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Commutation matrix

In research
Commutation matrix appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Commutation matrix in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Commutation matrix is common in secondary-school and first-year university syllabi. It links to neighbouring topics Linear algebra, Matrices (mathematics), so understanding it makes those chapters shorter.
In everyday life
Look for Commutation matrix outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Commutation matrix” →

How to study Commutation matrix in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Commutation matrix means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Commutation matrix out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Commutation matrix in simple terms?

In mathematics, especially in linear algebra and matrix theory, the commutation matrix is used for transforming the vectorized form of a matrix into the vectorized form of its transpose. Specifically, the commutation matrix K(m,n) is the nm × mn permutation matrix which, for any m × n matrix A, tra…

Why does Commutation matrix matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Commutation matrix?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Commutation matrix.

Tags

  • Linear algebra
  • Matrices (mathematics)

Keep exploring