Peter ShorPhoto: International Centre for Theoretical Physics, CC BY 3.0, via Wikimedia CommonsAudiobook by Fruggia.com · Nov 2026
Peter Shor
Quantum factoring algorithm
- 8 chapters
- 39m
- Physics & Cosmology
- Free · no sign-up
The book explains Shor's algorithm step by step, covering quantum threat assessments and post-quantum cryptography solutions. It details the Shor code for quantum error correction and the threshold theorem that enables fault-tolerant quantum computing. Each chapter builds on the previous one to show how quantum mechanics can be harnessed for computational power.
Anyone interested in the future of cybersecurity, quantum physics, or computational mathematics will find this essential reading.
Listen
-
Read this chapter
Overview
Shor’s algorithm is a quantum method for finding the prime factors of a number, created in 1994 by American mathematician Peter Shor. It's one of the rare quantum algorithms believed to outperform classical computers significantly, with evidence of superpolynomial speedup. The algorithm can factor an integer n on a quantum computer in polynomial time, specifically using a number of quantum gates proportional to the square of the logarithm of n, with some additional logarithmic factors. This places the problem of factoring within the complexity class BQP. Shor also developed related algorithms for the discrete logarithm and period-finding problems, all of which stem from the hidden subgroup problem. While it shows great promise, running such an algorithm may require quantum computers with millions of qubits due to error correction needs.
Feasibility and implications
If a quantum computer with enough qubits could avoid problems like quantum noise and decoherence, then Shor’s algorithm could break important encryption methods, including the RSA scheme, the finite-field Diffie–Hellman key exchange, and the elliptic-curve Diffie–Hellman key exchange. RSA relies on the difficulty of factoring large integers, which classical computers cannot do quickly enough. But Shor’s algorithm shows that a sufficiently powerful quantum computer could factor those numbers efficiently. That’s why researchers have worked so hard to build quantum computers and develop new algorithms. It also led to the creation of post-quantum cryptography, or PQC, which aims to secure data against attacks from quantum machines.
Physical implementation
As of 2026, quantum computers still struggle with high error rates and a limited number of qubits, making Shor’s algorithm only successful in partial attempts, and only with small numbers. In 2001, IBM demonstrated the algorithm by factoring 15 into 3×5 using seven qubits in an NMR system. Later that year, two other teams independently used photonic qubits to factor 15. In 2012, solid-state qubits were used to factor 15 again, and shortly after, 21 was factored. Then in 2016, 15 was factored once more using trapped-ion qubits. However, none of these experiments truly met the requirements of Shor’s algorithm—they relied on prior knowledge of the answer or oversimplified the process to the point of being equivalent to random guessing.
Algorithm
The challenge at hand is to find the factors of an odd composite number N. Shor’s algorithm tackles this in two steps. The first part is a classical process that reduces the factoring problem to another problem called order-finding, a method similar to techniques used in algorithms like the quadratic sieve. The second part uses a quantum algorithm to solve that order-finding problem.
Classical reduction
If we can efficiently factor a number N into two parts greater than one, we've solved the factoring problem, since any composite factors can be broken down until only primes remain. A basic check uses Euclid's algorithm to compute the greatest common divisor, quickly telling us if N is even—2 being a trivial factor—or whether it's a prime power, which also has efficient classical solutions. If those simple cases don't work, we pick a random number a between 2 and N−1 and compute gcd(a,N). If it's not 1, we've found a nontrivial factor. Otherwise, we look for the multiplicative order r of a modulo N, which the quantum part of Shor's algorithm finds. Once r is known, if it's even, we compute gcd(N, ar/2 − 1) or gcd(N, ar/2 + 1), and if either result is nontrivial, we've factored N. If not, we restart with a new a. This process succeeds with high probability after only a few attempts.
Quantum order-finding subroutine
The quantum subroutine in Shor’s algorithm aims to find the order *r* of a number *a* modulo *N*, which is the smallest *r* such that a^r ≡ 1 (mod N). The process uses a quantum circuit with two registers: the second holds *n* qubits, where *n* is the smallest integer such that N ≤ 2^n, meaning n = ⌈log₂N⌉. The first register needs *2n* qubits for sufficient accuracy. The algorithm applies quantum phase estimation using a unitary matrix *U* that represents multiplication by *a* modulo *N*, starting with the state |0⟩⊗²ⁿ ⊗ |1⟩. Because |1⟩ can be expressed as a sum of eigenvectors, this step outputs a random value of the form jr/2²ⁿ for some *j*. Finally, the classical continued fractions algorithm processes these results to recover the period *r*, a method later proposed by Alexei Kitaev.
Quantum phase estimation
The quantum phase estimation algorithm takes a unitary operator U and one of its eigenstates |ψ⟩, where U|ψ⟩ equals e2πiθ|ψ⟩, and transforms an input state |0⟩|ψ⟩ into an output state close to |ϕ⟩|ψ⟩. Here, |ϕ⟩ is a superposition of integers near 22nθ. For quantum order-finding, the unitary U acts on states |k⟩ such that U|k⟩ = |ak mod N⟩ for 0 ≤ k < N and U|k⟩ = |k⟩ for N ≤ k < 2n. The circuit requires implementing gates U2j through modular exponentiation, which is the slowest step. Because Ur = I, the eigenvalues are r-th roots of unity ωrk = e2πik/r, and each has an associated eigenvector |ψj⟩ = r−1/2∑k=0r−1ωr−kj|ak⟩. When applied to |0⟩⊗2n|1⟩, the algorithm produces a state where measuring the first register gives an integer approximation to 22nj/r with high probability.
Continued-fraction algorithm to retrieve the period
We use the continued-fraction algorithm to find integers b and c giving the best fraction approximation for the circuit result, where b and c are less than N and coprime. The number of qubits in the first register, 2n, ensures bc = jr given the best approximation from the superposition was measured. However, even though b and c are coprime, j and r might not be, meaning some factors may have been lost. To fix this, we run the quantum order-finding subroutine multiple times to get several fraction approximations b₁/c₁, b₂/c₂, ..., bₛ/cₛ. Each denominator ck will have different factors removed because the circuit likely measured different values of j. We then take the least common multiple of all denominators lcm(c₁, c₂, ..., cₛ), which equals the order r with high probability. In practice, one run is often enough with advanced post-processing.
-
Read this chapter
Overview
Peter Williston Shor is an American theoretical computer scientist born on August 14, 1959. He is known for his work in quantum computation and is especially recognized for inventing Shor's algorithm. This quantum method can factor numbers much more quickly than the fastest algorithm currently used on regular computers. Since 2003, he has been teaching applied mathematics at MIT.
Early life and education
Peter Shor was born in New York City on August 14, 1959, to Joan Bopp Shor and S. W. Williston Shor. He spent his early years in Washington, D.C., and later lived in Mill Valley, California. While attending Tamalpais High School, he placed third in the 1977 USA Mathematical Olympiad. The following year, after graduating, he earned a silver medal at the International Math Olympiad in Yugoslavia. In 1981, Shor received a B.S. in mathematics from the California Institute of Technology, where he had been a Putnam Fellow in 1978. He then went on to study applied mathematics at MIT, earning his Ph.D. in 1985 under the supervision of F. Thomson Leighton. His doctoral thesis focused on probabilistic analysis of bin-packing algorithms.
Career
After earning his PhD from MIT, Peter Shor worked as a postdoctoral researcher at UC Berkeley before joining Bell Labs in New Jersey, where he created Shor’s algorithm. Inspired by Simon's problem, he first solved the discrete logarithm problem and then, in the same week, the factoring problem, noting their connection to the HSP. His work earned him the Nevanlinna Prize in 1998, the Gödel Prize in 1999, and a MacArthur Fellowship in 1999. He returned to MIT in 2003 as a professor and has received numerous honors, including election to the National Academy of Sciences in 2002 and the National Academy of Engineering in 2020. In 2020, he was interviewed by Nature, saying post-quantum cryptography is key to addressing quantum threats. In 2023, he shared the Breakthrough Prize in Fundamental Physics for his foundational contributions to quantum information.
-
Read this chapter
Overview
In quantum computing, a quantum algorithm is a step-by-step procedure designed to run on a quantum computer, using features like superposition and entanglement that classical computers can't efficiently mimic. While all classical algorithms work on quantum machines, the term is saved for those that rely on uniquely quantum properties. Although quantum computers won’t solve problems that are impossible for classical ones, they might outperform them on certain tasks. The most famous examples are Shor’s algorithm, which could factor large numbers exponentially faster than the best-known classical method, and Grover’s algorithm, which speeds up unstructured searches quadratically compared to classical approaches.
Overview
Quantum algorithms are most often presented using the circuit model of quantum computation, where a sequence of operations called quantum gates works on input qubits and concludes with a measurement. Each gate affects only a limited number of qubits, and the entire process is visualized as a quantum circuit. These algorithms can also be expressed through alternative frameworks, such as the Hamiltonian oracle model. Techniques frequently used in their design involve phase estimation, the quantum Fourier transform, quantum walks, and amplitude amplification. They are often classified according to the types of problems they address, including areas like algebraic computations.
Algorithms based on the quantum Fourier transform
The quantum Fourier transform serves as the quantum version of the classical discrete Fourier transform and is central to several quantum algorithms. One notable example is the Hadamard transform, which functions as a quantum Fourier transform over an n-dimensional vector space defined over the field F2. This quantum variant offers significant computational advantages, enabling efficient execution within quantum systems.
Deutsch–Jozsa algorithm
The Deutsch–Jozsa algorithm addresses a problem where a classical computer must check many inputs to figure out if a function is always the same result—or balanced between zeros and ones. A quantum computer can solve this with just one check. Still, if you allow classical computers to make a few mistakes, they can also guess the answer quickly, so there's no real advantage in speed. This algorithm helps determine whether a function is constant or balanced by evaluating it only once.
Simon's algorithm
Simon's algorithm stands as a breakthrough in computational theory, solving a specific black-box problem with a speedup that grows exponentially faster than anything possible with classical methods—including those using randomness to help find answers. This achievement was so significant that it directly inspired Peter Shor’s later work, which led to his famous algorithm for factoring large numbers. The impact of Simon's approach showed just how much more powerful quantum computing could be compared to traditional computing methods we consider efficient. It opened the door for further developments in quantum algorithms and demonstrated the potential for exponential gains in solving certain types of problems.
Quantum phase estimation algorithm
The quantum phase estimation algorithm helps find the eigenphase of a unitary gate's eigenvector. You need a quantum state that's proportional to the eigenvector and access to the gate itself. This method is often used inside other algorithms as a building block, which makes it a key tool in quantum computing.
Shor's algorithm
Shor's algorithm is a quantum method that solves two major mathematical problems: the discrete logarithm problem and integer factorization. It does so in what's called polynomial time, which means it's much faster than the best classical algorithms we know, which take super-polynomial time. These problems—whether they belong to the class P or are NP-complete—is still unknown. What makes Shor’s algorithm especially notable is that it solves a non-black-box problem in polynomial time, something that classically requires super-polynomial time.
Hidden subgroup problem
The abelian hidden subgroup problem is a framework that includes many tasks quantum computers can solve efficiently, like Simon's problem, factoring, solving Pell's equation, and testing principal ideals in rings. Quantum algorithms exist for these abelian cases. The hidden subgroup problem becomes more general when the group isn’t abelian, encompassing issues such as graph isomorphism and certain lattice problems. Some non-abelian groups allow efficient quantum solutions, but not the symmetric group or the dihedral group—finding algorithms for either would lead to breakthroughs in graph isomorphism or lattice problems respectively.
-
Read this chapter
Overview
The quantum threat, sometimes called Q-Day or Y2Q, refers to a possible future moment when quantum computers will be powerful enough to break the encryption that keeps most of our digital world secure today. Although no one knows exactly when that day will come, experts agree it could happen in the late 2020s or 2030s. The idea stems from Peter Shor’s 1994 algorithm, which showed that a quantum computer could factor large numbers and solve discrete logarithm problems quickly—tasks that current public-key systems rely on to stay secure. Because of this, the focus has shifted from trying to predict Q-Day to preparing for post-quantum cryptography instead.
Background
Modern communication depends on public-key systems like RSA and elliptic-curve cryptography, which rely on problems hard for classical computers to solve, like factoring large numbers and calculating discrete logarithms. For years, experts believed these tasks were practically impossible to crack, even with the most powerful supercomputers. That changed when Peter Shor developed an algorithm showing that a sufficiently powerful quantum computer could solve both problems quickly, in polynomial time, threatening today's internet security. Symmetric encryption like AES-256 is more resistant; Grover's algorithm speeds up brute-force attacks only quadratically, so longer keys can easily compensate. The concept of "Y2Q," or years to quantum, helps assess risk by comparing how long it takes to migrate systems versus how soon a codebreaker might exist. Some call it the "quantum apocalypse," though serious experts tend to avoid that term.
Timeline assessments
There is no agreement on when a quantum computer powerful enough to break current encryption will arrive. The Global Risk Institute’s report found most experts expect it in the 2030s or later, but by March 2026, the report called such a machine “quite possible” within ten years. Even so, organizations are already planning migrations. NIST finalized its first post-quantum cryptography standard in 2024, and governments like the U.S., U.K., Australia, and the EU have published roadmaps. Companies like Google set internal deadlines, such as 2029. In early 2026, three papers revised estimates of the quantum resources needed to break encryption downward. One, from Google Quantum AI with people from the Ethereum Foundation and Stanford University, said elliptic-curve cryptography could be broken with fewer than 500,000 physical qubits. Another preprint suggested fault-tolerant computing might need fewer qubits than previously thought.
Risks
Blockchains, especially those using proof-of-work like Bitcoin and Ethereum, are vulnerable because a wallet address is linked to a public key, and if that key is reused or left exposed on the ledger, a code-breaker could theoretically trace back to the private key and start forging transactions. That concern was raised by a March 2026 Google paper. Another serious issue is called harvest now, decrypt later — a surveillance approach where encrypted data is collected and stored for years, waiting for a quantum computer to decode it. So anything sent today that needs to stay secret for five or ten years or more is already at risk. The US National Security Memorandum 10 requires every federal agency to complete its post-quantum transition by 2035.
Post-quantum cryptography
In 2016, NIST began evaluating post-quantum algorithms, receiving 82 submissions, and in August 2024 finalized three standards: FIPS 203 for encryption, FIPS 204 for signatures, and FIPS 205 as a backup. A fourth, FIPS 206, based on FALCON, was still in progress by year’s end, while a fifth, HQC, was added in March 2025. NIST also set a timeline: RSA and ECC should be deprecated after 2030 and banned by 2035. Earlier, one candidate, SIKE, had been broken classically. In February 2024, the Linux Foundation created the Post-Quantum Cryptography Alliance with support from major tech firms and universities. QuSecure demonstrated quantum-resilient satellite communication in 2023 and joined NIST’s NCCoE consortium in 2026 to help organizations test new tools. Many are using hybrid cryptography, running classical and post-quantum algorithms together, as seen in Google Chrome, Cloudflare, Signal, and iMessage by 2024.
Governments
Governments around the world are preparing for the impact of quantum computing on cybersecurity. In the United States, federal agencies must transition to post-quantum cryptography under the 2022 Quantum Computing Cybersecurity Preparedness Act, with National Security Memorandum 10 setting 2035 as the deadline. The NSA has outlined approved algorithms through its Commercial National Security Algorithm Suite 2.0. Australia’s Signals Directorate requires immediate planning and plans to stop approving current public-key methods such as RSA and elliptic-curve schemes by 2030. Britain’s NCSC has set key milestones for 2028, 2031, and 2035. The European Commission and member states agreed on a shared roadmap in 2025, targeting protection of critical infrastructure by 2030.
-
Read this chapter
Overview
Post-quantum cryptography protects data against quantum computer attacks using algorithms believed secure though not proven. Most current public-key systems rely on math problems like integer factorization or discrete logarithms that Shor's algorithm could solve quickly on large quantum machines. Researchers build confidence through security reductions showing breaking the system equals solving known problems, or through years of unsuccessful attempts to break them. Some schemes like Rainbow and SIKE have already been compromised. By 2026, quantum computers weren't powerful enough to threaten existing systems, but cryptographers are preparing for Y2Q or "Q-Day," when current methods will no longer be safe. Mosca's theorem helps organizations assess migration timing. The work has drawn attention from academics and industry through events like PQCrypto conference series and ETSI workshops. Concerns about "harvest now, decrypt later" programs push early adoption. Unlike public-key systems, most symmetric algorithms and hash functions are thought relatively safe; Grover's algorithm speeds up attacks but can be countered by doubling key sizes. In 2024, NIST released the first three Post-Quantum Cryptography Standards.
Preparation
Digital systems rely on strong cybersecurity to keep information safe and verify its authenticity. Many of today’s cryptographic methods, which protect data, are only secure against regular computers. Quantum computing poses a serious risk to these systems, threatening both confidentiality and trustworthiness of information. Data that is not yet quantum-safe—whether stored or sent—could be at risk from future quantum computers using what's called "harvest now, decrypt later" attacks. The solution lies in moving quickly and carefully toward post-quantum cryptography to protect against this emerging threat.
Lattice-based cryptography
Lattice-based cryptography includes systems like learning with errors and ring learning with errors, or ring-LWE, which has security proofs tied to worst-case problems. Schemes such as NTRU encryption and GGH encryption have been studied for years without any feasible attacks found. The Stehle–Steinfeld variant of NTRU was suggested by the Post-Quantum Cryptography Study Group funded by the European Commission, since NTRU was still patented at the time. Some studies suggest NTRU may be more secure than other lattice-based algorithms. Among the first post-quantum algorithms standardized by NIST were ML-KEM, known as Kyber, and ML-DSA, known as Dilithium.
Multivariate cryptography
Multivariate cryptography relies on the challenge of solving systems of equations, like the Unbalanced Oil and Vinegar signature scheme. Some attempts at creating secure encryption using these methods have failed, including the Rainbow signature. These systems depend on mathematical problems that are hard to solve, but researchers have found ways to break them. The field continues to evolve as new vulnerabilities are discovered in existing schemes. Cryptographers work to develop better approaches that can resist attacks from both classical and quantum computers. This ongoing effort shapes the future of digital security.
Hash-based cryptography
Hash-based cryptography offers digital signatures like Lamport signatures, the Merkle scheme, XMSS, SPHINCS, WOTS, and SPHINCS+, invented by Ralph Merkle in the late 1970s. These systems are alternatives to RSA and DSA, but they can only sign a limited number of messages before their private keys expire. Interest revived when researchers sought quantum-resistant methods, and although there are no patents on the Merkle scheme, many non-patented hash functions work with these systems. The stateful XMSS, developed under Johannes Buchmann’s direction and described in RFC 8391, is one example. In 1989, Moni Naor and Moti Yung created UOWHF hashing and designed the first unlimited-time signature—called the Naor-Yung scheme—that doesn’t rely on trapdoor functions.
Code-based cryptography
Code-based cryptography uses error-correcting codes, like the McEliece and Niederreiter encryption methods, and a related signature scheme called Courtois, Finiasz, and Sendrier. The original McEliece signature, based on random Goppa codes, has held up for more than forty years. But many versions of the McEliece system that try to reduce key sizes by adding structure have been broken. The European Commission’s Post-Quantum Cryptography Study Group recommended McEliece as a strong option against quantum attacks. In 2025, NIST said it would standardize the HQC encryption algorithm, a code-based method.
Isogeny-based cryptography
These cryptographic systems use isogeny graphs—specifically supersingular ones—from elliptic curves and higher-dimensional abelian varieties over finite fields. One well-known system is CSIDH, a Diffie–Hellman-like key exchange that could replace current methods resistant to quantum attacks. Another is SQIsign, a signature scheme based on the connection between supersingular elliptic curves and quaternion algebras. SIDH/SIKE was also widely known but was broken in 2022; however, that attack only affected that specific family of schemes and doesn’t apply to other isogeny-based constructions.
Symmetric key quantum resistance
Symmetric key systems like AES and SNOW 3G are already secure against attacks from quantum computers, provided they use large enough keys. This includes protocols such as Kerberos and the 3GPP Mobile Network Authentication Structure, which rely on symmetric cryptography instead of public key methods. Because these systems are already widely used, some experts suggest expanding their deployment as a practical way to achieve post-quantum security right now.
-
Read this chapter
Overview
Integer factorization breaks down positive integers into products of smaller integers. Every number greater than one is either prime—cannot be split further—or composite, written as a product of primes. For example, 15 is composite because it equals 3 times 5, but 7 is prime and cannot be broken down. The process continues until all factors are prime, and this result is always unique. A basic method for small numbers is trial division, checking divisibility by primes up to the square root of the number. For larger numbers, more advanced algorithms are needed. Currently, no efficient classical algorithm exists for very large numbers, which is why it's central to cryptography like RSA encryption. The hardest cases involve semiprimes—products of two large primes—which can take an impractically long time to factor even on the fastest computers today.
Prime decomposition
Every positive integer has a unique set of prime numbers that multiply together to make it, as stated by the fundamental theorem of arithmetic. Testing whether a number is prime can be done quickly, for example, using the AKS primality test. But knowing a number is composite doesn't tell us how to find its factors. A general factorization algorithm can break any integer into primes through repeated use. Special methods depend heavily on the structure of the number. For instance, if n = 171 × p × q with p and q being large primes, trial division will quickly reveal 3 and 19 but then require many steps to find the rest. On the other hand, Fermat's method works efficiently when one factor is close to the square root of n. If n equals the product of 13729, 1372933, and 18848997161—where 13729 × 1372933 = 18848997157—then Fermat's approach begins near √n = 18848997159 and quickly finds b = √a² − n = √4 = 2. This gives the factors a − b = 18848997157 and a + b = 18848997161. Though one is clearly composite and the other prime, Fermat's method still takes more time to factor the composite number because the starting point √18848997157 = 137292 is only a factor of 10 away from 1372933.
Current state of the art
In cryptography, the hardest numbers to factor are semiprimes—numbers with two large prime factors—especially when those primes are close in size. In 2019, researchers including Paul Zimmermann successfully factored RSA-240, a 240-digit number, using around 900 core-years of computing power. They estimated that factoring a 1024-bit RSA modulus would take about 500 times longer. The record for the largest semiprime factored was set in September 2026 with RSA-260, an 862-bit number. That factorization took roughly 4,900 GPU-days, using a GPU-accelerated version of the general number field sieve run across hundreds of machines.
Time complexity
No algorithm is known that can factor any integer in polynomial time, meaning it would take no more than a power of the number of bits needed to write it. That's what it would mean to be in class P, and while we haven't proved such an algorithm doesn't exist, most experts think it probably doesn't. The fastest known method for classical computers is the general number field sieve, or GNFS, which runs in sub-exponential time and was first published in 1993. For quantum computers, however, Peter Shor found a breakthrough algorithm in 1994 that factors in polynomial time—specifically O(b³) time and O(b) space for a b-bit number. In 2001, this algorithm was demonstrated using nuclear magnetic resonance techniques on molecules with seven qubits. The problem of factoring is known to be in both NP and co-NP, but it's suspected to be outside P, NP-complete, and co-NP-complete, making it a strong candidate for the NP-intermediate class. Meanwhile, deciding whether a number is prime or composite can be done quickly using the AKS primality test, which is essential for systems like RSA.
Heuristic running time
In number theory, there are several algorithms used to factor integers, and many of them have a predicted running time described by the notation Ln[12,1+o(1)], which equals e(1+o(1))(logn)(loglogn). These algorithms include the elliptic curve method and the quadratic sieve. Another example is the class group relations method, which was proposed by Schnorr, Seysen, and Lenstra, and they proved its properties under the assumption of the generalized Riemann hypothesis, a conjecture that remains unproven.
Rigorous running time
The Schnorr–Seysen–Lenstra probabilistic algorithm was rigorously proven by Lenstra and Pomerance to have an expected running time of Ln[1/2, 1+o(1)], doing away with the need for the GRH assumption by instead using multipliers. This method operates on the class group of positive binary quadratic forms of a given discriminant Δ, denoted as GΔ. The set GΔ consists of triples of integers (a, b, c) that are relatively prime to one another.
Schnorr–Seysen–Lenstra algorithm
When factoring an odd positive integer n, this method selects a discriminant Δ set to −dn, with d being a positive multiplier, and depends on having many smooth forms in GΔ. Lenstra and Pomerance demonstrate that choosing d from a limited set ensures this smoothness. The set PΔ contains all primes q where the Kronecker symbol (Δ/q) equals 1. By building generators of GΔ and prime forms fq with q in PΔ, relations are created among them. The size of q is bounded by c0(log|Δ|)2 for some constant c0. These relations produce an ambiguous form of GΔ, an element whose order divides 2. Computing the corresponding factorization of Δ and taking a gcd gives the full prime factorization of n. To factor any positive integer, extra steps such as trial division and the Jacobi sum test must also be included.
-
Read this chapter
Overview
In quantum computing, there’s a method called the Shor code, also known as the Shor nine qubit code, which helps protect quantum information from errors caused by decoherence and faulty operations. Introduced by Peter Shor in 1995, it was the first quantum error-correcting code. It encodes one logical qubit using nine physical qubits, allowing it to fix bit-flip, phase-flip, or both types of errors on any single physical qubit. As the first to show how fault-tolerant quantum computing could work in theory, the Shor code was a major milestone. It’s also a basic example of a Bacon–Shor code, which use local operations and repeating patterns, enabling dynamic switching of encoding during a computation in a fault-tolerant way.
Encoding states
The Shor code is a method for protecting quantum information by encoding one logical qubit using nine physical qubits. It begins by encoding a basic qubit state α|0⟩+β|1⟩ into three-qubit states, where |0⟩ becomes |+++⟩ and |1⟩ becomes |−−−⟩, with |±⟩ defined as (|0⟩±|1⟩)/2. To build the full logical states, this process uses concatenation: each of the three qubits in the initial encoding is expanded into a three-qubit block. This results in the logical |0L⟩ state being expressed as 1/2√2 times the tensor product of three identical |000⟩+|111⟩ combinations, and |1L⟩ as 1/2√2 times the tensor product of three |000⟩−|111⟩ combinations.
Detection and correction
The Shor code uses nine qubits grouped into three blocks, each protecting against bit-flip errors, while the entire structure defends against phase flips affecting any block. This setup allows the code to fix any single qubit error that is either a bit flip or phase flip, and it can also correct two bit flips as long as they occur in different blocks. Because errors in quantum systems happen in discrete steps, it's possible to correct all single-qubit unitary transformations by simply handling bit and phase flip errors.
Logical gates
In the Shor code, one can define logical Pauli gates using the physical qubits that make up the code. The logical Pauli Z gate is represented by a tensor product of nine single-qubit Pauli X gates, written as X⊗X⊗X⊗X⊗X⊗X⊗X⊗X⊗X. Similarly, the logical Pauli X gate is defined as the tensor product of nine single-qubit Pauli Z gates, expressed as Z⊗Z⊗Z⊗Z⊗Z⊗Z⊗Z⊗Z⊗Z. These definitions show how logical operations emerge from the structure of the code itself.
Random error threshold
According to the threshold theorem, a quantum error correction code can fix physical errors only if the error rate stays below a certain point. If p represents the chance of a random error on a single qubit, a cautious approach treats any mistake affecting two or more qubits as uncorrectable. That happens with probability P2(p) = 1 − (1 − p)^9 − 9p(1 − p)^8, which is about 36p^2. When P2(p) becomes larger than p—ignoring terms with powers higher than p^3—it's better not to use the Shor code at all. In that case, the threshold comes to around 1/36, or 2.78 percent. But when errors in the correction process are included, this value can fall as low as 10^-4.
Stabilizer formalism
The Shor code is a quantum error-correcting code that uses nine physical qubits to encode one logical qubit, with the ability to correct up to a single qubit error, as indicated by its [[9,1,3]] notation. In the stabilizer formalism, this code is defined by eight generators, six of which are bit flip checks and two are phase flip checks. These generators are represented as strings of Z and X operators acting on nine qubits, with the pattern showing how the code detects and corrects errors. Because the stabilizers are purely X-type or Z-type, without mixing them, the Shor code is classified as a CSS code, named after its structure that separates bit-flip and phase-flip error correction.
-
Read this chapter
Overview
In quantum computing, the threshold theorem, also called the quantum fault-tolerance theorem, establishes that a quantum computer with physical errors below a specific rate can suppress logical errors to arbitrarily small levels using error correction. This result demonstrates that fault tolerance is achievable in quantum systems, echoing von Neumann’s work for classical computers. The theorem was independently proven by three groups: one led by Dorit Aharonov and Michael Ben-Or; another including Emanuel Knill, Raymond Laflamme, and Wojciech Zurek; and a third from Alexei Kitaev. Their efforts expanded upon earlier work by Peter Shor, who had established a less strong version of the same principle.
Explanation
The threshold theorem answers whether quantum computers can handle long computations despite noise. Since gate operations won't be perfect, some error is inevitable, which might seem to limit how many gates can be applied before computation fails. But surprisingly, if each gate has a small enough error rate, it's possible to do arbitrarily long computations with high precision using only a small increase in gate count. The theorem's formal statement appears in Quantum Computation and Quantum Information by Michael Nielsen and Isaac Chuang. It says that for a quantum circuit with p(n) gates, the number of gates needed to simulate it with error ε is O(log^c(p(n)/ε)p(n)), provided the error per gate is below some threshold p<th. Scott Aaronson explains: "The entire content of the Threshold Theorem is that you're correcting errors faster than they're created."
Threshold value in practice
The surface code's threshold is estimated to be around 1%, though that number varies widely since calculating it is extremely difficult—mostly because simulating large quantum systems grows exponentially more complex as they get bigger. At a depolarizing error rate of 0.1%, the surface code would need between 1,000 and 10,000 physical qubits for every logical data qubit. But if the errors are more complicated or pathological in nature, that number could change dramatically.
Read
Free to download, keep and share. For general information only — not professional medical, legal or financial advice. Please consult a qualified professional.