cirq.testing.assert_allclose_up_to_global_phase

Checks if a ~= b * exp(i t) for some t.

Used in the notebooks

Used in the tutorials

actual A numpy array.
desired Another numpy array.
rtol Relative error tolerance.
atol Absolute error tolerance.
equal_nan Whether or not NaN entries should be considered equal to other NaN entries.
err_msg The error message to be printed in case of failure.
verbose If True, the conflicting values are appended to the error message.

AssertionError The matrices aren't nearly equal up to global phase.