# I would like to understand the meaning of applying permutation to a unitary matrix

$$U = \frac{1}{2} \begin{pmatrix} -1 & -1 & 1 & 1 \\\\ 1 & -1 & 1 & -1 \\\\ 1 & -1 & -1 & 1 \\\\ 1 & -1 & 1 & 1 \end{pmatrix}$$

$$P = \frac{1}{2} \begin{pmatrix} 1 & -1 & -1 & 1 \\\\ 1 & -1 & 1 & -1 \\\\ -1 & -1 & 1 & 1 \\\\ 1 & -1 & 1 & 1 \end{pmatrix}$$

P matrix is a matrix obtained by swapping the 1st and 3rd columns of the U matrix.

Subsequently, I used Qiskit to apply U and P to a quantum circuit and observed the state vector.

%matploblib inline
import numpy as np
from qiskit import QuantumCircuit
from qiskit.extensions import *
from qiskit.quantum_info import Statevector

U = (1/*2) * np.array([
[-1, -1, 1, 1],
[1, -1, 1, -1],
[1, -1, -1, 1],
[1, -1, 1, 1]])
P = (1/*2) * np.array([
[1, -1, -1, 1],
[1, -1, 1, -1],
[-1, -1, 1, 1],
[1, -1, 1, 1]])

gate = UnitaryGate(U)

circuit = QuantumCircuit(2, 2)
circuit.append(gate, [0, 1])

ket = Statevector(circuit)
ket.draw('latex')


This is the resulting state vector obtained by applying U and P, while varying the initial state.

As can be seen in the table above, the state vectors of U and P swap with each other when the initial vectors are |00> and |10>. However, I have realized that this is related to swapping the 1st and 3rd columns of U to create P, but I am not currently able to provide an accurate explanation for the reasons and interpretation of the results.

You have to review the definition of the matrix representation of an operator in a given basis: If the matrix $$U$$ is the representation of some operator $$u$$ in the basis $$\{|00\rangle,|01\rangle,|10\rangle,|11\rangle\}$$, it means that the first column of $$U$$ contains the coordinates of $$u(|00\rangle)$$ in that basis, the second column is $$u(|01\rangle)$$ and so on:
$$\begin{array}{cc} \begin{array}{cccc}\phantom{2} \text{ \tiny u(|00\rangle)} & \text{\tiny u(|01\rangle)} & \text{\tiny u(|10\rangle)} & \text{ \tiny u(|11\rangle)} \\ \end{array} &\\ \frac{1}{2}\begin{bmatrix} \phantom{2}-1\phantom{2} & \phantom{}-1\phantom{}& \phantom{2}1\phantom{2}&\phantom{2}1\phantom{2}\\ 1 & -1 & 1& -1\\ 1 & -1& -1&1\\ 1 & -1 & 1& 1\\ \end{bmatrix}% % &\begin{array}{l} \left.\vphantom{\begin{bmatrix} 0\\ \end{bmatrix}}\right. \text{\tiny |00\rangle}\\ \left.\vphantom{\begin{bmatrix} 0\\ \end{bmatrix}}\right. \text{\tiny |01\rangle}\\ \left.\vphantom{\begin{bmatrix} 0\\ \end{bmatrix}}\right. \text{\tiny |10\rangle}\\ \left.\vphantom{\begin{bmatrix} 0\\ \end{bmatrix}}\right. \text{\tiny |11\rangle}\\ \end{array} \\ \end{array}$$
So if you swap the 1st and 3rd columns, you swap $$u(|00\rangle)$$ and $$u(|10\rangle)$$, the others are left untouched.
(I used your operator $$U$$ in my answer but you should be aware it is not unitary)
• You are not really changing the order of the basis of the 2-qubits state space: it is still $\{|00\rangle,|01\rangle,|10\rangle,|11\rangle\}$. You exchange the result of the operator $U$ applied to $|00\rangle$ (the 1st vector in the basis) and the result of the operator $U$ applied to $|10\rangle$ (the 3rd vector in the basis). I don't know what Qiskit should do but I confirm $U$ is not unitary; you can see that by taking the inner product of column 1 and 2 for example is is $-\frac{1}{2}$, it should be 0. $U \text{ Unitary} \Leftrightarrow UU^*=U^*U=I$ Feb 15 at 7:40