Quantum Computing Basics

Quantum computing isn’t “trying all answers at once.” It’s interference engineering — the art of making wrong answers cancel and right answers amplify.

Mental Model: The Wave Pool

Consider a wave pool shaped like a maze, with waves released from the entrance. The waves explore every path simultaneously — they’re waves, that’s what waves do.

At dead ends, reflected waves interfere destructively — they cancel out. Along the correct path, waves interfere constructively — they build up. After the right amount of time, the strongest wave is at the exit.

A quantum computer works the same way. Qubits in superposition explore a computational space. Quantum gates engineer interference so that incorrect answers cancel and the correct answer accumulates probability amplitude.

Why “Trying All Answers” Is Wrong

The popular description — “a quantum computer tries all N answers simultaneously” — misses the point entirely. If superposition alone solved problems, it would suffice to put a qubit in superposition and measure. But measurement returns a random answer.

The hard part isn’t exploring the space. It’s engineering the interference pattern so that measurement yields the correct answer with high probability. Not every problem admits such a pattern. This is why quantum computers don’t speed up everything.

Qubits: Superposition of 0 and 1

A classical bit is 0 or 1. A qubit can be in a superposition: α|0⟩ + β|1⟩, where α and β are complex amplitudes satisfying |α|² + |β|² = 1.

This is not “0 and 1 at the same time.” It’s a state that, when measured, collapses to 0 with probability |α|² or 1 with probability |β|². Before measurement, the qubit is in a definite quantum state — just not a definite classical state.

Two qubits can represent four computational basis states simultaneously. Three qubits, eight. N qubits, 2ⁿ. But only one answer is extracted per measurement — the interference must concentrate probability on the right one.

Physical Qubit Implementations

Qubits are realized in multiple physical systems, each with trade-offs:

  • Superconducting circuits (Google, IBM): fast gates, short coherence times, manufactured with existing chip fab techniques
  • Trapped ions (IonQ, Quantinuum): long coherence times, slower gates, high-fidelity operations
  • Photonic (Xanadu, PsiQuantum): naturally resistant to decoherence, difficult to make photons interact
  • Topological (Microsoft): qubits encoded in exotic quasiparticles, theoretically robust to errors, experimentally unproven

No approach has decisively won. This is the “VHS vs Betamax” era of quantum hardware.

Quantum Gates

Classical logic gates (AND, OR, NOT) transform bits. Quantum gates transform qubits. The key difference: all quantum gates (except measurement) are reversible. Given the output, the input can always be reconstructed.

Fundamental single-qubit gates:

  • X gate: flips |0⟩ to |1⟩ and vice versa (quantum NOT)
  • H gate (Hadamard): puts |0⟩ into equal superposition of |0⟩ and |1⟩ — the “start exploring” gate
  • Z gate: flips the phase of |1⟩ — invisible to measurement but crucial for interference

Multi-qubit gates:

  • CNOT: flips target qubit if control qubit is |1⟩ — creates entanglement
  • Toffoli: universal for classical reversible computing

Why Reversibility Matters

Quantum mechanics is unitary — time evolution preserves information. This forces all quantum gates to be reversible (unitary matrices). Any computation can always be “un-computed.”

This has a practical consequence: quantum algorithms must carefully uncompute temporary results to avoid entangling garbage bits with the answer. Classical algorithms discard intermediate values freely. Quantum algorithms must clean up after themselves — like a pure function that produces no side effects.

Entanglement as a Resource

Entanglement (from the earlier lesson) isn’t just a curiosity — it’s the computational resource that separates quantum computing from classical probabilistic computing.

A quantum computer without entanglement can be efficiently simulated on a classical computer. It’s just a fancy random number generator. Entanglement between qubits creates correlations that have no classical description, and these correlations enable interference patterns across the full 2ⁿ-dimensional state space.

Entanglement is to quantum computing what concurrency is to parallel computing — the thing that makes it genuinely more powerful, not just differently organized.

Quantum Algorithms: Not Universal Speedup

Quantum computers don’t speed up everything. They excel at problems with exploitable mathematical structure:

  • Grover’s search: searching an unsorted database of N items in roughly √N steps instead of N. Quadratic speedup — significant but not exponential.
  • Shor’s factoring: factoring an N-digit number in time polynomial in N, instead of sub-exponential. This breaks RSA encryption.
  • Quantum simulation: simulating quantum systems efficiently — the original motivation (Feynman, 1982). Classical computers struggle because the state space grows exponentially; quantum computers match it naturally.

Many everyday algorithms (sorting, graph traversal, string matching) get no meaningful quantum speedup. Quantum computing is a specialized tool, not a universal accelerator.

The Interference Pattern Requirement

Why does Grover’s get only a quadratic speedup while Shor’s gets exponential? The difference lies in the problem’s mathematical structure.

Shor’s algorithm exploits the periodicity of modular exponentiation — a structure that quantum Fourier transforms extract efficiently. The interference pattern is clean and concentrates probability sharply on the answer.

Grover’s algorithm works on unstructured search — no exploitable pattern beyond “the answer satisfies this predicate.” The best interference pattern for unstructured problems gives √N, and this is provably optimal. No quantum algorithm can do better on unstructured search.

Structure determines speedup. No structure, modest speedup. Rich structure, dramatic speedup.

A Software Analogy: MapReduce Is Not “Running All Maps at Once”

MapReduce — a framework for processing large datasets across many machines — doesn’t speed up computation by “running everything simultaneously.” It structures computation for parallelism — breaking problems into independent units, processing them in parallel, and combining results.

Quantum computing structures computation for interference — encoding the problem into amplitudes, applying gates that create constructive interference on correct answers, and measuring.

Both are computational paradigms that require restructuring a problem to exploit a physical resource (parallelism or interference). Both are useless if the problem doesn’t fit the paradigm. And both are frequently oversimplified.

Key Takeaways

This lesson establishes:

  • Why quantum computing is interference engineering, not parallel search
  • What a qubit is and why measurement extracts only one answer
  • The distinction between quadratic and exponential quantum speedups and what determines which one applies
  • Why entanglement is the essential resource that makes quantum computing non-trivially powerful

Next: Quantum Field Theory Preview

← Quantum Mechanics Quantum Computing Basics