Permutes the order of the qubits in an n-qubit operator matrix.
Parameters:
A (ndarray) – Matrix of an operator acting on the state space of n qubits, to be reordered.
perm (list[int]) – Permutation vector for the n qubits.
perm[k] is the new index for the k:th qubit in the old ordering.
For example, reorder(kron(A,B,C)),[2,0,1])==kron(B,C,A).