toqito.channels.depolarizing ============================ .. py:module:: toqito.channels.depolarizing .. autoapi-nested-parse:: Generates the depolarizing channel. Module Contents --------------- .. py:function:: depolarizing(dim, param_p = 0) Produce the partially depolarizing channel. (Section: Replacement Channels and the Completely Depolarizing Channel from [@Watrous_2018_TQI]). The Choi matrix of the completely depolarizing channel [@WikiDepo] that acts on `dim`-by-`dim` matrices. The *completely depolarizing channel* is defined as \[ \Omega(X) = \text{Tr}(X) \omega \] for all \(X \in \text{L}(\mathcal{X})\), where \[ \omega = \frac{\mathbb{I}_{\mathcal{X}}}{\text{dim}(\mathcal{X})} \] denotes the completely mixed stated defined with respect to the space \(\mathcal{X}\). .. rubric:: Examples The completely depolarizing channel maps every density matrix to the maximally-mixed state. For example, consider the density operator \[ \rho = \frac{1}{2} \begin{pmatrix} 1 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 1 \end{pmatrix} \] corresponding to one of the Bell states. Applying the depolarizing channel to \(\rho\) we have that \[ \Phi(\rho) = \frac{1}{4} \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}. \] This can be observed in `|toqito⟩` as follows. ```python exec="1" source="above" import numpy as np from toqito.channels import depolarizing from toqito.channel_ops import apply_channel test_input_mat = np.array([[1 / 2, 0, 0, 1 / 2], [0, 0, 0, 0], [0, 0, 0, 0], [1 / 2, 0, 0, 1 / 2]]) print(apply_channel(test_input_mat, depolarizing(4))) ``` ```python exec="1" source="above" import numpy as np from toqito.channels import depolarizing from toqito.channel_ops import apply_channel test_input_mat = np.arange(1, 17).reshape(4, 4) print(apply_channel(test_input_mat, depolarizing(4, 0.5))) ``` :raises ValueError: If `param_p` is outside the interval [0,1]. :param dim: The dimensionality on which the channel acts. :param param_p: Depolarizing probability \(p \) \in [0,1] that mixes the input state with the maximally mixed state. :param Default 0.: :returns: The Choi matrix of the completely depolarizing channel.