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 first provides the simplest basis-state flip. The Hadamard gate H then creates the |+⟩ and |−⟩ superpositions, and Z finally makes their relative-phase difference visible. 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 |
|+⟩ = (|0⟩ + |1⟩)/√2 and |−⟩ = (|0⟩ − |1⟩)/√2. Each state gives 0 and 1 with equal probability when measured in the computational basis. They are not classical 50/50 mixtures: the plus or minus sign records a coherent relative phase, placing the states at opposite ends of the Bloch sphere’s x-axis.

|+⟩ and |−⟩ states are expanded below the spheres as equal-amplitude superpositions of |0⟩ and |1⟩.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 Hadamard Gate: Create Superposition and Change Basis
After X establishes the two computational basis states, the Hadamard gate creates equal-amplitude coherent superpositions and connects the z-axis basis to the x-axis basis:
[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.

H|0⟩ = |+⟩ = (|0⟩ + |1⟩)/√2 and H|1⟩ = |−⟩ = (|0⟩ − |1⟩)/√2.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)
5 · 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.
6 · X, H, and Z Side by Side
| Property | X gate | H gate | Z gate |
|---|---|---|---|
| Main role | Bit flip | Create superposition / change basis | Phase flip |
| Bloch rotation | 180° about x | 180° about the axis halfway between +x and +z | 180° about z |
| Coordinate map | (x,y,z) → (x,−y,−z) | (x,y,z) → (z,−y,x) | (x,y,z) → (−x,−y,z) |
| Illustrative input | |0⟩ → |1⟩ | |0⟩ → |+⟩ | |+⟩ → |−⟩ |
| What becomes clear | The computational value changes | Basis states become coherent superpositions | Relative phase changes |
|+⟩ and |−⟩. Z then reveals why the relative sign between their amplitudes matters.
7 · Verify the X → H → Z Diagram in Qiskit
The following public-API Qiskit program verifies the three transformations, arranges the Bloch spheres in the teaching order X, H, Z, labels the x-axis endpoints, and writes the two superposition formulas below the 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 = zero.evolve(HGate())
minus = plus.evolve(ZGate())
assert one.equiv(Statevector.from_label("1"))
assert plus.equiv(Statevector.from_label("+"))
assert minus.equiv(Statevector.from_label("-"))
rows = [
("X gate", zero, one, r"Input: $|0\rangle$", r"Output: $|1\rangle$"),
("H gate", zero, plus, r"Input: $|0\rangle$", r"Output: $|+\rangle$"),
("Z gate", plus, minus, r"Input: $|+\rangle$", r"Output: $|-\rangle$"),
]
fig = plt.figure(figsize=(9.6, 12.6), facecolor="white")
for row_index, (gate, before, after, before_title, after_title) in enumerate(rows):
for column_index, (state, title, color) in enumerate((
(before, before_title, "#1565C0"),
(after, after_title, "#D32F2F"),
)):
axis = fig.add_subplot(
3, 2, row_index * 2 + column_index + 1, projection="3d"
)
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.text(
0.03, 0.805 - row_index * 0.31, gate,
rotation=90, va="center", ha="center", fontweight="bold",
)
fig.suptitle(
"Bloch-sphere gate order: X, then H, then Z",
fontsize=19, fontweight="bold", y=0.995,
)
fig.text(
0.5, 0.018,
r"$|+\rangle=(|0\rangle+|1\rangle)/\sqrt{2}$"
r" and $|-\rangle=(|0\rangle-|1\rangle)/\sqrt{2}$",
ha="center", fontsize=13,
)
fig.tight_layout(rect=(0.055, 0.05, 1, 0.975), h_pad=1.4)
output = Path("bloch-sphere-x-h-z-gates.png")
fig.savefig(output, dpi=220, bbox_inches="tight", facecolor="white")
print(output)
|0⟩ to |1⟩, H maps |0⟩ to |+⟩, and Z maps |+⟩ to |−⟩.
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 is a half-turn around x, H is a half-turn about the axis halfway between +x and +z, and Z is a half-turn around 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, H, and Z really rotations?
Yes. Ignoring physically irrelevant global phase, X is a π rotation about the x-axis, H is a π rotation about the axis halfway between +x and +z, 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