cirq.channel

cirq.channel(val: Any, default: Any = (array([], dtype=float64), )) → Union[Tuple[numpy.ndarray], Sequence[TDefault]][source]

Returns a list of matrices describing the channel for the given value.

These matrices are the terms in the operator sum representation of
a quantum channel. If the returned matrices are {A_0,A_1,…, A_{r-1}},
then this describes the channel:
\rho \rightarrow \sum_{k=0}^{r-1} A_0 \rho A_0^\dagger
These matrices are required to satisfy the trace preserving condition
\sum_{k=0}^{r-1} A_i^\dagger A_i = I
where I is the identity matrix. The matrices A_i are sometimes called
Krauss or noise operators.
Parameters:
  • val – The value to describe by a channel.
  • default – Determines the fallback behavior when val doesn’t have a channel. If default is not set, a TypeError is raised. If default is set to a value, that value is returned.
Returns:

If val has a _channel_ method and its result is not NotImplemented, that result is returned. Otherwise, if val has a _mixture_ method and its results is not NotImplement a tuple made up of channel corresponding to that mixture being a probabilistic mixture of unitaries is returned. Otherwise, if val has a _unitary_ method and its result is not NotImplemented a tuple made up of that result is returned. Otherwise, if a default value was specified, the default value is returned.

Raises:

TypeErrorval doesn’t have a _channel_ or _unitary_ method (or that method returned NotImplemented) and also no default value was specified.