|q⟩ Bad Qubits

beginner · Programming · Single-Qubit Gates I: X, Y, Z

The Y Gate

The three Pauli gates — XX, YY, and ZZ — form a natural family. You have already seen XX (the bit-flip). Now meet YY, the gate that flips both the amplitude values and introduces an imaginary factor.

What Y does

Acting on the computational basis states, the Pauli-Y gate gives

Y∣0⟩=i∣1⟩,Y∣1⟩=−i∣0⟩.Y|0\rangle = i|1\rangle, \qquad Y|1\rangle = -i|0\rangle.

Its matrix is

Y=(0−ii0).Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}.

The imaginary unit ii in the off-diagonal entries is what sets YY apart from XX. You can verify the first rule directly: multiply YY by the column vector (10)\binom{1}{0} and you get (0i)\binom{0}{i}, which represents the state i∣1⟩i|1\rangle.

Relating Y to X and Z

The Pauli matrices satisfy a compact product identity:

Y=iXZ.Y = iXZ.

To check it, multiply the matrices step by step. First compute

XZ=(0110)(100−1)=(0−110),XZ = \begin{pmatrix}0&1\\1&0\end{pmatrix}\begin{pmatrix}1&0\\0&-1\end{pmatrix} = \begin{pmatrix}0&-1\\1&0\end{pmatrix},

then multiply by ii:

i⋅(0−110)=(0−ii0)=Y.✓i \cdot \begin{pmatrix}0&-1\\1&0\end{pmatrix} = \begin{pmatrix}0&-i\\i&0\end{pmatrix} = Y. \checkmark

On the Bloch sphere, YY is a 180° rotation about the yy-axis. By comparison, XX rotates about xx and ZZ rotates about zz. All three Pauli gates are their own inverses: Y2=IY^2 = I. You can confirm this by direct multiplication, or by noting that YY is both unitary (Y†Y=IY^\dagger Y = I, so Y−1=Y†Y^{-1} = Y^\dagger) and Hermitian (Y†=YY^\dagger = Y); combining these gives Y−1=Y†=YY^{-1} = Y^\dagger = Y, hence Y⋅Y=IY \cdot Y = I.

Try it

Apply YY to a qubit starting in ∣0⟩|0\rangle. The simulator will compare the full state vector, so a do-nothing circuit will not pass.

Run your code to see the quantum state.

After running, the amplitude on ∣1⟩|1\rangle should be ii and the amplitude on ∣0⟩|0\rangle should be 00. The measurement probability is entirely on outcome 1, just as with X∣0⟩X|0\rangle — but the amplitude carries an extra factor of ii.

Sign in on the full site to ask questions and join the discussion.