Table of Contents
Two qubits
Two-qubit system is a quantum system of two qubits. The Hilbert space is , meaning four complex amplitudes to describe it, not two.
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 two-qubit state is a superposition over the four computational basis states, with the normalization condition saying the total probability must be 1:
Product states
The simplest two-qubit states are product states: states where the two qubits are independent of each other. If qubit 1 is in and qubit 0 is in , the combined state is just their tensor product:
The shorthand means . There are infinitely many product states. Any pair of single-qubit states gives you one. The ones worth naming come from picking a standard single-qubit basis and using it for both qubits.
Z-basis (Computational basis)
Pick and for each qubit and you get four product states that look exactly like a classical 2-bit register. Each qubit is definitively 0 or 1 with no superposition. These four states span all of , so every two-qubit state can be written in terms of them.
| State | Description |
|---|---|
| Both qubits are . Default initial state of every qubit register. | |
| Qubit 1 is , qubit 0 is . | |
| Qubit 1 is , qubit 0 is . | |
| Both qubits are . |
X-basis (Hadamard basis)
Pick and for each qubit instead. These states look “spread out” in the computational basis, because mixes both. But in the X basis they are perfectly sharp, just like is sharp in the Z basis. You get from the computational basis to this one by applying a Hadamard to every qubit.
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 |
|---|---|---|
| Both qubits in . | ||
| Qubit 1 in , qubit 0 in . | ||
| Qubit 1 in , qubit 0 in . | ||
| Both qubits in . |
Entangled states
Some two-qubit states cannot be written as for any choice of single-qubit states. These are entangled states. The give-away is that the four amplitudes cannot be factored into two pairs: entanglement means .
What does that mean physically? Measuring one qubit of an entangled state instantly determines the outcome of measuring the other, even though neither qubit has a definite value before measurement. The correlations are stronger than anything a classical system can produce.
Bell states
The four Bell states are the canonical maximally entangled two-qubit states. Each is an equal superposition of two computational basis states that are not factorable. Together they form a complete orthonormal basis for .
Any single-qubit Pauli gate on one qubit of a Bell state maps it to another Bell state: switches , toggles the sign, does both.
Partial measurement
Measuring one qubit of an entangled state collapses the joint state. Take and measure qubit 0 in the Z basis:
- result 0 with probability : the state collapses to . Qubit 1 is now certain to be .
- result 1 with probability : the state collapses to . Qubit 1 is now certain to be .
Before the measurement neither qubit has a definite value. After a measurement on qubit 0, qubit 1's outcome is fixed without touching it. The same pattern holds for any maximally entangled state and any measurement basis.
Gates
Two-qubit gates are unitary matrices acting on . The three most common ones are CX (CX), CZ, and SWAP. Row and column ordering follows the computational basis: .
CX flips qubit 0 when qubit 1 is (qubit 1 is the control; Qiskit: cx(1, 0)). CZ applies a phase when both qubits are ; it is symmetric so either qubit can serve as the control. SWAP exchanges the two qubits entirely. For a full list see Two-qubit gates.
Qiskit
# Requires: pip install qiskit qiskit-aer # Run: Python Bell.py # Prepares |Φ+⟩ and samples 1000 shots; expect roughly equal counts of '00' and '11'. from qiskit import QuantumCircuit from qiskit_aer import AerSimulator qc = QuantumCircuit(2, 2) qc.h(0) # Hadamard on qubit 0 → superposition qc.cx(0, 1) # CX: control=qubit 0, target=qubit 1 → entanglement qc.measure([0, 1], [0, 1]) counts = AerSimulator().run(qc, shots=1000).result().get_counts() print(counts) # {'00': ~500, '11': ~500}
