-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
commutative_cancellation raises 'internal error' for classically controlled Toffoli #2667
Comments
This reminds me of #2571 so I took a quick look, but I'm not able to reproduce this locally. When I run your reproduce scenario locally on master I get a different error related to model validation:
|
Ok, well I was able to get around that by using my pre-existing dev environment instead of a freshly created venv (which is normally what I do for recreation scenarios) and it seems to work (ie fail) as expected. The validation error from a fresh install is something we'll have to look into later. Anyway, it looks like this pass is failing because a the op with the condition (post unrolling, and whatever earlier passes were run) is ending up in the cancellation set. That internal error is raised because the check is guarding against a node with a condition set. It also looks like it fails the check for the qarg being on the right qubit. I'll have to trace through how this node is ending up in the cancellation sets, it's not immediately obvious like it was for the 1q pass. |
A previous CommutationAnalysis pass is marking those gates as commuting, which is not correct when there are conditionals. I submitted a patch. |
The text was updated successfully, but these errors were encountered: