cirq.testing.assert_has_consistent_apply_unitary

cirq.testing.assert_has_consistent_apply_unitary(val: Any, *, atol: float = 1e-08) → None[source]

Tests whether a value’s apply_unitary is correct.

Contrasts the effects of the value’s _apply_unitary_ with the
matrix returned by the value’s _unitary_ method.
Parameters
  • val – The value under test. Should have a __pow__ method.

  • atol – Absolute error tolerance.