Advanced Engineering Physics
Unit 3: Quantum Computing
I. Introduction to Quantum Computing & Qubits
1. Concept of a Quantum Computer
Classical vs. Quantum Computing Models:
- Classical Computing: Traditional computers operate using the laws of classical physics. Their fundamental unit of information is the bit, their logic gates are sometimes reversible (but often irreversible), and their mathematical foundation relies on boolean algebra.
- Quantum Computing: Quantum computers operate using the laws of quantum physics. Their fundamental unit of information is the quantum bit (qubit). Unlike classical gates, quantum operations (unitary gates) are always reversible, and their mathematical foundation relies on linear algebra.
Complexity Classes: P vs. BQP & Computational Speedups:
- P (Polynomial Time): The complexity class encompassing all problems that can be efficiently solved by a classical computer (meaning the algorithm runs in polynomial time or faster).
- BQP (Bounded-Error Quantum Polynomial-Time): The complexity class of problems that can be efficiently solved by a quantum computer.
- The Strong Church-Turing Thesis: This thesis states that any model of computation can be simulated by a probabilistic classical computer with at most a polynomial overhead in time. Classical computing strongly supports this thesis. However, it is believed that quantum computers can efficiently solve certain problems that are hard for classical computers, thereby violating the Strong Church-Turing Thesis.
- Theoretical Speedups:
- Because quantum computers can process certain algorithms with far fewer steps or queries than classical computers, they achieve notable speedups.
- Exponential Speedup: Finding a secret XOR mask (Simon’s algorithm) takes exponentially fewer queries on a quantum computer.
- Subexponential Speedup: Factoring large prime numbers (Shor’s algorithm) is believed to be intractable for classical computers but is efficiently solvable (in BQP) by a quantum computer, threatening modern RSA cryptography.
- Polynomial/Quadratic Speedup: Brute-force searching an unstructured database of size classically takes queries, but Grover’s algorithm achieves this in queries.
2. Classical Bits vs. Qubits
Core Definitions & Physical Implementation:
- Classical Bits: The smallest unit of classical information. A bit is deterministic and can only hold one of two distinct states: 0 or 1. Physically, they are represented by systems with two clear states, such as a coin (heads/tails), a switch (off/on), optical disc pits/lands, or distinct voltage levels (0 V / 5 V).
- Qubits: The fundamental unit of quantum information. Using Dirac (bra-ket) notation from quantum physics, the two foundational states of a qubit are written as the kets and .
- Physical Qubits: Physically, any quantum system with two distinct states can serve as a qubit. Examples include the polarization states of photons, the energy levels of trapped ions or cold neutral atoms, the spin states in nuclear magnetic resonance or quantum dots, defect qubits (nitrogen-vacancy centers in diamonds), and superconducting circuits.
3. Superposition & The Bloch Sphere
The Principle of Superposition:
- Core Concept: While a classical bit is strictly 0 or 1, the laws of quantum mechanics allow a qubit to exist in a linear combination of both and simultaneously. This is called a superposition.
- Mathematical Expression: A generic qubit state is written as: where and are complex numbers known as amplitudes.
- Measurement & Collapse: A qubit cannot be directly read as a superposition. Upon measurement, the qubit “collapses” into a single definite value. The probability of measuring is given by the norm-square of its amplitude, , and the probability of measuring is . For the state to be normalized (meaning the total probability equals 1), the amplitudes must satisfy .
Examples of Superposition States: If a qubit has amplitudes that are exactly equal in magnitude, it has a 50/50 chance of being measured as or . By changing the relative phase of the amplitudes, we can construct uniquely different superposition states:
- The state:
- The state:
- The state:
- The state:
The Bloch Sphere:
- Visualization: A qubit’s state can be mapped geometrically as a point on the surface of a three-dimensional unit sphere known as the Bloch sphere.
- The pure states and are plotted at the North pole and South pole , respectively.
- Equal superpositions (like , , , and ) are distributed entirely along the sphere’s equator, halfway between the poles.
II. Mathematical Foundations for Quantum Computation
1. Linear Algebra for Quantum Computation
Core Concept: While elementary algebra can be used to track quantum states, it becomes incredibly tedious for complex circuits. Instead, the mathematics of quantum computing is fundamentally built on linear algebra, where numbers are arranged in columns, rows, and tables called matrices.
- States as Column Vectors:
- The fundamental states of a qubit are represented as column vectors of length 2.
- and .
- A generic superposition state is written as the column vector .
- Quantum Operations as Matrices:
- Quantum gates transform basis states into new superpositions. The resulting amplitudes can be arranged side-by-side to form a rectangular array of numbers called a matrix.
- For example, if a gate maps and , the gate is represented by the matrix .
- Unitary Matrices:
- To be a valid quantum gate, a matrix must preserve the total probability of the quantum state (meaning it must keep the sum of the norm-squared amplitudes equal to 1).
- Mathematically, this requires the matrix to be unitary, which is defined by the property , where is the conjugate transpose and is the identity matrix.
- Because , every quantum gate is perfectly reversible, and its inverse is simply its conjugate transpose ().
- Eigenvalues and Eigenvectors:
- Typically, applying a matrix to a vector changes it into a different vector. However, for certain special vectors, applying a specific matrix results in the exact same vector simply multiplied by a scalar number.
- The special vector is called an eigenvector (or eigenstate in quantum systems), and the scalar multiplier is called the eigenvalue.
- Example: If we apply the Pauli-X gate to the state, we get . Therefore, is an eigenvector of with an eigenvalue of 1.
- For unitary matrices, eigenvalues always take the form for some real number (a phase).
2. Dirac’s Bra and Ket Notation & Properties
To easily manipulate these linear algebra components, quantum mechanics utilizes Dirac’s bra-ket notation.
- Kets ():
- A ket represents a quantum state as a column vector.
- Bras ():
- A bra is a row vector representing the conjugate transpose of a ket.
- Step-by-step process: To find the bra , you take the ket , transpose it into a row, and take the complex conjugate of every amplitude.
- If , then . Flipping between a ket and a bra is known as “taking the dual”.
- Inner Products (Bra-Kets):
- Definition: Multiplying a bra on the left and a ket on the right () is called an inner product. The result is always a scalar (a single complex number). It calculates the overlap or projection of one state onto another.
- Calculation: To evaluate , you multiply the first entry of each vector, multiply the second entry of each vector, and add them together: .
- Normalization: If you take the inner product of a state with itself, you get the total probability: . If the state is normalized, this equals 1.
- Orthogonality: If the inner product of two states is exactly zero (e.g., ), the states are defined as orthogonal. Orthogonal states represent completely distinct measurement outcomes.
- Outer Products:
- Definition: Multiplying a ket on the left and a bra on the right () is called an outer product. Unlike inner products, the result of an outer product is a matrix.
- Calculation: To evaluate , you multiply every row element of the ket by every column element of the bra. .
- Creating Operators: Outer products can be added together to construct quantum gates. For example, the Pauli-X gate can be constructed using outer products of the computational basis: .
3. Hilbert Space
- Core Concept: The abstract, complex vector space where all of these bra and ket vectors reside and are manipulated is governed by the strict rules of linear algebra.
- Completeness Relation: A defining property of this space is that any valid quantum state can be fully expressed in terms of an orthonormal basis (e.g., and , or and ).
- Mathematical Expression: If forms a complete orthonormal basis, the sum of their outer products with themselves will always equal the identity matrix : This relation guarantees the “completeness” of the space, meaning no quantum information is lost outside of these basis vectors.
III. Single Qubit Systems & Visualization
1. Bloch’s Sphere: Geometric Representation of a Qubit
Core Definitions & Concepts:
- The Bloch Sphere: The Bloch sphere is a geometric visualization tool where any single qubit state is mapped as a point on the surface of a three-dimensional sphere with a radius of 1.
- Coordinate System Convention: Following standard physics conventions, the z-axis points straight up, the y-axis points to the side, and the x-axis points out of the page.
- The Poles (Z-Basis): The fundamental classical states are located at the poles. The state corresponds to the north pole at Cartesian coordinates , and the state corresponds to the south pole at .
- The Equator (Superpositions): States that are equal parts and (50/50 probability) lie entirely on the equator of the sphere. Changing the relative phase between the amplitudes moves the point around this equator:
- : Located on the positive x-axis at .
- : Located on the negative x-axis at .
- : Located on the positive y-axis at .
- : Located on the negative y-axis at .
- Universal Mapping: A qubit is not restricted to the poles or the equator; a valid qubit state can be any point on the surface of the Bloch sphere.
2. Global vs. Relative Phase
Core Explanations & Theoretical Breakdowns:
- Global Phase: A global phase is an overall complex phase multiplier, such as , applied to the entire quantum state.
- Physical Irrelevance: When calculating the probability of a measurement outcome, we take the norm-square of the amplitude. Because the norm-square of any phase is exactly 1 (), a global phase has zero effect on the measurement probabilities in any basis.
- Conclusion: Global phases are physically irrelevant and can be entirely dropped or ignored. Quantum states that differ only by a global phase correspond to the exact same point on the Bloch sphere.
- Relative Phase: A relative phase is the complex phase difference between the and amplitudes within the superposition.
- Physical Significance: Unlike global phases, relative phases are physically significant because they dictate the exact longitude of the state on the Bloch sphere.
- Example: The states and have different relative phases. While they yield the same 50/50 statistics if measured in the Z-basis, they yield entirely different results if measured in the X-basis (measuring yields 100% of the time, while measuring yields or 50% of the time).
3. Spherical Coordinates: Parameterizing the Qubit State
Mathematical Formulas & Angle Definitions:
- To precisely map any normalized generic state to the Bloch sphere, we parameterize the complex amplitudes and using two angles:
- Polar Angle (): Measures the angle straight down from the north pole (). It is restricted to the range .
- Azimuthal Angle (): Measures the rotation across from the positive x-axis in the xy-equatorial plane. It is restricted to .
- The Parameterization Equation: Because the global phase is irrelevant, we can factor it out to ensure the amplitude of is strictly real and positive. The state is then mathematically written as: . (Note: The angles in the amplitudes are halved (), but the physical angle mapped on the 3D Bloch sphere is ).
- Mapping to Cartesian Coordinates: Once and are known, the exact coordinates on the sphere are calculated using:
Step-by-Step Example Process: To map a complex state like to the Bloch sphere:
- Make the amplitude real: Convert to polar form, which is . Factor out the global phase , leaving the state equivalent to .
- Ensure the equation matches the standard format (+ sign): Convert the minus sign on the amplitude to a phase using . The amplitude becomes . The fully formatted state is: .
- Solve for and :
- Compare to : (or ).
- Compare to : (or ).
- Conclusion: The qubit is located down from the north pole and rotated around the xy-plane from the x-axis.
IV. Multiple Qubit Systems & Entanglement
1. Multiple Qubit Systems
Core Definitions & Concepts:
- The Tensor Product / Kronecker Product: When dealing with multiple qubits, their combined state is mathematically represented using the tensor product (denoted by ). For example, if we have two qubits both in the state, their combined state is written as . In practice, this notation is often compressed to or simply .
- Vector Representation (Kronecker Product Math): In linear algebra, the tensor product is calculated as the Kronecker product, which is obtained by multiplying every term of the first column vector by the entire second column vector.
- Step-by-step Example: To find the vector for (which is ), we multiply the vector for by the vector for : .
Scaling to -Qubit Systems ():
- Exponential Vector Size: With a single qubit, there are 2 basis states. With qubits, the number of basis states scales exponentially to . The general state of an -qubit system is a superposition of all these basis states, meaning its column vector will have exactly complex amplitudes.
- Significance: Because the vector size doubles with every added qubit, a system of just 300 qubits requires tracking amplitudes—a number greater than the total number of atoms in the visible universe. This exponential scaling is evidence of why simulating quantum systems on classical computers becomes rapidly intractable, hinting at the boundary between the P and BQP complexity classes.
2. Entanglement
When multiple qubits interact, their states can either remain independent or become fundamentally linked.
A. Product States (Separable States):
- Core Concept: A multi-qubit state is called a product state (or separable state) if it can be perfectly factored into the tensor products of individual, independent single-qubit states.
- Properties: In a product state, the qubits have no entanglement. If you measure one qubit in a product state, it collapses independently and has absolutely zero effect on the state of the other qubit.
- Example: The state can be factored into , which is precisely the product state .
B. Entangled States & Bell States:
- Core Concept: Quantum states that cannot be factored into the product of individual single-qubit states are called entangled states. Because they cannot be factored, the condition of one qubit is fundamentally intertwined with the condition of the other.
- Measurement Effect: If you measure a single qubit in an entangled state, it instantly affects the state of the other qubit.
- Maximally Entangled States (The Bell States): When measuring one qubit completely determines the outcome of the other qubit, the system is maximally entangled. For two qubits, there are exactly four maximally entangled states, known as the Bell states or EPR pairs (named after Einstein, Podolsky, and Rosen). They are:
- .
- .
- .
- .
- Theoretical Breakdown (Proof of Entanglement): To prove is entangled, attempt to factor it into . Expanding this yields . Matching coefficients with , we find (meaning either or ). However, if , then , which is a contradiction. Thus, no such factorization exists.
C. Monogamy of Entanglement:
- Core Concept: Classically, information can be perfectly correlated among multiple parties (e.g., Alice, Bob, and Charlie can all share the exact same bit value perfectly). Quantum entanglement, however, does not behave this way.
- The Principle: Entanglement is strictly monogamous. The principle dictates that if two qubits (Alice and Bob) are maximally entangled with each other (such as being in the state), they cannot be entangled at all with a third qubit (Charlie).
- Implication: Like an exclusive relationship, the correlation between Alice and Bob in a maximally entangled state is fully exhausted between the two of them, forbidding any quantum correlation with a third party.
V. Quantum Information Processing & System Evolution
1. Quantum Computing System & Evolution of Quantum Systems
- Unitary Evolution:
- Core Concept: In linear algebra, quantum states are represented as vectors, and quantum gates are represented as matrices. For a matrix to represent a valid quantum gate, it must ensure that the total probability of the quantum state remains equal to 1 after the transformation.
- Mathematical Breakdown: Mathematically, a matrix preserves this probability if it satisfies the condition , where is the conjugate transpose of , and is the identity matrix. Matrices that satisfy this exact property are called unitary matrices. Therefore, the evolution of a closed quantum system is governed strictly by unitary matrices.
- Reversibility:
- Core Concept: A matrix is considered reversible (or invertible) if there exists an inverse matrix such that .
- Quantum vs. Classical: In classical computing, gates like AND or OR are irreversible because information is lost (you cannot uniquely determine the inputs from the output). In quantum computing, because every valid gate must be a unitary matrix (), the inverse of the gate is simply its conjugate transpose: .
- Conclusion: This guarantees that all quantum gates are perfectly reversible. You can always undo a quantum operation by applying to the system: .
2. Quantum Gates
A. Single-Qubit Gates All single-qubit quantum gates can be geometrically interpreted as rotations of the qubit’s state around the Bloch sphere.
- Pauli X (NOT) Gate: Turns into , and into . It is represented by the matrix and is geometrically equivalent to a rotation about the x-axis of the Bloch sphere.
- Pauli Y Gate: Turns into , and into . It is represented by the matrix and is a rotation about the y-axis.
- Pauli Z Gate: Keeps as but flips the sign of to . It is represented by the matrix and is a rotation about the z-axis.
- Phase (S) Gate: The square root of the Z gate (). It turns into and into . It corresponds to a rotation about the z-axis and its matrix is .
- T Gate: The square root of the S gate (). It turns into and into . It is a rotation about the z-axis.
- Hadamard (H) Gate: Creates superpositions by turning into the state and into the state. It is represented by the matrix and is a rotation about the diagonal x+z axis.
B. Multi-Qubit Gates
- Controlled-NOT (CNOT / CX) Gate: A two-qubit gate that inverts the target (right) qubit if the control (left) qubit is 1; otherwise, it does nothing.
- Mathematical Operation: It acts as a quantum XOR gate: .
- Significance: CNOT is incredibly important because applying it to a superposition can create entangled states (e.g., produces the maximally entangled Bell state ).
- SWAP Gate: A two-qubit gate that simply swaps the states of two qubits: . It cannot generate entanglement on its own and can be constructed using three sequential CNOT gates.
- Toffoli (CCNOT) Gate: A three-qubit gate (controlled-controlled-NOT) that flips the third (target) qubit if and only if both the first and second (control) qubits are 1: .
- Significance: Because the Toffoli gate is universal for classical computing, its existence as a valid, reversible quantum gate proves that quantum computers can efficiently compute anything a classical computer can.
3. Quantum Measurements
- Collapsing the Wave Function:
- Core Concept: While the laws of quantum mechanics allow a qubit to exist in a superposition (a linear combination like ), a qubit cannot be observed as a superposition.
- The Collapse: Upon measurement, the qubit instantly “collapses” into a single, definite basis state (either or ). Once measured, the original superposition is permanently destroyed.
- Calculating Probabilities:
- The Rule: The probability of getting a specific measurement outcome is mathematically defined as the norm-square of its amplitude.
- Formula & Example: For a normalized state , the probability of measuring is exactly , and the probability of measuring is exactly .
- Step-by-Step Breakdown: If a qubit is in the superposition :
- Identify the amplitude of : .
- Square the norm: . The probability of getting is 75%.
- Identify the amplitude of : .
- Square the norm: . The probability of getting is 25%.
VI. Challenges and Advantages Over Classical Computation
1. Advantages of Quantum Computation
- Quantum Parallelism and Speedups:
- Core Concept: It is a common misconception that quantum computers simply compute all answers at once in a “massively parallel” way; if a superposition of answers is measured, only one result is obtained. Instead, quantum algorithms manipulate the amplitudes of these superpositions to amplify the correct answer before measurement.
- Polynomial & Quadratic Speedups: For brute-force searching an unstructured database of size , classical computers require queries. Quantum computers use Grover’s algorithm to find the target in exactly queries, representing a provable quadratic speedup.
- Exponential Speedups: For certain oracular problems, such as finding a secret XOR mask (Simon’s algorithm), quantum computers can solve the problem in queries compared to a classical computer’s , demonstrating an exponential speedup.
- Phase Kickback:
- Mechanism: When querying a quantum oracle , the standard operation maps the input and answer qubits as . However, if the answer qubit is prepared in the state, querying the oracle leaves the answer qubit unchanged while the input qubit acquires a phase: .
- Significance: This “phase kickback” allows quantum algorithms (like Deutsch-Jozsa and Bernstein-Vazirani) to encode the function’s output directly into the phase of the input qubit, enabling problem-solving in significantly fewer queries.
- Amplitude Amplification:
- Mechanism: Used centrally in Grover’s Algorithm, this process involves repeatedly applying the oracle followed by a reflection operator (which reflects the state about the uniform superposition ).
- Effect: Each rotation step geometrically moves the state closer to the “winner” state in the coordinate plane, amplifying the amplitude (and thus the measurement probability) of the correct answer while suppressing the others.
- Solving Intractable Problems (Shor’s Algorithm):
- The Problem: Factoring large numbers is the basis of modern RSA cryptography because no known classical algorithm can factor large integers efficiently (the best classical algorithm, the Number Field Sieve, takes subexponential time).
- The Quantum Solution: Peter Shor invented a quantum algorithm in 1994 that utilizes the Quantum Fourier Transform to find the period of modular exponents.
- Impact: Shor’s algorithm provides a subexponential speedup over classical computers, rendering RSA vulnerable and suggesting that quantum computers may overturn the Strong Church-Turing Thesis (which states that any computer can be efficiently simulated by a classical probabilistic Turing machine).
2. Challenges in Quantum Computation
- Decoherence:
- Core Concept: Qubits are highly sensitive to their environment, and it is extremely difficult to isolate them while still keeping them accessible for gates and measurements. Interaction with the environment causes “decoherence,” shifting the qubit away from its intended state.
- Bit-Flip Errors: Instead of a complete flip from to , a physical qubit may experience a partial bit-flip error where it rotates only slightly toward the opposite pole on the Bloch sphere.
- Phase-Flip Errors: A qubit can also experience a phase flip, which corresponds to an unintended rotation around the z-axis (e.g., drifting from toward along the equator).
- The No-Cloning Theorem:
- Core Concept: Classically, error correction relies on creating copies of data (like the repetition code). In quantum mechanics, however, it is physically impossible to create an identical copy of a general, unknown quantum state.
- Theoretical Breakdown: If a quantum cloning gate existed, it would have to perform the operation . Because scales quadratically rather than linearly, this violates the fundamental linear algebra governing quantum mechanics (unitary matrices are strictly linear operators).
- Consequence: Because unknown states cannot be copied, classical repetition codes cannot be used directly for quantum error correction.
- Quantum Error Correction:
- Parity Measurements (The Workaround): Because measuring a qubit collapses its superposition, we cannot read the data directly to look for errors. Instead, we use CNOT gates and an extra “ancilla” qubit to calculate the parity of adjacent qubits. This reveals the “error syndrome” (e.g., indicating which specific qubit flipped) without measuring and collapsing the actual encoded quantum information.
- The Shor Code: Invented by Peter Shor, this error-correcting code combines the 3-qubit phase-flip code and the 3-qubit bit-flip code via a method called concatenation.
- Mechanism: It uses exactly 9 physical qubits to securely encode 1 logical qubit (e.g., ).
- Result: By alternating between correcting bit-flip and phase-flip errors using parity measurements, the Shor code can successfully correct all quantum errors, provided no more than one error of each type occurs per triplet in a correction cycle. Building hardware where errors accumulate slowly enough for these codes to keep up—a “fault-tolerant” quantum computer—remains the ultimate goal.
Based strictly on the provided textbook Introduction to Classical and Quantum Computing by Thomas G. Wong, here are your comprehensive, detailed study notes for VII. Quantum Algorithms.
VII. Quantum Algorithms
1. Deutsch-Jozsa Algorithm
- Purpose & Core Concept:
- The algorithm is designed to evaluate a boolean function that takes an -bit binary string and outputs either 0 or 1.
- We are given the promise that the function is either constant (outputs 0 all the time or 1 all the time) or balanced (outputs 0 half the time and 1 half the time). The goal is to determine which category the function falls into.
- Computational Speedup:
- Classical Runtime: To be absolutely certain whether the function is constant or balanced classically, one must query the oracle in the worst-case scenario times.
- Quantum Runtime: The Deutsch-Jozsa algorithm determines the answer with 100% certainty in exactly 1 query. This represents an exponential speedup over exact classical algorithms, though it provides no speedup over bounded-error probabilistic classical algorithms (which require queries).
- Mechanism & Theoretical Breakdown:
- Step 1: Begin with input qubits all in the state and apply a Hadamard gate () to each. This creates a uniform superposition over all possible -bit strings: .
- Step 2: Query the phase oracle , which uses phase kickback (by keeping the answer qubit in the state) to multiply each state by . The state becomes .
- Step 3: Apply the Hadamard gate to all qubits again. Mathematically, this transforms the state into a sum over all possible outcomes , where the amplitude of measuring the specific all-zeros state is exactly .
- Measurement Conclusion:
- If is constant, all values are the same, making the sum evaluate to . The probability of measuring is (100%).
- If is balanced, exactly half of the outputs are 1 and half are 0, causing the positive and negative terms to perfectly cancel out. The amplitude is 0, making the probability of measuring exactly 0%.
- Conclusion: If you measure the qubits and get , the function is constant; if you get anything else, the function is balanced.
2. Grover’s Algorithm
- Purpose & Core Concept:
- The algorithm performs brute-force searching of an unstructured database. Given a function that outputs 0 for all inputs except one special “winner” input where , the goal is to find .
- Computational Speedup & Optimality:
- Classical Runtime: Classically, one must check the inputs one by one, requiring queries (where ) to find the winner on average.
- Quantum Runtime: Grover’s algorithm finds the winner in queries, delivering a provable quadratic speedup over classical searches.
- Optimality: It has been mathematically proven that quantum computers cannot solve this brute-force problem faster than . Therefore, Grover’s algorithm is optimally efficient, and proves that quantum computers cannot magically brute-force NP-complete problems in polynomial time by simply checking all answers in superposition.
- Mechanism & Amplitude Amplification:
- Step 1: Initialize the system by applying Hadamards to all qubits, creating a uniform superposition of all states. We define as the superposition of all non-winner states.
- Step 2: Query the phase oracle . Because and , phase kickback flips the sign (amplitude) of the winner state while leaving unchanged. Geometrically, this reflects the state across the axis.
- Step 3: Apply the reflection operator , which reflects the state about the uniform superposition state .
- Result: Together, and rotate the quantum state vector by exactly toward the winner state in the 2D plane.
- By repeating this process times, the state aligns almost perfectly with , meaning a measurement will yield the winner with near 100% probability.
3. Shor’s Algorithm
- Purpose & Core Concept:
- Shor’s algorithm efficiently solves the problem of prime factorization: given a large integer that is the product of two prime numbers and , find and .
- Because modern RSA public-key cryptography relies on the fact that factoring is practically impossible for classical computers, Shor’s algorithm theoretically breaks RSA encryption.
- Computational Speedup:
- Classical Runtime: The best known classical factoring method (the number field sieve) takes subexponential time (roughly ).
- Quantum Runtime: Shor’s algorithm provides a subexponential speedup over classical algorithms (running in polynomial time ), serving as strong evidence against the Strong Church-Turing thesis.
- Mechanism & Theoretical Breakdown:
- The algorithm reduces the problem of factoring to finding the period of a modular exponential function . It contains three primary steps:
- Step 1 (Classical): Pick a random number . Check the greatest common divisor . If it is , you got extremely lucky and found a factor. If , proceed to Step 2.
- Step 2 (Quantum Period Finding): Use a quantum computer to find the period of the function .
- This is done by preparing an equal superposition of eigenstates using a modular multiplication gate.
- By utilizing the Quantum Phase Estimation algorithm, the quantum computer evaluates the phase of these eigenstates.
- An Inverse Quantum Fourier Transform (IQFT) is applied to the eigenvalue register to extract an -bit approximation of (where is an integer).
- A classical continued fractions algorithm is then used on this approximation to deduce the exact period . Ensure is even and ; otherwise pick a new .
- Step 3 (Classical): With the correct period found, calculate the factors using elementary number theory: and .