In quantum mechanics, a qubit can be understood as a 2 by 1 vector denoted by Dirac notation as $$|0\rangle \equiv \left( \begin{array}{c} 1\\ 0\\ \end{array} \right) ,|1\rangle \equiv \left( \begin{array}{c} 0\\ 1\\ \end{array} \right) .$$ The above notation stands for one qubit. For more qubits, we simply tensor them. E.g. there are four possible two qubits $$\left( \begin{array}{c} 1\\ 0\\ 0\\ 0\\ \end{array} \right) =|0\rangle \otimes |0\rangle \equiv |00\rangle ,|01\rangle ,|10\rangle ,|11\rangle .$$ I want to consider the permutation between different qubits, that is we permute the first qubit with the second qubit will lead $|01\rangle $ into $|10\rangle $ and $|10\rangle $ into $|01\rangle $ and keep $|00\rangle ,|11\rangle $ unchanged. The matrix stands for the above operation can be represented as $$|00\rangle \langle 00|+|01\rangle \langle 10|+|10\rangle \langle 01|+|11\rangle \langle 11|=\left( \begin{matrix} 1& 0& 0& 0\\ 0& 0& 1& 0\\ 0& 1& 0& 0\\ 0& 0& 0& 1\\ \end{matrix} \right) \tag{1}$$ where $\langle 10|$ stands for transpose of $|10\rangle $(cases we are considering can be limited to real numbers). There are only two permutation matrices for two qubits. They are identity matrix and eq(1) corresponding to do not change and change the first qubit with the second qubit respectively.
I want to know, how can I use Mathematica to generate all the permutation matrices (16 by 16) similar to eq(1) to 4 qubits? There are $4!=24$ permutation matrices for 4 qubits.
Permute[IdentityMatrix[4], #] & /@ GroupElements@SymmetricGroup[4]
makes a list of the sixteen permutation matrices in dimension 4. Is that what you want? $\endgroup$PermutationMatrix[#,4]&/@GroupElements[SymmetricGroup[4]]
$\endgroup$