|View source on GitHub|
An object that can efficiently implement a mixture.
cirq.protocols.SupportsApplyMixture( *args, **kwargs )
cirq.protocols.ApplyMixtureArgs) -> Union[np.ndarray, None, NotImplementedType]
Efficiently applies a mixture.
This method is given both the target tensor and workspace of the same shape and dtype. The method then either performs inline modifications of the target tensor and returns it, or writes its output into the a workspace tensor and returns that. This signature makes it possible to write specialized simulation methods that run without performing large allocations, significantly increasing simulation performance.
If the receiving object is not able to apply its unitary effect,
None or NotImplemented should be returned.
If the receiving object is able to work inline, it should directly
If the receiving object is unable to work inline, it can write its
The receiving object is also permitted to allocate a new numpy.ndarray and return that as its result.