Educational · Original content

How quantum computers work

A visual tour of qubits, gates, algorithms, and hardware — honest about NISQ limits, quadratic speedups, and what still needs fault tolerance.

Honesty first: NISQ devices are not fault-tolerant. Grover is quadratic, not exponential. Shor against RSA-2048 needs large-scale FTQC. Annealers are not a cryptanalytic CRQC threat. No “quantum AI magic.”
Chapter 01

What is a quantum computer?

A machine that stores and processes information in quantum states — not a faster classical chip, and not a universal accelerator for every problem.

Chapter mindmap · 本章心智圖

A classical computer encodes bits that are definitively 0 or 1. Logic gates flip and combine those bits with deterministic (or well-characterized probabilistic) rules. Scaling means more transistors, more memory, better algorithms.

A quantum computer encodes qubits whose state can be a superposition of 0 and 1, and whose qubits can be entangled. Computation is a carefully choreographed sequence of unitary operations (gates), followed by measurement that collapses amplitudes into classical outcomes.

The point is not that every step is “both 0 and 1 at once equals infinite parallelism.” Interference — constructive for right answers, destructive for wrong ones — is the real engine. Without a structure that creates useful interference, a quantum device is just an expensive random-bit generator.

Classical

Bits & Boolean logic

State is a string of 0/1. Copying is free. Error correction is mature. Best for the vast majority of software.

Quantum

Amplitudes & unitaries

State is a vector in ℂ²ⁿ. No-cloning forbids naive backup. Noise is the central engineering battle.

Aspect Classical Quantum (gate model)
Information unit Bit ∈ {0,1} Qubit ∈ ℂ² (up to global phase)
n-unit state space 2ⁿ discrete configs 2ⁿ complex amplitudes (normalized)
Typical ops AND, OR, NOT, RAM… Unitary gates + measurement
Error reality today ~10⁻²⁰+ logical FIT with ECC NISQ: noisy physical qubits; FTQC still ahead
Key takeaway
Quantum computing is a new computational model with a narrow set of structured advantages — not a drop-in replacement for CPUs/GPUs.
Chapter 02

What problems can quantum help with?

Useful quantum advantage is about problem structure: periodicity, oracles with amplitude amplification, sparse Hamiltonians, and certain optimization landscapes — not “hard ⇒ quantum.”

Chapter mindmap · 本章心智圖

Classically hard problems are not automatically good quantum targets. Many NP-hard tasks remain hard on quantum machines under standard complexity beliefs. The interesting cases are problems where quantum linear algebra, interference, or quantum simulation map cleanly onto the question.

Promising / structured fits

  • Quantum simulation — chemistry, materials, lattice models where the system is itself quantum.
  • Period finding / Shor-type — factoring & discrete log, once fault-tolerant scale exists.
  • Unstructured search (Grover) — quadratic speedup; huge constants and oracle costs still matter.
  • Some linear-algebra primitives — under strong input/output assumptions (QRAM, sparse access).
  • Hybrid variational heuristics — VQE/QAOA as research tools; advantage not guaranteed.

Not magic — common myths

  • Not “exponential speedup for all optimization.”
  • Not a replacement for deep learning GPUs by default.
  • Not instant crypto-breaking on today’s NISQ or annealers.
  • Not guaranteed advantage for NP-complete problems.
Complexity honesty
Grover gives O(√N) queries vs O(N) classical for unstructured search — quadratic, not exponential. Shor’s algorithm is exponential-vs-subexp in a cryptographically decisive way, but requires fault-tolerant resources far beyond current devices for RSA-2048.
Chapter 03

Qubits, superposition & measurement

A qubit’s pure state is a point on the Bloch sphere. Superposition is a direction; measurement picks a pole with probabilities set by amplitudes.

Chapter mindmap · 本章心智圖

Write a single-qubit pure state as |ψ⟩ = α|0⟩ + β|1⟩ with |α|² + |β|² = 1. In polar form, α = cos(θ/2), β = e^{iφ} sin(θ/2). The angles (θ, φ) are coordinates on the Bloch sphere: north pole |0⟩, south pole |1⟩, equator equal superpositions with a relative phase.

Measuring in the computational basis yields 0 with probability |α|² and 1 with |β|², and the state collapses to the observed basis vector. Phase between amplitudes is invisible to that single measurement — but it becomes crucial when gates create interference across paths.

Interactive Bloch sphere

Drag to rotate the view · presets set the state · Measure collapses toward a pole

|ψ⟩ = …

Superposition is not “the qubit is randomly 0 or 1 before you look.” Before measurement there is a definite state vector; randomness appears in the Born-rule sampling of that vector. After measurement, phases and coherences that encoded the prior superposition are gone for that copy.

Chapter 04

Quantum gates

Gates are unitary matrices: reversible, norm-preserving maps on the statevector. Common single-qubit gates generate rotations on the Bloch sphere; multi-qubit gates create entanglement.

Chapter mindmap · 本章心智圖

X (NOT) flips |0⟩↔|1⟩. Z leaves |0⟩ alone and maps |1⟩→−|1⟩ (phase flip). H (Hadamard) maps |0⟩→|+⟩ and |1⟩→|−⟩ — the usual way to create equal superposition from a computational basis state.

Any single-qubit unitary is a rotation of the Bloch vector. Circuits compose gates; global phases don’t affect measurement probabilities, but relative phases do.

Gate playground

Apply gates in sequence · bars show measurement probabilities · circuit sketch updates live

|ψ⟩ = |0⟩
Chapter 05

Circuits & entanglement

A quantum circuit is a timeline of gates on wires (qubits). Entanglement is when the joint state cannot be written as a product of single-qubit states — Bell pairs are the canonical example.

Chapter mindmap · 本章心智圖

To build a Bell state |Φ⁺⟩ = (|00⟩+|11⟩)/√2: start from |00⟩, apply H on qubit A, then CNOT with A as control and B as target. Measuring A alone looks random; measuring B afterward is perfectly correlated.

Entanglement does not allow faster-than-light signaling. Local measurement outcomes are random; only when compared (classically) do correlations appear. That is why teleportation and device-independent protocols still need classical communication channels.

Bell-pair visualizer

Watch correlated collapse · switch Bell states with the chips

Chapter 06

Core algorithms: Grover, Shor & VQE

Three different ideas: amplitude amplification (Grover), period finding via QFT (Shor), and hybrid variational optimization (VQE).

Chapter mindmap · 本章心智圖

Grover search — quadratic amplitude amplification

Given a black-box function that marks one (or a few) items in an unstructured list of N, Grover’s algorithm rotates the state in the plane spanned by the uniform superposition and the marked subspace. Each oracle + diffusion iteration boosts the marked amplitude. Optimal iterations ≈ π/4 √N.

Claim check
Speedup is quadratic (√N vs N), not exponential. If the “oracle” is expensive to implement, or if classical structure exists, the practical win can vanish. Still foundational for quantum query complexity.
Amplitude amplification sketch

Step 0

Yellow dashed line = mean amplitude · ★ = marked item · too many iterations overshoots

Shor’s algorithm — intuition

Reduce factoring to period finding

From a random a coprime to N, find the order r of a mod N (smallest r with aʳ ≡ 1 mod N). Classical post-processing turns a suitable r into factors.

Quantum period finding

Prepare a superposition of exponents, compute aˣ mod N into an ancilla, then apply the quantum Fourier transform to extract the period from phase kickback / peak interference.

Resource reality

RSA-2048 class factoring needs fault-tolerant logical qubits and deep circuits — far beyond NISQ. “Shor exists” ≠ “cryptography is broken today.”

VQE — hybrid variational eigensolver

Estimate the ground-state energy of a Hamiltonian by preparing a parameterized ansatz on a QPU, measuring Pauli expectations, and letting a classical optimizer update the parameters. Fits NISQ-era exploration of chemistry/materials — but ansatz choice, barren plateaus, and noise mean VQE is not automatic quantum advantage.

No quantum AI magic
Variational quantum circuits are research tools. They do not imply that quantum computers will replace classical ML. Treat claims of universal quantum ML supremacy with extreme skepticism unless accompanied by clear problem structure and resource estimates.
Chapter 07

Quantum annealing vs gate model

Two architectural families: universal digital gate machines, and analog annealers aimed at optimization landscapes.

Chapter mindmap · 本章心智圖
Gate model

Gate-model (digital) QC

  • Universal for BQP when fault-tolerant
  • Algorithms as explicit circuits (Shor, Grover, QPE…)
  • Path to FTQC via error-correcting codes
  • Today: NISQ devices with limited depth
Annealing

Quantum annealing / adiabatic

  • Specialize in Ising / QUBO-type optimization
  • Evolve under a time-dependent Hamiltonian
  • Not a drop-in for Shor-style cryptanalysis
  • Performance vs classical heuristics is problem-dependent
CRQC threat model
Cryptographically relevant quantum computers (CRQC) in the Shor sense are large fault-tolerant gate-model machines. Annealers — even with thousands of physical qubits — are not the RSA-breaking threat. Post-quantum crypto migration is driven by gate-model FTQC timelines, harvest-now-decrypt-later, and standardization — not by annealing progress alone.
Chapter 08

How to physically build qubits

Many modalities, one goal: long coherence, high-fidelity gates, scalable connectivity, and a credible path to error correction. This is an overview — not a fabrication manual.

Chapter mindmap · 本章心智圖

Every platform trades coherence, gate speed, connectivity, operating temperature, and manufacturability. Roadmaps converge on needing logical qubits: encode many noisy physical qubits into fewer protected logical ones.

Superconducting

Josephson junctions as nonlinear oscillators; fast gates; cryogenic dilution refrigerators; used by many leading gate-model labs.

~mKfast gatestransmon

Trapped ions

Atomic ions in EM traps; laser/microwave gates; excellent coherence & fidelity; gates often slower; shuttling or photonic links for scale.

high fidelitylasershuttling

Neutral atoms

Rydberg arrays in optical tweezers; flexible geometries; mid-circuit measurement improving; strong for analog & digital flavors.

Rydbergtweezersreconfigurable

Photonics

Dual-rail / GKP / cluster-state approaches; room-temp transmission; probabilistic entangling gates or continuous-variable codes.

opticalGKPcluster

Spin qubits / quantum dots

Electron or hole spins in semiconductors; CMOS-adjacent fab hopes; dense integration challenges around control wiring.

Si/GeCMOS pathdense

NV centers & defects

Spins in diamond (or SiC); optical interface; strong for sensing; computing scale still research-heavy.

diamondsensingoptical

Topological (aspirational)

Non-Abelian anyons / Majorana-based proposals aim for intrinsic protection; experimental status remains contested and research-grade.

Majoranaresearchprotection?

NMR / early liquid-state

Historic demonstration platform; ensemble qubits; not a scalable FTQC path but pedagogically important.

historicensemblepedagogy

Hybrid & modular

Microwave-optical transducers, ion–photon interfaces, cryogenic CMOS control — systems engineering between modalities.

transducerscryo-CMOSmodular

Silicon photonics + donors

Donor spins (e.g. P in Si) and photonic integration explore fab-friendly stacks; still deep in research scaling.

P:Siphotonicsfab-friendly?
NISQ ≠ fault-tolerant
Physical qubit count is not logical qubit count. A device with 100 noisy qubits is not “100 qubits of Shor capacity.” Until error correction crosses threshold with enough headroom, treat algorithmic cryptanalysis claims as resource-estimate discussions — not product features.
Chapter 09

Learning-path mindmaps

See how the eight chapters lock together: qubits → gates → circuits → algorithms, with hardware feeding every layer, annealing as a parallel optimization path, and error correction bridging noisy devices to fault-tolerant algorithms. Crypto honesty sits between “why it matters” and what Shor actually requires.

Hover a node to highlight its links. Click a chapter node to jump there. Each earlier chapter also has a smaller local mindmap under its lead.

Whole-site interrelation · 全書關聯
Reading tip
If a box feels abstract, open the 300-term glossary and search the English or 中文 keyword — explanations are written in plain language on purpose.
Chapter 10

Glossary · 300 terms

Plain-spoken definitions for quantum computing — English and 繁體中文. Search either language; tap a card to expand aliases and jump to a related chapter.