Skip to content

Commit

Permalink
Fix operator spaces test which fails due to precision (#4636)
Browse files Browse the repository at this point in the history
See #4379 for failure which occurs only on some architectures.
  • Loading branch information
dabacon authored Nov 8, 2021
1 parent aaf95a8 commit eb1d903
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cirq-core/cirq/linalg/operator_spaces_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ def test_hilbert_schmidt_inner_product_is_linear(a, m1, b, m2):
@pytest.mark.parametrize('m', (I, X, Y, Z, H, SQRT_X, SQRT_Y, SQRT_Z))
def test_hilbert_schmidt_inner_product_is_positive_definite(m):
v = cirq.hilbert_schmidt_inner_product(m, m)
assert np.isreal(v)
# Cannot check using np.is_real due to bug in aarch64.
# See https://github.com/quantumlib/Cirq/issues/4379
assert np.isclose(np.imag(v), 1e-16)
assert v.real > 0


Expand Down

0 comments on commit eb1d903

Please sign in to comment.