qics.quantum.swap¶
- qics.quantum.swap(mat, dims, sys1, sys2)[source]¶
Swaps two systems of a multipartite quantum state, e.g., for a bipartite state with
dims=(n0, n1), it is the unique linear maps satisfying\[X \otimes Y \mapsto Y \otimes X,\]for all \(X,Y\in\mathbb{H}^{n}\).
- Parameters:
- mat
ndarray Array of size
(n0*n1*...*nk-1, n0*n1*...*nk-1)represnting a matrix defined on \(k\) subsystems which we want to swap the subsystems of.- dims
tupleofint The dimensions
(n0, n1, ..., nk-1)of the \(k\) subsystems.- sys1
int First of the \(k\) subsystems to swap.
- sys2
int Second of the \(k\) subsystems to swap
- mat
- Returns:
ndarrayThe resulting
(n0*n1*...*nk-1, n0*n1*...*nk-1)matrix after performing the swap operator.