Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

QCQI - Chapter 7: Shor’s Algorithm & Phase Estimation

Learning Objectives

  • QPE circuit and accuracy.

  • Shor: factoring \to order finding \to continued fractions.

  • Modular exponentiation resources and IPEA.

QPE in One Slide

Control U2kU^{2^k} from +|+\rangle qubits \Rightarrow inverse QFT reveals bits of ϕ\phi.

Eureka! Global eigenphase \to measurable bit string.

From Order to Factors

If rr even and ar/2≢1 (mod N)a^{r/2}\not\equiv -1 \ (\mathrm{mod}\ N) then gcd(ar/2±1,N)\gcd(a^{r/2}\pm1,N) are nontrivial.

Eureka! Quantum finds rr, classical extracts the factors.

Modular Exponentiation (Sketch)

Repeated squaring: multiply by constants ck=a2kmodNc_k=a^{2^k}\bmod N controlled on exponent bits.

Ancillas uncompute to keep the map reversible.

Schematic: QPE (concept)

Hands-on Notebook

Companion notebook (multi-backend): L09_QCQI_Ch07_Shor_Algorithm_and_Phase_Estimation

Set backend in the first cell to cirq, pennylane, braket, pyquil, or qiskit.

Mini-Lab

  • QPE for U=diag(1,e2πiϕ)U=\mathrm{diag}(1,e^{2\pi i\phi}).

  • Iterative vs. standard QPE.

  • Small-NN order-finding and factor recovery.