A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Simon's Algorithm

Graduate Depth 160 in the knowledge graph ☐ I know this ☆ Set as goal
1topic build on this
959prerequisites beneath it
See this on the map →
Bernstein-Vazirani AlgorithmQuantum Circuits→→Shor's Algorithm
Simon hidden-subgroup period-finding exponential-speedup

Core Idea

Simon's algorithm finds a hidden period string s for a function f:{0,1}^n -> {0,1}^n satisfying f(x) = f(y) if and only if x = y or x = y xor s. Classically, finding s requires O(2n/2) queries (birthday bound). Simon's algorithm uses O(n) quantum queries, each producing a random vector orthogonal to s, and classical Gaussian elimination recovers s — achieving an exponential speedup. It was the first algorithm to prove an exponential quantum advantage over all classical algorithms (including probabilistic ones) and directly inspired Shor's factoring algorithm.

Explainer

Simon's problem is the bridge between the toy oracle problems (Deutsch-Jozsa, Bernstein-Vazirani) and the practically significant quantum algorithms (Shor). You are given a black-box function f:{0,1}^n -> {0,1}^n with the promise that there exists a secret string s such that f(x) = f(y) if and only if x = y or x = y xor s. If s = 0...0, the function is one-to-one; otherwise, it is two-to-one with period s. Your task is to find s.

Classically, this is essentially a collision-finding problem. By the birthday paradox, you need O(2n/2) queries before you expect to find a collision f(x) = f(y) with x != y, from which s = x xor y. No classical algorithm — deterministic or randomized — can do substantially better. Simon's quantum algorithm uses only O(n) queries and O(n2) total time (including classical post-processing), achieving an exponential speedup.

The quantum subroutine works as follows. Prepare two n-qubit registers, both initialized to |0>^n. Apply Hadamard to the first register to create a uniform superposition. Apply the oracle to compute f into the second register, producing the state (1/sqrt(2n)) sum_x |x>|f(x)>. Now measure the second register, obtaining some value f(x_0). The first register collapses to (|x_0> + |x_0 xor s>)/sqrt(2) — a superposition of the two preimages. Apply Hadamard to the first register and measure, obtaining a random n-bit string y. The key constraint is that y dot s = 0 (mod 2): only strings orthogonal to s have nonzero amplitude after the Hadamard transform, because the two terms |x_0> and |x_0 xor s> interfere constructively only for such y.

Each run yields one random equation y dot s = 0 (mod 2). After O(n) runs, you have a system of linear equations over GF(2) that you solve by Gaussian elimination. With high probability, n-1 of these equations are linearly independent, uniquely determining s (the only nontrivial element of the null space of the constraint matrix). The total cost is O(n) quantum oracle queries plus O(n3) classical computation for Gaussian elimination — exponentially better than the classical 2n/2. Simon's algorithm established the template of quantum Fourier sampling that Shor later adapted: create a periodic quantum state, apply a Fourier transform to extract the period, and use classical post-processing to recover the answer.

Practice Questions 3 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Double Integrals: Definition and Setup → Iterated Integrals and Fubini's Theorem → Double Integrals over Rectangular Regions → Double Integrals over General Regions → Applications of Double Integrals: Area, Mass, and Moments → Triple Integrals in Cartesian Coordinates → Triple Integrals in Cylindrical and Spherical Coordinates → Change of Variables and the Jacobian Determinant → Applications of Triple Integrals: Volume and Mass → Vector Fields and Their Representations → Line Integrals of Vector Fields → Work and Circulation → Line Integrals of Scalar and Vector Functions → Fundamental Theorem for Line Integrals → Conservative Vector Fields → Conservative Vector Fields and Potential Functions → Curl and Divergence of Vector Fields → Curl and Divergence → Divergence Theorem → Electric Flux and Divergence Theorem → Gauss's Law: Integral Form and Meaning → Solving Problems with Gauss's Law → Conductors in Electrostatic Equilibrium → Capacitance and Capacitors → Dielectrics → Dielectric Constant and Relative Permittivity → Electric Field Inside Dielectric Materials → Dielectric Materials and Polarization → Dielectric Susceptibility and Permittivity → Energy Density in Electric Fields → Electric Current and Current Density → Electrical Resistance and Resistivity → Ohm's Law and Circuit Elements → Electromotive Force (EMF) and Batteries → Kirchhoff's Circuit Laws: Voltage and Current → DC Circuit Network Analysis Methods → Transient Response in RC Circuits → RC Circuits → LC and RLC Circuits → AC Circuits: Fundamentals → Impedance and Reactance → AC Power and Resonance → Electromagnetic Waves → Postulates of Special Relativity → Time Dilation → Length Contraction → Lorentz Transformation → Relativistic Velocity Addition → Relativistic Momentum and Energy → Mass-Energy Equivalence and E=mc² → Photons as Particles with Energy and Momentum → Planck-Einstein Relation: Energy and Frequency → Photoelectric Effect → The Photon: Light as Quanta → Compton Scattering → Wave-Particle Duality → de Broglie Wavelength → The Schrödinger Equation → State Vectors and Wavefunctions → Quantum Superposition → Quantum Entanglement → Bell Theorem and Bell Inequalities → Postulates of Quantum Mechanics → Observables and Quantum Operators → Commutators and Commutation Relations → Quantum Angular Momentum → Quantum Mechanical Treatment of Hydrogen → Solving the Schrödinger Equation for Hydrogen Atom → Quantum Numbers → Spin-1/2 Systems → Pauli Matrices → Quantum Gates → Quantum Circuits → Deutsch-Jozsa Algorithm → Bernstein-Vazirani Algorithm → Simon's Algorithm

Longest path: 161 steps · 959 total prerequisite topics

Prerequisites (2)

Leads To (1)