Skip to content

Commit

Permalink
Fix flaky behavior of test_xeb_fidelity (#6337)
Browse files Browse the repository at this point in the history
Increase tolerance for fidelities calculated with and without state
vector amplitudes.  Avoid flaky test failures due to round-off errors.

Example: https://github.com/quantumlib/Cirq/actions/runs/6726576064/job/18283075054#step:6:598
  • Loading branch information
pavoljuhas authored Nov 2, 2023
1 parent 2f7d732 commit aa312bc
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) < 1e-6
assert np.abs(f - f2) < 2e-6

fs.append(f)

Expand Down

0 comments on commit aa312bc

Please sign in to comment.