<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Quantum Computer on kenji.blog</title><link>http://kenji.blog/en/tags/quantum-computer/</link><description>Recent content in Quantum Computer on kenji.blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>kenjinote</copyright><lastBuildDate>Sat, 05 Sep 2026 22:10:00 +0900</lastBuildDate><atom:link href="http://kenji.blog/en/tags/quantum-computer/index.xml" rel="self" type="application/rss+xml"/><item><title>[Complete Guide] What is a Quantum Computer? ~The Ultimate Computing Principle from Scratch~</title><link>http://kenji.blog/en/p/quantum-computer-basics/</link><pubDate>Sat, 05 Sep 2026 22:10:00 +0900</pubDate><guid>http://kenji.blog/en/p/quantum-computer-basics/</guid><description>&lt;img src="http://kenji.blog/p/quantum-computer-basics/quantum_basics_eyecatch_1788613712487.jpg" alt="Featured image of post [Complete Guide] What is a Quantum Computer? ~The Ultimate Computing Principle from Scratch~" />&lt;h2 id="introduction-the-paradigm-shift-in-computing-brought-by-quantum-computers">Introduction: The &amp;ldquo;Paradigm Shift in Computing&amp;rdquo; Brought by Quantum Computers
&lt;/h2>&lt;p>In recent years, not a day goes by without seeing the term &amp;ldquo;quantum computer&amp;rdquo; in the news or technical articles. Sci-fi-like stories are often told, such as &amp;ldquo;calculations that would take current supercomputers thousands of years can be finished in minutes&amp;rdquo; or &amp;ldquo;all current cryptographic technologies might be broken.&amp;rdquo; Giant IT companies like Google, IBM, and Microsoft, as well as universities and startups worldwide, are fiercely competing to commercialize this dream technology.&lt;/p>
&lt;p>However, if asked, &amp;ldquo;What exactly is a quantum computer?&amp;rdquo;, few people could answer accurately. Many have a vague image of a &amp;ldquo;magic box that can calculate all combinations simultaneously,&amp;rdquo; but strictly speaking, that is incorrect.&lt;/p>
&lt;p>In this article, we will thoroughly explain from the basics how quantum computers fundamentally differ from classical computers (the PCs and smartphones we usually use), and how they utilize mysterious phenomena of quantum mechanics such as &amp;ldquo;Superposition,&amp;rdquo; &amp;ldquo;Entanglement,&amp;rdquo; and &amp;ldquo;Quantum gates&amp;rdquo; for calculations, in a professional yet easy-to-understand manner. By the time you finish reading this article, you should clearly understand the essential greatness of quantum computers and their current challenges.&lt;/p>
&lt;hr>
&lt;h2 id="chapter-1-the-crucial-difference-between-classical-and-quantum-computers">Chapter 1: The Crucial Difference Between Classical and Quantum Computers
&lt;/h2>&lt;p>To understand how a quantum computer works, we first need to review how the &amp;ldquo;classical computers&amp;rdquo; we currently use operate.&lt;/p>
&lt;h3 id="comparison-table-classical-computers-vs-quantum-computers">Comparison Table: Classical Computers vs Quantum Computers
&lt;/h3>&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Item&lt;/th>
&lt;th>Classical Computer&lt;/th>
&lt;th>Quantum Computer&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>Basic Unit&lt;/strong>&lt;/td>
&lt;td>Bit (0 or 1)&lt;/td>
&lt;td>Qubit (superposition of 0 and 1)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>State Representation&lt;/strong>&lt;/td>
&lt;td>Deterministic&lt;/td>
&lt;td>Probabilistic (undetermined until observed)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Calculation Method&lt;/strong>&lt;/td>
&lt;td>Sequential processing (requires physical cores for parallelization)&lt;/td>
&lt;td>Quantum parallelism (manipulates exponential states simultaneously)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Excels at&lt;/strong>&lt;/td>
&lt;td>Arithmetic operations, everyday data processing&lt;/td>
&lt;td>Prime factorization, quantum chemistry calculations&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Error Tolerance&lt;/strong>&lt;/td>
&lt;td>Very strong&lt;/td>
&lt;td>Very weak (requires cryogenic environments and error correction)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h3 id="the-world-of-classical-computers-the-bit-of-0-or-1">The World of Classical Computers: The &amp;ldquo;Bit&amp;rdquo; of 0 or 1
&lt;/h3>&lt;p>Classical computers represent all information in a state of either &amp;ldquo;0&amp;rdquo; or &amp;ldquo;1&amp;rdquo;. This is called a &lt;strong>Bit&lt;/strong>. Physically, it is represented by whether the voltage of a transistor on a semiconductor chip is high (1) or low (0).
The high-quality photos on your smartphone, the text you are reading now, and your favorite YouTube videos are all ultimately reduced to a massive sequence of 0s and 1s. Computation is nothing more than the process of applying operations to this sequence of 0s and 1s by combining basic logic circuits such as AND, OR, and NOT.
This is a very reliable and deterministic world. If the input is the same, you will always get the same output.&lt;/p>
&lt;h3 id="the-world-of-quantum-computers-the-qubit-that-is-both-0-and-1">The World of Quantum Computers: The &amp;ldquo;Qubit&amp;rdquo; That is Both 0 and 1
&lt;/h3>&lt;p>On the other hand, the smallest unit of information in a quantum computer is called a &lt;strong>Qubit (Quantum bit)&lt;/strong>.
The biggest feature of a qubit is that, unlike a classical bit which is strictly either &amp;ldquo;0&amp;rdquo; or &amp;ldquo;1&amp;rdquo;, it can take on a state where &amp;ldquo;0 and 1 are mixed with specific probabilities.&amp;rdquo; This is called &lt;strong>&amp;ldquo;Superposition&amp;rdquo;&lt;/strong>.&lt;/p>
&lt;p>For example, if a classical bit is a coin placed with either &amp;ldquo;heads&amp;rdquo; or &amp;ldquo;tails&amp;rdquo; facing up, a qubit is often compared to a &amp;ldquo;coin constantly spinning in the air.&amp;rdquo; A spinning coin cannot be said to be heads or tails; both states are superimposed. And the moment the coin falls to the floor and stops moving (in quantum mechanics, this is called &amp;ldquo;observation&amp;rdquo;), it is determined as either &amp;ldquo;heads&amp;rdquo; or &amp;ldquo;tails&amp;rdquo; for the first time.&lt;/p>
&lt;p>Quantum computers incorporate this very property unique to the microscopic world (quantum mechanics)—where &amp;ldquo;the state is not determined until observed&amp;rdquo;—directly into the information processing process.&lt;/p>
&lt;hr>
&lt;h2 id="chapter-2-three-quantum-mechanical-properties-that-fundamentally-change-computing">Chapter 2: Three Quantum Mechanical Properties That Fundamentally Change Computing
&lt;/h2>&lt;p>The source of the astonishing computing power of quantum computers is not simply a high clock frequency or small components. It lies in utilizing the laws of physics themselves as computational resources. The following three quantum mechanical phenomena are the keys.&lt;/p>
&lt;h3 id="1-superposition-and-exponential-information-capacity">1. Superposition and Exponential Information Capacity
&lt;/h3>&lt;p>As mentioned earlier, a qubit can simultaneously hold the states of both 0 and 1. One qubit is a &amp;ldquo;superposition of 0 and 1,&amp;rdquo; but what happens when you increase the number of qubits?&lt;/p>
&lt;ul>
&lt;li>1 Qubit: Superposition of 2 states (0, 1)&lt;/li>
&lt;li>2 Qubits: Superposition of 4 states (00, 01, 10, 11)&lt;/li>
&lt;li>3 Qubits: Superposition of 8 states&lt;/li>
&lt;li>&lt;strong>N Qubits: Superposition of $2^N$ patterns&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>With just 50 qubits, you can simultaneously hold $2^{50}$ (about 1.1 quadrillion) states. And with just 300 qubits, you can hold $2^{300}$ patterns at once—a number greater than all the atoms in the universe! This exponential information holding capacity is the foundation of a quantum computer&amp;rsquo;s potential. It is physically impossible for a classical computer to store more states in memory than there are atoms in the universe.&lt;/p>
&lt;h3 id="2-entanglement-spooky-action-at-a-distance">2. Entanglement: Spooky Action at a Distance
&lt;/h3>&lt;p>Quantum entanglement is such a counter-intuitive and mysterious phenomenon that Albert Einstein called it &amp;ldquo;Spooky action at a distance&amp;rdquo; and refused to accept it throughout his life.&lt;/p>
&lt;p>When multiple qubits enter a state of &amp;ldquo;quantum entanglement,&amp;rdquo; they become strongly linked to each other, forming a shared destiny: &lt;strong>&amp;ldquo;when the state of one is determined, the state of the other is instantly determined, no matter how far apart they are.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;p>For example, suppose we have two entangled qubits A and B (each in a superposition of 0 and 1). If we observe A and find it to be &amp;ldquo;0,&amp;rdquo; the state of B is instantly determined (for example, to definitely be &amp;ldquo;1&amp;rdquo;), exceeding the speed of light, which is the limit of information transmission.
In quantum computers, this entanglement is used to represent complex correlations between multiple qubits and perform massively parallel information processing. Without entanglement, the computing power of quantum computers would not be much different from that of classical computers.&lt;/p>
&lt;h3 id="3-quantum-interference-the-magic-that-brings-out-the-right-answer">3. Quantum Interference: The Magic That Brings Out the Right Answer
&lt;/h3>&lt;p>You might think, &amp;ldquo;If it can hold all patterns simultaneously, couldn&amp;rsquo;t it calculate them all at once in parallel and output the answer instantly?&amp;rdquo; This is the most common misconception about quantum computers.
Even if you calculate in a superposition state, you must &amp;ldquo;observe&amp;rdquo; to finally know the answer. However, the moment you observe, the state randomly collapses into one of the $2^N$ patterns. This would just give you a random answer.&lt;/p>
&lt;p>Here is where &lt;strong>&amp;ldquo;Quantum Interference&amp;rdquo;&lt;/strong> comes in. When waves collide, they strengthen each other where their wavelengths match, and cancel each other out where they are out of sync (the principle is essentially the same as noise-canceling headphones).&lt;/p>
&lt;p>An excellent &amp;ldquo;quantum algorithm&amp;rdquo; masterfully manipulates quantum states during the computation process so that &lt;strong>&amp;ldquo;the probability amplitudes of states (waves) leading to the correct answer amplify each other&amp;rdquo;&lt;/strong> and &lt;strong>&amp;ldquo;the probability amplitudes of states leading to incorrect answers cancel each other out.&amp;rdquo;&lt;/strong> It is designed so that when ultimately observed, the &amp;ldquo;correct answer&amp;rdquo; pops out with a probability as close to 100% as possible. Designing this interference process well is the very essence of quantum programming.&lt;/p>
&lt;hr>
&lt;h2 id="chapter-3-how-do-they-compute-quantum-gates-and-quantum-circuits">Chapter 3: How Do They Compute? &amp;ldquo;Quantum Gates&amp;rdquo; and &amp;ldquo;Quantum Circuits&amp;rdquo;
&lt;/h2>&lt;p>Just as classical computers use logic gates (AND, OR, NOT, etc.) to perform calculations, quantum computers apply operations called &lt;strong>&amp;ldquo;Quantum Gates&amp;rdquo;&lt;/strong> to qubits to advance calculations. A combination of multiple quantum gates is called a ** Quantum Circuit**.&lt;/p>
&lt;p>The state of a qubit is mathematically represented as a point on the surface of a 3-dimensional sphere called a &amp;ldquo;Bloch sphere.&amp;rdquo; The North Pole is &amp;ldquo;0&amp;rdquo;, the South Pole is &amp;ldquo;1&amp;rdquo;, and the equator represents a state where &amp;ldquo;0 and 1 are equally superimposed.&amp;rdquo; A quantum gate is nothing more than an operation that rotates the state (vector) on the surface of this sphere.&lt;/p>
&lt;p>Let&amp;rsquo;s introduce some representative quantum gates.&lt;/p>
&lt;h3 id="1-hadamard-gate-h-gate">1. Hadamard Gate (H Gate)
&lt;/h3>&lt;p>This is the most fundamental gate unique to quantum computers, not found in classical computers. When a qubit exactly in the &amp;ldquo;0&amp;rdquo; state passes through an H gate, it creates a &amp;ldquo;perfect superposition state&amp;rdquo; (a point on the equator of the Bloch sphere) where 0 and 1 are observed with exactly 50% probability each. As an initialization step for quantum computation, many algorithms begin by applying this H gate to all qubits.&lt;/p>
&lt;h3 id="2-pauli-gates-x-y-z-gates">2. Pauli Gates (X, Y, Z Gates)
&lt;/h3>&lt;p>These gates correspond to the NOT gate (flipping 0 to 1, and 1 to 0) of classical computers. On the Bloch sphere, they correspond to 180-degree rotations around the X, Y, and Z axes. The X gate, in particular, flips the North Pole (0) to the South Pole (1), working exactly the same as a classical NOT gate. The Z gate has the role of flipping the &amp;ldquo;phase&amp;rdquo; (like the timing of a wave) of a superposition, which is extremely important for causing quantum interference.&lt;/p>
&lt;h3 id="3-cnot-gate-controlled-not-gate">3. CNOT Gate (Controlled NOT Gate)
&lt;/h3>&lt;p>This is a hyper-important gate for creating quantum entanglement. It uses two qubits (a control bit and a target bit).
It operates as follows: &amp;ldquo;If the control bit is 1, flip the state of the target bit (apply an X gate). If the control bit is 0, do nothing.&amp;rdquo; At first glance, it looks like a simple IF conditional branch, but what happens if the control bit is in a &amp;ldquo;superposition state of 0 and 1&amp;rdquo;? The target bit becomes a &amp;ldquo;superposition of flipped and unflipped states,&amp;rdquo; and the destinies of the two bits become completely linked. The two qubits beautifully become &amp;ldquo;entangled.&amp;rdquo;&lt;/p>
&lt;p>By placing and applying these gates in sequence from left to right like a musical score, complex algorithms are executed.&lt;/p>
&lt;hr>
&lt;h2 id="chapter-4-what-are-quantum-computers-good-at-and-what-are-they-bad-at">Chapter 4: What Are Quantum Computers Good At, and What Are They Bad At?
&lt;/h2>&lt;p>Here is an important fact: quantum computers are not omnipotent gods.
For everyday tasks like web browsing, video rendering, Excel macro processing, or running general smartphone apps, quantum computers will probably never surpass classical computers. Classical computers, which are already highly optimized and boast overwhelming speed and low cost, are better suited for these sequential processes.&lt;/p>
&lt;p>Quantum computers truly shine only when applied to &lt;strong>&amp;ldquo;specific problems where the combinations of calculations explode exponentially for classical computers, taking time comparable to the age of the universe.&amp;rdquo;&lt;/strong> This is called &amp;ldquo;Quantum Supremacy&amp;rdquo; or &amp;ldquo;Quantum Advantage.&amp;rdquo;&lt;/p>
&lt;h3 id="what-quantum-computers-excel-at-killer-applications">What Quantum Computers Excel At (Killer Applications)
&lt;/h3>&lt;h4 id="1-prime-factorization-and-cryptanalysis-shors-algorithm">1. Prime Factorization and Cryptanalysis (Shor&amp;rsquo;s Algorithm)
&lt;/h4>&lt;p>Currently, secure communications on the Internet (such as credit card payments and sending personal information) are protected by &amp;ldquo;RSA encryption,&amp;rdquo; which is based on the premise that &amp;ldquo;prime factorization of huge numbers is practically impossible (takes an enormous amount of time) for classical computers.&amp;rdquo;
However, by using &amp;ldquo;Shor&amp;rsquo;s Algorithm&amp;rdquo; discovered by mathematician Peter Shor in 1994, a quantum computer can skillfully use interference to solve this at a dramatic speed (polynomial time). Because of this, there is a risk that the current cryptographic systems will collapse in the future, and central banks and government agencies worldwide are rushing to transition to &amp;ldquo;Post-Quantum Cryptography.&amp;rdquo;&lt;/p>
&lt;h4 id="2-quantum-chemistry-calculations-new-materials-and-drug-discovery">2. Quantum Chemistry Calculations, New Materials, and Drug Discovery
&lt;/h4>&lt;p>The behavior of molecules and atoms in the natural world originally follows the laws of quantum mechanics. When trying to simulate the behavior of complex molecules on a classical computer, the combinations of electron interactions explode, hitting the computational limits even for relatively small molecules.
As Nobel laureate Richard Feynman said, &amp;ldquo;Nature isn&amp;rsquo;t classical, dammit, and if you want to make a simulation of nature, you&amp;rsquo;d better make it quantum mechanical,&amp;rdquo; quantum computers exert overwhelming native power in material simulations. Breakthroughs that solve humanity&amp;rsquo;s challenges are expected, such as the design of revolutionary new drugs, the discovery of room-temperature superconductors, the development of highly efficient solar cells and battery materials, and the synthesis of energy-efficient fertilizers.&lt;/p>
&lt;h4 id="3-combinatorial-optimization-problems-and-search-grovers-algorithm">3. Combinatorial Optimization Problems and Search (Grover&amp;rsquo;s Algorithm)
&lt;/h4>&lt;p>Quantum algorithms also demonstrate power for problems that involve finding the optimal choice from an enormous number of options (logistics route optimization, financial portfolio optimization, etc.). By using &amp;ldquo;Grover&amp;rsquo;s Algorithm,&amp;rdquo; the target data can be found from an unsorted database in the square root of the time it would take a classical computer. For example, if there are 100 million pieces of data, a search that takes a maximum of 100 million tries classically can be completed in just about 10,000 tries.&lt;/p>
&lt;hr>
&lt;h2 id="chapter-5-the-hardware-walls-in-the-way-decoherence-and-quantum-error-correction">Chapter 5: The Hardware Walls In the Way: &amp;ldquo;Decoherence&amp;rdquo; and &amp;ldquo;Quantum Error Correction&amp;rdquo;
&lt;/h2>&lt;p>Although theoretically magically powerful, the path to practical application of quantum computers is blocked by extremely high and steep physical walls. The biggest enemy is &lt;strong>&amp;ldquo;Noise&amp;rdquo;&lt;/strong>.&lt;/p>
&lt;p>The &amp;ldquo;superposition&amp;rdquo; and &amp;ldquo;quantum entanglement&amp;rdquo; of qubits are extremely delicate and fragile states. Even the slightest ambient heat, electromagnetic fluctuation, or cosmic rays can instantly cause that magical state to collapse, turning it into just a classical bit. This phenomenon is called &lt;strong>&amp;ldquo;Decoherence&amp;rdquo;&lt;/strong>.&lt;/p>
&lt;h3 id="the-fierce-competition-of-physical-implementation-methods">The Fierce Competition of Physical Implementation Methods
&lt;/h3>&lt;p>Currently, there is a battle for supremacy worldwide regarding how to physically create these delicate qubits.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Superconducting Method&lt;/strong>: Adopted by Google, IBM, Amazon, etc. It uses loop-shaped superconducting circuits and controls the quantum state by cooling it to a cryogenic temperature close to absolute zero (about -273°C) using massive refrigerators. It is currently the most advanced method and the easiest to scale up the number of qubits, but the cooling equipment is huge and expensive.&lt;/li>
&lt;li>&lt;strong>Trapped Ion Method&lt;/strong>: Adopted by IonQ, Quantinuum, etc. It traps ions (atoms) in a vacuum using electromagnetic fields and controls them by shining precise lasers. Its strength is that all qubits are uniform and can maintain their state for a long time (long coherence time), but the operation speed is slower compared to superconducting.&lt;/li>
&lt;li>&lt;strong>Photonic Method&lt;/strong>: Focused on by PsiQuantum, etc. It uses particles of light (photons). It has the great advantage of not requiring a cryogenic environment and mostly operating at room temperature, while being highly compatible with existing silicon chip manufacturing and fiber-optic communication technologies.&lt;/li>
&lt;li>&lt;strong>Topological Method&lt;/strong>: Researched for a long time by Microsoft. It is an ambitious approach trying to create qubits fundamentally robust against environmental noise (resistant to errors) by utilizing the topological properties of special particles called anyons. It is theoretically the strongest, but the physical realization hurdle is considered the highest.&lt;/li>
&lt;/ul>
&lt;h3 id="the-path-to-the-ultimate-goal-fault-tolerant-quantum-computer-ftqc">The Path to the Ultimate Goal: &amp;ldquo;Fault-Tolerant Quantum Computer (FTQC)&amp;rdquo;
&lt;/h3>&lt;p>Calculation errors (like bit flips from cosmic rays) also exist in today&amp;rsquo;s classical computers, but they are perfectly corrected by &amp;ldquo;error-correcting codes,&amp;rdquo; so we can use our smartphones without ever noticing an error. To perform practical large-scale calculations on a quantum computer, similar &lt;strong>&amp;ldquo;Quantum Error Correction (QEC)&amp;rdquo;&lt;/strong> is essential.&lt;/p>
&lt;p>However, because quantum states have the property of &amp;ldquo;breaking when observed,&amp;rdquo; there is a fatal dilemma: you cannot directly look inside (observe) to check for errors.
To avoid this, theories have been established (like surface codes) that skillfully combine many unstable &amp;ldquo;physical qubits&amp;rdquo; to build one stable &amp;ldquo;logical qubit&amp;rdquo; that can detect and correct errors.
However, it is said that 1,000 to 10,000 physical qubits are needed to create just one logical qubit. Executing Shor&amp;rsquo;s algorithm using thousands of logical qubits would require a massive system with millions to tens of millions of physical qubits overall.&lt;/p>
&lt;p>We are currently in what is called the era of &lt;strong>NISQ (Noisy Intermediate-Scale Quantum)&lt;/strong> devices. These are transitional machines operating with tens to hundreds of qubits without error correction.
Experts predict that it will take a long-term research and development period of 10 to several decades to realize the ultimate goal, a fully error-correctable &lt;strong>&amp;ldquo;Fault-Tolerant Quantum Computer (FTQC)&amp;rdquo;&lt;/strong>.&lt;/p>
&lt;hr>
&lt;h2 id="chapter-6-history-and-future-prospects-of-quantum-computers">Chapter 6: History and Future Prospects of Quantum Computers
&lt;/h2>&lt;p>Finally, let&amp;rsquo;s take a bird&amp;rsquo;s-eye view of how quantum computers were born and where they are heading.&lt;/p>
&lt;h3 id="from-the-birth-of-the-theory-to-the-demonstration-of-quantum-supremacy">From the Birth of the Theory to the Demonstration of &amp;ldquo;Quantum Supremacy&amp;rdquo;
&lt;/h3>&lt;ul>
&lt;li>&lt;strong>1980s&lt;/strong>: Physicists Paul Benioff and Richard Feynman proposed the concept of a computer using the principles of quantum mechanics. The phrase &amp;ldquo;If you want to make a simulation of nature, you&amp;rsquo;d better make it quantum mechanical&amp;rdquo; was the starting point.&lt;/li>
&lt;li>&lt;strong>1994&lt;/strong>: Peter Shor published a quantum algorithm for prime factorization (Shor&amp;rsquo;s algorithm). It shocked the world and triggered a massive influx of research funding.&lt;/li>
&lt;li>&lt;strong>1996&lt;/strong>: Lov Grover published Grover&amp;rsquo;s algorithm to speed up data search.&lt;/li>
&lt;li>**2019 **: A historical milestone. Google announced that using its 53-qubit superconducting processor &amp;ldquo;Sycamore,&amp;rdquo; it completed a random number generation verification calculation in about 200 seconds that would have taken a classical supercomputer 10,000 years (so they claimed). This caused a sensation as the world&amp;rsquo;s first declaration of demonstrating &lt;strong>&amp;ldquo;Quantum Supremacy&amp;rdquo;&lt;/strong> (although IBM and others later improved the classical supercomputer algorithm and argued it could be calculated in a few days, leading to heated debates).&lt;/li>
&lt;li>&lt;strong>From 2023 onwards&lt;/strong>: IBM announced the processor &amp;ldquo;Condor&amp;rdquo; with over 1,000 qubits. Furthermore, early demonstrations of error correction technology are being reported one after another, such as Harvard University&amp;rsquo;s success in creating and manipulating &amp;ldquo;logical qubits.&amp;rdquo;&lt;/li>
&lt;/ul>
&lt;h3 id="towards-the-technology-of-the-next-generation">Towards the Technology of the Next Generation
&lt;/h3>&lt;p>A quantum computer is not merely a &amp;ldquo;next-generation CPU with a faster clock speed.&amp;rdquo; It is a true paradigm shift in computer science, fundamentally rewriting the concept of computation itself with the rules of quantum mechanics that govern the microscopic world.&lt;/p>
&lt;p>We will probably not have a &amp;ldquo;personal quantum smartphone&amp;rdquo; that fits in our pockets during our lifetime (and there is no need for one). However, the future is steadily approaching where powerful quantum data centers behind cloud networks like AWS and Azure might one day suddenly discover a cure for an incurable disease, or calculate dream clean energy materials to solve global warming (for example, catalysts to synthesize ammonia from atmospheric nitrogen at room temperature).&lt;/p>
&lt;p>We are currently in a dawn comparable to the 1940s ENIAC, which ran on punch cards while the heat from its massive vacuum tubes made the whole room hot. However, top-level researchers and engineers worldwide are pooling their wisdom, and technical breakthroughs are reported daily.
We, who can witness the evolution of this new &amp;ldquo;dawn of computing&amp;rdquo; in real time, can be said to live in a historically very exciting era.&lt;/p>
&lt;p>The door to the quantum world has just been opened. Keep an eye on future developments.&lt;/p>
&lt;hr>
&lt;p>&lt;em>This article aims to explain the basic concepts of quantum computing in an easy-to-understand manner for business professionals and the general public interested in technology. Please note that some rigorous mathematical and physical definitions (such as bra-ket notation and details of complex probability amplitudes) have been partially simplified.&lt;/em>&lt;/p></description></item><item><title>Will Quantum Computers Really Break RSA Encryption? ~Shor's Algorithm and the Current State of the Art~</title><link>http://kenji.blog/en/p/shors-algorithm-and-rsa-breaking/</link><pubDate>Sat, 05 Sep 2026 22:09:21 +0900</pubDate><guid>http://kenji.blog/en/p/shors-algorithm-and-rsa-breaking/</guid><description>&lt;img src="http://kenji.blog/p/shors-algorithm-and-rsa-breaking/quantum_breaking_rsa_1788613722990.jpg" alt="Featured image of post Will Quantum Computers Really Break RSA Encryption? ~Shor's Algorithm and the Current State of the Art~" />&lt;h2 id="introduction-the-intersection-of-cryptography-and-quantum-computers">Introduction: The Intersection of Cryptography and Quantum Computers
&lt;/h2>&lt;p>In modern Internet society, &amp;ldquo;public-key cryptography&amp;rdquo; is the foundation for protecting the secrecy of communications. A representative example of this is &amp;ldquo;RSA encryption,&amp;rdquo; developed in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman. From online shopping payments we use every day to website browsing (HTTPS) and email transmission/reception, RSA encryption functions as the heart of the Internet infrastructure.&lt;/p>
&lt;p>However, it has been pointed out that the advent of &amp;ldquo;quantum computers&amp;rdquo; could fundamentally overturn this security. Media outlets sometimes run sensational headlines like, &amp;ldquo;Once quantum computers are completed, passwords and codes worldwide will be decrypted in seconds.&amp;rdquo; But is this really true?&lt;/p>
&lt;p>In this article, we delve deeply into the mechanisms of GNFS (General Number Field Sieve), a classical cryptanalysis method, and &amp;ldquo;Shor&amp;rsquo;s Algorithm,&amp;rdquo; the definitive cryptanalysis algorithm using a quantum computer. We will explain advanced concepts like Quantum Fourier Transform and period finding in an easy-to-understand manner, and examine in detail the current state of quantum hardware in the NISQ (Noisy Intermediate-Scale Quantum) era and the hurdles required to actually break RSA-2048.&lt;/p>
&lt;hr>
&lt;h2 id="the-core-of-rsa-encryption-the-difficulty-of-prime-factorization">The Core of RSA Encryption: The Difficulty of Prime Factorization
&lt;/h2>&lt;p>The security of RSA encryption relies on a very simple asymmetry in mathematics. It is based on the fact that &amp;ldquo;it is easy to multiply two enormous prime numbers together, but it is extremely difficult to find the original two prime numbers (prime factorization) from the result of that multiplication (a composite number).&amp;rdquo;&lt;/p>
&lt;p>For example, suppose we have two prime numbers, $ p = 61 $ and $ q = 53 $. Calculating this multiplication $ N = p \times q = 3233 $ is instantaneous. However, if given only the number &amp;ldquo;3233&amp;rdquo; and asked, &amp;ldquo;Which prime numbers were multiplied to get this?&amp;rdquo;, the computational complexity explodes as the numbers get larger.&lt;/p>
&lt;p>In the currently mainstream RSA-2048, a massive composite number $ N $ with a key length of 2048 bits—about 617 decimal digits—is used. If this $ N $ can be factored into primes, the encryption is as good as broken.&lt;/p>
&lt;h3 id="the-challenge-by-classical-computers-gnfs-general-number-field-sieve">The Challenge by Classical Computers: GNFS (General Number Field Sieve)
&lt;/h3>&lt;p>To solve the prime factorization problem, mathematicians and cryptographers have developed various algorithms over the years. Among them, the fastest currently on classical computers is the &lt;strong>General Number Field Sieve (GNFS)&lt;/strong>.&lt;/p>
&lt;p>GNFS is a method that extends computations in the ring of integers to more abstract algebraic number fields (Number Fields) to analyze and factorize a huge number $ N $. The rough flow is as follows:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Polynomial Selection&lt;/strong>: Find a polynomial $ f(x) $ with appropriate degrees and coefficients that has $ N $ as a root.&lt;/li>
&lt;li>&lt;strong>Data Collection (Sieving)&lt;/strong>: Over the field of rational numbers and algebraic number fields, search for a massive amount of pairs of numbers that can be factored into small prime numbers (Smooth numbers). This process is called &amp;ldquo;sieving&amp;rdquo; and is the most time-consuming part.&lt;/li>
&lt;li>&lt;strong>Matrix Generation and Reduction&lt;/strong>: Based on the collected relations, generate a huge sparse matrix (a matrix where most components are 0) and find a solution using linear algebraic methods (such as the Block Lanczos algorithm).&lt;/li>
&lt;li>&lt;strong>Square Root Calculation&lt;/strong>: Finally, calculate the square root over the algebraic number field and derive the factors (prime factors) of $ N $.&lt;/li>
&lt;/ol>
&lt;p>The computational complexity of GNFS is non-asymptotically evaluated as $ O(\exp((\sqrt[3]{\frac{64}{9}} + o(1)) (\log N)^{\frac{1}{3}} (\log \log N)^{\frac{2}{3}})) $. This is called &amp;ldquo;sub-exponential&amp;rdquo; time complexity. While faster than exponential time, it is still far slower than polynomial time.&lt;/p>
&lt;p>In fact, in 2020, an international research team succeeded in the prime factorization of RSA-250 (an 829-bit, 250-digit composite number) using GNFS. This calculation gathered computing resources from around the world and spent an enormous amount of computing time, roughly 2,700 CPU core years. However, when it comes to 2048 bits, the required computational complexity is said to swell to trillions of times the lifespan of the universe, making it impossible to decrypt within a realistic time frame using classical methods, no matter how many supercomputers are run in parallel.&lt;/p>
&lt;hr>
&lt;h2 id="the-trump-card-of-quantum-computers-shors-algorithm">The Trump Card of Quantum Computers: Shor&amp;rsquo;s Algorithm
&lt;/h2>&lt;p>Enter &amp;ldquo;Shor&amp;rsquo;s Algorithm,&amp;rdquo; announced by Peter Shor in 1994. This algorithm was groundbreaking because it could solve the prime factorization problem on a quantum computer in &lt;strong>polynomial time&lt;/strong> ( $ O((\log N)^3) $ ). The difference between sub-exponential time and polynomial time is decisive; in theory, the use of quantum computers means the complete destruction of RSA encryption.&lt;/p>
&lt;h3 id="the-overall-flow-of-shors-algorithm">The Overall Flow of Shor&amp;rsquo;s Algorithm
&lt;/h3>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">graph TD
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> A[Input number N to be factored] --&amp;gt; B[Select a random integer a]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> B --&amp;gt; C{Greatest Common Divisor&amp;lt;br&amp;gt;of a and N}
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> C --&amp;gt;|Greater than 1| D[Luckily discovered a prime factor!]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> C --&amp;gt;|1 Mutually prime| E[Quantum computer takes the stage]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> E --&amp;gt; F[Find the period r of the function&amp;lt;br&amp;gt;f_x = a^x mod N&amp;lt;br&amp;gt;using Quantum Fourier Transform]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> F --&amp;gt; G{Is period r even and&amp;lt;br&amp;gt;a^r/2 ≢ -1 mod N?}
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> G --&amp;gt;|Yes| H[Calculate greatest common divisor gcd_a^r/2 ± 1, N]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> H --&amp;gt; I((Prime factorization successful!))
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> G --&amp;gt;|No| B
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>Shor&amp;rsquo;s algorithm does not solve the prime factorization problem directly, but rather uses theorems from number theory to transform it into another problem called the &amp;ldquo;Period Finding Problem,&amp;rdquo; and solves that rapidly by leveraging the characteristics of a quantum computer.&lt;/p>
&lt;h3 id="step-1-reduction-from-prime-factorization-to-the-period-finding-problem-classical-processing">Step 1: Reduction from Prime Factorization to the Period Finding Problem (Classical Processing)
&lt;/h3>&lt;p>The first step of the algorithm is performed on a classical computer.
For the number $ N $ you want to factorize, pick a random integer $ a $ ( $ 1 &lt; a &lt; N $ ) that is coprime to $ N $ (their greatest common divisor is 1). If by chance the greatest common divisor is not 1, the common divisor found at that point is a prime factor of $ N $, and decryption is complete, but the probability of this is extremely low.&lt;/p>
&lt;p>Next, consider the following sequence of modulo equations:
$ f(x) = a^x \pmod N $&lt;/p>
&lt;p>If we substitute $ x = 1, 2, 3, \dots $ into this function $ f(x) $, the values may seem random, but because we are calculating within a finite range, it will always return to the original value somewhere and repeat the same sequence of numbers. The period of this repetition is called $ r $. In other words,
the problem of finding the smallest positive integer $ r $ such that
$ a^r \equiv 1 \pmod N $,
this is the &amp;ldquo;Period Finding Problem&amp;rdquo;.&lt;/p>
&lt;p>If this period $ r $ is found, and $ r $ is an even number, then $ a^r - 1 \equiv 0 \pmod N $, and using the factorization formula, it can be transformed into:
$ (a^{r/2} - 1)(a^{r/2} + 1) \equiv 0 \pmod N $
From here, by using the Euclidean algorithm to calculate the greatest common divisor of $ N $ and $ a^{r/2} \pm 1 $, a prime factor of $ N $ can be obtained with extremely high probability.&lt;/p>
&lt;p>Finding the period $ r $ on a classical computer ultimately requires an exponential number of steps and cannot be sped up. However, a quantum computer can find this period $ r $ in an instant (in polynomial time).&lt;/p>
&lt;h3 id="step-2-preparation-and-superposition-of-quantum-states">Step 2: Preparation and Superposition of Quantum States
&lt;/h3>&lt;p>This is where the quantum computer comes into play.
Quantum computers use &amp;ldquo;Qubits&amp;rdquo;, which can simultaneously hold the states of &amp;ldquo;0&amp;rdquo; and &amp;ldquo;1&amp;rdquo;. In Shor&amp;rsquo;s algorithm, two registers are prepared: a register to store inputs (the first register) and a register to store calculation results (the second register).&lt;/p>
&lt;p>First, a quantum gate operation called a Hadamard gate is applied to all qubits in the first register. As a result, the first register becomes an &lt;strong>equal superposition state&lt;/strong> of all conceivable values of $ x $ (from $ 0 $ to $ 2^n-1 $, where $ n $ is a sufficiently large number of bits).&lt;/p>
&lt;p>In other words, inside the quantum computer, a state is created where countless input values $ x=0, 1, 2, 3, \dots $ exist simultaneously in parallel.&lt;/p>
&lt;h3 id="step-3-quantum-modular-exponentiation">Step 3: Quantum Modular Exponentiation
&lt;/h3>&lt;p>Next, taking the superposition state of the first register as input, calculate $ f(x) = a^x \pmod N $ and store the result in the second register.
Because this calculation is executed as a unitary transformation on a quantum circuit, the calculation of $ f(x) $ for all $ x $ is performed &amp;ldquo;simultaneously and in parallel (quantum parallelism)&amp;rdquo; while maintaining the superposition.&lt;/p>
&lt;p>The space of the entire quantum system at this point is an enormous superposition of states:
$ |x, a^x \bmod N\rangle $&lt;/p>
&lt;p>However, if we simply measure (observe) the second register here, a single random value of $ a^x \bmod N $ will be probabilistically selected, and the $ x $ of the first register will be fixed to one value in conjunction with it. This is exactly the same as calculating it once on a classical computer, and the period $ r $ cannot be found.&lt;/p>
&lt;p>Under the rules of quantum mechanics, you cannot directly peek into the contents of a superposition state. So how do we extract the global information of the overall &amp;ldquo;period&amp;rdquo;?&lt;/p>
&lt;h3 id="step-4-quantum-fourier-transform-qft">Step 4: Quantum Fourier Transform (QFT)
&lt;/h3>&lt;p>The true brilliance of Shor&amp;rsquo;s algorithm that breaks through this wall is the application of the &lt;strong>Quantum Fourier Transform (QFT)&lt;/strong> to the first register.&lt;/p>
&lt;p>Before making a measurement, we analyze the wave properties of the function $ f(x) $. Suppose we observed the second register. Suppose a value $ y $ was obtained. Then, the state of the first register collapses to a &amp;ldquo;superposition of all $ x $ such that $ a^x \pmod N = y $&amp;rdquo;.
These values of $ x $ will be in a state that is discretely arranged at intervals of period $ r $, such as $ x_0, x_0 + r, x_0 + 2r, x_0 + 3r, \dots $ (a kind of comb-like probability amplitude distribution).&lt;/p>
&lt;p>We apply the Quantum Fourier Transform (QFT) to this state. Just as the classical discrete Fourier transform converts a time-domain signal into the frequency domain, QFT causes interference in the probability amplitudes of the quantum state.&lt;/p>
&lt;p>When QFT is applied, due to quantum interference effects, the probabilities of incorrect answers that do not resonate with the period $ r $ (where phases do not align) cancel each other out and approach zero (destructive interference), and only the probability of the correct answer that carries the information of the period $ r $ is amplified (constructive interference).&lt;/p>
&lt;h3 id="step-5-measurement-and-continued-fraction-expansion-classical-post-processing">Step 5: Measurement and Continued Fraction Expansion (Classical Post-Processing)
&lt;/h3>&lt;p>When the first register is measured after applying QFT, an integer $ c $ close to the form $ c \approx \frac{j \cdot 2^n}{r} $ is obtained with very high probability (where $ j $ is an unknown integer and $ 2^n $ is the size of the register).&lt;/p>
&lt;p>By returning this measurement result $ c $ to a classical computer and creating a fraction $ \frac{c}{2^n} \approx \frac{j}{r} $, and then calculating an approximate value using a mathematical method called &amp;ldquo;Continued fraction expansion&amp;rdquo;, the denominator, the period $ r $, can be successfully brought to light.&lt;/p>
&lt;p>Once $ r $ is known, the prime factors of $ N $ can be calculated using the formula from Step 1, and the RSA encryption is completely broken.&lt;/p>
&lt;hr>
&lt;h2 id="the-capability-and-challenges-of-current-quantum-computers-nisq">The Capability and Challenges of Current Quantum Computers (NISQ)
&lt;/h2>&lt;p>While Shor&amp;rsquo;s algorithm is theoretically perfect, if asked, &amp;ldquo;Will RSA encryption be broken tomorrow?&amp;rdquo;, the answer is a definitive &amp;ldquo;No.&amp;rdquo; The reason lies in the limitations of current quantum computer hardware technology.&lt;/p>
&lt;h3 id="the-nisq-noisy-intermediate-scale-quantum-era">The NISQ (Noisy Intermediate-Scale Quantum) Era
&lt;/h3>&lt;p>We currently exist in an era known as &amp;ldquo;NISQ&amp;rdquo;. NISQ devices have tens to hundreds of physical qubits, but they are extremely vulnerable to noise.&lt;/p>
&lt;p>Qubits are susceptible to external environmental influences such as heat and electromagnetic waves, and &amp;ldquo;decoherence&amp;rdquo; (loss of quantum entanglement) where the quantum state breaks down, and &amp;ldquo;gate errors&amp;rdquo; during gate operations occur frequently. If one tries to execute a very deep quantum circuit (with an enormous number of calculation steps) like Shor&amp;rsquo;s algorithm, errors accumulate during the calculation, and the final output becomes completely meaningless noise.&lt;/p>
&lt;h3 id="physical-qubits-and-logical-qubits">Physical Qubits and Logical Qubits
&lt;/h3>&lt;p>What is indispensable for solving this error problem is &amp;ldquo;Quantum Error Correction&amp;rdquo;.
While error correction codes are also used in classical computers, quantum error correction is extremely complex due to the &amp;ldquo;no-cloning theorem&amp;rdquo; which forbids the duplication of quantum states.&lt;/p>
&lt;p>In quantum error correction, an ideal, error-free &amp;ldquo;logical qubit&amp;rdquo; is created by combining a large number of noisy &amp;ldquo;physical qubits&amp;rdquo; using techniques such as the &amp;ldquo;Surface Code&amp;rdquo;.&lt;/p>
&lt;p>Assuming current error rates, it is estimated that approximately 1,000 to 10,000 physical qubits will be required to create one logical qubit. This is called &amp;ldquo;error correction overhead&amp;rdquo;.&lt;/p>
&lt;h3 id="what-resources-are-needed-to-break-rsa-2048">What Resources Are Needed to Break RSA-2048?
&lt;/h3>&lt;p>So, how many resources are actually needed to run Shor&amp;rsquo;s algorithm to decrypt RSA-2048?&lt;/p>
&lt;p>According to a groundbreaking resource estimation in a 2021 paper by Craig Gidney (Google) and Martin Ekerå, if an optimized Shor&amp;rsquo;s algorithm is used and error correction by surface codes is performed, the following resources will be required:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Number of logical qubits&lt;/strong>: Approx. 4,096&lt;/li>
&lt;li>**Number of physical qubits &lt;strong>: ** Approx. 20 million&lt;/strong> (Assuming an error rate of about $10^{-3}$)&lt;/li>
&lt;li>&lt;strong>Computation time&lt;/strong>: Approx. 8 hours (Millions to billions of physical gate operations required)&lt;/li>
&lt;/ul>
&lt;p>In contrast, what is the current state of quantum hardware?
The superconducting quantum processor &amp;ldquo;Condor&amp;rdquo; announced by IBM at the end of 2023 has 1,121 qubits. In addition, groundbreaking research on the generation of logical qubits (such as the generation of 48 logical qubits using a neutral atom quantum computer by Harvard University and QuEra, etc.) has appeared, but we are not yet at the stage where we can continuously execute &amp;ldquo;perfect, noise-free calculations&amp;rdquo; for a long time.&lt;/p>
&lt;p>Scaling up from a few thousand physical qubits to &lt;strong>20 million&lt;/strong> practical physical qubits (and a system that is interconnected, operates stably at cryogenic temperatures, and can process control signals at ultra-high speeds) presents a tremendous engineering wall (wiring problems, limits of cooling capacity, bloating of control electronics). Many experts predict that it will take at least 10 to 30 years, or even longer, to realize a &amp;ldquo;Fault-Tolerant Quantum Computer (FTQC)&amp;rdquo; capable of breaking RSA-2048.&lt;/p>
&lt;hr>
&lt;h2 id="the-creeping-threat-of-store-now-decrypt-later-and-the-dawn-of-pqc">The Creeping Threat of &amp;ldquo;Store Now, Decrypt Later&amp;rdquo; and the Dawn of PQC
&lt;/h2>&lt;p>It is premature to think, &amp;ldquo;We are safe since it will still take more than 10 years.&amp;rdquo; Currently, there is data that must remain secret for decades to come, such as national classified information, medical data, and long-term infrastructure designs.&lt;/p>
&lt;p>What is feared here is the threat of an attack method known as &lt;strong>&amp;ldquo;Store Now, Decrypt Later&amp;rdquo;&lt;/strong>. Malicious nations or organizations intercept all communication data currently encrypted with RSA or ECC (Elliptic Curve Cryptography) and store it in storage. Then, 10 or 20 years later, the moment a powerful quantum computer is completed, they use Shor&amp;rsquo;s algorithm to decrypt all past data and expose secrets.&lt;/p>
&lt;p>To counter this time lag threat, the standardization process for &lt;strong>&amp;ldquo;Post-Quantum Cryptography (PQC)&amp;rdquo;&lt;/strong> has been rapidly advancing, primarily led by NIST (National Institute of Standards and Technology).&lt;/p>
&lt;p>PQC is a new cryptographic algorithm based on mathematical problems that are difficult to solve even with a quantum computer (i.e., Shor&amp;rsquo;s algorithm cannot be applied). The main approaches include the following:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Lattice-based cryptography&lt;/strong>: Based on problems such as LWE (Learning with Errors). The mainstream in NIST standardization (Kyber, Dilithium, etc.).&lt;/li>
&lt;li>&lt;strong>Code-based cryptography&lt;/strong>: Relies on the difficulty of the decoding problem of error-correcting codes.&lt;/li>
&lt;li>&lt;strong>Multivariate cryptography&lt;/strong>: Relies on the difficulty of solving systems of multivariate quadratic equations.&lt;/li>
&lt;li>&lt;strong>Hash-based signatures&lt;/strong>: Digital signatures that rely solely on the security of hash functions.&lt;/li>
&lt;/ul>
&lt;p>Major software and platforms such as Google Chrome and Apple&amp;rsquo;s iMessage have already started introduction testing and hybrid implementation of PQC.&lt;/p>
&lt;h2 id="conclusion">Conclusion
&lt;/h2>&lt;p>Quantum computers are transitioning from a pipe dream in the world of science fiction to a real engineering challenge. Shor&amp;rsquo;s algorithm is a great intellectual achievement of humanity that merges mathematics and quantum mechanics, but at the same time, it harbors a &amp;ldquo;destructive power&amp;rdquo; that shakes the foundations of our digital society.&lt;/p>
&lt;p>RSA encryption will not suddenly become unusable tomorrow. However, considering the evolution of quantum technology and the risk of &amp;ldquo;Store Now, Decrypt Later,&amp;rdquo; a large-scale migration that will remain in cryptographic history—the transition to PQC—has already begun. We are now witnessing the front lines of a paradigm shift in information security.&lt;/p></description></item><item><title>[Complete Mathematical Guide] Why the Ultimate Classical 'GNFS' Loses to Quantum Algorithms: The Paradigm Shift in Prime Factorization</title><link>http://kenji.blog/en/p/gnfs-to-shors-algorithm-math-deepdive/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>http://kenji.blog/en/p/gnfs-to-shors-algorithm-math-deepdive/</guid><description>&lt;img src="http://kenji.blog/p/gnfs-to-shors-algorithm-math-deepdive/quantum_vs_gnfs_eyecatch_1788616101508.jpg" alt="Featured image of post [Complete Mathematical Guide] Why the Ultimate Classical 'GNFS' Loses to Quantum Algorithms: The Paradigm Shift in Prime Factorization" />&lt;p>Information security in the modern internet society is protected by public-key cryptography, such as RSA cryptography. The basis for the security of RSA relies on the fact that &lt;strong>&amp;ldquo;the prime factorization of huge composite numbers is computationally extremely difficult.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;p>In this article, we will unravel the mathematical mechanism of the &lt;strong>&amp;ldquo;General Number Field Sieve&amp;rdquo;&lt;/strong> (GNFS), which is the most powerful prime factorization algorithm for classical computers. We will also dive deeply into why it is completely defeated by &lt;strong>&amp;ldquo;Shor&amp;rsquo;s Algorithm,&amp;rdquo;&lt;/strong> discovered by Peter Shor, exploring this paradigm shift thoroughly with mathematical formulas and conceptual diagrams.&lt;/p>
&lt;hr>
&lt;h2 id="1-the-approach-to-prime-factorization-in-classical-computing-evolution-from-fermats-factorization-method">1. The Approach to Prime Factorization in Classical Computing: Evolution from Fermat&amp;rsquo;s Factorization Method
&lt;/h2>&lt;p>The prime factorization problem is the problem of finding prime numbers $p$ and $q$ such that $N = p \times q$ for a given composite number $N$.&lt;/p>
&lt;p>The basic idea reduces to finding non-trivial $x$ and $y$ that satisfy the following congruence:&lt;/p>
$$ x^2 \equiv y^2 \pmod N $$
&lt;p>By rearranging this, we get:&lt;/p>
$$ x^2 - y^2 \equiv 0 \pmod N $$
$$ (x - y)(x + y) \equiv 0 \pmod N $$
&lt;p>Here, if $x \not\equiv \pm y \pmod N$, we can obtain a non-trivial factor of $N$ by calculating $\gcd(x-y, N)$ or $\gcd(x+y, N)$. This fact is the foundation of modern prime factorization algorithms like GNFS.&lt;/p>
&lt;hr>
&lt;h2 id="2-the-ultimate-classical-algorithm-the-depths-of-the-general-number-field-sieve-gnfs">2. The Ultimate Classical Algorithm: The Depths of the &amp;ldquo;General Number Field Sieve&amp;rdquo; (GNFS)
&lt;/h2>&lt;p>&lt;strong>&amp;ldquo;GNFS&amp;rdquo;&lt;/strong> is the fastest known prime factorization algorithm for classical computers today. Its time complexity requires sub-exponential time.&lt;/p>
&lt;h3 id="complexity-of-gnfs">Complexity of GNFS
&lt;/h3>&lt;p>Letting the number of digits (bits) of the number $N$ be $b = \log_2 N$, the computational complexity of GNFS is expressed as follows:&lt;/p>
$$ O\left( \exp \left( \left(\frac{64}{9} b\right)^{1/3} (\log b)^{2/3} \right) \right) $$
&lt;p>As can be seen from this formula, the computational complexity is not polynomial time, but &lt;strong>&amp;ldquo;sub-exponential time,&amp;rdquo;&lt;/strong> which is slightly slower than exponential time. Still, as the number of digits increases, the computation time grows astronomically.&lt;/p>
&lt;h3 id="mathematical-mechanism-of-gnfs">Mathematical Mechanism of GNFS
&lt;/h3>&lt;p>GNFS consists broadly of four steps:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Polynomial Selection&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Sieving&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Matrix Reduction&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Square Root&lt;/strong>&lt;/li>
&lt;/ol>
&lt;h4 id="21-polynomial-selection-and-number-fields">2.1. Polynomial Selection and Number Fields
&lt;/h4>&lt;p>First, we select irreducible polynomials $f(x)$ and $g(x)$ with integer coefficients. These are set to have a common root $m$ modulo $N$. That is,&lt;/p>
$$ f(m) \equiv 0 \pmod N $$
$$ g(m) \equiv 0 \pmod N $$
&lt;p>Usually, $g(x)$ is chosen as a linear polynomial $g(x) = x - m$. If we let $\alpha$ be a root of $f(x)$, a &lt;strong>&amp;ldquo;Number Field&amp;rdquo;&lt;/strong> $\mathbb{Q}(\alpha)$ is constructed. We compare operations in the ring of $\mathbb{Q}(\alpha)$ and operations in the normal integer ring $\mathbb{Z}$ through the homomorphism $\phi: \alpha \mapsto m$.&lt;/p>
&lt;h4 id="22-sieving">2.2. Sieving
&lt;/h4>&lt;p>Next, we search for a massive number of coprime integer pairs $(a, b)$. The goal is to find pairs such that the following two values are both &lt;strong>&amp;ldquo;B-smooth&amp;rdquo;&lt;/strong> (composed only of relatively small prime factors):&lt;/p>
&lt;ol>
&lt;li>$a - bm$ (value over the integer ring)&lt;/li>
&lt;li>$b^d f(a/b)$ (corresponding to the norm $N(a - b\alpha)$ over the number field)&lt;/li>
&lt;/ol>
&lt;p>Here, a high-speed search method called a &lt;strong>&amp;ldquo;Sieve&amp;rdquo;&lt;/strong> is used. This efficiently extracts $(a, b)$ pairs that satisfy the conditions from a vast number of candidates.&lt;/p>
&lt;h4 id="23-linear-algebra-over-gf2-matrix-reduction">2.3. Linear Algebra over GF(2) (Matrix Reduction)
&lt;/h4>&lt;p>From the collected pairs $(a, b)$, we construct exponent vectors and find the left null space of a massive sparse matrix over $\mathbb{F}_2$ (the field with only elements 0 and 1).&lt;/p>
&lt;p>We find a vector $v$ as a solution so that the relations $ \prod (a_i - b_i m) $ and $ \prod (a_i - b_i \alpha) $ both become squares. This is nothing but solving a system of linear equations:&lt;/p>
$$ M \mathbf{x} \equiv \mathbf{0} \pmod 2 $$
&lt;p>Advanced numerical algorithms such as the Block Lanczos Algorithm and the Block Wiedemann Algorithm are utilized here.&lt;/p>
&lt;h4 id="24-square-root">2.4. Square Root
&lt;/h4>&lt;p>Finally, we take square roots in both the number field and the integer ring to derive the relation $x^2 \equiv y^2 \pmod N$. Then, we calculate $\gcd(x-y, N)$ to obtain the factor.&lt;/p>
&lt;hr>
&lt;h2 id="3-the-breakthrough-by-quantum-computing-shors-algorithm">3. The Breakthrough by Quantum Computing: &amp;ldquo;Shor&amp;rsquo;s Algorithm&amp;rdquo;
&lt;/h2>&lt;p>While GNFS requires sub-exponential time, &lt;strong>&amp;ldquo;Shor&amp;rsquo;s Algorithm,&amp;rdquo;&lt;/strong> published by Peter Shor in 1994, can solve this problem in &lt;strong>&amp;ldquo;polynomial time&amp;rdquo;&lt;/strong> by using a quantum computer.&lt;/p>
&lt;h3 id="complexity-of-shors-algorithm">Complexity of Shor&amp;rsquo;s Algorithm
&lt;/h3>&lt;p>When the number of qubits is $O(\log N)$, the time complexity is as follows:&lt;/p>
$$ O((\log N)^3) $$
&lt;p>This means it does not cause an exponential explosion with respect to the number of bits. This is an astonishing result: even for huge composite numbers where the complexity of &lt;strong>&amp;ldquo;classical computing&amp;rdquo;&lt;/strong> exceeds the lifespan of the universe, they can be cracked in hours to days with &lt;strong>&amp;ldquo;quantum computing.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;h3 id="overview-of-shors-algorithm-reduction-to-the-period-finding-problem">Overview of Shor&amp;rsquo;s Algorithm: Reduction to the Period-Finding Problem
&lt;/h3>&lt;p>Shor&amp;rsquo;s algorithm cleverly reduces the prime factorization problem to a &lt;strong>&amp;ldquo;period-finding problem.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;ol>
&lt;li>Choose a random integer $a$ coprime to $N$ ($1 &lt; a &lt; N$).&lt;/li>
&lt;li>Define the function $f(x) = a^x \bmod N$.&lt;/li>
&lt;li>Find the period $r$ of $f(x)$, i.e., the smallest positive integer $r$ such that $a^r \equiv 1 \pmod N$.&lt;/li>
&lt;li>If $r$ is even, check if $a^{r/2} \not\equiv -1 \pmod N$, and calculate $\gcd(a^{r/2} \pm 1, N)$ to obtain a prime factor.&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>&amp;ldquo;Finding the period $r$&amp;rdquo;&lt;/strong> in step 3 is the bottleneck that requires exponential time on classical computers, but quantum computers solve this instantly using &lt;strong>&amp;ldquo;quantum superposition&amp;rdquo;&lt;/strong> and the &lt;strong>&amp;ldquo;Quantum Fourier Transform&amp;rdquo;&lt;/strong> (QFT).&lt;/p>
&lt;hr>
&lt;h2 id="4-quantum-fourier-transform-qft-and-period-extraction">4. Quantum Fourier Transform (QFT) and Period Extraction
&lt;/h2>&lt;p>Let&amp;rsquo;s look in detail with formulas at the manipulation of quantum states, which is the core of Shor&amp;rsquo;s algorithm.&lt;/p>
&lt;h3 id="41-generation-of-quantum-superposition">4.1. Generation of Quantum Superposition
&lt;/h3>&lt;p>First, we prepare two quantum registers. Register 1 holds a superposition state of inputs $x$, and Register 2 holds the computation result $f(x)$. We apply the Hadamard Transform to the initial state $|0\rangle |0\rangle$ to create a superposition of all possible $x$.&lt;/p>
$$ |\psi_1\rangle = \frac{1}{\sqrt{Q}} \sum_{x=0}^{Q-1} |x\rangle |0\rangle $$
&lt;p>
(Here $Q$ is a power of 2 satisfying $N^2 \le Q &lt; 2N^2$)&lt;/p>
&lt;p>Next, we use a quantum oracle $U_f$ to compute $f(x) = a^x \bmod N$ and store it in Register 2.&lt;/p>
$$ |\psi_2\rangle = U_f |\psi_1\rangle = \frac{1}{\sqrt{Q}} \sum_{x=0}^{Q-1} |x\rangle |a^x \bmod N\rangle $$
&lt;p>Let&amp;rsquo;s assume here that we measure Register 2 (in reality, the mathematical structure is the same even without measurement). If a value $y = a^{x_0} \bmod N$ is observed, the state of Register 1 collapses into a superposition of all $x$ such that $f(x) = y$. Letting the period be $r$, such $x$ are $x_0, x_0 + r, x_0 + 2r, \dots$&lt;/p>
$$ |\psi_3\rangle = \frac{1}{\sqrt{M}} \sum_{k=0}^{M-1} |x_0 + kr\rangle $$
&lt;p>
(Here $M \approx Q/r$ is the number of terms)&lt;/p>
&lt;p>This state inherently contains information about the period $r$, but direct measurement will only yield a random $x_0 + kr$, and the period $r$ remains unknown. This is where QFT comes in.&lt;/p>
&lt;h3 id="42-application-of-the-quantum-fourier-transform-qft">4.2. Application of the Quantum Fourier Transform (QFT)
&lt;/h3>&lt;p>QFT is an operation that performs a discrete Fourier transform on the amplitudes of quantum states. The action of QFT on state $|x\rangle$ is defined as follows:&lt;/p>
$$ \text{QFT} |x\rangle = \frac{1}{\sqrt{Q}} \sum_{y=0}^{Q-1} e^{2\pi i \frac{xy}{Q}} |y\rangle $$
&lt;p>When this is applied to $|\psi_3\rangle$, phase interference (quantum interference) occurs.&lt;/p>
$$ |\psi_4\rangle = \text{QFT} |\psi_3\rangle = \frac{1}{\sqrt{MQ}} \sum_{y=0}^{Q-1} \sum_{k=0}^{M-1} e^{2\pi i \frac{(x_0 + kr)y}{Q}} |y\rangle $$
&lt;p>Expanding the sum in this equation reveals the part:&lt;/p>
$$ \sum_{k=0}^{M-1} e^{2\pi i \frac{kry}{Q}} $$
&lt;p>This sum of a geometric series reinforces each other (Constructive Interference) only when $ry/Q$ is close to an integer, and cancels each other out (Destructive Interference) otherwise.&lt;/p>
&lt;p>Therefore, the state $|y\rangle$ measured with high probability will be an integer $y$ that satisfies the condition:&lt;/p>
$$ \frac{y}{Q} \approx \frac{c}{r} $$
&lt;p>(where $c$ is some integer).&lt;/p>
&lt;h3 id="43-identifying-the-period-via-continued-fraction-expansion">4.3. Identifying the Period via Continued Fraction Expansion
&lt;/h3>&lt;p>After obtaining $y$ through measurement, we perform a &lt;strong>&amp;ldquo;Continued Fraction Expansion&amp;rdquo;&lt;/strong> of $y/Q$ using a classical computer. This allows us to calculate the convergent fraction $c/r$ of $y/Q$, and extract candidates for the period $r$ from the denominator with high efficiency.&lt;/p>
&lt;hr>
&lt;h2 id="5-comparison-of-conceptual-models-and-the-paradigm-shift">5. Comparison of Conceptual Models and the Paradigm Shift
&lt;/h2>&lt;p>To intuitively understand the difference between GNFS and Shor&amp;rsquo;s algorithm, we present a conceptual diagram using Mermaid notation.&lt;/p>
&lt;h3 id="conceptual-diagram-of-shors-algorithm-via-quantum-circuit">Conceptual Diagram of Shor&amp;rsquo;s Algorithm via Quantum Circuit
&lt;/h3>&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">graph TD
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> A[Initial State: 0...0] --&amp;gt; B[Superposition of all states via Hadamard Transform]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> B --&amp;gt; C[Modular exponentiation a^x mod N]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> C --&amp;gt;|Quantum Entanglement| D[Collapse to a state with periodicity]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> D --&amp;gt; E[Quantum Fourier Transform QFT]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> E --&amp;gt;|Probability amplification via interference| F[Measurement: Obtain y]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> F --&amp;gt; G[Classical processing: Continued Fraction Expansion]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> G --&amp;gt; H[Discovery of period r]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> H --&amp;gt; I[Calculate prime factors of N]
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> style A fill:#f9f,stroke:#333,stroke-width:2px
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> style E fill:#bbf,stroke:#333,stroke-width:2px
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> style I fill:#bfb,stroke:#333,stroke-width:2px
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;h3 id="the-essence-of-the-paradigm-shift">The Essence of the Paradigm Shift
&lt;/h3>&lt;p>GNFS takes the approach of &lt;strong>&amp;ldquo;searching for relations within a mathematical space (number field).&amp;rdquo;&lt;/strong> However, since the search space expands exponentially with the number of digits, it becomes virtually unsolvable for classical computer capabilities (even including parallelization) when the key length exceeds 2048 bits.&lt;/p>
&lt;p>On the other hand, Shor&amp;rsquo;s algorithm utilizes the &lt;strong>&amp;ldquo;wave nature of quantum interference.&amp;rdquo;&lt;/strong> It simultaneously evaluates all computation paths in a superposition state, uses QFT to cancel out (destructively interfere) unnecessary answers, and amplifies (constructively interferes) only the probability amplitude of the period that is the correct answer. Through this, instead of searching space, it realizes a completely different dimensional approach of &lt;strong>&amp;ldquo;making the correct answer itself surface.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;h2 id="6-summary">6. Summary
&lt;/h2>&lt;p>In this article, we deeply compared the mathematical backgrounds and algorithmic structures of &lt;strong>&amp;ldquo;GNFS,&amp;rdquo;&lt;/strong> the pinnacle of classical limits, and &lt;strong>&amp;ldquo;Shor&amp;rsquo;s Algorithm,&amp;rdquo;&lt;/strong> which demonstrates the power of quantum computing.&lt;/p>
&lt;p>While GNFS drove computational complexity down to sub-exponential time by employing mathematical tricks such as polynomial selection and massive matrix calculations, Shor&amp;rsquo;s algorithm fused the fundamental principles of quantum mechanics—superposition and interference—with a mathematical tool (QFT), achieving a breakthrough to polynomial time in one stroke.&lt;/p>
&lt;p>Currently, Fault-Tolerant Quantum Computers (FTQC) capable of executing Shor&amp;rsquo;s algorithm at a practical scale (thousands of qubits) do not exist. However, the very existence of this mathematical and theoretical paradigm shift is the primary reason why the transition to Post-Quantum Cryptography (PQC) is urgently being accelerated worldwide today.&lt;/p></description></item></channel></rss>