The enemy: the environment
A qubit is only useful while it holds a precise quantum state — a particular blend of |0> and |1> with a definite relative phase between them. The catch is that nothing in the universe is truly isolated. Stray magnetic fields, heat, vibrations, control wiring, even a passing cosmic ray — all of these can nudge your qubit. The moment the outside world learns something about your qubit's state, that state stops being your private quantum information and starts being correlated with the environment. That leakage of information is what we call decoherence.
It helps to be precise about what's lost. A qubit's state |psi> = alpha|0> + beta|1> carries two kinds of fragile information: the populations (roughly, how much |0> versus |1>) and the phase (the relative angle between the two parts, the thing that makes interference possible). Decoherence attacks both. When the environment 'measures' your qubit by accident, it does the same thing a deliberate measurement would: it collapses or scrambles the superposition, except now you don't even get to read the answer. The quantumness simply drains away into the surroundings.
T1 and T2
Engineers boil 'how long does the state survive?' down to two measured timescales: T1 and T2. They describe two different ways a qubit forgets. T1, the relaxation time, measures how long the qubit can stay in its excited |1> state before it dumps that energy into the environment and decays toward |0>. Think of it as a hot object cooling down: energy leaks out, and the population relaxes. If T1 is 100 microseconds, that's roughly the timescale over which a |1> slumps back to |0>.
T2, the dephasing time, measures something subtler: how long the *phase* relationship between |0> and |1> stays sharp. You can lose phase without losing any energy at all — random wobbles in the qubit's frequency gradually blur the relative angle until interference no longer works. Because any energy-losing T1 event also destroys phase, T2 can never exceed 2·T1; in practice T2 is often the tighter, more painful limit. These two numbers, together with how long your gates take, set the entire budget for what you can compute.
# A T1 experiment in spirit: excite the qubit, wait, then measure.
# Sweep the delay and watch the |1> population decay.
from qiskit import QuantumCircuit
def t1_probe(delay_dt):
qc = QuantumCircuit(1, 1)
qc.x(0) # prepare |1>
qc.delay(delay_dt, 0) # let the environment act
qc.measure(0, 0) # how often is it still |1>?
return qc
# Longer delays -> fewer |1> outcomes. Fit the decay -> estimate T1.
circuits = [t1_probe(d) for d in [0, 200, 400, 800, 1600]]Gate fidelity
Coherence sets how long you have; fidelity measures how cleanly each operation actually lands. Every gate is supposed to be a perfect, reversible (unitary) rotation of the state. Real hardware misses slightly — control pulses are a hair off, crosstalk leaks in, decoherence ticks away during the gate itself. Gate fidelity is the number, usually quoted as a percentage, that tells you how close the gate you actually applied is to the gate you intended. A two-qubit gate at 99.9% fidelity means roughly one part in a thousand goes wrong each time you use it.
Small per-gate errors compound fast. If a single gate is 99.9% faithful (0.1% error), a circuit of 1000 such gates has, very roughly, a coin-flip chance of being right overall — and useful algorithms want millions of gates. This is exactly why you can't just 'add more qubits' to get a useful machine. Two-qubit gates (like the CNOT) are almost always the weakest link; they're harder to control than single-qubit gates, so their fidelity is the headline number people fight to improve.
The clock you race
Put coherence and gate speed together and you get the single most important practical question in quantum hardware: how many gates can you run before the state decoheres? Roughly, that's your coherence time divided by your gate time. If T2 is 100 microseconds and a gate takes 100 nanoseconds, you get on the order of a thousand gate-times of runway before noise dominates — and real circuits spend much of that budget on idling and readout, not just useful operations.
T2_us = 100 # dephasing time, microseconds gate_ns = 100 # one gate, nanoseconds gate_us = gate_ns / 1000 rough_budget = T2_us / gate_us # ~ how many gate-times you get print(rough_budget) # -> 1000 (an optimistic ceiling)
This clock is exactly why near-term algorithms are built to be short and shallow. Hybrid methods like the VQE and QAOA deliberately keep circuits small, running them many times and letting a classical optimizer do the heavy lifting — precisely because a long, deep circuit would decohere before it finished. It's also the honest reason a textbook-scale Shor's algorithm run, which needs deep, fault-tolerant circuits, is still out of reach: not because the math is wrong, but because today's hardware can't stay coherent long enough.
Mitigation tricks
If you can't yet afford full error correction, you fight decoherence the engineer's way: a stack of partial tricks that each buy a little more coherent time or a little more fidelity. None of them make a qubit perfect; together they push the clock back far enough to get useful work done in the NISQ era.
- Isolate the qubit. Cool superconducting chips to near absolute zero, shield against stray magnetic fields, and filter the control wiring. Less coupling to the environment means slower information leakage and longer T1/T2.
- Dynamical decoupling. Insert carefully timed pulse sequences (a rapid run of flips) that effectively average out slow environmental noise — like a camera's image stabilization canceling a steady drift. This mainly extends T2 by fighting dephasing.
- Better materials and fabrication. Much decoherence comes from microscopic defects in the chip's materials and interfaces. Cleaner fabrication and better substrates have steadily pushed coherence times up year over year.
- Calibrate and characterize constantly. Frequently re-tune gates and measure error rates so control pulses stay accurate, keeping gate fidelity as high as the hardware allows.
- Error mitigation (not correction). Run a circuit many times and use clever post-processing — for example, extrapolating results toward the zero-noise limit — to estimate what the noiseless answer would have been. It reduces bias in your results; it does not give you a fault-tolerant qubit.