channel_ops.partial_channel

Apply channel a subsystem of an operator.

Module Contents

Functions

partial_channel(rho, phi_map[, sys, dim])

Apply channel to a subsystem of an operator [1].

channel_ops.partial_channel.partial_channel(rho, phi_map, sys=2, dim=None)

Apply channel to a subsystem of an operator [1].

Applies the operator

\[\left(\mathbb{I} \otimes \Phi \right) \left(\rho \right).\]

In other words, it is the result of applying the channel \(\Phi\) to the second subsystem of \(\rho\), which is assumed to act on two subsystems of equal dimension.

The input phi_map should be provided as a Choi matrix.

This function is adapted from the QETLAB package.

Examples

The following applies the completely depolarizing channel to the second subsystem of a random density matrix.

>>> import numpy as np
>>> from toqito.channel_ops import partial_channel
>>> from toqito.channels import depolarizing
>>> rho = np.array([
...    [0.3101, -0.0220-0.0219*1j, -0.0671-0.0030*1j, -0.0170-0.0694*1j],
...    [-0.0220+0.0219*1j, 0.1008, -0.0775+0.0492*1j, -0.0613+0.0529*1j],
...    [-0.0671+0.0030*1j, -0.0775-0.0492*1j, 0.1361, 0.0602 + 0.0062*1j],
...    [-0.0170+0.0694*1j, -0.0613-0.0529*1j, 0.0602-0.0062*1j, 0.4530]])
>>> partial_channel(rho, depolarizing(2))
array([[ 0.20545+0.j     ,  0.     +0.j     , -0.0642 +0.02495j,
         0.     +0.j     ],
       [ 0.     +0.j     ,  0.20545+0.j     ,  0.     +0.j     ,
        -0.0642 +0.02495j],
       [-0.0642 -0.02495j,  0.     +0.j     ,  0.29455+0.j     ,
         0.     +0.j     ],
       [ 0.     +0.j     , -0.0642 -0.02495j,  0.     +0.j     ,
         0.29455+0.j     ]])

The following applies the completely depolarizing channel to the first subsystem.

>>> import numpy as np
>>> from toqito.channel_ops import partial_channel
>>> from toqito.channels import depolarizing
>>> rho = np.array([[0.3101, -0.0220-0.0219*1j, -0.0671-0.0030*1j, -0.0170-0.0694*1j],
...                 [-0.0220+0.0219*1j, 0.1008, -0.0775+0.0492*1j, -0.0613+0.0529*1j],
...                 [-0.0671+0.0030*1j, -0.0775-0.0492*1j, 0.1361, 0.0602 + 0.0062*1j],
...                 [-0.0170+0.0694*1j, -0.0613-0.0529*1j, 0.0602-0.0062*1j, 0.4530]])
>>> partial_channel(rho, depolarizing(2), 1)
array([[0.2231+0.j     , 0.0191-0.00785j, 0.    +0.j     ,
        0.    +0.j     ],
       [0.0191+0.00785j, 0.2769+0.j     , 0.    +0.j     ,
        0.    +0.j     ],
       [0.    +0.j     , 0.    +0.j     , 0.2231+0.j     ,
        0.0191-0.00785j],
       [0.    +0.j     , 0.    +0.j     , 0.0191+0.00785j,
        0.2769+0.j     ]])

References

[1] (1,2)

John Watrous. The Theory of Quantum Information. Cambridge University Press, 2018. doi:10.1017/9781316848142.

Raises:

ValueError – If Phi map is not provided as a Choi matrix or Kraus operators.

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

  • phi_map (numpy.ndarray | list[list[numpy.ndarray]]) – The map to partially apply.

  • sys (int) – Scalar or vector specifying the size of the subsystems.

  • dim (list[int] | numpy.ndarray) – Dimension of the subsystems. If None, all dimensions are assumed to be equal.

Returns:

The partial map phi_map applied to matrix rho.

Return type:

numpy.ndarray