Skip to content

Commit

Permalink
Use np.allclose for more robust value comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
pavoljuhas committed Nov 2, 2023
1 parent bfb58c2 commit 9ddcbaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cirq-core/cirq/experiments/fidelity_estimation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_xeb_fidelity(depolarization, estimator):
f2 = cirq.xeb_fidelity(
circuit, bitstrings, qubits, amplitudes=amplitudes, estimator=estimator
)
assert np.abs(f - f2) < 2e-6
assert np.allclose(f, f2, rtol=1e-6)

fs.append(f)

Expand Down

0 comments on commit 9ddcbaa

Please sign in to comment.