Key Moments

Shor's Algorithm for Quantum Computing - Computerphile

ComputerphileComputerphile
Education4 min read39 min video
Jul 9, 2026|10,130 views|924|100
Save to Pod

Want to know something specific about what's covered?

We've already dissected every moment. Ask and we will deliver (with timestamps).

TL;DR

Shor's algorithm can break current encryption by turning factorization into a period-finding problem, but practical quantum computers capable of this are 20-30 years away and face immense engineering challenges.

Key Insights

1

Shor's algorithm reframes integer factorization into a period-finding problem, which quantum computers are exceptionally good at solving.

2

The RSA encryption system's security relies on the difficulty of factoring large semi-prime numbers (N = P * Q) into their prime components (P and Q).

3

Physicists and engineers use Fourier transforms to break down complex patterns into constituent sine and cosine waves, a concept analogous to finding the period in Shor's algorithm.

4

Quantum computing utilizes superposition and wave interference; controlled phase manipulation of quantum states (qubits) allows for constructive and destructive interference, mimicking classical wave behavior.

5

Trapped ion quantum computers use microwave pulses to control the superposition of qubit states (representing 0 and 1) and lasers to measure probabilities, with each measurement collapsing the quantum state.

6

While Shor's algorithm can factor small numbers like 15 easily, factoring a 2000-bit RSA number would require a quantum computer with hundreds or thousands of stable qubits, which are currently 20-30 years from realization due to noise and error correction challenges.

Factoring large numbers underpins modern encryption

The security of widely used public-key cryptography systems like RSA hinges on the mathematical difficulty of factoring large semi-prime numbers. An RSA public key contains a large number N, which is the product of two secret prime numbers, P and Q. If an adversary can determine P and Q from N, they can derive the private key and compromise the entire system, enabling them to forge digital signatures and impersonate secure websites. Factoring these large numbers (e.g., 2000-bit numbers) using classical computers is computationally infeasible, potentially taking billions of years. This is where Shor's algorithm offers a theoretical solution.

Shor's algorithm transforms factorization into period-finding

Instead of directly tackling integer factorization, Shor's algorithm cleverly reframes the problem. It seeks to find the period 'r' of a specific function: A^x mod N, where A is a randomly chosen number and N is the number to be factored. This function will eventually repeat, returning to 1. For example, with N=15 and A=2, the sequence is 2^0=1, 2^1=2, 2^2=4, 2^3=8, 2^4=16 mod 15 = 1. The period (r) here is 4. Once this period 'r' is found, classical mathematics can efficiently derive P and Q. For instance, calculating the greatest common divisor (GCD) of (A^(r/2) - 1) and N often yields one of the prime factors. This pivot from brute-force factorization to period-finding is crucial, as quantum computers excel at the latter.

Fourier transforms reveal hidden periodicity

The concept of periodicity is deeply ingrained in physics and engineering, particularly through Fourier transforms. A Fourier transform decomposes a complex signal or pattern into a sum of simple sine and cosine waves of different frequencies and amplitudes. Physicists use this to understand phenomena ranging from crystal lattice structures to cosmic microwave background radiation. In Shor's algorithm, the quantum computer essentially performs a quantum Fourier transform to identify the fundamental frequency (and thus the period) of the modular exponentiation function. This process involves analyzing the 'waves' that constitute the function's pattern, pinpointing the dominant frequency that reveals the repeating cycle required for factorization.

Quantum mechanics enables superposition and interference

Quantum computers harness quantum phenomena like superposition and interference. A qubit, unlike a classical bit (0 or 1), can exist in a superposition of both states simultaneously. This is not science fiction or parallel universes, but rather a description of probabilities, akin to how waves combine. Quantum computing leverages the ability to manipulate the 'phase' of these quantum states. By precisely controlling how qubits interfere (constructively or destructively), quantum algorithms can amplify correct answers and cancel out incorrect ones. This wave-like behavior is fundamental to how quantum computers operate and is analogous to how Fourier analysis breaks down signals.

Trapped ions implement quantum computation

One proposed method for building quantum computers is using trapped ions. An ion is held in place using electromagnetic fields in an ultra-high vacuum. Specific energy states of the ion are used to represent qubit states (0 and 1). Microwave pulses are applied to control the superposition and probabilities of the ion being in the 0 or 1 state. Lasers are then used to measure which state the ion collapses into. This measurement process forces the qubit out of superposition, yielding a probabilistic outcome. Because quantum computations are statistical, the entire process of preparing the qubit, performing the operation, and measuring must be repeated many times to obtain reliable results and map the probabilities accurately.

The measurement problem and practical challenges

A significant aspect of quantum mechanics is the 'measurement problem': why and how does measuring a quantum system cause its wave function to collapse? While the mathematical framework describes this process (often involving squaring the length of a 'phasor' arrow representing a quantum state to get probability), the fundamental 'why' remains a subject of study. Furthermore, quantum computers are extremely sensitive to environmental noise, which can disrupt the delicate phase relationships and cause decoherence, leading to errors. Even factoring a small number like 15 requires careful error correction. Building a quantum computer large

Common Questions

Shor's algorithm is a quantum computing algorithm designed to efficiently solve the integer factorization problem. It's important because it can theoretically break widely used cryptographic systems like RSA, which rely on the difficulty of factoring large numbers.

Topics

Mentioned in this video

More from Computerphile

View all 89 summaries

Ask anything from this episode.

Save it, chat with it, and connect it to Claude or ChatGPT. Get cited answers from the actual content — and build your own knowledge base of every podcast and video you care about.

Get Started Free