Why quantum computing
Why quantum computing: the basic reasons engineers care — new computational power from quantum mechanics (superposition, entanglement), faster algorithms for some problems, and natural simulation of quantum systems.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Quantum computing gives engineers new ways to solve certain problems more efficiently than classical computers — for example, searching large databases faster, factoring integers (important for cryptography) and simulating quantum materials and molecules. An engineer working on cryptography, materials, drug-design, or quantum hardware needs to know when a quantum solution is fundamentally faster or when classical methods remain adequate.
Key ideas
Start from first principles: a classical digital bit stores 0 or 1. A quantum computer uses qubits (see the topic Qubits) which can be in a superposition of 0 and 1. I will not re-teach the full mathematics of superposition and entanglement here (see those topics), but I use the standard consequences below.
Definition — Qubit advantage (informal): A computational advantage arises when a quantum algorithm solves a problem using asymptotically fewer resources (time, circuit depth, memory) than any known classical algorithm, under standard complexity assumptions.
Definition — Quantum parallelism (informal): Because a qubit can be in a superposition of basis states, a quantum circuit can transform many basis states' amplitudes in one unitary operation. This is not the same as obtaining all answers at once (measurement gives limited information) but it enables interference-based algorithms.
Definition — Interference: The ability of amplitude components to add or cancel (constructive or destructive interference) under unitary evolution. Algorithms exploit interference to make the correct answers have high probability on measurement.
Exact statement — Grover's search theorem (informal exact form used in exams): For an unstructured search among N items with M marked items, Grover's algorithm finds a marked item with high probability after approximately (π/4) · sqrt(N/M) iterations of a specific oracle-and-diffusion unitary pair, assuming perfect unitary gates. For the special case M = 1 this reduces to approximately (π/4) · sqrt(N) iterations.
- Assumptions: access to an oracle that flips phase of marked states; ideal (noiseless) qubits; M known or approximable. In exams you should show the state evolution as rotation in a two-dimensional subspace spanned by equal-superposition of marked and unmarked states. Also note: this quadratic speedup is optimal in the oracle (black-box) model; no algorithm can use asymptotically fewer queries.
Exact statement — Shor's result (informal): Integer factoring and discrete-logarithm problems are in the class BQP (bounded-error quantum polynomial time); that is, there exists a polynomial-time quantum algorithm (Shor's algorithm) that factors integers with high probability. Assumptions: access to quantum modular exponentiation and quantum Fourier transform, and ideal error-free gates (error correction needed in practice).
Definition — Complexity classes (precise exam-style definitions):
- BPP: The class of decision problems solvable by a probabilistic (randomized) classical Turing machine in time polynomial in input size, with error probability ≤ 1/3 for all instances. The constant 1/3 can be replaced by any fixed ε with 0 < ε < 1/2, because amplification reduces error.
- BQP: The class of decision problems solvable by a polynomial-time quantum Turing machine (or uniform family of polynomial-size quantum circuits) with error probability ≤ 1/3 for all instances.
- Important exam note: You should state the error bound (1/3) and mention amplification (repeat or amplitude amplification) as a justification why constant error probability is acceptable.
Physical motivation — Feynman's observation: Simulating quantum systems with classical computers appears to require resources exponential in the system size because the state of n quantum two-level systems lives in a Hilbert space of dimension 2^n. Hence a quantum device that itself uses quantum degrees of freedom can simulate such systems efficiently (this is the foundational motivation for quantum computing and quantum simulation).
Practical caveats (engineer viewpoint): Real quantum hardware has noise and decoherence. To achieve the theoretical advantages we need error rates below thresholds and quantum error correction (see Quantum error correction). Therefore theoretical speedup ≠ immediate practical speedup; hardware scale, gate fidelities, and algorithm overheads matter.
Diagram to draw (if asked in an exam): Draw two boxes side-by-side and label them "Classical" and "Quantum". Under Classical write: "State = 1 classical configuration at a time; memory growth ~ poly(n) for classical data." Under Quantum write: "State = superposition over 2^n basis states; Hilbert-space dimension = 2^n; allows interference." Below, draw an arrow from "Quantum" to three application boxes: "Search (Grover) — quadratic speedup", "Factoring (Shor) — polynomial-time", "Simulation — efficient for quantum systems". Label arrows with brief complexity formulas (see Formulas section).
Formulas
Hilbert-space dimension = 2^n — n is number of qubits (dimension is unitless). Applies to isolated n-qubit pure states describing amplitude vectors.
Number of complex amplitudes = 2^n — n is number of qubits (unitless). Each amplitude is a complex number (unitless). Applies to state-vector simulation memory estimates.
Memory (bytes) ≈ 2^n × 16 — 16 bytes per complex amplitude (two 8-byte doubles) is a common engineering estimate; n is qubits. Units: bytes. Applies when storing full state as double-precision complex numbers in classical simulation.
Grover iterations ≈ (π/4) × sqrt(N / M) — N = number of database items (unitless), M = number of marked items (unitless). Applies to Grover's algorithm under ideal (noiseless) conditions.
Classical factoring time (NFS, asymptotic, informal) ≈ exp(((64/9)^{1/3} + o(1)) (ln N)^{1/3} (ln ln N)^{2/3}) — N is the integer being factored; this is the sub-exponential L_N[1/3, (64/9)^{1/3}] complexity of the number field sieve. Units: unitless time-scaling; applies to best-known classical factoring algorithms asymptotically.
Shor runtime ≈ polynomial in log(N) — log(N) is number of bits in the integer N; runtime is O((log N)^k) for some constant k depending on implementation. Units: unitless time-scaling. Applies to Shor's quantum factoring algorithm in the idealized, error-free model.
Worked examples
Example 1 — Derive Grover iteration count for single marked item (M = 1). Question (model): Show why Grover's algorithm needs about (π/4)√N iterations to find one marked item among N. Model answer (step-by-step):
- Let |s> = (1/√N) Σ_{x=0}^{N-1} |x> be the equal superposition. Let |w> be the marked basis state. Define the two-dimensional subspace spanned by |w> and |w_⊥>, where |w_⊥> is the normalized projection of |s> orthogonal to |w>.
- Express |s> in this subspace: |s> = sin(θ) |w> + cos(θ) |w_⊥>, where sin(θ) = 1/√N and cos(θ) = √(1-1/N). For large N, θ ≈ 1/√N.
- Grover's iteration G (oracle phase flip followed by diffusion) acts as a rotation by angle 2θ in this two-dimensional space: G = R(2θ).
- Starting from |s>, after t iterations the state is rotated to angle (2t+1)θ from the |w_⊥> axis; probability to measure |w> is sin^2((2t+1)θ).
- To maximize success we want (2t+1)θ ≈ π/2 ⇒ t ≈ (π/(4θ)) − 1/2.
- Substitute θ ≈ 1/√N to get t ≈ (π/4)√N − 1/2; for large N the −1/2 is negligible. Therefore t ≈ (π/4)√N iterations. Final boxed answer: Approximately (π/4)√N iterations for a single marked item.
Example 2 — Memory needed to simulate n qubits classically; compute for n = 50. Question: How much classical memory is needed to store the full state vector of 50 qubits in double-precision complex numbers? Show steps and final answer. Model answer (step-by-step):
- Number of complex amplitudes = 2^n = 2^50 = 1,125,899,906,842,624 ≈ 1.1259 × 10^15.
- Each complex amplitude stored as two 8-byte doubles uses 16 bytes.
- Memory in bytes = 2^50 × 16 ≈ 1.1259 × 10^15 × 16 = 1.800 × 10^16 bytes.
- Convert to petabytes (1 PB = 10^15 bytes): ≈ 18.0 PB. Final boxed answer: About 1.8 × 10^16 bytes ≈ 18 PB to store 50 qubits' state vector in double precision. (Practical note: this is why classical simulation becomes infeasible at modest n; quantum devices natively hold the state in n qubits.)
Example 3 — Short model answer: Why quantum computers can break RSA but not necessarily all cryptography. Question: Explain, at a high level, how Shor's algorithm changes RSA security and what practical caveats remain. Model answer (key points):
- Shor's algorithm uses quantum period-finding (via quantum Fourier transform) to factor integers in polynomial time, placing factoring in BQP. If large, error-corrected quantum computers with enough logical qubits exist, RSA keys of current sizes would become breakable in reasonable time.
- Caveats: (1) Building sufficiently many high-fidelity logical qubits requires physical qubits, error correction and overheads; (2) some cryptosystems (symmetric-key with doubled key size, and post-quantum public-key schemes) resist known quantum algorithms; (3) theoretical polynomial-time does not directly tell the exact wall-clock run time for realistic hardware. Final boxed point: Shor's algorithm threatens RSA in principle; in practice, hardware and error-correction are major barriers.
Common mistakes
- Saying Grover gives exponential speedup — it gives only quadratic speedup for unstructured search.
- Quoting exact constants for Shor's running time without clarifying they depend on implementation; say "polynomial in log N" rather than an unverified exponent unless asked to derive.
- Mixing units when computing memory (forgetting 16 bytes per complex amplitude if using two doubles) or using 2^n in base-10 rather than power-of-two values.
- Forgetting the assumptions of algorithms (ideal/noiseless gates, availability of oracles) when claiming speedups.
- Assuming quantum computers efficiently solve NP-complete problems; no such algorithms are known, and Grover's quadratic speedup does not make NP-complete problems polynomial-time.
For your exam
Likely question types:
- Definitions and short notes: Define BQP, BPP, explain quantum parallelism, state Grover's algorithm result. Full-marks answer: precise definitions with error bounds and brief explanation of importance.
- Derivations: Derive Grover iteration count or show rotation picture in 2-D subspace. Full-marks: correct subspace selection, derivation of θ, rotation angle, and final iteration formula.
- Numericals: Compute classical memory to store n-qubit state or compare asymptotic runtimes. Full-marks: show steps, unit conversions, and final numeric answer with units.
- Diagrams: Draw classical vs quantum comparison and the two-dimensional Grover rotation. Full-marks: clear labels for basis states, rotation angle, and annotated arrows.
- Long answers: Explain why quantum advantage exists for some problems but not others and discuss practical barriers. Full-marks: mention algorithmic complexity, hardware noise, error correction needs, and application examples.
Quick check
- What is the Hilbert-space dimension of n qubits?
- How many Grover iterations are needed for a single marked item among N?
- Roughly how many bytes to store a 50-qubit state vector in double-precision complex numbers? Answers: 1) 2^n. 2) Approximately (π/4)√N iterations. 3) About 1.8 × 10^16 bytes (≈ 18 PB).
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?