Open MattePalte opened 1 year ago
This is a bug in the CommutationAnalysis
pass (it should probably just assume that operations that involve classical wires don't commute with things), but just to point out that what you're doing here is kind of an edge case for us: it's not normal to transpile with no particular basis gates or coupling constraints defined.
Environment
What is happening?
When I append a circuit (using classical bits) to another circuit, the transpiler fails with an error (optimization level 2).
How can we reproduce the issue?
Run this python script:
Produces this output and error:
What should happen?
The transpiler should not fail, I would expect a robust behaviour by a transpiler (e.g. just skip the optimization if not possible or simply raise a warning).
Any suggestions?
What about adding a warning in the transpiler, and skipping the optimization pass in such cases?