-
Notifications
You must be signed in to change notification settings - Fork 47
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
Quantum circuit with conditionals can cause RunTime error #1536
Comments
Is the above the full code to reproduce? Running it works for me without error. |
No, here is the updated code snippet: main_circ = Circuit(2, 2, "main_circ")
a = Symbol("a")
s_map = {a : -0.5}
# Adding creg resources
creg_0 = main_circ.add_c_register("creg_0",2)
main_circ.Rz(1,0, condition = reg_eq(creg_0, 3))
main_circ.symbol_substitution(s_map)
main_circ.measure_all()
backend = AerBackend()
no_pass_circ = backend.get_compiled_circuit(main_circ, optimisation_level=0)
counts = backend.run_circuit(no_pass_circ).get_counts() |
I think the bug here is that |
Ah, that makes sense. Thank you for the quick response. |
Thank you for raising the issue. Will work on a fix. |
Benny and I found this by running a randomly generated circuit through the compiler.
Recreate with:
Results in:
When we remove the symbol substitution, the code runs. After closer inspection, we found that symbol substitution changes
Optype.RangePredicate
ops intoOptype.ClassicalOp
even though optype is still stated asOptype.RangePredicate
hereThe text was updated successfully, but these errors were encountered: