Curriculum / Quantum Gates Deep Dive / Pauli Gates: X, Y, Z
Pauli Gates: X, Y, Z
The fundamental rotation gates. Understand what they do to qubit states.
Pauli Gates: X, Y, Z
The three Pauli gates, X, Y, and Z, are the most fundamental single-qubit operations in quantum computing. Every single-qubit gate you will ever meet can be written as a product of Pauli rotations, and the Pauli matrices themselves form a basis for all single-qubit observables. Understanding them deeply is non-negotiable.
Geometrically, each Pauli gate is a 180° rotation of the Bloch sphere about one of the three coordinate axes. That single fact explains almost all of their behaviour.
Pauli-X, The Quantum NOT
X = [[0, 1],
[1, 0]]- •Flips |0⟩ → |1⟩ and |1⟩ → |0⟩.
- •On superpositions: X(α|0⟩ + β|1⟩) = β|0⟩ + α|1⟩, the amplitudes swap.
- •Geometrically: a 180° rotation about the X axis. The north pole |0⟩ swings around to the south pole |1⟩ and back.
- •In code:
qc.x(0)
X is the closest thing quantum computing has to a classical NOT gate. It acts on the computational basis exactly like a classical bit flip, which is why you'll also hear it called the "bit flip" gate.
Pauli-Y, Bit Flip + Phase Flip
Y = [[0, -i],
[i, 0]]- •Y|0⟩ = i|1⟩ and Y|1⟩ = −i|0⟩.
- •Combines a bit flip with a phase flip, which is another way of saying Y = iXZ.
- •180° rotation about the Y axis of the Bloch sphere.
- •In code:
qc.y(0)
Y shows up whenever you need to toggle and introduce a phase at the same time, for example in error-correction codes and in constructing Bell bases.
Pauli-Z, The Phase Flip
Z = [[1, 0],
[0, -1]]- •Z|0⟩ = |0⟩, Z|1⟩ = −|1⟩.
- •Leaves computational-basis probabilities unchanged, but flips the sign of the |1⟩ amplitude. On |+⟩ this is a dramatic change: Z|+⟩ = |−⟩.
- •180° rotation about the Z axis of the Bloch sphere.
- •In code:
qc.z(0)
Because Z does nothing to P(0) and P(1), its effect is invisible unless you later interfere the state with another gate. That is the whole point of phase in quantum computing: it is silent until it meets an H or another non-diagonal gate and turns into a measurable difference.
This is the opening of the lesson. The full walkthrough, the interactive circuit, and the graded challenge continue inside myqubit.
How this lesson works
A hands-on coding challenge. You write Qiskit-compatible Python in the browser editor, run it instantly via WebAssembly, watch the circuit and Bloch sphere react, and pass automatic output checks. The AI tutor Qubitus gives Socratic hints if you get stuck.
Part of: Quantum Gates Deep Dive
Master single-qubit and multi-qubit gates. Understand rotations, phases, and the math behind every gate in Qiskit.
This lesson is part of Pro
Unlock Quantum Gates Deep Dive and all 10 tracks with Pro: $12.99/month, $79/year, or $97 lifetime. Start with the free track first if you are new.