View source on GitHub |
An object that decomposes into a probability distribution of unitaries.
cirq.SupportsMixture(
*args, **kwargs
)
Methods
_has_mixture_
_has_mixture_() -> bool
Whether this value has a mixture representation.
This method is used by the global cirq.has_mixture
method. If this
method is not present, or returns NotImplemented, it will fallback
to using mixture with a default value, or False if neither exist.
Returns | |
---|---|
True if the value has a mixture representation, Falseotherwise. |
_mixture_
_mixture_() -> Union[Sequence[Tuple[float, Any]], NotImplementedType]
Decompose into a probability distribution of unitaries.
This method is used by the global cirq.mixture
method.
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 between 0 and 1 (inclusive).
Returns | |
---|---|
A list of (probability, unitary) pairs. |