This is technically correct but inefficient. Those U gates can all just be removed.
If I change euler_basis='U321' then it works correctly and returns:
q13_0: ──■──
┌─┴─┐
q13_1: ┤ X ├
└───┘
What should happen?
Those gates should not be inserted in the first place. They are hard to remove by subsequent passes as the transformation is not local.
Environment
What is happening?
Extra single-qubit gates are inserted during KAK decomposition (when they can just be removed).
For some reason this does not happen in
euler_basis='U321'
but happens in other euler_basis.How can we reproduce the issue?
It's just doing KAK on the CX gate in the CX basis. So it should just return CX itself.
However it returns this:
This is technically correct but inefficient. Those U gates can all just be removed. If I change euler_basis='U321' then it works correctly and returns:
What should happen?
Those gates should not be inserted in the first place. They are hard to remove by subsequent passes as the transformation is not local.
Any suggestions?
No response