Closed Bennybenassius closed 3 weeks ago
It looks like https://github.com/Qiskit/qiskit/pull/12704 introduced this bug, after Consolidate2qBlocks
it appears the unitary is not correct anymore. Though this is quite fragile to reproduce, e.g. removing the h
gate from the subcircuit or from the main_circuit
the unitary is still correct.
Environment
What is happening?
Ilan and I have found a possible miscompilation caused by the transpiler.
The resulting state-vector of the circuit after putting it through
transpile()
changes abruptly after optimization level has been set to above 2, thereby also changing the states of the circuit upon measurement.How can we reproduce the issue?
Running the above code will reveal that the state-vectors are different when the optimization level is above 2. The results will also be the same if the circuit was instead run on
AerBackend
, with optimization levels 2 and 3 producing very different measured states than levels 0 and 1.This is done on the latest version of qiskit (1.3.0), which we have compiled from source to get the latest fixes. However, it seems like this issue is also present in version 1.2.0.
What should happen?
The circuit should not have a different state-vector after putting it through the transpiler.
Any suggestions?
No response