-
Notifications
You must be signed in to change notification settings - Fork 272
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
Bizarre IndexError if attempt to measure a qubit after a Control block #343
Comments
Now, I am not sure having a It is true, however, that ProjectQ currently does not checks whether control and target qubits are disjoints. |
Yeah identical qubits in a CNOT isn't useful or even allowed by most frameworks, but crashing with an obscure IndexError isn't very helpful in that case either... |
I agree! So I'll keep this issue open until we fix this (hopefully sometime soon) |
Repro:
This yields:
With
verbose=True
:Of course,
eng.flush()
fixes the issue, but this should probably raise that relevant exception instead of the more obscure IndexError...On that note, is there a reason why this doesn't work:
EDIT: I just realized my
eng.flush()
's were before theMeasure
statements in order to avoid the crash, but aren't they supposed to be after?EDIT 2: The same crash can be reproduced via
CNOT | (q0, q0)
.The text was updated successfully, but these errors were encountered: