Avoid state vector normalization if it worsens the round offs#6556
Conversation
This fixes failure of check/pytest -n0 cirq-core/cirq/circuits/circuit_test.py::test_final_state_vector which happened because normalization of a state vector at `np.complex64` precision can subtly increase the overall round-off error. Follow up to quantumlib#6522 and quantumlib#6402
|
I have got consistent failures for the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6556 +/- ##
=======================================
Coverage 97.79% 97.79%
=======================================
Files 1124 1124
Lines 95486 95489 +3
=======================================
+ Hits 93376 93380 +4
+ Misses 2110 2109 -1 ☔ View full report in Codecov by Sentry. |
NoureldinYosri
left a comment
There was a problem hiding this comment.
maybe we should remove it normalization then?
The normalization does help for your original round-off example in #6402. where the latter value for normalized xn is above the test tolerance. With this PR the test passes and the round-off is better for #6402. |
…mlib#6556) This fixes failure of check/pytest -n0 cirq-core/cirq/circuits/circuit_test.py::test_final_state_vector which happened because normalization of a state vector at `np.complex64` precision can subtly increase the overall round-off error. Follow up to quantumlib#6522 and quantumlib#6402
…mlib#6556) This fixes failure of check/pytest -n0 cirq-core/cirq/circuits/circuit_test.py::test_final_state_vector which happened because normalization of a state vector at `np.complex64` precision can subtly increase the overall round-off error. Follow up to quantumlib#6522 and quantumlib#6402
…mlib#6556) This fixes failure of check/pytest -n0 cirq-core/cirq/circuits/circuit_test.py::test_final_state_vector which happened because normalization of a state vector at `np.complex64` precision can subtly increase the overall round-off error. Follow up to quantumlib#6522 and quantumlib#6402
This fixes failure of
check/pytest -n0 cirq-core/cirq/circuits/circuit_test.py::test_final_state_vector
which happened because normalization of a state vector at
np.complex64precision can subtly increase the overall round-off error.
Follow up to #6522 and #6402