■ Change #86 · wiki.edited
Shor's algorithm and the hidden subgroup problem: Normalize Markdown to canonical form
body
## From factoring to period findingFactoring an $n$-bit odd integer $N$ with at least two distinct prime factors reduces, with a randomised classical argument, to **order finding**: pick a random $a$ coprime to $N$ and find the smallest $r>0$ with $a^r\equiv 1 \pmod N$. If $r$ is even and $a^{r/2}\not\equiv -1 \pmod N$, then $\gcd(a^{r/2}-1,N)$ is a nontrivial factor, which happens for at least half of the choices of $a$.The quantum part finds $r$. A register is put in a uniform superposition over exponents $x$, the value $a^x \bmod N$ is computed into a second register, and the quantum Fourier transform (QFT) is applied to the first register. Measuring gives a value close to a multiple of $2^m/r$, and the continued-fraction expansion recovers $r$ with good probability. The cost is dominated by modular exponentiation: $O(n^3)$ gates with schoolbook arithmetic and $O(n^2\log n\log\log n)$ with fast multiplication. Discrete logarithms are a two-dimensional period-finding problem and fall to the same method, including in elliptic-curve groups.## The hidden subgroup problem− A function $f$ on a group $G$ *hides* a subgroup $H$ if it is constant on the cosets of $H$ and takes different values on different cosets; the task is to find $H$. For abelian groups this is solved efficiently by Fourier sampling (Kitaev's abelian stabilizer algorithm, 1995), with Simon's problem, factoring and discrete logarithms as special cases. Ettinger, Høyer and Knill (2004) showed that polynomially many queries determine $H$ for every finite group, but extracting $H$ from those queries may take exponential time.+ A function $f$ on a group $G$ _hides_ a subgroup $H$ if it is constant on the cosets of $H$ and takes different values on different cosets; the task is to find $H$. For abelian groups this is solved efficiently by Fourier sampling (Kitaev's abelian stabilizer algorithm, 1995), with Simon's problem, factoring and discrete logarithms as special cases. Ettinger, Høyer and Knill (2004) showed that polynomially many queries determine $H$ for every finite group, but extracting $H$ from those queries may take exponential time.The open cases are non-abelian. The **dihedral** group is linked to lattices: Regev (2002) showed that an algorithm for the dihedral coset problem that tolerates faulty samples gives a quantum algorithm for the unique shortest vector problem, and Kuperberg (2003) gave a subexponential algorithm with running time $2^{O(\sqrt{\log N})}$. The **symmetric** group would give graph isomorphism, but Moore, Russell and Schulman (2005) showed that strong Fourier sampling on coset states cannot distinguish the relevant subgroups, and Babai's quasipolynomial classical algorithm (2015) reduced the stakes. Childs and van Dam (2010) review the area.## Resource estimatesExperiments so far have factored only small numbers, often with circuits simplified using knowledge of the answer (Smolin, Smith and Vargo, 2013). For RSA-2048, Gidney and Ekerå (2019) estimated 20 million noisy qubits for 8 hours; Gidney (2025) lowered this to under a million qubits for under a week, assuming a 0.1% gate error rate, a nearest-neighbour square grid, a 1 microsecond surface-code cycle and a 10 microsecond reaction time. Preprints in 2026 go further by replacing the surface code with high-rate codes: Webster et al. (the "Pinnacle" architecture, qLDPC codes) estimate fewer than 100,000 physical qubits under the same error rate and timing, and Cain et al. argue that as few as 10,000 reconfigurable neutral-atom qubits could run Shor's algorithm at cryptographic scale, with RSA-2048 taking one to two orders of magnitude longer than a few-day P-256 discrete logarithm on 26,000 qubits. Regev (2023) gave a different factoring circuit with $\tilde O(n^{3/2})$ gates run about $\sqrt n$ times, under a number-theoretic heuristic. All of these are paper estimates for machines that do not exist.## LimitsShor's algorithm does not break symmetric ciphers or hash functions (Grover search gives only a quadratic speedup against them) and gives no known speedup for NP-complete problems. Lattice-based schemes such as ML-KEM (FIPS 203, 2024) were standardised because no efficient quantum algorithm for their underlying problems is known; the dihedral hidden subgroup problem is the main known quantum route towards them.
explainer.student
**Reduction to period finding.** To factor an odd number $N$, pick a random $a$ that shares no factor with $N$ and look at the sequence $a^1, a^2, a^3,\dots$ taken modulo $N$ (the remainder after dividing by $N$). It repeats with some period $r$, called the order of $a$. If $r$ is even, then $a^{r/2}-1$ usually shares a factor with $N$, and the greatest common divisor, computed with Euclid's algorithm in first-year time, gives a factor. So factoring reduces to finding $r$.**The quantum step.** A register of qubits is put in a superposition of all exponents $x$ at once, and $a^x \bmod N$ is computed into a second register. The first register then holds a periodic pattern with period $r$. The **quantum Fourier transform** works like a discrete Fourier transform from signals courses: it turns a signal with period $r$ into sharp peaks at multiples of $1/r$. Measuring gives one of those peaks, and a short classical calculation (continued fractions) recovers $r$. The cost is dominated by the modular arithmetic, roughly $n^3$ gates for an $n$-bit number, versus the best classical method, the number field sieve, whose time grows faster than any polynomial in $n$.− **Hidden subgroups.** Factoring, discrete logarithms and Simon's problem are all instances of the *hidden subgroup problem*: a function is constant on the cosets of an unknown subgroup and the task is to find it. For commutative (abelian) groups, quantum computers solve it efficiently. For the dihedral group (symmetries of a polygon) only a subexponential algorithm is known, and a fast one would threaten lattice-based encryption.+ **Hidden subgroups.** Factoring, discrete logarithms and Simon's problem are all instances of the _hidden subgroup problem_: a function is constant on the cosets of an unknown subgroup and the task is to find it. For commutative (abelian) groups, quantum computers solve it efficiently. For the dihedral group (symmetries of a polygon) only a subexponential algorithm is known, and a fast one would threaten lattice-based encryption.**How big a machine?** Running Shor on a 2048-bit RSA key needs error-corrected logical qubits. Estimates: 20 million noisy qubits for 8 hours (2019), under a million for under a week (2025), and preprints in 2026 claiming around 100,000 or fewer with newer error-correcting codes. None of these machines exists yet.
hash 9f80fb2f93ddc03fe1db4b3d40f91d2a7aa917573b56cd4137d53b701f6980d6
previous b13b9b01c48c799be6825bf19c6749e3a5cb375af79c0b798875e5f38c9ddb7a