ApplyMap

ApplyMap is a function that applies a superoperator to an operator. Both the superoperator and the operator may be either full or sparse.

Syntax

 * PHIX = ApplyMap(X,PHI)

Argument descriptions

 * X: A matrix.
 * 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).

A random example
The following code computes $\Phi(X)$, where $X = \begin{bmatrix}1 & 2 \\ 3 & 4\end{bmatrix}$ and $\Phi$ is the superoperator defined by $$ \Phi(X) = \begin{bmatrix}1 & 5 \\ 1 & 0 \\ 0 & 2\end{bmatrix}X\begin{bmatrix}0 & 1 \\ 2 & 3 \\ 4 & 5\end{bmatrix}^\dagger - \begin{bmatrix}1 & 0 \\ 0 & 0 \\ 0 & 1\end{bmatrix}X\begin{bmatrix}0 & 0 \\ 1 & 1 \\ 0 & 0\end{bmatrix}^\dagger. $$

Transpose map
The swap operator is the Choi matrix of the transpose map. Thus, the following code is a (rather slow and ugly) way of computing the transpose of a matrix:

Of course, in practice you should just use MATLAB's built-in transposition operator X.'.