Skip to content
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

Fix classical conditions getting optimized ahead of their measurements #6872

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

daxfohl
Copy link
Collaborator

@daxfohl daxfohl commented Dec 23, 2024

During simulation, classical controlled empty subcircuits were getting put in the "prefix" part of the simulation, while corresponding measurements were put in the suffix, causing these ops to be executed out of order. This was due to the split_into_matching_protocol_then_general function, which ensured that qubit access order was preserved, but overlooked doing the same for measurement keys. This PR fixes that.

Fixes #6730

@daxfohl daxfohl requested review from vtomole and a team as code owners December 23, 2024 05:35
@daxfohl daxfohl requested a review from tanujkhattar December 23, 2024 05:35
@CirqBot CirqBot added the size: S 10< lines changed <50 label Dec 23, 2024
Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.86%. Comparing base (686766f) to head (d35ae33).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6872      +/-   ##
==========================================
- Coverage   97.86%   97.86%   -0.01%     
==========================================
  Files        1084     1084              
  Lines       94225    94234       +9     
==========================================
+ Hits        92215    92223       +8     
- Misses       2010     2011       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Controlled empty subroutine causes ValueError on simulator
2 participants