One qubit, one sphere, and three gates that connect the computational and phase bases.
The X and Z gates are both called “flips,” but they do not flip the same thing. X exchanges the computational basis states |0⟩ and |1⟩. Z leaves those measurement outcomes unchanged and instead reverses the relative phase of a superposition.
The Bloch sphere makes those distinctions geometric. X is a half-turn about the x-axis; Z is a half-turn about the z-axis; and the Hadamard gate H changes between the computational z basis and the phase-sensitive x basis. The diagrams and Qiskit verification below show exactly where the four states |0⟩, |1⟩, |+⟩, and |−⟩ move.
1 · Why the Bloch Sphere Works
A general pure state of one qubit is described by two complex amplitudes:
The angle θ measures the state’s distance from the north pole. The angle φ gives its direction around the equator. Together they supply the two real parameters needed after normalisation and global phase have been removed.
A pure state lies on the sphere’s surface. A mixed state—representing statistical uncertainty or noise—lies inside the sphere. The centre is the maximally mixed one-qubit state, not a pure superposition.
2 · Basis States and the Equator
The computational basis states occupy the poles. The two equal superpositions with real amplitudes occupy opposite points on the x-axis:
|1⟩ = [0, 1]T → (0, 0, −1)
|+⟩ = (|0⟩ + |1⟩)/√2 → (+1, 0, 0)
|−⟩ = (|0⟩ − |1⟩)/√2 → (−1, 0, 0)
| State | Bloch position | Computational-basis measurement |
|---|---|---|
| |0⟩ | North pole, +z | 0 with certainty |
| |1⟩ | South pole, −z | 1 with certainty |
| |+⟩ | Equator, +x | 0 or 1, each with probability 1/2 |
| |−⟩ | Equator, −x | 0 or 1, each with probability 1/2 |

3 · The X Gate: Rotate About x
The Pauli X gate swaps the two amplitudes of a one-qubit state:
[1 0]
X(α|0⟩ + β|1⟩) = β|0⟩ + α|1⟩
For the computational basis, this gives X|0⟩ = |1⟩ and X|1⟩ = |0⟩. On the Bloch sphere, X is a 180-degree rotation around the x-axis:
The x-coordinate stays fixed while y and z reverse. The poles therefore exchange places, but the states |+⟩ and |−⟩ remain on their respective x-axis points, up to global phase.
4 · The Z Gate: Rotate About z
The Pauli Z gate leaves the |0⟩ amplitude unchanged and reverses the sign of the |1⟩ amplitude:
[0 −1]
Z(α|0⟩ + β|1⟩) = α|0⟩ − β|1⟩
For the poles, Z|0⟩ = |0⟩ and Z|1⟩ = −|1⟩. The minus sign in the second expression is only a global phase when the input is |1⟩, so the physical point on the Bloch sphere does not move.
The change becomes visible for a superposition. Z maps |+⟩ to |−⟩ and |−⟩ to |+⟩, moving the state to the opposite side of the equator:
The phase flip is not a bit flip. Z preserves the z-coordinate and therefore leaves computational-basis probabilities unchanged. It reverses the transverse x and y components that encode relative phase.
5 · The Hadamard Gate: Change Basis
The Hadamard gate connects the computational basis on the z-axis to the |+⟩/|−⟩ basis on the x-axis:
[1 −1]
H|0⟩ = |+⟩ H|1⟩ = |−⟩
H|+⟩ = |0⟩ H|−⟩ = |1⟩
On Bloch coordinates, Hadamard swaps the x and z components and reverses the y component:
Geometrically, H is—up to an irrelevant global phase—a 180-degree rotation about the axis halfway between +x and +z. It is also self-inverse: applying H twice returns the starting state.

The state mappings can be checked directly with Qiskit:
from qiskit.circuit.library import HGate
from qiskit.quantum_info import Statevector
zero = Statevector.from_label("0")
one = Statevector.from_label("1")
plus = zero.evolve(HGate())
minus = one.evolve(HGate())
assert plus.equiv(Statevector.from_label("+"))
assert minus.equiv(Statevector.from_label("-"))
assert plus.evolve(HGate()).equiv(zero)
assert minus.evolve(HGate()).equiv(one)
6 · X and Z Side by Side
| Property | X gate | Z gate |
|---|---|---|
| Common name | Bit flip | Phase flip |
| Bloch rotation | 180° about x | 180° about z |
| Coordinate map | (x,y,z) → (x,−y,−z) | (x,y,z) → (−x,−y,z) |
| Illustrative input | |0⟩ → |1⟩ | |+⟩ → |−⟩ |
| What visibly changes | Computational value | Relative phase |
7 · Verify the Diagrams in Qiskit
The following program constructs the X, Z, and H output states, checks all four gate identities, converts the X/Z states into Cartesian Bloch coordinates, labels the x-axis endpoints, and saves the four-panel X/Z figure. Install the visualisation dependencies with python -m pip install "qiskit[visualization]".
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from qiskit.circuit.library import HGate, XGate, ZGate
from qiskit.quantum_info import Statevector
from qiskit.visualization.bloch import Bloch
def bloch_vector(state):
alpha, beta = state.data
overlap = np.conj(alpha) * beta
return [
float(2 * np.real(overlap)),
float(2 * np.imag(overlap)),
float(abs(alpha) ** 2 - abs(beta) ** 2),
]
zero = Statevector.from_label("0")
one = zero.evolve(XGate())
plus = Statevector.from_label("+")
minus = plus.evolve(ZGate())
h_plus = zero.evolve(HGate())
h_minus = Statevector.from_label("1").evolve(HGate())
assert one.equiv(Statevector.from_label("1"))
assert minus.equiv(Statevector.from_label("-"))
assert h_plus.equiv(Statevector.from_label("+"))
assert h_minus.equiv(Statevector.from_label("-"))
states = [zero, one, plus, minus]
titles = [
r"Before X: $|0\rangle$",
r"After X: $|1\rangle$",
r"Before Z: $|+\rangle$",
r"After Z: $|-\rangle$",
]
colors = ["#1565C0", "#D32F2F", "#1565C0", "#D32F2F"]
fig = plt.figure(figsize=(14, 4.2), facecolor="white")
axes = [
fig.add_subplot(1, 4, index + 1, projection="3d")
for index in range(4)
]
for axis, state, title, color in zip(axes, states, titles, colors):
sphere = Bloch(fig=fig, axes=axis, font_size=13)
sphere.xlabel = [r"$|+\rangle$", r"$|-\rangle$"]
sphere.vector_color = [color]
sphere.add_vectors(bloch_vector(state))
sphere.render(title=title)
fig.suptitle(
"Bloch-sphere action of the Pauli X and Z gates",
fontsize=18,
fontweight="bold",
y=1.02,
)
fig.tight_layout(rect=(0, 0.07, 1, 0.95))
output = Path("bloch-sphere-x-z-gates.png")
fig.savefig(output, dpi=220, bbox_inches="tight", facecolor="white")
print(output)
Bloch renderer and explicitly labels |+⟩ and |−⟩ on the x-axis.
8 · What the Geometry Establishes
- Basis states are geometric poles.
|0⟩and|1⟩point along +z and −z. - Superposition includes phase.
|+⟩and|−⟩have identical computational-basis probabilities but occupy opposite points because their relative phases differ. - Single-qubit gates are rotations. X and Z are half-turns around their named axes, while H is a half-turn about the axis halfway between +x and +z.
- Hadamard changes basis. It maps
|0⟩and|1⟩to|+⟩and|−⟩, then reverses that mapping when applied again. - A statevector and its Bloch vector are two descriptions of the same one-qubit state. Qiskit provides a direct numerical check of the geometry.
Frequently Asked Questions
Can a Bloch sphere represent more than one qubit?
Not as a complete state description. A Bloch sphere exactly represents one qubit. Separate single-qubit spheres cannot display all correlations in an entangled multi-qubit state.
Why does Z appear to do nothing to |0⟩ and |1⟩?
Z leaves |0⟩ unchanged and maps |1⟩ to −|1⟩. For a basis state that minus sign is global phase, so the Bloch point and computational-basis measurement remain unchanged.
Are X and Z really rotations?
Yes. Ignoring physically irrelevant global phase, X is a π rotation about the x-axis and Z is a π rotation about the z-axis.
What does the Hadamard gate do on the Bloch sphere?
H swaps the x and z coordinates and reverses y, so it maps the computational z basis to the |+⟩/|−⟩ x basis. Because H is self-inverse, a second application maps those states back.
Why use |+⟩ to demonstrate the Z gate?
The Z gate changes relative phase, which is invisible when the state contains only one computational-basis component. The state |+⟩ contains both components, so Z moves it visibly across the equator to |−⟩.
Quantum Series 2026 · Diagrams rendered with Qiskit 2.5.2
✦ This article and its diagrams were prepared with assistance from OpenAI Codex. The equations, gate identities, Bloch coordinates, and Qiskit code were technically verified. ✦
Share this:
- Share on Facebook (Opens in new window) Facebook
- Email a link to a friend (Opens in new window) Email
- Share on LinkedIn (Opens in new window) LinkedIn
- Share on Telegram (Opens in new window) Telegram
- Share on WhatsApp (Opens in new window) WhatsApp
- More
- Share on Bluesky (Opens in new window) Bluesky
- Print (Opens in new window) Print
- Share on Threads (Opens in new window) Threads
- Share on Reddit (Opens in new window) Reddit
- Share on Tumblr (Opens in new window) Tumblr
- Share on Pinterest (Opens in new window) Pinterest
- Share on X (Opens in new window) X
Leave a comment