test_exhaustive_symmetrization_1q failure in test_operator_estimation.py
See original GitHub issuetest_exhaustive_symmetrization_1q
failed when run by semaphoreci for PR #925.
=================================== FAILURES ===================================
______________________ test_exhaustive_symmetrization_1q _______________________
forest = <pyquil.api._base_connection.ForestConnection object at 0x7f6957ab6eb8>
def test_exhaustive_symmetrization_1q(forest):
qc = get_qc('9q-qvm')
qubs = [5]
n_shots = 2000
p = Program()
p00, p11 = 0.90, 0.80
p.define_noisy_readout(5, p00, p11)
bs_results, d_qub_idx = _exhaustive_symmetrization(qc, qubs, n_shots, p)
frac0 = np.count_nonzero(bs_results == 0) / n_shots
expected_frac0 = (p00 + p11) / 2
assert d_qub_idx == {5: 0}
> assert np.isclose(frac0, expected_frac0, 2e-2)
E assert False
E + where False = <function isclose at 0x7f6966899a60>(0.8785, 0.8500000000000001, 0.02)
E + where <function isclose at 0x7f6966899a60> = np.isclose
pyquil/tests/test_operator_estimation.py:758: AssertionError
Here is a Python repl session replicating the above np.isclose
calculation, according to the numpy docs. The last line is meant to show how close/far the test was from passing.
>>> import numpy as np
>>> a = 0.8785
>>> b = 0.8500000000000001
>>> atol = 1e-08
>>> rtol = 2e-2
>>> np.isclose(a, b, rtol)
False
>>> abs(a - b)
0.02849999999999986
>>> atol + rtol * b
0.017000010000000003
>>> abs(a-b) - (atol + rtol * b)
0.011499989999999856
Link to the semaphoreci logs is here: https://semaphoreci.com/rigetti/pyquil/branches/pull-request-925/builds/1
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
long running py.test stop at first failure - Stack Overflow
I am using pytest , and the test execution is supposed to run until it encounters an exception. If the test never encounters...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The remote test runner also just passed.
Addressed in #928