When using qiskit to transpile a circuit sometimes there is a gate Rz(0.0)
in the result. I wonder 1) why this happens and 2) what does it mean for the executed circuit (is it just a waiting time with length gate-length)?
In more detail: I transpile the following circuit with optimization_level=3
for ibm_oslo (here shown without the measurements on all qubits) :
┌───┐ ┌──────────┐┌───┐
q_0: ───┤ X ├────┤ Ry(p[0]) ├┤ X ├─────
├───┤ ├──────────┤└─┬─┘┌───┐
q_1: ───┤ X ├────┤ Ry(p[1]) ├──┼──┤ X ├
┌──┴───┴───┐└──────────┘ │ └─┬─┘
q_2: ┤ Ry(p[2]) ├─────■────────■────┼──
├──────────┤ ┌─┴─┐ │
q_3: ┤ Ry(p[3]) ├───┤ X ├───────────■──
└──────────┘ └───┘
It sometimes gives the mentioned RZ(0.0) in the 1st and 5th logical qubit :
┌───┐ ┌─────────┐ ┌────┐┌──────────────┐┌────┐┌────────┐┌───┐ ░ ┌─┐
q_1 -> 0 ┤ X ├───┤ Rz(0.0) ├───┤ √X ├┤ Rz(p[1] + π) ├┤ √X ├┤ Rz(3π) ├┤ X ├─░────┤M├──────
├───┴┐┌─┴─────────┴──┐├────┤└──┬────────┬──┘├───┬┘└────────┘└─┬─┘ ░ └╥┘ ┌─┐
q_3 -> 1 ┤ √X ├┤ Rz(p[3] + π) ├┤ √X ├───┤ Rz(3π) ├───┤ X ├─────────────■───░─────╫────┤M├
└────┘└──────────────┘└────┘ └────────┘ └─┬─┘ ░ ║ └╥┘
ancilla_0 -> 2 ──────────────────────────────────────────────┼─────────────────────────╫─────╫─
┌────┐┌──────────────┐┌────┐ ┌────────┐ │ ░ ║ ┌─┐ ║
q_2 -> 3 ┤ √X ├┤ Rz(p[2] + π) ├┤ √X ├───┤ Rz(3π) ├─────■───────────────■───░─────╫─┤M├─╫─
└────┘└──────────────┘└────┘ └────────┘ │ ░ ║ └╥┘ ║
ancilla_1 -> 4 ──────────────────────────────────────────────────────────────┼─────────╫──╫──╫─
┌───┐ ┌─────────┐ ┌────┐┌──────────────┐┌────┐┌────────┐┌─┴─┐ ░ ┌─┐ ║ ║ ║
q_0 -> 5 ┤ X ├───┤ Rz(0.0) ├───┤ √X ├┤ Rz(p[0] + π) ├┤ √X ├┤ Rz(3π) ├┤ X ├─░─┤M├─╫──╫──╫─
└───┘ └─────────┘ └────┘└──────────────┘└────┘└────────┘└───┘ ░ └╥┘ ║ ║ ║
ancilla_2 -> 6 ─────────────────────────────────────────────────────────────────────╫──╫──╫──╫─
║ ║ ║ ║
meas: 4/═════════════════════════════════════════════════════════════════════╩══╩══╩══╩═
0 1 2 3