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 3 commits into
base: main
Choose a base branch
from

Conversation

daxfohl
Copy link
Contributor

@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
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