






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Bellโs Inequality is powerful demonstration that there is some- thing very strange going on with quantum mechanics. But could this โstrangenessโ be of any use to solve computational problems not directly related to quantum systems? A priori, one could guess the answer is no. In 1994 Peter Shor showed that one would be wrong:
Theorem 19.1 โ Shorโs Theorem. The map that takes an integer ๐ into its prime factorization is efficiently quantumly computable. Specifically, it can be computed using ๐(log^3 ๐) quantum gates.
This is an exponential improvement over the best known classical algorithms, which as we mentioned before, take roughly 2 ๐(log1/3ฬ^ ๐) time. We will now sketch the ideas behind Shorโs algorithm. In fact, Shor proved the following more general theorem:
Theorem 19.2 โ Order Finding Algorithm. There is a quantum polyno- mial time algorithm that given a multiplicative Abelian group ๐พ and element ๐ โ ๐พ computes the order of ๐ in the group.
Recall that the order of ๐ in ๐พ is the smallest positive integer ๐ such that ๐๐^ = 1. By โgiven a groupโ we mean that we can represent the elements of the group as strings of length ๐(log |๐พ|) and there is a ๐๐๐๐ฆ(log |๐พ|) algorithm to perform multiplication in the group.
19.1 FROM ORDER FINDING TO FACTORING AND DISCRETE LOG The order finding problem allows not just to factor integers in polyno- mial time, but also solve the discrete logarithm over arbitrary Abelian groups, hereby showing that quantum computers will break not just RSA but also Diffie Hellman and Elliptic Curve Cryptography. We merely sketch how one reduces the factoring and discrete logarithm
Compiled on 11.17.2021 22:
364 an intensive introduction to cryptography
problems to order finding: (see some of the sources above for the full details)
19.2 FINDING PERIODS OF A FUNCTION: SIMONโS ALGORITHM
Let โ be some Abelian group with a group operation that weโll denote by โ, and ๐ be some function mapping โ to an arbitrary set (which we can encode as {0, 1}โ). We say that ๐ has period โโ^ for some โโ^ โ โ if for every ๐ฅ, ๐ฆ โ โ, ๐(๐ฅ) = ๐(๐ฆ) if and only if ๐ฆ = ๐ฅ โ ๐โโ^ for some integer ๐. Note that if ๐พ is some Abelian group, then if we define โ = โค|๐พ|, for every element ๐ โ ๐พ, the map ๐(๐) = ๐๐^ is a periodic map over โ with period the order of ๐. So, finding the order of an item reduces to the question of finding the period of a function. How do we generally find the period of a function? Let us consider the simplest case, where ๐ is a function from โ to โ that is โโ^ periodic for some number โโ, in the sense that ๐ repeats itself on the intervals [0, โโ], [โโ, 2โโ], [2โโ, 3โโ], etc.. How do we find this number โโ? The key idea would be to transform ๐ from the time to the frequency do- main. That is, we use the Fourier transform to represent ๐ as a sum of wave functions. In this representation wavelengths that divide the period โโ^ would get significant mass, while wavelengths that donโt would likely โcancel outโ. Similarly, the main idea behind Shorโs algorithm is to use a tool known as the quantum fourier transform that given a circuit computing the function ๐ โถ โ โ โ, creates a quantum state over roughly log |โ| qubits (and hence dimension |โ|) that corresponds to the Fourier transform of ๐. Hence when we measure this state, we get a group element โ with probability proportional to the square of the corre- sponding Fourier coefficient. One can show that if ๐ is โโ-periodic then we can recover โโ^ from this distribution. Shor carried out this approach for the group โ = โคโ๐ for some ๐, but we will start be seeing this for the group โ = {0, 1}๐^ with
366 an intensive introduction to cryptography
(^1) In the context of Fourier transform it is customary and convenient to denote the ๐ฅ๐กโ^ coordinate of a vector ๐ by ๐(๐ฅ) rather than ๐๐ฅ.
Simonโs algorithm seems to really use the special bit-wise structure of the group {0, 1}๐, so one could wonder if it has any relevance for the group โคโ๐ for some exponentially large ๐. It turns out that the same insights that underlie the well known Fast Fourier Transform (FFT) algorithm can be used to essentially follow the same strategy for this group as well.
19.3 FROM SIMON TO SHOR
(Note: The presentation here is adapted from the quantum computing chapter in my textbook with Arora.) We now describe how to achieve Shorโs algorithm for order finding. We will not do this for a general group but rather focus our attention on the group โคโโ for some number โ which is the case of interest for integer factoring and the discrete logarithm modulo primes problems. That is, we prove the following theorem:
Theorem 19.4 โ Shorโs Algorithm, restated. For every โ and ๐ โ โคโโ, there is a quantum ๐๐๐๐ฆ(๐๐๐โ) algorithm to find the order of ๐ in โคโโ.
The idea is similar to Simonโs algorithm. We consider the map ๐ฅ โฆ ๐๐ฅ( mod โ) which is a periodic map over โค๐ where ๐ = |โคโโ| with period being the order of ๐. To find the period of this map we will now need to perform a Quan- tum Fourier Transform (QFT) over the group โค๐ instead of {0, 1}๐. This is a quantum algorithm that takes a register from some arbitrary state ๐ โ โ๐^ into a state whose vector is the Fourier transform ๐ ฬof ๐. The QFT takes only ๐(log^2 ๐) elementary steps and is thus very efficient. Note that we cannot say that this algorithm โcomputesโ the Fourier transform, since the transform is stored in the amplitudes of the state, and as mentioned earlier, quantum mechanics give no way to โread outโ the amplitudes per se. The only way to get information from a quantum state is by measuring it, which yields a single basis state with probability that is related to its amplitude. This is hardly repre- sentative of the entire Fourier transform vector, but sometimes (as is the case in Shorโs algorithm) this is enough to get highly non-trivial information, which we do not know how to obtain using classical (non-quantum) computers.
19.3.1 The Fourier transform over โค๐ We now define the Fourier transform over โค๐ (the group of integers in {0, โฆ , ๐ โ 1} with addition modulo ๐). We give a definition that is specialized to the current context. For every vector ๐ โ โ๐, the Fourier transform of ๐ is the vector ๐ ฬwhere the ๐ฅ๐กโ^ coordinate of ๐ ฬis defined as^1
quantum computing and cryptography ii 367
๐ฅ๐ฆ where ๐ = ๐2๐๐/๐. The Fourier transform is simply a representation of ๐ in the Fourier basis {๐๐ฅ}๐ฅโโค๐ , where ๐๐ฅ is the vector/function whose ๐ฆ๐กโ^ coordinate is โ๐๐^1 ๐ฅ๐ฆ. Now the inner product of any two vectors ๐๐ฅ, ๐๐ง in this basis is equal to
โจ๐๐ฅ, ๐๐งโฉ = (^) ๐^1 โ ๐ฆโโค๐
๐ฆโโค๐
But if ๐ฅ = ๐ง then ๐(๐ฅโ๐ง)^ = 1 and hence this sum is equal to 1. On the other hand, if ๐ฅ โ ๐ง, then this sum is equal to (^) ๐^1 1โ๐ (๐ฅโ๐ฆ)๐ 1โ๐๐ฅโ๐ฆ^ = 1 ๐ 1โ 1โ๐๐ฅโ๐ฆ^ = 0^ using the formula for the sum of a geometric series. In other words, this is an orthonormal basis which means that the Fourier transform map ๐ โฆฬ ๐ is a unitary operation. What is so special about the Fourier basis? For one thing, if we identify vectors in โ๐^ with functions mapping โค๐ to โ, then itโs easy to see that every function ๐ in the Fourier basis is a homomorphism from โค๐ to โ in the sense that ๐(๐ฆ + ๐ง) = ๐(๐ฆ)๐(๐ง) for every ๐ฆ, ๐ง โ โค๐. Also, every function ๐ is periodic in the sense that there exists ๐ โ โค๐ such that ๐(๐ฆ + ๐) = ๐(๐ง) for every ๐ฆ โ โค๐ (indeed if ๐(๐ฆ) = ๐๐ฅ๐ฆ^ then we can take ๐ to be โ/๐ฅ where โ is the least common multiple of ๐ฅ and ๐). Thus, intuitively, if a function ๐ โถ โค๐ โ โ is itself periodic (or roughly periodic) then when representing ๐ in the Fourier basis, the coefficients of basis vectors with periods agreeing with the period of ๐ should be large, and so we might be able to discover ๐โs period from this representation. This does turn out to be the case, and is a crucial point in Shorโs algorithm.
19.3.2 Fast Fourier Transform. Denote by FT ๐ the operation that maps every vector ๐ โ โ๐^ to its Fourier transform ๐. The operationฬ FT ๐ is represented by an ๐ ร ๐ matrix whose (๐ฅ, ๐ฆ)th entry is ๐๐ฅ๐ฆ. The trivial algorithm to compute it takes ๐^2 operations. The famous Fast Fourier Transform (FFT) algo- rithm computes the Fourier transform in ๐(๐ log ๐) operations. We now sketch the idea behind the FFT algorithm as the same idea is used in the quantum Fourier transform algorithm. Note that ๐(๐ฅ) =ฬ โ^1 ๐ โ ๐ฆโโค๐^ ๐(๐ฆ)๐
โ^1 ๐ โ๐ฆโโค๐,๐ฆ ๐๐ฃ๐๐ ๐(๐ฆ)๐
Now since ๐^2 is an ๐/2th root of unity and ๐๐/2^ = โ1, letting ๐ be the ๐/2 ร ๐/2 diagonal matrix with diagonal entries ๐^0 , โฆ , ๐๐/2โ1, we get that FT ๐(๐)๐๐๐ค = FT ๐/2(๐๐๐ฃ๐๐) + ๐ FT ๐/2(๐๐๐๐) FT ๐(๐)โ๐๐โ = FT ๐/2(๐๐๐ฃ๐๐) โ ๐ FT ๐/2(๐๐๐๐)
quantum computing and cryptography ii 369
(^2) To compute this map we may need to extend the register by some additional ๐๐๐๐ฆ๐๐๐(๐) many qubits, but we can ignore them as they will always be equal to zero except in intermediate computations.
to be the result of applying for every ๐ โ {0, โฆ , ๐ โ 2} the following elementary operation on the ๐๐กโ^ qubit of the register: |0โฉ โฆ |0โฉ and |1โฉ โฆ ๐^2 ๐ |1โฉ. The final state is equal to ๐ ฬby the FFT equations (we leave this as an exercise)
19.4 SHORโS ORDER-FINDING ALGORITHM.
We now present the central step in Shorโs factoring algorithm: a quan- tum polynomial-time algorithm to find the order of an integer ๐ mod- ulo an integer โ.
Theorem 19.6 โ Order finding algorithm, restated. There is a polynomial- time quantum algorithm that on input ๐ด, ๐ (represented in bi- nary) finds the smallest ๐ such that ๐ด๐^ = 1 (mod ๐ ).
Let ๐ก = โ5 log(๐ด + ๐ )โ. Our register will consist of ๐ก + ๐๐๐๐ฆ๐๐๐(๐ ) qubits. Note that the function ๐ฅ โฆ ๐ด๐ฅ^ (mod ๐ ) can be computed in ๐๐๐๐ฆ๐๐๐(๐ ) time and so we will assume that we can compute the map |๐ฅโฉ|๐ฆโฉ โฆ |๐ฅโฉ|๐ฆ โ (๐ด๐ฅ^ (mod ๐ โฉ)) (where we identify a number ๐ โ {0, โฆ , ๐ โ 1} with its representation as a binary string of length log ๐ ).^2 Now we describe the order-finding algorithm. It uses a tool of elementary number theory called continued fractions which allows us to approximate (using a classical algorithm) an arbitrary real num- ber ๐ผ with a rational number ๐/๐ where there is a prescribed upper bound on ๐ (see below) We now describe the algorithm and the state, this time including normalizing factors.
๐พโ โ=0 |๐ฅ^0 + โ๐โฉ|๐ฆ^0 โฉ^ where^ ๐ฅ^0 is the smallest number such that ๐ด๐ฅ^0 = ๐ฆ 0 (mod ๐ ) and ๐พ = โ(๐ โ 1 โ ๐ฅ 0 )/๐โ.)
๐พโ โ=0 ๐
In the analysis, it will suffice to show that this algorithm outputs the order ๐ with probability at least ฮฉ(1/ log ๐ ) (we can always am- plify the algorithmโs success by running it several times and taking the smallest output).
370 an intensive introduction to cryptography
19.4.1 Analysis: the case that ๐|๐ We start by analyzing the algorithm in the case that ๐ = ๐๐ for some integer ๐. Though very unrealistic (remember that ๐ is a power of 2 !) this gives the intuition why Fourier transforms are useful for detecting periods.
Claim: In this case the value ๐ฅ measured will be equal to ๐๐ for a random ๐ โ {0, โฆ , ๐ โ 1}. The claim concludes the proof since it implies that ๐ฅ/๐ = ๐/๐ where ๐ is random integer less than ๐. Now for every ๐, at least ฮฉ(๐/ log ๐) of the numbers in [๐ โ 1] are co-prime to ๐. Indeed, the prime number theorem says that there at least this many primes in this interval, and since ๐ has at most log ๐ prime factors, all but log ๐ of these primes are co-prime to ๐. Thus, when the algorithm computes a rational approximation for ๐ฅ/๐, the denominator it will find will indeed be ๐. To prove the claim, we compute for every ๐ฅ โ โค๐ the absolute value of |๐ฅโฉโs coefficient before the measurement. Up to some normalization factor this is โฃโ๐โ1โ=0 ๐(๐ฅ^0 +โ๐)๐ฅโฃ = โฃ๐๐ฅ^0 ๐โฒ๐โฃ โฃโ๐โ1โ=0 ๐๐โ๐ฅโฃ = 1 โ โฃโ๐โ1โ=0 ๐๐โ๐ฅโฃ. If ๐ does not divide ๐ฅ then ๐๐^ is a ๐๐กโ^ root of unity, so โ๐โ1โ=0 ๐ค๐โ๐ฅ^ = 0 by the formula for sums of geometric progressions. Thus, such a number ๐ฅ would be measured with zero probability. But if ๐ฅ = ๐๐ then ๐๐โ๐ฅ^ = ๐ค๐๐๐โ^ = ๐๐๐^ = 1, and hence the amplitudes of all such ๐ฅโs are equal for all ๐ โ {0, 2, โฆ , ๐ โ 1}.
19.4.2 The general case In the general case, where ๐ does not necessarily divide ๐, we will not be able to show that the measured value ๐ฅ satisfies ๐|๐ฅ๐. However, we will show that with ฮฉ(1/ log ๐) probability, (1) ๐ฅ๐ will be โalmost divisibleโ by ๐ in the sense that 0 โค ๐ฅ๐ (mod ๐) < ๐/10 and (2) โ๐ฅ๐/๐โ is coprime to ๐. Condition (1) implies that |๐ฅ๐ โ ๐๐| < ๐/10 for ๐ = โ๐ฅ๐/๐โ. Dividing by ๐๐ gives โฃ (^) ๐๐ฅ โ ๐๐ โฃ < (^) 10๐^1. Therefore, ๐๐ is a rational number with denominator at most ๐ that approximates (^) ๐๐ฅ to within 1/(10๐) < 1/(4๐ 4 ). It is not hard to see that such an approximation is unique (again left as an exercise) and hence in this case the algorithm will come up with ๐/๐ and output the denominator ๐. Thus all that is left is to prove the next two lemmas. The first shows that there are ฮฉ(๐/ log ๐) values of ๐ฅ that satisfy the above two con- ditions and the second shows that each is measured with probability ฮฉ((1/
Lemma 1: There exist ฮฉ(๐/ log ๐) values ๐ฅ โ โค๐ such that:
372 an intensive introduction to cryptography
then write ๐ผ = โ๐ผโ +
If we continue this process for ๐ steps, we get a rational number, de- noted by [๐ 0 , ๐ 1 , โฆ , ๐๐], which can be represented as ๐ ๐๐๐ with ๐๐, ๐๐ coprime. The following facts can be proven using induction:
Furthermore, it is known that โฃ ๐ ๐๐๐ โ ๐ผโฃ< (^) ๐๐๐^1 ๐+1 (โ) which implies
that ๐ ๐๐๐ is the closest rational number to ๐ผ with denominator at most ๐๐. It also means that if ๐ผ is extremely close to a rational number, say, โฃ๐ผ โ ๐๐ โฃ < (^) 4๐^14 for some coprime ๐, ๐ then we can find ๐, ๐ by iterating the continued fraction algorithm for ๐๐๐๐ฆ๐๐๐(๐) steps. Indeed, let ๐๐ be the first denominator such that ๐๐+1 โฅ ๐. If ๐๐+1 > 2๐^2 then (โ) implies that โฃ ๐ ๐๐๐ โ ๐ผโฃ < (^) 2๐^12. But this means that ๐ ๐๐๐ = ๐๐ since there is at most one rational number of denominator at most ๐ that is so close to ๐ผ. On the other hand, if ๐๐+1 โค 2๐^2 then since ๐ ๐๐+1๐+1 is closer to ๐ผ than ๐๐ , โฃ ๐ ๐๐+1๐+1 โ ๐ผโฃ < (^) 4๐^14 , again meaning that ๐ ๐๐+1๐+1 = ๐๐. Itโs not hard to verify
that ๐๐ โฅ 2๐/2, implying that ๐๐ and ๐๐ can be computed in ๐๐๐๐ฆ๐๐๐(๐๐) time.
19.5.1 Quantum cryptography There is another way in which quantum mechanics interacts with cryptography. These โspooky actions at a distanceโ have been sug- gested by Weisner and Bennet-Brassard as a way in which parties can create a secret shared key over an insecure channel. On one hand, this concept does not require as much control as general-purpose quantum computing, and so it has in fact been demonstrated physically. On the other hand, unlike transmitting standard digital information, this โinsecure channelโ cannot be an arbitrary media such as wifi etc.. but rather one needs fiber optics, lasers, etc.. Unlike quantum computers, where we only need one of those to break RSA, to actually use key exchange at scale we need to setup these type of networks, and so it is unclear if this approach will ever dominate the solution of Alice sending to Bob a Brinkโs truck with the shared secret key. People have proposed some other ways to use the interesting properties of quan- tum mechanics for cryptographic purposes including quantum money and quantum software protection.