cirq.has_kraus

Returns whether the value has a Kraus representation.

Used in the notebooks

Used in the tutorials

val The value to check.
allow_decompose Used by internal methods to stop redundant decompositions from being performed (e.g. there's no need to decompose an object to check if it is unitary as part of determining if the object is a quantum channel, when the quantum channel check will already be doing a more general decomposition check). Defaults to True. When False, the decomposition strategy for determining the result is skipped.

If val has a _has_kraus_ method and its result is not NotImplemented, that result is returned. Otherwise, if val has a _has_mixture_ method and its result is not NotImplemented, that result is returned. Otherwise if val has a _has_unitary_ method and its results is not NotImplemented, that result is returned. Otherwise, if the value has a kraus method return if that has a non-default value. Returns False if none of these functions exists.