DiamondNorm

DiamondNorm is a function that computes the diamond norm $\|\Phi\|_\diamond$ of a superoperator $\Phi$.

Syntax

 * DN = DiamondNorm(PHI)
 * DN = DiamondNorm(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). PHIC will be a cell of Kraus operators if PHI is a cell of Kraus operators, and similarly PHIC will be a Choi matrix if PHI is a Choi matrix.
 * DIM</tt> (optional, default has input and output spaces of equal dimension): A 1-by-2 vector containing the input and output dimensions of PHI</tt>, in that order (equivalently, these are the dimensions of the first and second subsystems of the Choi matrix PHI</tt>, in that order). If the input or output space is not square, then DIM</tt>'s first row should contain the input and output row dimensions, and its second row should contain its input and output column dimensions. DIM</tt> is required if and only if PHI</tt> has unequal input and output dimensions and is provided as a Choi matrix.

A completely positive map
If $\Phi$ is completely positive then $\|\Phi\|_{\diamond} = \|\Phi^\dagger(I)\|$, where $I$ is the identity matrix, $\Phi^\dagger$ is the dual map of $\Phi$, and $\|\cdot\|$ is the usual operator norm, which we can verify in a special case via the following code:

A difference of unitaries channel
If $\Phi(X) = X - UXU^\dagger$, then the diamond norm of $\Phi$ is the diameter of the smallest circle that contains the eigenvalues of $U$, which we can verify in a special case via the following code:

Can be used within CVX
The diamond norm is convex (like all norms) and this function can be used in the same way as any other convex function within CVX. Thus you can minimize the diamond norm or use the diamond norm in constraints of CVX optimization problems. For example, the following code finds the closest Pauli channel (i.e., channel with Kraus operators all of which are multiples of Pauli matrices) to a given 2-qubit channel, where the measure of "closest" is the diamond norm: