Can you build a quantum computer at home?
You can build a two-qubit simulator at home. Here is what it teaches about interference and entanglement, and what physical hardware would require.
Yes, if your goal is to write a small quantum circuit simulator on a laptop. A physical programmable quantum computer is a different project. It needs a controllable physical qubit, a way to prepare and measure it, and enough stability to repeat those operations. An ordinary laptop can reproduce the mathematics for small circuits.
What a qubit stores
A pure qubit has two complex amplitudes, usually written α for 0 and β for 1. The squared magnitudes sum to one. Measurement in the computational basis returns a classical 0 or 1. The relative phase between amplitudes can change the result of later gates, even when the current measurement probabilities look identical.
Two qubits have four amplitudes. A general pure state of n qubits has 2ⁿ amplitudes. At 16 bytes per complex double, a dense 30-qubit state alone takes 16 GiB, before overhead. That is a storage estimate for one simulation representation. Special-purpose methods can simulate some much larger circuits when their structure permits it.
Build a two-qubit Bell circuit
Start with |00⟩. Apply a Hadamard gate to the first qubit and a controlled-NOT using that qubit as the control. This prepares (|00⟩ + |11⟩)/√2. The following Python script uses only the standard library, treats the left-hand bit as the first qubit and prints theoretical probabilities. It also changes the relative phase and measures in a second basis.
from math import sqrt
# Basis order: 00, 01, 10, 11. Left bit is qubit 0.
def hadamard(state, bit):
result = state.copy()
stride = 1 << (1 - bit)
for i in range(4):
if i & stride:
continue
j = i | stride
result[i] = (state[i] + state[j]) / sqrt(2)
result[j] = (state[i] - state[j]) / sqrt(2)
return result
def cnot(state):
return [state[0], state[1], state[3], state[2]]
def probabilities(state):
return {f"{i:02b}": round(abs(a) ** 2, 6)
for i, a in enumerate(state)}
plus = cnot(hadamard([1, 0, 0, 0], 0))
minus = [plus[0], plus[1], plus[2], -plus[3]]
for label, state in [(, plus), (, minus)]:
print(label, , probabilities(state))
print(label, , probabilities(hadamard(hadamard(state, ), )))In the computational basis, the two Bell states in the script both yield 00 and 11 with equal probability. In the X basis, the plus state gives matching outcomes and the minus state gives opposite outcomes. A classical mixture of 00 and 11 has uniform joint outcomes when both are measured in X. A single set of matching Z-basis counts alone does not distinguish that mixture from entanglement.
Could you build a physical one?
Superconducting qubits are fabricated devices operated at millikelvin temperatures, with microwave control and sensitive readout. Other approaches use different equipment. Photonics can encode quantum information in light, but demonstrations involving individual photons or entangled pairs need suitable sources, detectors, stability and optical safety. A classroom experiment with polarising film and an ordinary light source can illustrate basis choice. It does not prepare, entangle or verify individual programmable qubits.
A sensible progression is to reproduce the script, then run the same small circuit using a local simulator library, and then use a cloud quantum processor if suitable access is available. Compare results across repeated shots and multiple measurement bases. Keep simulator output, hardware counts and any interpretation of noise clearly separate.