Sponsored Links

Kamis, 14 Desember 2017

Sponsored Links

Shor's algorithm - YouTube
src: i.ytimg.com

Shor's algorithm, named after mathematician Peter Shor, is a quantum algorithm (an algorithm that runs on a quantum computer) for integer factorization formulated in 1994. Informally, it solves the following problem: given an integer N, find its prime factors.

On a quantum computer, to factor an integer N, Shor's algorithm runs in polynomial time (the time taken is polynomial in log N, which is the size of the input). Specifically it takes quantum gates of order O((log N)2(log log N)(log log log N)) using fast multiplication, demonstrating that the integer factorization problem can be efficiently solved on a quantum computer and is thus in the complexity class BQP. This is substantially faster than the most efficient known classical factoring algorithm, the general number field sieve, which works in sub-exponential time - about O(e1.9 (log N)1/3 (log log N)2/3). The efficiency of Shor's algorithm is due to the efficiency of the quantum Fourier transform, and modular exponentiation by repeated squarings.

If a quantum computer with a sufficient number of qubits could operate without succumbing to noise and other quantum decoherence phenomena, Shor's algorithm could be used to break public-key cryptography schemes such as the widely used RSA scheme. RSA is based on the assumption that factoring large numbers is computationally intractable. So far as is known, this assumption is valid for classical (non-quantum) computers; no classical algorithm is known that can factor in polynomial time. However, Shor's algorithm shows that factoring is efficient on an ideal quantum computer, so it may be feasible to defeat RSA by constructing a large quantum computer. It was also a powerful motivator for the design and construction of quantum computers and for the study of new quantum computer algorithms. It has also facilitated research on new cryptosystems that are secure from quantum computers, collectively called post-quantum cryptography.

In 2001, Shor's algorithm was demonstrated by a group at IBM, who factored 15 into 3 × 5, using an NMR implementation of a quantum computer with 7 qubits. After IBM's implementation, two independent groups implemented Shor's algorithm using photonic qubits, emphasizing that multi-qubit entanglement was observed when running the Shor's algorithm circuits. In 2012, the factorization of 15 was performed with solid-state qubits. Also in 2012, the factorization of 21 was achieved, setting the record for the largest number factored with Shor's algorithm. In April 2012, the factorization of 143 was achieved, although this used adiabatic quantum computation rather than Shor's algorithm. In November 2014, it was discovered that this 2012 adiabatic quantum computation had also factored larger numbers, the largest being 56153.


Video Shor's algorithm



Procedure

The problem we are trying to solve is: given an odd composite number N {\displaystyle N} , find an integer d {\displaystyle d} , strictly between 1 {\displaystyle 1} and N {\displaystyle N} , that divides N {\displaystyle N} . We are interested in odd values of N {\displaystyle N} because any even value of N {\displaystyle N} trivially has the number 2 {\displaystyle 2} as a prime factor. We can use a primality testing algorithm to make sure that N {\displaystyle N} is indeed composite.

Moreover, for the algorithm to work, we need N {\displaystyle N} not to be the power of a prime. This can be tested by checking that N k {\displaystyle {\sqrt[{k}]{N}}} is not an integer, for all k <= log 2 ( N ) {\displaystyle k\leq \log _{2}(N)} .

Since N {\displaystyle N} is not a power of a prime, it is the product of two coprime numbers greater than 1 {\displaystyle 1} . As a consequence of the Chinese remainder theorem, the number 1 {\displaystyle 1} has at least four distinct square roots modulo N {\displaystyle N} , two of them being 1 {\displaystyle 1} and - 1 {\displaystyle -1} . The aim of the algorithm is to find a square root b {\displaystyle b} that is different from 1 {\displaystyle 1} and - 1 {\displaystyle -1} ; such a b {\displaystyle b} will lead to a factorization of N {\displaystyle N} , as in other factoring algorithms like the quadratic sieve.

In turn, finding such a b {\displaystyle b} is reduced to finding an element a {\displaystyle a} of even period with a certain additional property (as explained below, it is required that the condition of Step 6 of the classical part does not hold). The quantum algorithm is used for finding the period of randomly chosen elements a {\displaystyle a} , as this is a hard problem on a classical computer.

Shor's algorithm consists of two parts:

  1. A reduction, which can be done on a classical computer, of the factoring problem to the problem of order-finding.
  2. A quantum algorithm to solve the order-finding problem.

Classical part

For example: N = 15 , a = 7 , r = 4 {\displaystyle N=15,a=7,r=4} , g c d ( 7 2 ± 1 , 15 ) = g c d ( 49 ± 1 , 15 ) {\displaystyle \mathrm {gcd} (7^{2}\pm 1,15)=\mathrm {gcd} (49\pm 1,15)} , where g c d ( 48 , 15 ) = 3 {\displaystyle \mathrm {gcd} (48,15)=3} , and g c d ( 50 , 15 ) = 5 {\displaystyle \mathrm {gcd} (50,15)=5} .

Quantum part: period-finding subroutine

The quantum circuits used for this algorithm are custom designed for each choice of N and each choice of the random a used in f(x) = ax mod N. Given N, find Q = 2q such that N 2 <= Q < 2 N 2 {\displaystyle N^{2}\leq Q<2N^{2}} , which implies Q / r > N {\displaystyle Q/r>N} . The input and output qubit registers need to hold superpositions of values from 0 to Q - 1, and so have q qubits each. Using what might appear to be twice as many qubits as necessary guarantees that there are at least N different x which produce the same f(x), even as the period r approaches N/2.

Proceed as follows:


Maps Shor's algorithm



Explanation of the algorithm

The algorithm is composed of two parts. The first part of the algorithm turns the factoring problem into the problem of finding the period of a function, and may be implemented classically. The second part finds the period using the quantum Fourier transform, and is responsible for the quantum speedup.

Obtaining factors from period

The integers less than N and coprime with N form the multiplicative group of integers modulo N, a finite abelian group G {\displaystyle G} . The size of this group is given by Euler's totient function ? ( N ) {\displaystyle \phi (N)} . By the end of step 3, we have an integer a in this group. Since the group is finite, a must have a finite order r, the smallest positive integer such that

a r ? 1   mod   N . {\displaystyle a^{r}\equiv 1\ {\mbox{mod}}\ N.}

Therefore, N {\displaystyle N} divides a r - 1 {\displaystyle a^{r}-1} (also written N | a r - 1 {\displaystyle N\mid a^{r}-1} ). Suppose we are able to obtain r, and it is even. (If r is odd, see step 5.) Now b ? a r / 2 ( mod N ) {\displaystyle b\equiv a^{r/2}{\pmod {N}}} is a square root of 1 modulo N {\displaystyle N} , different from 1. This is because r {\displaystyle r} is the order of a {\displaystyle a} modulo N {\displaystyle N} , so a r / 2 ? 1 ( mod N ) {\displaystyle a^{r/2}\not \equiv 1{\pmod {N}}} , else the order of a {\displaystyle a} in this group would be r / 2 {\displaystyle r/2} . If a r / 2 ? - 1 ( mod N ) {\displaystyle a^{r/2}\equiv -1{\pmod {N}}} , by step 6 we have to restart the algorithm with a different random number a {\displaystyle a} .

Eventually, we must hit an a {\displaystyle a} , of order r {\displaystyle r} in G {\displaystyle G} , such that b ? a r / 2 ? 1 , - 1 ( mod N ) {\displaystyle b\equiv a^{r/2}\not \equiv 1,-1{\pmod {N}}} . This is because such a b {\displaystyle b} is a square root of 1 modulo N {\displaystyle N} , other than 1 and - 1 {\displaystyle -1} , whose existence is guaranteed by the Chinese remainder theorem, since N {\displaystyle N} is not a prime power.

We claim that d = gcd ( b - 1 , N ) {\displaystyle d=\operatorname {gcd} (b-1,N)} is a proper factor of N {\displaystyle N} , that is, d ? 1 , N {\displaystyle d\neq 1,N} . In fact if d = N {\displaystyle d=N} , then N {\displaystyle N} divides b - 1 {\displaystyle b-1} , so that b ? 1 ( mod N ) {\displaystyle b\equiv 1{\pmod {N}}} , against the construction of b {\displaystyle b} . If on the other hand d = gcd ( b - 1 , N ) = 1 {\displaystyle d=\operatorname {gcd} (b-1,N)=1} , then by Bézout's identity there are integers u , v {\displaystyle u,v} such that

( b - 1 ) u + N v = 1 {\displaystyle (b-1)u+Nv=1} .

Multiplying both sides by b + 1 {\displaystyle b+1} we obtain

( b 2 - 1 ) u + N ( b + 1 ) v = b + 1 {\displaystyle (b^{2}-1)u+N(b+1)v=b+1} .

Since N {\displaystyle N} divides b 2 - 1 ? a r - 1 ( mod N ) {\displaystyle b^{2}-1\equiv a^{r}-1{\pmod {N}}} , we obtain that N {\displaystyle N} divides b + 1 {\displaystyle b+1} , so that b ? - 1 ( mod N ) {\displaystyle b\equiv -1{\pmod {N}}} , again contradicting the construction of b {\displaystyle b} .

Thus d {\displaystyle d} is the required proper factor of N {\displaystyle N} .

Finding the period

Shor's period-finding algorithm relies heavily on the ability of a quantum computer to be in many states simultaneously. Physicists call this behavior a "superposition" of states. To compute the period of a function f, we evaluate the function at all points simultaneously.

Quantum physics does not allow us to access all this information directly, though. A measurement will yield only one of all possible values, destroying all others. If not for the no cloning theorem, we could first measure f(x) without measuring x, and then make a few copies of the resulting state (which is a superposition of states all having the same f(x)). Measuring x on these states would provide different x values which give the same f(x), leading to the period. Because we cannot make exact copies of a quantum state, this method does not work. Therefore, we have to carefully transform the superposition to another state that will return the correct answer with high probability. This is achieved by the quantum Fourier transform.

Shor thus had to solve three "implementation" problems. All of them had to be implemented "fast", which means that they can be implemented with a number of quantum gates that is polynomial in log N {\displaystyle \log N} .

  1. Create a superposition of states. This can be done by applying Hadamard gates to all qubits in the input register. Another approach would be to use the quantum Fourier transform (see below).
  2. Implement the function f as a quantum transform. To achieve this, Shor used repeated squaring for his modular exponentiation transformation. It is important to note that this step is more difficult to implement than the quantum Fourier transform, in that it requires ancillary qubits and substantially more gates to accomplish.
  3. Perform a quantum Fourier transform. By using controlled rotation gates and Hadamard gates, Shor designed a circuit for the quantum Fourier transform (with Q = 2q) that uses just q ( q - 1 ) / 2 = O ( ( log Q ) 2 ) {\displaystyle q(q-1)/2=O((\log Q)^{2})} gates.

After all these transformations a measurement will yield an approximation to the period r. For simplicity assume that there is a y such that yr/Q is an integer. Then the probability to measure y is 1. To see that we notice that then

e - 2 ? i b y r Q = 1 {\displaystyle e^{-{\frac {2\pi ibyr}{Q}}}=1}

for all integers b. Therefore, the sum whose square gives us the probability to measure y will be Q/r since b takes roughly Q/r values and thus the probability is 1 / r 2 {\displaystyle 1/r^{2}} . There are r y such that yr/Q is an integer and also r possibilities for f ( x 0 ) {\displaystyle f(x_{0})} , so the probabilities sum to 1.

Note: another way to explain Shor's algorithm is by noting that it is just the quantum phase estimation algorithm in disguise.

The bottleneck

The runtime bottleneck of Shor's algorithm is quantum modular exponentiation, which is by far slower than the quantum Fourier transform and classical pre-/post-processing. There are several approaches to constructing and optimizing circuits for modular exponentiation. The simplest and (currently) most practical approach is to mimic conventional arithmetic circuits with reversible gates, starting with ripple-carry adders. Knowing the base and the modulus of exponentiation facilitates further optimizations. Reversible circuits typically use on the order of n 3 {\displaystyle n^{3}} gates for n {\displaystyle n} qubits. Alternative techniques asymptotically improve gate counts by using quantum Fourier transforms, but are not competitive with less than 600 qubits due to high constants.


Realization of a scalable Shor algorithm | Science
src: d2ufo47lrtsv5s.cloudfront.net


Discrete logarithms

Given prime p {\displaystyle p} with generator g {\displaystyle g} where 1 < g < p - 1 {\displaystyle 1<g<p-1} , suppose we know that x = g r ( mod p ) {\displaystyle x=g^{r}{\pmod {p}}} , for some r, and we wish to compute r, which is the discrete logarithm: r = log g x ( mod p - 1 ) {\displaystyle r=\log _{g}x{\pmod {p-1}}} . Consider the abelian group ( Z p ) × × ( Z p ) × {\displaystyle \left(\mathbb {Z} _{p}\right)^{\times }\times \left(\mathbb {Z} _{p}\right)^{\times }} where each factor corresponds to modular multiplication of nonzero values, assuming p is prime. Now, consider the function

f ( a , b ) = g a x - b ( mod p ) . {\displaystyle f(a,b)=g^{a}x^{-b}{\pmod {p}}.}

This gives us an abelian hidden subgroup problem, as f corresponds to a group homomorphism. The kernel corresponds to modular multiples of (r,1). So, if we can find the kernel, we can find r.


Shor's Algorithm and Quantum Fourier Transform(QFT) - YouTube
src: i.ytimg.com


In popular culture

On the television show Stargate Universe, the lead scientist, Dr. Nicholas Rush, hoped to use Shor's algorithm to crack Destiny's master code. He taught a quantum cryptography class at the University of California, Berkeley, in which Shor's algorithm was studied.

In the animated film Summer Wars, the character Kenji Koiso reads an article titled "Shor's Factorization Algorithm" while riding on a train, foreshadowing his ability to understand and calculate complex equations.

In the TV series The Big Bang Theory it was mentioned in a Physics bowl competition in season 1 episode 13.


Quantum computing: Time for venture capitalists to put chips on ...
src: ibmcai.files.wordpress.com


See also

  • Daniel J. Bernstein, who in 2017 proposed a factorization algorithm which is "often much faster than Shor's".

Hacking at Quantum Speed with Shor's Algorithm | Infinite Series ...
src: i.ytimg.com


References


Realization of a scalable Shor algorithm | Science
src: d2ufo47lrtsv5s.cloudfront.net


Further reading

  • Nielsen, Michael A. & Chuang, Isaac L. (2010), Quantum Computation and Quantum Information, 10th Anniversary Edition, Cambridge University Press, ISBN 9781107002173 .
  • Phillip Kaye, Raymond Laflamme, Michele Mosca, An introduction to quantum computing, Oxford University Press, 2007, ISBN 0-19-857049-X
  • "Explanation for the man in the street" by Scott Aaronson, "approved" by Peter Shor. (Shor wrote "Great article, Scott! That's the best job of explaining quantum computing to the man on the street that I've seen."). An alternate metaphor for the QFT was presented in one of the comments. Scott Aaronson suggests the following 12 references as further reading (out of "the 10105000 quantum algorithm tutorials that are already on the web."):
  • Shor, Peter W. (1997), "Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer", SIAM J. Comput., 26 (5): 1484-1509, arXiv:quant-ph/9508027v2 , Bibcode:1999SIAMR..41..303S, doi:10.1137/S0036144598347011 . Revised version of the original paper by Peter Shor ("28 pages, LaTeX. This is an expanded version of a paper that appeared in the Proceedings of the 35th Annual Symposium on Foundations of Computer Science, Santa Fe, NM, Nov. 20--22, 1994. Minor revisions made January, 1996").
  • Quantum Computing and Shor's Algorithm, Matthew Hayward's Quantum Algorithms Page, 2005-02-17, imsa.edu, LaTeX2HTML version of the original LaTeX document, also available as PDF or postscript document.
  • Quantum Computation and Shor's Factoring Algorithm, Ronald de Wolf, CWI and University of Amsterdam, January 12, 1999, 9 page postscript document.
  • Shor's Factoring Algorithm, Notes from Lecture 9 of Berkeley CS 294-2, dated 4 Oct 2004, 7 page postscript document.
  • Chapter 6 Quantum Computation, 91 page postscript document, Caltech, Preskill, PH229.
  • Quantum computation: a tutorial by Samuel L. Braunstein.
  • The Quantum States of Shor's Algorithm, by Neal Young, Last modified: Tue May 21 11:47:38 1996.
  • III. Breaking RSA Encryption with a Quantum Computer: Shor's Factoring Algorithm, Lecture notes on Quantum computation, Cornell University, Physics 481-681, CS 483; Spring, 2006 by N. David Mermin. Last revised 2006-03-28, 30 page PDF document.
  • Lavor, C.; Manssur, L. R. U.; Portugal, R. (2003). "Shor's Algorithm for Factoring Large Integers". arXiv:quant-ph/0303175 . 
  • Lomonaco, Jr (2000). "Shor's Quantum Factoring Algorithm". arXiv:quant-ph/0010034 .  This paper is a written version of a one-hour lecture given on Peter Shor's quantum factoring algorithm. 22 pages.
  • Chapter 20 Quantum Computation, from Computational Complexity: A Modern Approach, Draft of a book: Dated January 2007, Comments welcome!, Sanjeev Arora and Boaz Barak, Princeton University.
  • A Step Toward Quantum Computing: Entangling 10 Billion Particles, from "Discover Magazine", Dated January 19, 2011.
  • Josef Gruska - Quantum Computing Challenges also in Mathematics unlimited: 2001 and beyond, Editors Björn Engquist, Wilfried Schmid, Springer, 2001, ISBN 978-3-540-66913-5

Shor's Algorithm in Mathematica - YouTube
src: i.ytimg.com


External links

  • Version 1.0.0 of libquantum: contains a C language implementation of Shor's algorithm with their simulated quantum computer library, but the width variable in shor.c should be set to 1 to improve the runtime complexity.
  • PBS Infinite Series created two videos explaining the math behind Shor's algorithm, "How to Break Cryptography" and "Hacking at Quantum Speed with Shor's Algorithm".

Source of the article : Wikipedia

Comments
0 Comments