KrausOperators

KrausOperators is a function that computes a set of Kraus operators for a superoperator $\Phi$. These superoperators will always be canonical in the following ways:
 * 1) If $\Phi$ is completely positive, only the left Kraus operators will be returned (and the right Kraus operators are the same). That is, a cell will be returned that contains operators $\{A_j\}$ so that $\Phi(X) = \sum_j A_j X A_j^*$.
 * 2) If $\Phi$ is Hermiticity preserving, the right Kraus operators are the same as the left Kraus operators, up to sign. The pairs of Kraus operators that are equal are given first, followed by the pairs that are negatives of each other.
 * 3) The left Kraus operators form an orthogonal set in the Hilbert-Schmidt inner product, and similarly for the right Kraus operators.

Syntax

 * KO = KrausOperators(PHI)
 * KO = KrausOperators(PHI,DIM)

Argument descriptions

 * PHI: A superoperator. Should be provided as either a Choi matrix, or as a cell with either 1 or 2 columns (see the tutorial page for more details about specifying superoperators within QETLAB).
 * DIM (optional, default has input and output spaces of equal dimension): This argument should only be given if PHI is provided as a Choi matrix. In this case, DIM should be a 1-by-2 vector containing the input and output dimensions of PHI, in that order (equivalently, these are the dimensions of the first and second subsystems of the Choi matrix PHI</tt>, in that order).

Examples
Since the Choi matrix of the transpose map is the swap operator, the following code finds a family of Kraus operators for the transpose map on 2-by-2 matrices:

In other words, the following holds for all 2-by-2 matrices $X$: $$X^T = \frac{1}{2}\begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix}X\begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix} + \begin{bmatrix}1 & 0 \\ 0 & 0\end{bmatrix}X\begin{bmatrix}1 & 0 \\ 0 & 0\end{bmatrix} + \begin{bmatrix}0 & 0 \\ 0 & 1\end{bmatrix}X\begin{bmatrix}0 & 0 \\ 0 & 1\end{bmatrix} + \frac{1}{2}\begin{bmatrix}0 & 1 \\ -1 & 0\end{bmatrix}X\begin{bmatrix}0 & 1 \\ -1 & 0\end{bmatrix}.$$