-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make RouteCQC
errorout on intermediate measurements on 3+ qubits
#6307
Conversation
updat with latest version
Allow specifying settings field from Cirq-ionq (#5817)
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
thanks for helping with this issue. please check https://github.com/quantumlib/Cirq/blob/master/docs/dev/development.md#continuous-integration-and-local-testing for CI instructions. currently your PR will fail format and pylint tests and maybe others. In the describtion section of your PR please explain what your change does. also the title should be informative. As it stands this PR doesn't fix the problem. There are two ways to go about this
The first harder conceptually, the second is more of a coding excersize. I think we prefer the first option unless the routing algorithm https://arxiv.org/pdf/1902.08091.pdf can't support this case. |
Thanks for the help, will review the routing algorthm to see if it supports intermidiate measurements case. I should be able to implment the second implemention just to get a quick solution out but will also look for example of handling intermidiate measurements correctly in the source code and on online. |
RouteCQC
mishandling intermediate measurements
RouteCQC
mishandling intermediate measurementsRouteCQC
mishandling intermediate measurements
I think, it's better to not support intermediate multiqubit measurements. I'm not aware of any usage of intermdiate multiqubit measurements that can't be done with single qubit measurements. |
RouteCQC
mishandling intermediate measurementsRouteCQC
mishandling intermediate measurements on multiple qubits
updating branch from upstream master
this seems like a lot of changes for a simple check. The check is just if any(protocols.num_qubits(op) > 2 and protocols.is_measurement(op) for op in itertools.chain(*circuit.moments[:-1])):
# There is at least one non-terminal measurement on 3+ qubits |
Yes, apologies, I pulled the changes from upstream so that my branch would be up-to-date before doing the commit. It added changes I wasn't expecting. I did 2 separate commits Errorout for mid-circuit measurements on 3+ qubits with just my changes and Merge commit 'e81919ef8e48ae3efa7f866d6d3e98bd480e7c10' into shef4/is… to fix the divergence. Was able to revert to the intended commit. The change should only be class, unit test, and cleaned-up example notebook files. |
This reverts commit 13c0ea9.
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.
almost there. a few more changes. after you are done please run
./check/format-incremental --apply
and commit its effect
RouteCQC
mishandling intermediate measurements on multiple qubitsRouteCQC
errorout on intermediate measurements on 3+ qubits
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.
a few more things.
& please clear you changes to the notebook
Added the changes you recommended. Cleaning up the notebook was done in removed debug code commit. Will try and replace the debug code with an empty cell in the meantime just in case. |
I see what the changes are, will update now. |
Just updated the notebook. Changed files made it way easier, thanks! |
@shef4 please fix failing CI checks and update the branch to head |
Fixes #6293
currently testing change locally |
I ran CI and everything is passing. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6307 +/- ##
=======================================
Coverage 97.83% 97.83%
=======================================
Files 1108 1108
Lines 96352 96372 +20
=======================================
+ Hits 94270 94290 +20
Misses 2082 2082
☔ View full report in Codecov by Sentry. |
router mishandling mid-circuit measurements #issue6293
Description of the issue
cirq.RouteCQC
commutes gates in undefined ways due to intermediate measurements with 3 or more qubits not being handled correctly.This PR aims to fix this issue by:
Next Steps