Follow your curiosity

What discovery has been shared with you?

Start with one fact. Explore it, go deeper, then follow whichever branch catches your imagination.

Choose subjects for a surprise

Exploring any topic

Begin your discovery

Your next discovery is one click away.

Choose one or more subjects above, or leave Any Topic selected and let curiosity decide.

Mathematics

Quantum Algorithms and Shor's Algorithm

Quick fact

Shor's algorithm can factor an integer in polynomial time, whereas the best-known classical algorithms take sub-exponential time — for a 2048-bit number, this is the difference between seconds and billions of years.

Why this is interesting

You've probably heard that quantum computers can break encryption, but how can a machine that operates on probabilities instead of bits achieve such a feat?

Read the full explanation

Understanding Quantum Algorithms and Shor's Algorithm

Think of a classical computer as a library where each book is a bit — it can be open or closed, 0 or 1. A quantum computer, on the other hand, uses qubits that can be in a superposition — a blend of 0 and 1 simultaneously. This is like a book that is both open and closed at the same time, until you look at it. A quantum algorithm is a sequence of operations that manipulates these superposed qubits, making all possible states coexist and interfere. The magic comes from constructive and destructive interference: by carefully designing steps, you can amplify the probability of the correct answer and cancel out others. Shor's algorithm is a masterpiece of this: it turns the hard problem of factoring into a period-finding problem, which can be solved efficiently by exploiting the quantum Fourier transform — a technique that extracts structural patterns from a superposition of numbers.

A deeper explanation

At its core, Shor's algorithm relies on the quantum Fourier transform (QFT) to find the period of a function. The algorithm chooses a random integer a and computes a^x mod N for a sequence of x's. The function is periodic: a^(x+r) = a^x mod N, and the period r leads to a factor of N. Quantum computers run this computation on a superposition of all x's at once, then apply the QFT to make the period 'pop out' with high probability. The QFT is exponentially faster than its classical counterpart because it manipulates the phase of qubits, creating interference patterns that encode the period in a measurement. This capability is not just a speedup; it's a fundamentally different way of processing information — a classical computer can only follow one path, while a quantum computer explores many paths in parallel. However, this parallelism is not free: extracting the answer requires clever interference to make the correct answer more likely than errors, and qubits are notoriously fragile, which is why practical quantum computing is so challenging. Shor's algorithm demonstrated that quantum computation could solve certain problems exponentially faster, directly threatening the security of RSA cryptography, which relies on the difficulty of factoring large numbers.

Keep FACTREE close

Internet access is required. Updates arrive when you reopen or reload the app. You may need to sign in again in the installed app.