Factorization of numbers with Gauss sums: III. Algorithms with Entanglement
aa r X i v : . [ qu a n t - ph ] O c t Factorization of numbers with Gauss sums:III. Algorithms with Entanglement
S W¨olk and W P Schleich Institute of Quantum Physics and Center for Integrated Quantum Science andTechnology, Ulm University,Albert-Einstein-Allee 11, D-89081 Ulm, GermanyE-mail: [email protected]
Abstract.
We propose two algorithms to factor numbers using Gauss sums andentanglement: (i) in a Shor-like algorithm we encode the standard Gauss sum in oneof two entangled states and (ii) in an interference algorithm we create a superpositionof Gauss sums in the probability amplitudes of two entangled states.These schemes arerather efficient provided that there exists a fast algorithm that can detect a period ofa function hidden in its zeros.PACS numbers: Valid PACS appear here
1. Introduction
Gauss sums, that are sums whose phases depend quadratically on the summation index,have periodicity properties that make them ideal tools to factor numbers. The crucialrole of periodicity in the celebrated Shor algorithm has recently been identified andsummarized by N. D. Mermin [1] in the statement “
Quantum mechanics is connected tofactoring through periodicity ... and a quantum computer provides an extremely efficientway to find periods ”.In a series of papers [2, 3] we have analyzed the possibilities of Gauss sums forfactorization offered by their periodicity properties. Although our considerations wereconfirmed by numerous experiments [4] the schemes proposed so far scale exponentiallysince they do not envolve entanglement. In the present article we propose and investigatetwo algorithms which connect [5, 6] Gauss sum factorization with entanglement.Throughout our article, we consider two interacting quantum systems and describethem by two complete sets of states with discrete eigenvalues. We pursue twoapproaches: (i) we encode the absolute value of the standard Gauss sum in one of thetwo quantum states, and (ii) we create an interference of Gauss sums in the probabilityamplitudes of a quantum state.Since our first algorithm is inspired by the one of Shor, we replace the modularexponentiation f used by Shor by a function g defined by the standard Gauss sum.However, there is a crucial difference between f and g : whereas every value of f is actorization with Gauss sums: Entanglement g takes on the same value several times.In this case, the periodicity is stored in the zeros of a probability distribution. Moreover,this method is based on a very specific initial state which is unfortunately hard to realize.In order to avoid these complications, we encode in the second approach the Gauss sumin the probability amplitudes of the state rather than in the state itself. In this way weobtain a superposition of Gauss sums.Our article is organized as followes: in Sec. 2 we combine the Shor algorithmwith Gauss sum factorization by replacing the function f by the appropriately standardGauss sum g . The discussion of this new algorithm leads in Sec. 3 to the idea of usingentanglement to estimate the Gauss sum W ( N ) n , which we then apply to factor numbers.We conclude in Sec. 4 by summarizing our results and presenting an outlook.
2. Shor algorithm with Gauss sum
In this section, we discuss a generalization of the Shor algorithm where the absolutevalue of an appropriately normalized standard Gauss sum replaces the modularexponentiation. For this purpose, we first analyze the periodicity properties of thisfunction and then suggest an algorithm similar to Shor. Next, we investigate thefactorization properties depending on the measurement outcome of the second system.We conclude with a brief discussion of the similarities and differences between theoriginal Shor algorithm and our alternative proposal.
The Shor algorithm [7] contains two crucial ingredients: (i) the mathematical property that the function f ( ℓ, N ) ≡ a ℓ mod N (1)exhibits a period r , that is f ( ℓ, N ) = f ( ℓ + r, N ), and (ii) the quantum mechanicalproperty that the Quantum Fourier Transform (QFT) is able to find the period of afunction in an efficient way.However, we now show that it is possible to construct an algorithm similar to theone by Shor, by using the periods of other functions which also contain informationabout the factors of a given number N . An example is the function g ( ℓ, N ) ≡ N | G ( ℓ, N ) | (2)expressed in terms of the standard Gauss sum [8, 9] G ( ℓ, N ) ≡ N − X m =0 exp (cid:20) π i m ℓN (cid:21) . (3)The properties of G provide us with the explicit form g = gcd( ℓ, N ) (4) actorization with Gauss sums: Entanglement g is determined by the greatest common divisor (gcd) of N and ℓ .We now analyze the periodicity properties of g for the two cases: (i) N consists oftwo, or (ii) more than two prime factors. g ( ℓ , ) ℓ Figure 1.
Periodicity properties of the function g = g ( ℓ, N ) defined by (2) for theexample N = 35 = 5 ·
7. This function contains one perfect period r = 35, given bythe number N = 35, and two imperfect periods ˜ r = 5 , N . At multiples k of a factor p = 5 or 7 the function g is given by the factor itself.However, if ℓ is also a multiple of N = 35 as marked by rectangles, the periodicityrelation g ( ℓ, N ) = g ( ℓ + ˜ r, N ) does not hold anymore. N consists of two prime factors If N contains only the two prime factors p and q , the explicit value of the function g = g ( ℓ, N ) is given by g ( ℓ, N ) = N if ℓ = k · Np if ℓ = k · pq if ℓ = k · q . (5)As a consequence, g shows one perfect period r = N , where the identity g ( ℓ, N ) = g ( ℓ + r, N ) is valid for all arguments ℓ , and two imperfect periods ˜ r = p, q , where g ( ℓ, N ) = g ( ℓ + ˜ r, N ) is valid for allmost all arguments ℓ . This behavior of g is displayedin figure 1 for the example N = 35. Indeed, every argument ℓ of g which is a multipleof a factor p leads to a value of g equal to this factor. However, for arguments ℓ = k · N which are also multiples of N the function g yields g ( k · N, N ) = N , and therefore theperiodicity relation g ( ℓ, N ) = g ( ℓ + k · p, N ) does not hold true for these arguments.Furthermore, the imperfect periods given by the factors of N interrupt each other.For example, all arguments ℓ which are multiples of q do not satisfy the periodicityrelation for the imperfect period ˜ r = p because the greatest common divisor of ℓ = sq actorization with Gauss sums: Entanglement N is q (if s = k · p ) and therefore g ( s · q, N ) = q. (6)However, the argument ℓ = s · q + k · p shares in general no factor with N . Therefore,we obtain g ( s · q + k · p, N ) = 1 . (7)
15 4515152135 g ( ℓ , ) ℓ Figure 2.
For numbers N with more than two factors such as N = 105 = 3 · · g which stands out mostclearly for multiples of factors such as p = 5. Whenever the argument ℓ is a multipleof a product of two or more factors, such as ℓ = 30 = 2 · ·
5, the signal is enhanced,and the periodicity relation is not valid at these arguments. N consists of three or more prime factors If N consists of more than two primefactors, such as N = 105 = 3 · ·
7, then the signal g is more complicated, as shown infigure 2. Here, the imperfect periodicity at multiples of factors is interrupted for every ℓ , which shares more than one prime factor with N , such as ℓ = 30 = 2 · ·
5. However,these arguments ℓ form a new imperfect period given by gcd( ℓ, N ) which in our examplereads gcd(30 , N .In the following sections, we will not distinguish between perfect periods andimperfect periods anymore, since the imperfection of the imperfect periods do notinfluence our proposed algorithms, as long as g ( ℓ, N ) = g ( ℓ + ˜ r, N ) is valid for mostarguments ℓ . In the present section we introduce an algorithm which combines Gauss sums andentanglement and is constructed in complete analogy to the Shor algorithm. For the actorization with Gauss sums: Entanglement N with only two prime factors p and q .Similar to Shor, we start with the entangled state | Ψ i A,B ≡ √ Q Q − X ℓ =0 | ℓ i A | g ( ℓ, N ) i B , (8)of two systems A and B . However, in contrast to Shor we encode in system B thefunction g defined by (2) rather than f given by (1). The dimension of system A ischosen to be 2 Q because we want to realize this system with qbits. We will give acondition for the magnitude of Q in the next section.In the second step, we perform a measurement on system B . For an integer N = p · q consisting only of the two prime factors p and q there exist three distinct measurementoutcomes:(i) the number N to be factored, that is g ( ℓ, N ) = N ,(ii) a factor of N , that is g ( ℓ, N ) = p or g ( ℓ, N ) = q ,(iii) unity, that is g ( ℓ, N ) = 1.In case (i), the state of system A after the measurement of B reads | ψ ( N ) i A ≡ N ( N ) M N − X k =0 | k · N i A (9)where the normalization constant N ( N ) ≡ M − / N is given by M N ≡ [2 Q /N ], and [ x ]denotes the smallest integer which is larger than x .The state | ψ ( N ) i A shows a periodicity with period N , which does not help us tofactor the number N . Therefore, we will have to repeat the first two steps of ouralgorithm until the measurement outcome differs from N . Fortunately, case (i) occursonly with the probability P ( N ) B ≈ /N and is therefore not very likely.In case (ii), system A is in a superposition of all number states | ℓ i A , which aremultiples of the factor p of N , but not of N itself giving rise to | ψ ( p ) i A ≡ N ( p ) M p − X k =0 | k · p i A − M N − X k =0 | k · N i A ! (10)where N ( p ) ≡ ( M p − M N ) − / with M p ≡ [2 Q /p ].In this state, as depicted in figure 3 for the example N = 91 and p = 7, onlymultiples of p appear with a non-zero probability P ( p ) A ( ℓ ; N ) ≡ (cid:12)(cid:12) A h p | ψ ( p ) i A (cid:12)(cid:12) (11)which leads to a clearly visible periodicity. However, the periodicity is imperfect atarguments ℓ = k · N , which are multiples of N . We emphasize that this case occurswith the probability P ( p ) B ≈ /p − /N and is therefore more likely than (i).In the third case, system A contains all numbers ℓ which are not multiples of oneof the factors of N . As a consequence, the state reads | ψ (1) i A ≡ N (1) Q − X ℓ =0 | ℓ i A − M p − X k =0 | k · p i A − M q − X k =0 | k · q i A + M N − X k =0 | k · N i A ! (12) actorization with Gauss sums: Entanglement
01 7 91 182 (cid:0) N ( ) (cid:1) − P ( ) A ( ℓ ; ) ℓ Figure 3.
Probability distribution P (7) A ( ℓ ; 91) to find | ℓ i A in the state | ψ (7) i A for theexample N = 91 = 7 ·
13 and p = 7 in the range 1 ≤ ℓ ≤ N = 91 have a vanishing probability. As a consequence, the period of | ψ (7) i A isimperfect. with N (1) ≡ (2 Q − M p − M q + M N ) − / and M q ≡ [2 Q /q ]. Since all multiples of N are contained in the second as well as in the third sum we have subtracted them twice.Therefore, we have to add them once again.The probability for this case is given by P (1) B ≈ − p − q + 1 N = N − p − q + 1 N (13)and takes on the smallest value around 1 / p = 2 and q = N/
2, but tends to unityfor prime factors p ≈ q ≈ √ N .As shown in figure 4, the state | ψ (1) i A exhibits perfect periodicity but every multipleof p and q has zero probability, whereas all other numbers are equally weighted. As aconsequence, in this case the information about the factors is encoded in the “holes”. In the preceding section, we have found that the function g = g ( ℓ, N ) in its dependenceon ℓ exhibits periods which contain information about the factors of N , but in somecases these periods are imperfect. We now analyze if it is possible to extract informationabout the periodicity of g with the help of a QFT defined byˆ U QF T | ℓ i ≡ √ Q Q − X m =0 exp (cid:20) π i mℓ Q (cid:21) | m i . (14)This procedure is analogous to the Shor algorithm. We distinguish two cases for thestate of system A . actorization with Gauss sums: Entanglement (cid:0) N ( ) (cid:1) − P ( ) A ( ℓ ; ) ℓ Figure 4.
Probability distribution P (1) A ( ℓ ; 91) to find | ℓ i A in the state | ψ (1) i A for theexample N = 91 = 7 ·
13 in the range 1 ≤ ℓ ≤ N = 91.The probability is equal to (cid:0) N (1) (cid:1) − for all other arguments. A contains only multiples of p The QFT transforms the state | ψ ( p ) i A given by (10) intoˆ U QF T | ψ ( p ) i A = N ( p ) √ Q Q − X m =0 (cid:20) F (cid:16) pm Q ; M p (cid:17) − F (cid:18) N m Q ; M N (cid:19)(cid:21) | m i A (15)with the definition F ( α ; M ) ≡ M − X k =0 exp [2 π i k α ] . (16)As shown in Appendix A.1 the sum F ( pm/ Q ; M p ) leads to sharp peaks in theprobability distribution˜ P ( p ) A ( m ; N ) ≡ (cid:12)(cid:12)(cid:12) A h p | ˆ U QF T | ψ ( p ) i A (cid:12)(cid:12)(cid:12) (17)for m = m p with m p ≡ j Q p + δ j . (18)These peaks will give us information about the factor p .Unfortunately, the sum F ( N m/ Q ; M N ) also leads to sharp peaks located at m N ≡ j Q /N + δ j . As a consequence, we need to calculate the probability ˜ P ( p,p ) A tofind any m p and compare it to the probability ˜ P ( p,N ) A to measure any m N .In Appendix A.2, we obtain the estimates˜ P ( p ) A ( m p ; N ) > . N − pN p (19) actorization with Gauss sums: Entanglement P ( p ) A ( m N ; N ) > . pN ( N − p ) . (20)As a consequence, we find that peaks at m p are enhanced compared to peaks at m N by the factor ( N − p ) /p ≈ q . This fact is clearly visible in figure 5 for the example N = 91 = 7 ·
13. The large frame shows the peaks located at m p . In the inset wemagnify the probability distribution in the range 1 ≤ m ≤ m N exist. However, they are approximately 13 times smaller. Furthermore, as verifiedin Appendix A.2 the total probability ˜ P ( p,p ) A to find any m p tends to 0 . P ( p,N ) A to find any m N approaches zero. . . . . . . . . .
590 100 292 . . . . . ˜ P ( ) A ( m ; ) · m Figure 5.
Probability distribution ˜ P (7) A ( m ; 91) if the measurement of system B resulted in the factor | i B shown for the example of N = 91 = 7 ·
13. Here, we haveused a system of Q = 11 qbits. Clearly visible are peaks at multiples of 2 / ≈ . ≤ n ≤ / ≈ . timessmaller than those at multiples of 292 . At last, we have to analyze the width of the probability distribution for estimatingthe minimal dimension 2 Q for an unique estimation of p from m p . Here, we follow theconsiderations of N. D. Mermin [1].The measurement result m is within 1 / j · Q /p and therefore (cid:12)(cid:12)(cid:12)(cid:12) m Q − jp (cid:12)(cid:12)(cid:12)(cid:12) ≤ Q +1 . (21) actorization with Gauss sums: Entanglement j ′ /p ′ = j/p which lies within this range of m/ Q ?The distance between these two pairs of numbers can be approximated by (cid:12)(cid:12)(cid:12)(cid:12) jp − j ′ p ′ (cid:12)(cid:12)(cid:12)(cid:12) = (cid:12)(cid:12)(cid:12)(cid:12) jp ′ − j ′ ppp ′ (cid:12)(cid:12)(cid:12)(cid:12) ≥ pp ′ ≥ N . (22)If both combinations would lie whithin 1 / Q +1 of m/ Q then their distance would besmaller than, or equal to 1 / Q .Therefore, if 2 Q > N , then their exists only one combination j · Q /p which lieswithin 1 / m . For a graphical representation of this statement, we refer to figure 6. m Q jp j ′ p ′ Q +1 Q +1 Q ≤ N ≥ N Figure 6.
Graphical demonstration of the uniqueness of j/p . The ratio j/p must bewithin 1 / Q +1 of m/ Q . Every other combination j ′ /p ′ with j ′ /p ′ = j/p must differat least 1 /N from j/p . Therefore, if N < Q then j ′ /p ′ cannot be within 1 / Q +1 of m/ Q , too. We conclude by emphasizing that we can extract in 40% of the measurements thefactor p of N . Furthermore, the imperfection of the periodicity does not influence theability of the QFT to find the period p . A does not contain any multiples of p or q When we perform the QFTon the state | ψ (1) i A given by (12) we arrive atˆ U QF T | ψ (1) i A = N (1) √ Q Q − X m =0 h F (cid:16) m Q ; 2 Q (cid:17) − F (cid:16) pm Q ; M p (cid:17) − F (cid:16) qm Q ; M q (cid:17) + F (cid:18) N m Q ; M N (cid:19)(cid:21) | m i A (23)where we have recalled the definition of F from (16).As estimated in Appendix A.3, the peaks at m p and m q ≡ j · Q /q + δ j areapproximately q times, or p times higher than peaks at m N . However, they are smallerin comparison to case (ii), where the measured value of system B was equal to p . Allthese aspects are visible in figure 7 for the example N = 91 = 7 · actorization with Gauss sums: Entanglement m p or m q is given by˜ P (1 ,p or q ) A = p ˜ P (1) A ( m p ; N ) + q ˜ P (1) A ( m q ; N ) = N q + N p + q + p − NN ( N − q − p + 1) , (24)as calculated in Appendix A.3. This probability tends to zero for large N with twoprime factors which are of the order of √ N . As a consequence, it is not useful to try tofind the period of | ψ (1) i A with a QFT.The periodicity of | ψ (1) i A is perfect, since the states corresponding to integermultiples of p and q are missing. Moreover,there exist many points with the samevalue. In contrast, in the Shor algorithm, every integer ℓ in the range 0 ≤ ℓ ≤ r − f , and therefore, we are able to find the period r withthe help of a QFT. In our scheme there exist approximately p numbers ℓ in the range0 ≤ ℓ ≤ p − g . As a consequence, it is not possibleanymore to find the period p with the help of a QFT. Nevertheless, the state | ψ (1) i A is remarkable, because the information about the factors of N is still endcoded in theperiodicity. Since the QFT is not a good tool to find this period, we need to developanother instrument which extracts the information about the periodicity of | ψ (1) i A inan efficient way. In this section, we have analyzed a factorization algorithm constructed in completeanalogy to the one by Shor but with the function g given by (2) instead of f determinedby (1). Our approach combines the periodicity properties of Gauss sums with the QFT.Although we have found some rather encouraging results there are problems with thisapproach. Indeed, it is not possible to measure a period with the help of a QFT if thereexists a large amount of arguments ℓ within one period were the function assumes thesame value. As a consequence, the problem of our scheme is not the imperfection of theperiodicity of g but the large number of arguments ℓ with g ( ℓ, N ) = 1.Furthermore, we emphasize that the QFT for the case (ii) is not necessary. Ameasurement of the state | ψ ( p ) i A , given by (10), itself will also give us the informationabout the period p . In contrast, the Shor algorithm relies on the state | φ i ≡ √ M M − X m =0 | ℓ + mr i A (25)which contains not only the period r , but also the unknown variable ℓ . Since it isnot possible to extract r from an argument ℓ + mr , the QFT is essential in the Shoralgorithm. Furthermore, several runs of the Shor algorithm lead to different numbers ℓ In summary, the modular exponentiation is not only special, because its periodcontains information about the factors of N , but also because every value appears onlyonce [1] in a period. Moreover, we suspect that there may exist quantum algorithms,which find periods of a function in an efficient way despite the fact that nearly allarguments ℓ in one period assume the same value. This may be achieved for example actorization with Gauss sums: Entanglement . . . . . . . . . .
590 157 . . . . . . ˜ P ( ) A ( m ; ) · m Figure 7.
Probability distribution ˜ P (1) A ( m ; 91) of system A conditioned on themeasurement of system B with the result | i B and the QFT for the example N =91 = 7 ·
13. Here, we have used a system of 11 qbits. Clearly visible are peaksat multiples of 2 / ≈ . / ≈ .
4. The inset magnifies the range1 ≤ n ≤
100 where also peaks at multiples of 2 / ≈ . times smaller than the peaks at multiples of 292 .
4. A comparisonwith figure 5 shows that all peaks are smaller than in the case (ii). by a comparison of this periodic function with a function were all arguments assumethe same value. Interferometry could archieve such a task. Here, two possibilities offerthemselves: i) We can couple the systems A und B to an ancilla system and preparethe superposition by a Hadamard transform. However, in this case we are confrontedwith a probabilistic approach in the spirit of quantum state engineering [11]. ii) In orderto avoid small probabilities for the desired measurement outcomes we rather pursue anidea based on adiabatic passage, a technique that has already been used successfully inmany situations of quantum optics to synthesize quantum states [12]. actorization with Gauss sums: Entanglement
3. Algorithm based on a superposition of Gauss sums
In Sec. 2 we have discussed an algorithm inspired by the one of Shor [7] which uses theGauss sum g instead of the modular exponentiation. However, we did not explain howto create the initial state | Ψ i A,B defined by (8). Indeed, this task is quite complicated,because in general it is not possible to display and add in an exact way complex numbersof the form e i ϕ with a finite amount of qbits. Therefore, we pursue in this section anotherapproach where we encode g not in the states | ℓ i B of system B but in their probabilityamplitudes. Encoding a Gauss sum in a probability amplitude of a quantum state was already doneexperimentally [4] for the truncated Gauss sum A ( M ) N ( ℓ ) ≡ M + 1 M X m =0 exp (cid:20) π i m Nℓ (cid:21) . (26)Moreover, the number M + 1 of terms of A ( M ) N grows only polynomial with the numberof digits of N , whereas for the standard Gauss sum G , defined by (3), it increasesexponentially. Furthermore, we want to estimate G for several ℓ in parallel. For thisreason, it is not useful to realize G experimentally by a pulse train, or in a ladder systemor by interferometry as proposed in [3].On the other hand, G has two major advantages compared to A ( M ) N : (i) | G | showsan enhanced signal not only at arguments ℓ = p but also at integer multiples of factors,and (ii) the signal at multiples of a factor is enhanced by the factor itself and not onlyby √
2. As a consequence, for the state | ψ i ≡ N N − X ℓ =0 G ( ℓ, N ) | ℓ i (27)the probability to find the state | ℓ i with ℓ being any multiple of a factor p is p timeshigher than finding | ℓ = k · p i . The amount of arguments ℓ , which are not multiples of p , is approximatly p times higher than the amount of multiples of p . As a consequence,the product of the probability of finding ℓ = k · p times the amount of numbers ℓ = k · p with 0 ≤ ℓ ≤ N − ℓ = k · p times the amount of numbers ℓ = k · p with 0 ≤ ℓ ≤ N −
1. Therefore, theprobability to find any multiple of a factor is around 50%.As a result, we have found a fast factorization algorithm provided we are able toprepare the state | ψ i defined in (27) in an efficient way. Unfortunately, this is not aneasy task. On the other hand, we can use entanglement to calculate the sum W ( N ) n ( ℓ ) ≡ N N − X m =0 exp (cid:20) π i ( m ℓN + m nN ) (cid:21) , (28)which is very close to the standard Gauss sum G and shows similar properties. Wetherefore now propose an algorithm based on W ( N ) n . actorization with Gauss sums: Entanglement The idea of our algorithm is that system A is in a state of superposition of all trialfactors ℓ and the summation in m in the Gauss sum W ( N ) n is realized by a superpositionof system B . Therefore, we start from the product state | Ψ i A,B ≡ N N − X ℓ,m =0 | ℓ i A | m i B (29)where the dimensions of the systems A and B are equal to the number N to be factored.Next, we produce phase factors of the form exp [2 π i m ℓ/N ]which appear in theGauss sum W ( N ) n by realizing the unitary transformationˆ U ph ≡ exp (cid:20) π i ˆ n B ˆ n A N (cid:21) . (30)Here, ˆ n j denotes the number operator of the system j = A, B and N defines theperiodicity of the phase.The operator ˆ U ph entangles the two systems, and the state | Ψ i A,B of the combinedsystem is now given by | Ψ i A,B ≡ ˆ U ph | Ψ i A,B = 1 N N − X ℓ,m =0 exp (cid:20) π i m ℓN (cid:21) | ℓ i A | m i B . (31)We emphasize, that the information about the Gauss sum is not stored in a singlesystem, but in the phase relations between the two systems. Therefore, tracing outone system and applying a number state measurement on the other, or measuring thenumber states of both systems would not help us to estimate the Gauss sums W ( N ) n . Itwould only show that all trial factors have equal weight. As a consequence, we have toperform local operations on the individual systems, which do not destroy the informationinherent in the phase relations but help us to read out the Gauss sum.Therefore, we perform as a second step a QFT, as defined in (14) on system B andthe state of the complete system reads | Ψ i A,B ≡ ˆ U QF T ˆ U ph | Ψ i A,B = 1 √ N N − X n,ℓ =0 W ( N ) n ( ℓ ) | ℓ i A | n i B (32)where W ( N ) n ( ℓ ) denotes the Gauss sum defined in (28).This operation achieves two tasks: (i) the sum of quadratic phase terms is nowindependent of system B . For this reason, we are able to make a measurement onsystem B leaving the sum of the quadratic phase terms in tact; and (ii) in addition tothem a second phase term which is linear in m arises.After a measurement on system B with outcome | n i B , system A is in the quantumstate | ψ i A ∼ N − X ℓ =0 W ( N ) n ( ℓ ) | ℓ i A . (33) actorization with Gauss sums: Entanglement W ( N ) n is equivalent to G only for n = 0. Nevertheless, W ( N ) n ( ℓ ) showsproperties which are similar to but not exactly the same as G ( ℓ, N ). Therefore, we haveto investigate now the influence of n on W ( N ) n . A In this section, we discuss the probability distribution P ( n ) A ( ℓ, N ) ≡ N ( n ) |W ( N ) n ( ℓ ) | (34)of system A , provided the measurement result of system B is equal to n , and analyze itsfactorization properties. Here, N denotes a normalization constant. Furthermore, weinvestigate how the measurement outcome n of system B influences these properties.From Appendix B we recall the result |W ( N ) n ( ℓ ) | = N if gcd( ℓ, N ) = 1 pN if gcd( ℓ, N ) = p & gcd( n , p ) = p ℓ, N ) = p & gcd( n , p ) = p , (35)and recognize that there is a distinct difference between trial factors ℓ which share acommon divisor with N and trial factors which do not. Depending on whether n is (i)equal to zero, (ii) shares a common factor p with N , or (iii) shares no common divisorwith N , the probability for factors and their multiples is much higher than for othertrial factors, or equal to zero. In any case, it is possible to distinguish between factorsand nonfactors.Now, we investigate the abilities of these three classes of probability distributionsto factor the number N . n is equal to zero A special case occurs for n = 0 where the probabilitydistribution P (0) A ( ℓ, N ) is equal to the absolute value squared of the Gauss sum G ( ℓ, N ).It is the only case, where the probability P ( n ) A ( ℓ = 0 , N ) is nonzero. Indeed, here itis N times larger than for trial factors, which do not share a common divisor with N .However, also in this case the probability to find a multiple of any factor p of N is p times larger compared to arguments which do not share a common factor with N . It isfor this reason that the multiples of the factors p = 7 and 13 stand out in figure 8.Important for the present discussion is not the probability for a given ℓ itself, butthe probability P (0) A to find any multiple of a factor. Now, we assume that N containsonly the two prime factors p and q = N/p . In this case, there exist
N/p − p with the probability p/ (4 N − p − N/p + 1) and p − q = N/p with the probability (
N/p ) / (4 N − p − N/p + 1). Therefore, P (0) A isgiven by P (0) A = 2 N − p − N/p N − p − N/p ) + 1 . (36) actorization with Gauss sums: Entanglement ℓ · (cid:12)(cid:12)(cid:12) W ( ) ( ℓ ) (cid:12)(cid:12)(cid:12) Figure 8.
Factorization of N = 91 = 7 ·
13 with the help of the probabilitydistribution P (0) A ( ℓ ; 91)to find the state | ℓ i A in system A if we have measured before thestate | n = 0 i B in system B . This probability distribution is proportional to |W (91)0 | .The probability for ℓ = 0 is N = 91 times larger than for trial factors which do notshare a common divisor with N . For arguments ℓ which are multiples of a factor p = 7or 13 the probability is p = 7 or 13 times larger, respectively. For large integers N we can neglect the term +1 in the denominator and arrive at theasymptotic behavior P (0) A −−−−→ N →∞ . (37)As a consequence, the probability to find any multiple of a factor tends for large N to 1 / P (0) A ( ℓ, N ) is an excellent tool for factoring. n and N share a common divisor p If n is a multiple of p with N = p · q the probability to find ℓ = k · p is p times larger than for other trial factors ℓ . Butthe probability to measure a multiple of q is equal to zero. This fact is clearly visiblein figure 9 where we factor the number N = 91 = 7 ·
13 with the help of P (14) A ( ℓ, n = 14 shares the common factor 7 with N = 91, all multiples of 7 have aprobability that is 7 times larger than arguments which do not share a common factor.In contrast, the probability to obtain any multiple of 13 is still zero.In order to derive the probability P ( k · p ) A to find any multiple of a factor we note thatthere exist N/p − p with probability p/ (2 N − p − N/p + 1)and arrive at P ( k · p ) A = N − p N − p ) − N/p + 1 . (38)This function is monotonically decreasing for 2 ≤ p ≤ N/
2. Therefore, we get thesmallest probability for the largest possible prime factor of N , which is N/ actorization with Gauss sums: Entanglement ℓ · (cid:12)(cid:12)(cid:12) W ( ) ( ℓ ) (cid:12)(cid:12)(cid:12) Figure 9.
Factorization of N = 91 = 7 ·
13 with the help of the probabilitydistribution P (14) A ( ℓ ; 91) to find the state | ℓ i A in the system A if we have measuredbefore the state | n = 14 i B . This probability is proportional to |W (91)14 | . For ℓ beinga multiple of 7 the probability is seven times larger than for other trial factors, butfor the multiples of the factor 13, the probability vanishes, because n = 14 is not amultiple of 13. to min (cid:16) P ( k · p ) A (cid:17) = N/ N − −−−−→ N →∞ , (39)which for large N also tends to 1 / n = k · p displays a similar behavior as n = 0: Theprobability P ( k · p ) A ( ℓ, N ) is also an excellent tool for factoring. n and N do not share a common divisor As shown in Fig. 10 the probability P ( n = k · p ) A to find a multiple of a factor is equal to zero if n and N do not share acommon divisor. As a consequence, it is not possible to deduce the factors of N with afew measurements of the state of system A . Nevertheless, it should still be possible toextract the factors of N from P ( n = k · p ) A , although at the moment we do not know howto perform this task in an efficient way. However, there exist proposals that encodinginformation in the zeros [10] of a function is better than encoding them in the maxima.Therefore, we suspect that there may exist an algorithm to obtain the information aboutthe factors of N from the zeros of P ( n = k · p ) A ( ℓ, N ). B In the preceding section we have found that the probability distribution of system A depends crucially on the measurement outcome n of system B . Depending on whether n is a multiple of a factor of N or not, system A shows a different behavior. Therefore, actorization with Gauss sums: Entanglement ℓ · (cid:12)(cid:12)(cid:12) W ( ) ( ℓ ) (cid:12)(cid:12)(cid:12) Figure 10.
Factorization of N = 91 = 7 ·
13 with the help of the probabilitydistribution P (4) A ( ℓ ; 91) to find | ℓ i A in system A if we have measured before the state | n = 4 i B . The probability is proportional to |W (91)4 | . Clearly visible are the zeroswhen ℓ is a multiple of a factor such as p = 7 or 13. All other trial factors ℓ are equallyprobable. it is essential to investigate the probability distribution of system B for predicting thebehavior of system A which constitutes the topic of the present section.With the help of the quantum state (32) of the combined system the probabilitydistribution P B ( n, N ) ≡ N − X ℓ =0 | A h ℓ | B h n || Ψ i A,B | (40)for system B is given by P B ( n, N ) = 1 N N − X ℓ =0 (cid:12)(cid:12) W ( N ) n ( ℓ ) (cid:12)(cid:12) . (41)From the explicit expression (35) for (cid:12)(cid:12)(cid:12) W ( N ) n ( ℓ ) (cid:12)(cid:12)(cid:12) we obtain the result P B ( n, N ) = 1 N (cid:26)(cid:20) N ( N − p − q + 1) + 1 (cid:21) δ n, + pN ( q − δ gcd(n , N) , p + qN ( p − δ gcd(n , N) , q (cid:27) (42)if N is the product of the two prime numbers p and q .An example for such a probability is depicted in figure 11, where we show P B ( n, N )for the example N = 91 = 7 ·
13. The probability to find a multiple of the two factors7 and 13 is larger than for other trial factors.However, we are not interested in the probability of a single n , but rather in theprobability P (0 or k · p or k · q ) B that n is equal to zero, or a multiple of a factor, because inthese two cases it is possible to efficiently extract the information about the factors of N . Since P (0 or k · p or k · q ) B is given by the sum over all probabilities P B ( n, N ) where n fallsinto one of these cases that is P (0 or k · p or k · q ) B ≡ P B (0 , N ) + ( q − P B ( p, N ) + ( p − P B ( q, N ) (43) actorization with Gauss sums: Entanglement n · P B ( n ; ) Figure 11.
Probability P B ( n ; 91) for system B to be in the state | n i B for the example N = 91 = 7 ·
13. For n = 0 the probability is largest. For multiples of a factor theprobability is enhanced compared to other trial factors. we find with the help of (42) and q = N/p the expression P (0 or k · p or k · q ) B = 2 N p + 2 p + 2 pN + 2 pN − p N − N − N . (44)The probability P (0 or k · p or k · q ) B exhibits a minimum at p = √ N , where it is given bymin ( P M ) = 4 N / + 4 N / − N − N −−−−→ N →∞ √ N , (45)and it tends to zero for large N as the inverse of a square root. As a consequence,it is very unlikely that n is equal to zero, or a multiple of a factor but it is highlyprobable that n shares no common divisor with N . Unfortunately, in this case a rapidfactorization based on our algorithm is only possible if we find an efficient way to extractthe factors of N from P ( n = k · p ) A . In Sec.3.2 we have mentioned that the information about factors is contained in theentanglement of the two systems A and B . Indeed, (35) suggests a strong correlationbetween the two systems. We now investigate the degree of entanglement [13, 14] withthe help of the purity µ ≡ Tr i (cid:0) ˆ ρ i (cid:1) (46)of the reduced density operator ˆ ρ i with i = A, B . For a product state the purity is equalto unity. On the other hand, the state is maximally entangled if µ = 1 /D , where D denotes the dimension of the subsystem. We now derive an exact closed-form expressionfor µ . actorization with Gauss sums: Entanglement ρ A of system A after the unitary transformation ˆ U ph following from (30) reads ρ A = 1 N N − X ℓ,ℓ ′ =0 N − X m =0 exp (cid:20) π i m ℓ − ℓ ′ N (cid:21) | ℓ ih ℓ ′ | , (47)which is independent of applying a QFT on system B or not. As a consequence, thepurity µ = 1 N N − X ℓ,k =0 N − X m,m ′ =0 exp (cid:20) π i( m − m ′ ) ℓ − kN (cid:21) (48)of subsystem A can be reduced to µ = 1 N N − X ℓ =0 (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) N − X m =0 exp (cid:20) π i m ℓN (cid:21)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (49)and is given by the sum µ = 1 N N − X ℓ =0 | G ( ℓ, N ) | (50)of the standard Gauss sum G ( ℓ, N ) over all test factors ℓ . Assuming that N only containsthe two prime factors p and q = N/p , the purity can be written in a closed form whichresults from the following considerations.For ℓ = 0 the standard Gauss sum is given by | G ( ℓ = 0 , N ) | = N . Furthermorethere exist N/p − p which leads to the standard Gauss sum | G ( ℓ = k · p, N ) | = pN and p − N/p with | G ( ℓ = k · N/p, N ) | = N /p . For allother trial factors ℓ , there exist N − p − N/p + 1 of them, the standard Gauss sum isgiven by | G ( ℓ ) | = N . Therefore, the closed form of the purity reads µ = 1 N (cid:20) N + pN ( Np −
1) + N p ( p −
1) + N ( N − p − Np + 1) (cid:21) , (51)that is µ = 4 N − p − N/p + 1 N . (52)The purity is maximal for p = √ N and tends in this case for large N to 4 /N . Themaximal value of purity is equal to the minimal degree of entanglement. Since themaximal purity is only 4 /N and therefore very small, the two systems A and B arestrongly entangled. So far, we have not discussed the resources and the time necessary for our proposedalgorithm. Both of them depend strongly on the underlying physical systems. Forexample, we can use two light modes for the two systems A and B and the mostappropriate states are photon number states. As a consequence, the energy needed to actorization with Gauss sums: Entanglement | ℓ i A and | m i B would grow exponentially with the number of digits of N . Therefore, it is more efficient to run the algorithm with qbits. Here, the number Q of qbits scales linearly with the digits of N . However, the use of qbits changes ouralgorithm a little bit. For example, the initial state | Ψ i A,B given by (29) now reads | Ψ ′ i A,B ≡ Q Q − X m,ℓ =0 | ℓ i A | m i B (53)with N < Q , that is the dimension of the system is not anymore given by the number N to be factored. Moreover, this state can be easily prepared by applying a Hadamard-gate to each single qbit whereas the state | Ψ i A,B is hard to create.In the unitary phase operator ˆ U ph defined in (30) the number N to be factored isencoded in an external variable which is independent of the dimension of the system,and can therefore be chosen arbitrarily. However, the QFT works now on a system ofthe size 2 Q and therefore the final state | Ψ ′ i A,B ≡ ˆ U QF T ˆ U ph | Ψ ′ i A,B (54)before the measurement on system B is given by | Ψ ′ i A,B = 12 Q/ Q − X ℓ,n =0 ˜ W ( N ) n ( ℓ, Q ) | ℓ i A | n i B , (55)where we have introduced˜ W ( N ) n ( ℓ, M ) ≡ M M − X m =0 exp (cid:20) π i ( m ℓN + m nM ) (cid:21) . (56)We emphasize that this Gauss sum is a generalization of the Gauss sum W ( N ) n ( ℓ ) definedby (28) due to the different denominators in the quadratic and linear phase. For reasonswe have denoted this Gauss sum ˜ W ( N ) n ( ℓ, M ) includes two arguments.For the investigation of ˜ W ( N ) n , we rewrite the summation index m ≡ sN + k (57)as a multiple s of N plus k and find˜ W ( N ) n ( ℓ, Q ) = 12 Q M N − X s =0 exp (cid:20) π i s N n Q (cid:21) N − X k =0 exp (cid:20) π i (cid:18) k ℓN + k n Q (cid:19)(cid:21) + R ( l ) . (58)The remainder R ( l ) ≡ Q r − X k =0 exp (cid:20) π i k ℓ + k · nN (cid:21) (59)with M N + r = 2 Q consists of less than N terms, whereas the other part contains almost N terms. As a consequence, we neglect R and the probability P ′ B ( n, N ) to measure n in system B is approximately given by P ′ B ( n, N ) ≈ Q Q − X ℓ =0 (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) N − X k =0 exp (cid:20) π i (cid:18) k ℓN + k n Q (cid:19)(cid:21)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (cid:12)(cid:12)(cid:12)(cid:12) F (cid:18) nN Q ; M N (cid:19)(cid:12)(cid:12)(cid:12)(cid:12) (60) actorization with Gauss sums: Entanglement F (cid:0) nN/ Q ; M N (cid:1) from (16).According to Appendix A.1, the function F (cid:0) nN/ Q ; M N (cid:1) is sharply peaked in theneighborhood of n N ≡ j Q N + δ j (61)with | δ j | ≤ / N < Q . This behavior is depicted in figure 12 for the example N = 21 and Q = 9.Since according to Appendix A.1 the sum F can be approximated by F (cid:16) nm Q ; M N (cid:17) ≈ exp [ π i δ j ] 2 π M, (62)we can estimate the probability P ′ B ≡ X n N P ′ B ( n N , N ) (63)to find any n N defined by (61) by P ′ B ≈ π Q N Q Q − X ℓ =0 N − X j =0 (cid:12)(cid:12)(cid:12)(cid:12)(cid:12) N − X k =0 exp (cid:20) π i (cid:18) k ℓN + k jN (cid:19)(cid:21)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12) (64)that is P ′ B ∼ = 4 π Q Q − X ℓ =0 N − X j =0 |W ( N ) j ( ℓ ) | . (65)By using (35) we find N − X j =0 |W ( N ) j ( ℓ ) | = 1 (66)by the following considerations: if gcd( ℓ, N ) = 1 then |W ( N ) j ( ℓ ) | = 1 /N for all j and(66) follows at once; if gcd( ℓ, N ) = p then |W ( N ) j ( ℓ ) | = p/N only for j = k · p and zerofor all other j . Since in this case we have q such terms we again obtain (66).As a consequence of (66), the probability P ′ B given by (65) reduces to P ′ B ∼ = 4 π Q Q − X ℓ =0 π (67)and system A is with a probability greater than 40% in the state | ψ ′ i A ∼ Q − X ℓ =0 W ( N ) j ( ℓ ) | ℓ i A , (68)which is similar to the state | ψ i A given by (33) obtained by the algorithm describedin Sec.3.2. However, it differs from it by the upper limit and by the fact that now themeasurement outcome of system B is not n but the multiple j of 2 Q /N defined by (61).Nevertheless, the properties of the states necessary to factor N are the same. actorization with Gauss sums: Entanglement P ′ B ( n ; ) . . .
15 0 24 . . . . n Figure 12.
Probability P ′ B ( n ; 21) for system B to be in the state | n i B for the example N = 21 = 7 · Q = 9 qbits for the algorithm. The probability is sharplypeaked at multiples of 2 Q /N ≈ . The analysis presented in this section was motivated by the idea to replace in the Shoralgorithm the modular exponentiation by the standard Gauss sum. Indeed, the approachof Sec.2 has lead us to the problem how to prepare the initial state containing thestandard Gauss sum which we could solve in the present section by encoding the Gausssum W ( N ) n ( ℓ ) into the probability amplitudes. However, this technique suffers againfrom the desease, that we arrive at a state, where the factors of N are encoded in theabsence of certain states. As a consequence, the search for an algorithm, which detectsin an efficient way the periodic appearance of missing states is the most important taskfor the future of factorization with Gauss sums.Moreover, we emphasize that by encoding the Gauss sum in the probabilityamplitudes we did not use the periodicity of the function itself, which was important inthe Shor algorithm. The feature of the Gauss sum central to an effective factorizationscheme is the fact that although there exist many more integers ℓ which are useless infactoring the number N , the product of their amount times their probability is nearlyequal to the amount of integers which do help us times their probability. This is theimportant difference to the truncated Gauss sum A ( M ) N . Here, the ratio between theprobability of factors to non-factors can be as small as 1 : 1 / √
2. Furthermore, thetruncated Gauss sum only exhibits maxima for the factors themselves and not for theirmultiples.
4. Summary
So far the major drawback of Gauss sum factorization has been its lack of speed.Therefore, we have combined in the present paper the Shor algorithm with thefactorization with Gauss sums. Here, we have used the features of the absolute value actorization with Gauss sums: Entanglement | G ( ℓ, N ) | of the standard Gauss sum. Since G shows similar periodic properties asthe function f ( ℓ, N ) = a ℓ mod N which plays an important role in the Shor algorithm,we have replaced f by g ( ℓ, N ) ≡ | G ( ℓ, N ) | /N and have investigated the resultingalgorithm. We have shown that f is not only special because it is a periodic function,but also because there does not exist two arguments within one period which exhibitthe same value of the function. This feature is the main difference to g , where nearlyall arguments within one period lead to the same functional value. Therefore, we facethe problem, that we have to distill the period of g out of the zeros of a probabilitydistribution instead of its maxima. Furthermore, by replacing f by g the QFT is notnecessary anymore.Another challenge of our combination of Shor with Gauss sums, is the creation ofthe initial state | Ψ i A,B defined by (8) because g consists of a sum of complex numbersinstead of integers. We have circumvented this problem by encoding the closely relatedGauss sum W ( N ) n in the probability amplitudes instead of the state. Furthermore, thenumber of terms in the standard Gauss sum grows exponentially with the number ofdigits of N which makes it necessary to develop implementation strategies different fromthe ones which had been sucessful [4] with the truncated Gauss sum. Therefore, we haveshown how to realize the Gauss sum W ( N ) n with the help of entanglement in an efficientway. Unfortunately, the resulting algorithm also sufferes from the problem that we needan efficient method to extract information from the zeros of a probability distribution.In summary, we have investigated the similarities and differences of the Shoralgorithm compared to Gauss sum factorization, which has lead us to a deeperunderstanding of both algorithms. Although, we have outlined a possibility for a fastGauss sum factorization algorithm there is still the problem of the information beingencoded in the zeros of the probability. As a consequence, the next challenge is to findan algorithm which performs this task and paves the way for an efficient algorithm ofGauss sum factorization.
5. Acknowledgment
We thank M. Bienert, R. Fickler, M. Freyberger, F. Haug, M. Ivanov, H. Mack,W. Merkel, M. Mehring, E. M. Rasel, M. Sadgrove, C. Schaeff, F. Straub and V. Tammafor many fruitful discussions on this topic. This research was partially supported by theMax Planck Prize of WPS awarded by the Humboldt Foundation and the Max PlanckSociety.
Appendix A. Probabilities for the Shor algorithm with Gauss sums
In the present appendix we first derive an approximation for the sum F ( α ; M ) ≡ M − X k =0 exp [2 π i k α ] (A.1) actorization with Gauss sums: Entanglement α close to an integer j , that is α ≡ j + δ j /M with the upper bound M and | δ j | ≤ /
2. We then apply this approximate expression to calculate the probabilities˜ P ( p,p ) A and ˜ P ( p,N ) A discussed in Sec. 2. Appendix A.1. Approximate expression for F ( α ; M )We establish with the help of the geometric sum M − X k =0 q k = 1 − q M − q (A.2)a closed form expression of F which reads F ( α ; M ) = 1 − exp [2 π i αM ]1 − exp [2 π i α ] . (A.3)By factoring out the phase factor exp [i παM ] in the numerator and exp [i πα ] in thedenominator we are able to rewrite (A.3) as F ( α ; M ) = exp[i πα ( M − παM )sin ( πα ) (A.4)which is a ratio of two sine functions. This function displays maxima at integerarguments α = j . For α = j + δ j /M we arrive at F ( j + δ j /M ; M ) ≈ exp[i πδ j ] sin ( πδ j )sin (cid:16) π δ j M (cid:17) . (A.5)Here, we have made use of the approximation ( M − /M ≈ π ( k + x )) = ( − k sin( πx ) and exp[i πk ] = ( − k for integer k and that for odd j oneof the two expressions jM and j ( M −
1) is even.The argument x ≡ πδ j of the sine function in the numerator lies in the regime0 ≤ x ≤ π/ δ j ≤ sin ( πδ j ) (A.6)as we demonstrate graphically in figure A1.Furthermore, the sine function in the denominator of (A.5) can be approximatedby sin ( πδ j /M ) ≈ πδ j /M because its argument x = πδ j /M is much smaller than unity.Hence, we obtain F ( j + δ j /M ; M ) > exp[i πδ j ] 2 π M (A.7)as the final result. Appendix A.2. Calculation of probabilities ˜ P ( p,p ) A and ˜ P ( p,N ) A To estimate the probabilities ˜ P ( p,p ) A and ˜ P ( p,N ) A to find any multiple of 2 Q /p or of 2 Q /N ,if a measurement of system B resulted in the factor p , we have to investigate theprobability distribution˜ P ( p ) A ( m ; N ) ≡ Q ( M p − M N ) (cid:12)(cid:12)(cid:12)(cid:12)(cid:20) F (cid:16) pm Q ; M p (cid:17) − F (cid:18) N m Q ; M N (cid:19)(cid:21)(cid:12)(cid:12)(cid:12)(cid:12) (A.8) actorization with Gauss sums: Entanglement
10 0 π π x Figure A1.
Graphical demonstration of the inequality 2 x/π ≤ sin x for 0 ≤ x ≤ π/ x whereas the dashed line represents f ( x ) ≡ x/π . for m p ≡ j · Q /p + δ j and m N ≡ j · Q /N + δ j , with M N ≡ [2 Q /N ] and M p ≡ [2 Q /p ].We first discuss the situation for m p and evaluate the function F at the arguments pm p Q = j + δ j p Q ≈ j + δ j M p (A.9)and N m p Q = qj + δ j N Q ≈ qj + δ j M N (A.10)using the estimate (A.7) F ( j + δ j /M ; M ) > exp[i πδ j ] 2 π M (A.11)for | δ j ≤ / | .As a consequence, the probability to find a state | m i with m being close to amultiple j of 2 Q /p reads˜ P ( p ) A ( m p ; N ) > Q ( M p − M N ) 4 π (cid:0) M p + M N − M p M N (cid:1) (A.12)which reduces with the help of the binomial formula x + y − xy = ( x − y ) to˜ P ( p ) A ( m p ; N ) > M p − M N Q π . (A.13)When we recall that M N ≈ Q /N and M p ≈ Q /p we obtain the final result˜ P ( p ) A ( m p ; N ) > . N − pN p (A.14) actorization with Gauss sums: Entanglement /π > . p different values of m p the total probability ˜ P ( p,p ) A to find anymultiple of 2 Q /p is given by˜ P ( p,p ) A > . N − pN (A.15)which tends towards 0 . N and prime factors p ≤ √ N .We now calculate the probability P ( p ) A ( m N ; N ) to find m N = j · Q /N + δ j whichare not multiple of m p . At these arguments the sum F (cid:0) pm N / Q ; M p (cid:1) is close to zeroand therefore can be neglected. As a consequence, we can approximate ˜ P ( p ) A ( m N ; N ) by˜ P ( p ) A ( m N ; N ) > . M N Q ( M p − M N ) ≈ . pN ( N − p ) . (A.16)Since there exist N − p different values of m N the total probability ˜ P ( p,N ) A to find anymultiple of 2 Q /N is given by˜ P ( p,N ) A > . pN (A.17)which tends towards zero for large N and prime factors p ≤ √ N . Appendix A.3. Calculation of probability ˜ P (1) A Similar to the calculation in the last section, we now evaluate the probability ˜ P (1) A tofind any multiple p or q if the measurement of system B resulted in unity. For this task,we first estimate the probability distribution˜ P (1) A ( m ; N ) ≡ (cid:12)(cid:12)(cid:12) A h m | ˆ U QF T | ψ (1) i A (cid:12)(cid:12)(cid:12) = 12 Q (2 Q − M p − M q + M N ) (cid:12)(cid:12)(cid:12) F (cid:16) m Q ; 2 Q (cid:17) − F (cid:16) pm Q ; M p (cid:17) − F (cid:16) qm Q ; M q (cid:17) + F (cid:18) N m Q ; M N (cid:19)(cid:12)(cid:12)(cid:12)(cid:12) (A.18)for m p ≡ j · Q /p + δ j , m q ≡ j · Q /q + δ j and m N ≡ j · Q /N + δ j following from (23)with M q ≡ [2 Q /q ].The first term given by F is equal to zero for all m = 0. The second term leadsto peaks at multiples of 2 Q /N , the third to peaks at multiples of 2 Q /p and the last topeaks at multiples of 2 Q /q . In this case, we get information about the factors of N onlyfrom the peaks at multiples of 2 Q /p and 2 Q /q .As a result we obtain the probability˜ P (1) A ( m p ; N ) > . M p − M N ) Q (2 Q − M p − M q + M N ) (A.19)to find m p . Here, we have taken into account that m ≈ j · Q /p is also an integermultiple of 2 Q /N . With the help of the approximations M N ≈ Q /N, M p ≈ Q /p and M q ≈ Q /q we get the final result˜ P (1) A ( m p ; N ) > . q − N ( N − q − p + 1) . (A.20) actorization with Gauss sums: Entanglement P (1) A ( m q ; N ) > . M q − M N ) Q (2 Q − M p − M q + M N ) = 0 . p − N ( N − q − p + 1) (A.21)for the probability to find m ≈ j · Q /q .For ˜ P (1) A ( m N , N ) only the term F (cid:0) N m/ Q ; M N (cid:1) is non-vanishing which leads to˜ P (1) A ( m N ; N ) > . M N Q (2 Q − M p − M q + M N ) = 0 . N ( N − p − q + 1) . (A.22)As a consequence, we arrive at the total probability˜ P (1 ,p or q ) A = p ˜ P (1) A ( m p ; N ) + q ˜ P (1) A ( m p ; N ) > . N q + N p + q + p − NN ( N − q − p + 1) (A.23)to find any multiple of a factor p or q . Appendix B. Probabilities for the superposition algorithm
In this appendix, we calculate the probability P ( n ) A ( ℓ, N ) = N ( n ) |W ( N ) n ( ℓ ) | (B.1)to measure ℓ in system A if the measurement result of system B was n . Here, N is anormalization constant and W ( N ) n is defined as W ( N ) n ( ℓ ) ≡ N N − X m =0 exp (cid:20) π i ( m ℓN + m nN ) (cid:21) . (B.2)Since P ( n ) A ( ℓ, N ) is proportional to W we take advantage of the result |W ( N ) n ( ℓ ) | = r N (B.3)from Ref. [15]. Here, N is odd and ℓ does not share a common divisor with N . We areonly interested in factoring odd numbers N . If we have to factor an even number, wecan divide it by two repeatedly until we arrive at an odd number.If ℓ and N share a common divisor p we have to eliminate it before we are allowedto apply (B.3). Assuming that ℓ = k · p, N = q · p (B.4)with k and q coprime, the sum W ( N ) n reduces to W ( q · p ) n ( k · p ) ≡ N N − X m =0 exp (cid:20) π i ( m kq + m n N ) (cid:21) . (B.5)Now, the quadratic phase is periodic with period q and not with period N . Therefore,it is useful to rewrite the summation index m as m = r · q + s (B.6) actorization with Gauss sums: Entanglement W ( q · p ) n ( k · p ) = p − X r =0 q − X s =0 exp (cid:20) π i (cid:18) kq s + n N ( rq + s ) (cid:19)(cid:21) = F ( n , p ) ·W ( q ) n ( k )(B.7)into the form of a product of two sums, where F ( n , p ) ≡ p − X r =0 exp (cid:20) π i n p r (cid:21) (B.8)points out the role of n : it is equal to p if it is a multiple of p . Otherwise, it vanishes.We now apply (B.3) to evaluate |W ( q ) n ( k ) | and find |W ( N ) n ( ℓ ) | = N if gcd( ℓ, N ) = 1 pN if gcd( ℓ, N ) = p &gcd( n , p ) = p ℓ, N ) = p & gcd( n , p ) = p (B.9)We emphasize that here we define gcd(0 , N ) ≡ N .The normalization constant N follows from the condition N − X ℓ =0 P ( n ) A ( ℓ, N ) = 1 (B.10)and reads |N ( n ) | ≡ N N − p − q +1 for n = 0 N N − p − q +1 for gcd( n , N ) = p NN − p − q +1 else (B.11)assuming N contains only the two prime factors p and q . References [1] Mermin N D 2007
Phys. Today (4) 8; ibid (10) 10; Mermin N D 2007 Quantum ComputerScience (Cambridge University Press, Cambridge).[2] W¨olk S,Merkel W, Schleich W P, Averbukh I Sh and Girard B 2011
New J. Phys. New. J. Phys. Phys. Rev. Lett. Phys. Rev. A Phys. Rev.Lett.
Phys. Rev. Lett.
Euro. Phys. Lett. Euro. Phys. Lett. J.Mod.Opt. Phys. Rev. A Found. Phys.
DOI 10.1007/s10701-010-9522-3 ; Sadgrove M, Kumar S and Nakagawa K 2008
Phys. Rev. Lett.
Phys. Rev. A Factorization with Gauss sums (Dr. Hut, M¨unchen)[6] Li J, Peng X, Du J and Suter D 2011 arXiv:1108.5848v1 actorization with Gauss sums: Entanglement [7] See for example: Shor P 1994 Proc. of the 35th Annual Symp. on Foundations of Computer Science(Santa Fe) ed. Goldwasser S (IEEE Computer Society Press, New York) p 124-134; Ekert A andJozsa R 1996
Rev. Mod. Phys.
733 ; or Beckman D, Chari A N, Devabhaktuni S and PreskillJ 1996
Phys. Rev. A AnalyticNumber Theory (American Mathematical Society, Providence); Ireland K and Rosen M 1990
AClassical Introduction to Modern Number Theory (Springer, Heidelberg)[9] Maier H and Schleich W P 2012
Prime Numbers 101: A Primer on Number Theory (Wiley-VCH,New York)[10] Fiddy M A and Ross G 1979