cirq.protocols.SupportsMixture

An object that decomposes into a probability distribution of unitaries.

Methods

_has_mixture_

View source

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_

View source

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.