# Permute the factors of a Kronecker product

Let two matrices $$A$$ and $$B$$ of size $$m\times n$$ and $$p \times q$$, respectively.

What is the expression of two matrices $$F$$ and $$G$$ such that $$A \otimes B = F ( B \otimes A ) G$$?

## 1 Answer

The matrices $$F$$ and $$G$$ are called commutation matrices. A commutation matrix $$K_{m,n}$$ is the unique permutation matrix that satisfies $$K_{m,n} \cdot {\rm vec}\{X\} = {\rm vec}\{X^T\}$$ for any $$X$$ of size $$m \times n$$, where $${\rm vec}\{\cdot\}$$ is the vectorization operator that stacks $$X$$ into a vector (column by column). These commutation matrices can be used to permute Kronecker products. They satisfy $$K_{m,p}^T \cdot(A \otimes B) \cdot K_{n,q} = B \otimes A,$$ where $$A$$ and $$B$$ are $$m \times n$$ and $$p\times q$$. Hence, your $$F$$ is $$K_{m,p}$$ and your $$G$$ is $$K_{n,q}^T$$. You can find a lot more details and properties about these matrices in [MN79, MN95].

[MN95] Magnus, Jan R.; Neudecker, Heinz, Matrix differential calculus with applications in statistics and econometrics, ZBL07044055, 1995.

[MN79] Magnus, Jan R.; Neudecker, H., The commutation matrix: Some properties and applications, Ann. Stat. 7, 381-394 (1979). ZBL0414.62040.