channel_ops.apply_channel

Applies a quantum channel to an operator.

Functions

apply_channel(mat, phi_op)

Apply a quantum channel to an operator.

Module Contents

channel_ops.apply_channel.apply_channel(mat, phi_op)

Apply a quantum channel to an operator.

(Section: Representations and Characterizations of Channels of [1]).

Specifically, an application of the channel is defined as

\[\Phi(X) = \text{Tr}_{\mathcal{X}} \left(J(\Phi) \left(\mathbb{I}_{\mathcal{Y}} \otimes X^{T}\right)\right),\]

where

\[J(\Phi): \text{T}(\mathcal{X}, \mathcal{Y}) \rightarrow \text{L}(\mathcal{Y} \otimes \mathcal{X})\]

is the Choi representation of \(\Phi\).

We assume the quantum channel given as phi_op is provided as either the Choi matrix of the channel or a set of Kraus operators that define the quantum channel.

This function is adapted from the QETLAB package.

Examples

The swap operator is the Choi matrix of the transpose map. The following is a (non-ideal, but illustrative) way of computing the transpose of a matrix.

Consider the following matrix

\[\begin{split}X = \begin{pmatrix} 1 & 4 & 7 \\ 2 & 5 & 8 \\ 3 & 6 & 9 \end{pmatrix}\end{split}\]

Applying the swap operator given as

\[\begin{split}\Phi = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \end{pmatrix}\end{split}\]

to the matrix \(X\), we have the resulting matrix of

\[\begin{split}\Phi(X) = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}\end{split}\]

Using |toqito⟩, we can obtain the above matrices as follows.

from toqito.channel_ops import apply_channel
from toqito.perms import swap_operator
import numpy as np
test_input_mat = np.array([[1, 4, 7], [2, 5, 8], [3, 6, 9]])
apply_channel(test_input_mat, swap_operator(3))
array([[1., 2., 3.],
       [4., 5., 6.],
       [7., 8., 9.]])

References

Raises:

ValueError – If matrix is not Choi matrix.

Parameters:
  • mat (numpy.ndarray) – A matrix.

  • phi_op (numpy.ndarray | list[list[numpy.ndarray]]) – A superoperator. phi_op should be provided either as a Choi matrix, or as a list of numpy arrays with either 1 or 2 columns whose entries are its Kraus operators.

Returns:

The result of applying the superoperator phi_op to the operator mat.

Return type:

numpy.ndarray