iqm.pulse.circuit_operations.reorder

Contents

iqm.pulse.circuit_operations.reorder#

iqm.pulse.circuit_operations.reorder(A, perm)#

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).

Returns:

Reordered A.

Return type:

ndarray