Qubit mapping is not correctly resolved in control flow since cf510a2. This PR is to fix this issue.
In AerCompiler, all of instructions are inlined. Qubits and clbits of a sub-circuit may be different from of its parent. Therefore, previously, they are inlined by using decomposition of trranspiler and transpiler coordinates correct qubits and clbits. However, in cf510a2, decomposition is implemented in AerCompier and mapping of qubits and clbits may be broken.
With this PR, qubits and clbits of top-parent are always used in the inlined circuits.
Summary
Resolve #2171
Details and comments
Qubit mapping is not correctly resolved in control flow since cf510a2. This PR is to fix this issue.
In
AerCompiler
, all of instructions are inlined. Qubits and clbits of a sub-circuit may be different from of its parent. Therefore, previously, they are inlined by using decomposition of trranspiler and transpiler coordinates correct qubits and clbits. However, in cf510a2, decomposition is implemented inAerCompier
and mapping of qubits and clbits may be broken.With this PR, qubits and clbits of top-parent are always used in the inlined circuits.