# Strange behaviour of IdentityGate IGate in IBM Q Composer

Can anyone explain the strange impact of the IGate in the enclosed quantum teleportation setup in view of the computational basis states? Any help is welcome!

The Identity gate I is not the problem.

The problem or rather the behavior that you observed is because of the reset (a non-unitary operation like measurement) combining with the structure of your circuit.

To make things easier to see, suppose you have the following circuit:

     ┌───┐           ░
q_0: ┤ H ├──■────────░─
└───┘┌─┴─┐┌───┐ ░
q_1: ─────┤ X ├┤ Z ├─░─
└───┘└───┘ ░
c: 2/══════════════════


Which brings you from the state $$|00\rangle$$ to the state $$|\psi \rangle = \dfrac{|00\rangle - |11\rangle}{\sqrt{2}}$$

Now, suppose you apply the Reset operation to the top qubit, that is:

     ┌───┐           ░
q_0: ┤ H ├──■────────░──|0>─
└───┘┌─┴─┐┌───┐ ░
q_1: ─────┤ X ├┤ Z ├─░──────
└───┘└───┘ ░
c: 2/═══════════════════════


what would happen?

Well, the reset operation almost have the same effect as measurement but you will guarantee it (the first qubit since we reset the first qubit) to be in the state $$|0\rangle$$. But the key here is that the second qubit can freely collapse to either the state $$|0\rangle$$ or $$-|1\rangle$$. You can't control that.

So upon the reset operation on the first qubit, you collapse to the state $$|00\rangle$$. And other time you would collapse into the state $$-|01\rangle$$.

That is what you observed in your circuit but in a larger scale because the state of your circuit before the reset operations is something like: $$|\psi\rangle = \dfrac{|000\rangle - |001\rangle - |010\rangle + |011\rangle + |100\rangle + |101\rangle + |110\rangle + |111\rangle}{\sqrt{8}}$$ So when you add the Identity gate, it essentially rerun your circuit so you see changes in the state coefficients for the same reason of the example given above.

You can see the same effect by just changing the original circuit (without the Idenity gate) by changing the Visualization seed locating on the top right of your Circuit Composer environment.

• Much thanks for your answer! I think I got it! My reset has to be substituted by a measurement, then the third qubit is effected by the entanglement as desired (and then may be treated by further gates according to the teleportation process). A pure reset keeps my third qubit simply in its former state and so doesn't work as expected. ok? Commented Nov 2, 2021 at 7:10

Much thanks for your answer! I think I got it! My reset has to be substituted by a measurement, then the third qubit is effected by the entanglement as desired (and then may be treated by further gates according to the teleportation process). A pure reset keeps my third qubit simply in its former state and so doesn't work as expected. ok?