- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.1k
 
Avoid state vector normalization if it worsens the round offs #6556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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