Permutation matrix (source code)

= Permutation matrix
{title2=$P$}
{wiki}

A permutation matrix has exactly one entry equal to one in each row and column and zeros elsewhere. Left or right multiplication permutes coordinates, and $P^{-1}=P^T$.