toqito.channel_props.is_unital ============================== .. py:module:: toqito.channel_props.is_unital .. autoapi-nested-parse:: Determines if a channel is unital. Module Contents --------------- .. py:function:: is_unital(phi, rtol = 1e-05, atol = 1e-08, dim = None) Determine whether the given channel is unital. A map \(\Phi \in \text{T} \left(\mathcal{X}, \mathcal{Y} \right)\) is *unital* if it holds that: \[ \Phi(\mathbb{I}_{\mathcal{X}}) = \mathbb{I}_{\mathcal{Y}}. \] If the input channel maps \(M_{r,c}\) to \(M_{x,y}\) then `dim` should be the list `[[r,x], [c,y]]`. If it maps \(M_m\) to \(M_n\), then `dim` can simply be the vector `[m,n]`. More information can be found in Chapter: Unital Channels And Majorization from [@Watrous_2018_TQI]). .. rubric:: Examples Consider the channel whose Choi matrix is the swap operator. This channel is an example of a unital channel. ```python exec="1" source="above" from toqito.perms import swap_operator from toqito.channel_props import is_unital choi = swap_operator(3) print(is_unital(choi)) ``` Additionally, the channel whose Choi matrix is the depolarizing channel is another example of a unital channel. ```python exec="1" source="above" from toqito.channels import depolarizing from toqito.channel_props import is_unital choi = depolarizing(4) print(is_unital(choi)) ``` :param phi: The channel provided as either a Choi matrix or a list of Kraus operators. :param rtol: The relative tolerance parameter (default 1e-05). :param atol: The absolute tolerance parameter (default 1e-08). :param dim: A scalar, vector or matrix containing the input and output dimensions of PHI. :returns: `True` if the channel is unital, and `False` otherwise.