Reflection: Algorithmic Toolkit
You have now written, simulated, and verified a rich collection of quantum algorithms. Before moving on, it is worth stepping back to see the full landscape — what each algorithm achieves, why it works, and how the pieces fit together.
The algorithms at a glance
Deutsch and Deutsch–Jozsa
The simplest demonstrations of quantum advantage. A single query to the Hadamard-prepared oracle decides whether a Boolean function is constant or balanced, whereas the best classical algorithm requires queries in the worst case. The key mechanism is phase kickback: the oracle flips the phase of input states where , and the final Hadamard layer turns global phase patterns into measurement outcomes.
Bernstein–Vazirani
A refinement of Deutsch–Jozsa that extracts a hidden -bit string in a single oracle call (the classical lower bound is queries). The oracle implements , and the same phase-kickback-plus-Hadamard structure reads directly from the output register.
Simon's algorithm
The first algorithm to demonstrate an exponential separation for a structured problem. Given a promise that for a hidden period , Simon's algorithm finds using quantum queries and classical post-processing (solving a linear system over ). This is the conceptual ancestor of Shor's algorithm.
Quantum Fourier Transform
The QFT on qubits is the unitary
It is implemented in gates (Hadamards plus controlled phase rotations), compared with the gates a naive classical FFT would need if encoded gate-by-gate. The QFT underpins nearly every super-polynomial quantum speedup.
Quantum Phase Estimation
QPE uses the QFT in reverse to extract the eigenphase of a unitary with precision (for ancilla qubits) using controlled- applications in total (ancilla qubit drives , requiring applications of controlled-, and ). Classically, finding to the same precision requires exponentially many samples. QPE is the kernel inside both Shor's algorithm and quantum chemistry simulations (HHL, VQE pre-processing).
Grover's search
Grover's algorithm finds a marked item among candidates in oracle calls, compared with classically. Each iteration applies the oracle (phase-flip the marked state) followed by the diffuser (reflection about the equal superposition ). After approximately iterations the amplitude on the marked item is close to 1. For (two qubits) a single iteration achieves certainty.
Period finding and Shor's algorithm
Shor's algorithm factors an integer in polynomial time by reducing factoring to order finding: given coprime to , find the smallest such that . Order finding is solved by QPE applied to the modular-exponentiation unitary . The QFT reveals the period , from which the factors follow via classical number theory.
Unifying themes
Complexity gains in one table
| Algorithm | Problem | Classical queries | Quantum queries | |---|---|---|---| | Deutsch–Jozsa | Constant vs. balanced | | | | Bernstein–Vazirani | Find hidden string | | | | Simon | Find hidden period (mod 2) | | | | Grover | Unstructured search | | | | Shor (order finding) | Find multiplicative order | | |
All separation results assume the oracle (black-box) model; Shor's gain is in the circuit model against the best known classical algorithm (GNFS).
Gate-set hierarchy
The circuits you built all fit inside the Clifford + universal gate set. Hadamards and CNOT gates are Clifford operations; the controlled phase rotations in the QFT — and the gate — are the non-Clifford gates that push beyond stabilizer circuits and unlock the full computational power.
What comes next
The advanced track builds on each of these algorithms:
- Error correction makes QPE and Grover fault-tolerant.
- Variational algorithms (VQE, QAOA) use the same circuit patterns in a hybrid classical-quantum optimization loop, targeting near-term devices.
- Hamiltonian simulation uses Trotterized product formulas as building blocks, with QPE providing the energy readout.
- Quantum machine learning leverages amplitude encoding and the HHL linear-systems algorithm, both of which rely on the QFT.
Every algorithm you have written is a working sub-routine of something larger. The toolkit is ready.
Sign in on the full site to ask questions and join the discussion.