You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transpilation with optimization level 2 and 3 result in a deeper circuit than optimization level 1.
The circuit of level 2 is deeper than that of level 1.
The circuit of level 3 is deeper than that of level 2.
This does not happen with Qiskit 1.2.4.
I took a brief look at this, I expect it's a bug introduced by #13141 when you don't use a Target for the backend's constraints. Since you just used basis_gates it's causing the UnitarySynthesis pass to not correctly synthesize the circuit. If you look at the circuit coming out of the BasisTranslator into the optimization loop at optimization_level=3 you see:
and immediately after unitary synthesis runs and does nothing with the circuit:
<qiskit.transpiler.passes.synthesis.unitary_synthesis.UnitarySynthesis object at 0x7111761906e0>
None
global phase: 3π/2
┌──────────┐
q_0: ┤0 ├
│ Unitary │
q_1: ┤1 ├
└──────────┘
Then that unitary gate for the circuit means none of the other optimization passes can do anything with the circuit, until we get to the if statement in the optimization loop looking for gates outside the basis which runs basis translation again to yield the returned circuit instead of optimizing the output as expected. @ElePT might have some thoughts on where this is going wrong.
Environment
What is happening?
Transpilation with optimization level 2 and 3 result in a deeper circuit than optimization level 1.
The circuit of level 2 is deeper than that of level 1.
The circuit of level 3 is deeper than that of level 2.
This does not happen with Qiskit 1.2.4.
How can we reproduce the issue?
What should happen?
Circuits of level 2 and 3 should be the same size as that of level 1 to be compatible with 1.2.4.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: