|View source on GitHub|
Return a sequence of tuples representing a probabilistic unitary.
cirq.protocols.mixture( val: Any, default: Any = cirq.protocols.mixture_protocol.RaiseTypeErrorIfNotProvided ) -> Sequence[Tuple[float, np.ndarray]]
A mixture is described by an iterable of tuples of the form
(probability of unitary, unitary as numpy array)
The probability components of the tuples must sum to 1.0 and be non-negative.
||The value to decompose into a mixture of unitaries.|
||A default value if val does not support mixture.|
|An iterable of tuples of size 2. The first element of the tuple is a probability (between 0 and 1) and the second is the object that occurs with that probability in the mixture. The probabilities will sum to 1.0.|