Site Tools


three-qubits

Table of Contents

Three qubits

Three-qubit system is a quantum system of three qubits. The Hilbert space is , meaning eight complex amplitudes to describe it, not three.

A single qubit needs two amplitudes; two qubits need four; three qubits need eight. The state space doubles with every qubit you add. That exponential growth is what makes quantum computers interesting.

A general three-qubit state is a superposition over the eight computational basis states, with the normalization condition saying the total probability must be 1:

Product states

The simplest three-qubit states are product states: states where all three qubits are independent of each other. If qubit 2 is in state , qubit 1 in , and qubit 0 in , the combined state is just their tensor product:

The shorthand means , with qubit 2 on the left (MSB) and qubit 0 on the right (LSB). There are infinitely many product states. The ones worth naming come from picking a standard single-qubit basis and using it for all three qubits.

Z-basis (Computational basis)

Pick and for each qubit and you get eight product states that look exactly like a classical 3-bit register. Each qubit is definitively 0 or 1 with no superposition. These eight states span all of , so every three-qubit state can be written in terms of them.

State Description
All qubits in . Default initial state of every qubit register.
Qubits 2 and 1 are , qubit 0 is .
Qubits 2 and 0 are , qubit 1 is .
Qubit 2 is , qubits 1 and 0 are .
Qubit 2 is , qubits 1 and 0 are .
Qubits 2 and 0 are , qubit 1 is .
Qubits 2 and 1 are , qubit 0 is .
All qubits in .

X-basis (Hadamard basis)

Pick and for each qubit instead. These states look “spread out” in the computational basis, because mixes both. In the X basis they are perfectly sharp. You get from the computational basis to this one by applying a Hadamard to every qubit.

State Expansion in computational basis Description
All qubits in . Uniform superposition over all eight computational basis states; .
Qubits 2 and 1 in , qubit 0 in .
Qubits 2 and 0 in , qubit 1 in .
Qubit 2 in , qubits 1 and 0 in .
Qubit 2 in , qubits 1 and 0 in .
Qubits 2 and 0 in , qubit 1 in .
Qubits 2 and 1 in , qubit 0 in .
All qubits in .

Y-basis (Phase basis)

Pick and for each qubit. These are the eigenstates of the Y gate. The coefficients are complex, so the Y-basis states are the first ones on this page with imaginary entries. You get from the computational basis to the Y basis by applying to every qubit ( first, then ).

State Expansion in computational basis Description
All qubits in .
Qubits 2 and 1 in , qubit 0 in .
Qubits 2 and 0 in , qubit 1 in .
Qubit 2 in , qubits 1 and 0 in .
Qubit 2 in , qubits 1 and 0 in .
Qubits 2 and 0 in , qubit 1 in .
Qubits 2 and 1 in , qubit 0 in .
All qubits in .

Entangled states

Some three-qubit states cannot be written as for any choice of single-qubit states. These are entangled states. Three-qubit entanglement is richer than two-qubit entanglement: there are two genuinely distinct classes of tripartite entanglement, and no local operations can convert a state from one class to the other.

GHZ states

The GHZ states (Greenberger-Horne-Zeilinger) are the canonical maximally entangled three-qubit states. The two principal ones are equal superpositions of and with a relative phase:

State Definition Notes
Prepared from by on qubit 0, then CX(0,1), then CX(0,2).
Apply to any qubit of . The minus sign is invisible in Z-basis measurements.

Measuring any one qubit of in the Z basis gives 0 or 1 with equal probability and instantly fixes the outcomes of the other two: result 0 collapses the state to , result 1 to . All three qubits are always found in the same state. This all-or-nothing correlation disappears entirely if any single qubit is lost: tracing out one qubit of a GHZ state leaves the remaining two in a completely mixed state with no entanglement.

W states

The W states are the other canonical class of tripartite entanglement. Unlike GHZ states, W states are robust to qubit loss: tracing out any one qubit leaves the remaining two in a partially entangled state rather than a product state.

State Definition Notes
Exactly one qubit is , all three positions equally weighted.
Exactly two qubits are ; the bitwise complement of .

Measuring qubit 0 of in the Z basis: result 1 with probability , leaving qubits 2 and 1 in . Result 0 with probability , leaving qubits 2 and 1 in , a Bell state. That residual entanglement after partial measurement is the signature of W-class entanglement and has no GHZ-class analogue.

Gates

Three-qubit gates are unitary matrices acting on . The two most common ones are CCX (Toffoli) and CSWAP (Fredkin). Row and column ordering follows the computational basis: .

CCX flips qubit 0 when both qubits 2 and 1 are (controls on qubits 2 and 1; Qiskit: ccx(2, 1, 0)). It is the three-qubit generalization of CX and is classically universal: any classical Boolean circuit can be simulated by a circuit of Toffoli gates alone. CSWAP swaps qubits 1 and 0 when qubit 2 is (control on qubit 2; Qiskit: cswap(2, 1, 0)). For a full list see Three-qubit gates.

Qiskit

# Requires: pip install qiskit qiskit-aer
# Run: Python ghz.py
# Prepares |GHZ+⟩ and samples 1000 shots; expect roughly equal counts of '000' and '111'.
from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator

qc = QuantumCircuit(3, 3)
qc.h(0)       # Hadamard on qubit 0 → superposition
qc.cx(0, 1)   # CX: control=qubit 0, target=qubit 1 → entangle
qc.cx(0, 2)   # CX: control=qubit 0, target=qubit 2 → entangle
qc.measure([0, 1, 2], [0, 1, 2])

counts = AerSimulator().run(qc, shots=1000).result().get_counts()
print(counts)  # {'000': ~500, '111': ~500}
three-qubits.md · Last modified: