Factorization of numbers with Gauss sums: I. Mathematical background

We use the periodicity properties of generalized Gauss sums to factor numbers. Moreover, we derive rules for finding the factors and illustrate this factorization scheme for various examples. This algorithm relies solely on interference and scales exponentially.


Introduction
'Mathematics is the abstract key that turns the lock of the physical universe.' This quote by John Polkinghorne expresses in a poetic way the fact that physics uses mathematics as a tool to make predictions about physical phenomena such as the motion of a particle, the outcome of a measurement or the time evolution of a quantum state. However, there exist situations in which the roles of the two disciplines are interchanged and physical phenomena allow us to obtain mathematical quantities. In the present series of papers [1], we follow this path of employing nature to evaluate mathematical functions. Here, we choose the special example of Gauss sums [2] and show that they are ideal for factoring numbers. At the same time we must issue the caveat that in contrast to the Shor algorithm [3], the proposed Gauss sum factorization algorithm in its most elementary version scales only exponentially since it is based solely on interference and does not involve entanglement. However, there are already indications [4,5] 3 that a combination of entanglement and Gauss sums can lead to a powerful tool to tackle questions of factorization.
Recent years have seen an impressive number of experiments implementing Gauss sums in physical systems to factor numbers. These systems range from nuclear magnetic resonance (NMR) methods [6][7][8] via cold atoms [9] and Bose-Einstein condensates (BECs) [10,11], tailored ultrashort laser pulses [12,13] to classical light in a multi-path Michelson interferometer [14,15]. Although these experiments have been motivated by earlier versions of this series of papers made available before publication, they have focused exclusively on a very special type of Gauss sum, that is, the truncated Gauss sum, which is not at the center of the present work. Indeed, throughout this series we concentrate on three types of Gauss sums: the continuous, the discrete and the reciprocate Gauss sum. Moreover, we propose experimental realizations with the help of chirped laser pulses [16,17] interacting with appropriate atoms.
We pursue two steps: (i) first we show that the mathematical properties of Gauss sums allow us to factor numbers and (ii) then we present three elementary quantum systems to implement our method using chirped laser pulses and multi-level atoms. To each step we devote an article. There is good reason to separate the individual articles. The work presented in the two articles is a combination of quantum optics and number theory (for an introduction to number theory, see, e.g., [18]). In order to avoid overloading the quantum optical aspects of the problem with number-theoretical questions, we deal with the mathematical properties of Gauss sums in this article and address the realizations in the second part.

Gauss sums in physics
Gauss sums [19,20] manifest themselves in many phenomena in physics and come in a wide variety. They are similar to Fourier sums with the distinct difference that the summation index appears in the phase in a quadratic rather than a linear way.
Real-valued Gaussians are familiar from statistical physics. The integral over a finite extension of a Gaussian leads to a higher transcendental that is, the error function. When the integration is not along the real axis but along one of the diagonals of complex space, we arrive at an integral giving rise to the Cornu spiral. This geometrical object determines [21] the intensity distribution of light on a screen in the far field of an edge. It is also an essential building block of the Feynman path integral [22,23] and the method of stationary phase [24].
One modern application of integrals over quadratic phases in physics is chirped laser pulses. Here, the frequency of the light increases linearly in time, giving rise to a quadratic phase. The resulting excitation probability is determined [25] by the complex-valued error function, which is closely related to the Cornu spiral. Indeed, the Cornu spiral was observed in real-time excitation of Rb atoms by chirped pulses [26].
A generalization of the Cornu spiral arises when we replace the integration over the continuous variable by a summation over a discrete parameter. In this case, the Cornu spiral turns into a Gauss sum.
Sums have properties that are dramatically different from their corresponding integrals. This feature stands out most clearly in the phenomena of revivals and fractional revivals [27,28]. In the context of the Cornu spiral, the transition from the integral to the sum leads to the curlicues [29,30], that is, Cornu spirals in Cornu spirals. The origin of this self-similarity is discreteness. In the Gauss sum, the question of whether a parameter takes on integer, rational or irrational values is crucial, whereas in the error function integral it does not matter. This 4 feature will also be of importance in the context of the factorization of numbers, which is the topic of the present series of papers.
Gauss sums are at the very heart of the Talbot effect [31] that describes the intensity distribution of the light close to a diffraction grating. They are also crucial in the familiar problem of the particle in the box and are the origin of the design of quantum carpets [32] and the creation of superpositions of distinct phase states (see, e.g., [33]) by nonlinear evolution [34]. Moreover, there is an interesting connection [20] to the Riemann zeta function, which is determined by the Mellin transform of the Jacobi theta function. For complex-valued rational arguments the zeta function leads to Gauss sums.

Why factor numbers with Gauss sums?
It is the exponential increase of the dimension of Hilbert space together with entanglement, that makes the quantum computer so efficient and ideal for the problem of factoring. Two landmark experiments [35,36] have implemented the Shor algorithm. They were based on either NMR [35] or optical [36] techniques, and they were able to factor the number 15.
Our proposal outlined in this series of papers follows a different approach. It aims for an analogue computer that relies solely on interference [37] without using entanglement. We test if a given integer is a factor of the integer N , to be factored. Since we have to try out at least √ N such factors, the method scales exponentially with the number of digits of N . It is therefore a classical algorithm. This fact is not surprising since our method does not take advantage of the exponential resources of the Hilbert space.
At the heart of the Shor algorithm is the task of finding the period of a function [38]. In our approach, we also use properties of a periodic function. It is the periodicity of the Gauss sum that allows us to factor numbers. For this purpose, we construct a system whose output is a Gauss sum. In this sense, nature is performing the calculation for us.
But why are Gauss sums ideal tools for the problem of factorization? Gauss sums play an important role in number theory as well as physics. Three examples may testify to this claim: (i) the distribution of prime numbers is determined by the nontrivial zeros of the Riemann zeta function, which is related [20] to the Gauss sums, (ii) a quantum algorithm [39][40][41] allows us to calculate the phase of a Gauss sum efficiently, and (iii) the Gauss reciprocity law can be interpreted [42] as the analogue of the commutation relation between position and momentum operators in quantum mechanics.

Various classes of Gauss sums
In order to lay the groundwork for part II of this series, we devote this paper to an overview of the mathematical properties of several Gauss sums, that arise in different physical systems. When we study the two-photon excitation through an equidistant ladder system with a chirped laser pulse, we arrive [25] at the sum Here N is expressed in terms of parameters characterizing the harmonic manifold and the argument ξ is proportional to the rescaled chirp of the laser pulse. The distribution of weight factors w m is governed by the shape of the laser pulse. The sum S N contains linear as well as quadratic phases. Quite different sums emerge for a one-photon transition in a two-level atom interacting with two driving fields. Here, we find two different types of Gauss sums depending on the temporal shape of the fields. For a sinusoidal modulation of the excited state and a weak-driving field, the corresponding excitation probability amplitude is proportional to the sum which depends on purely quadratic phases.
In the second realization, the modulating field causes a linear variation of the excited state energy and the one-photon transition is driven by a train of equidistant delta-shaped laser pulses. The excitation probability amplitude is proportional to the sum at integer arguments , which is again of the form of a Gauss sum. In comparison to S N ( ), now the roles of the argument and the number N to be factored are interchanged.
The first set of experiments relies on the interaction of a sequence of electromagnetic pulses with a two-level quantum system. The phase of each pulse is adjusted such that the total excitation probability is determined by a Gauss sum [6,43]. Two realizations of twolevel systems have been pursued: in NMR experiments [6][7][8], the two levels correspond to the two orientations of the spin, for example the proton of the water molecule. However, also, optical pumping in laser-cooled atoms creates [9] an effective two-level situation, for example the hyperfine states of rubidium. 6 The second type of experiments utilizes a sequence of appropriately designed femtosecond laser pulses [12,13]. The intensity at a given frequency component of this light is given by the interference of this component of the individual pulses giving rise to a sum. With the help of a pulse shaper it is possible to imprint the phases necessary for obtaining a Gauss sum determining the light intensity at a given frequency.
The third class of experiments [14,15] is based on a multi-path Michelson interferometer [44]. Here the phase shifts accumulated in the individual arms increase quadratically with arm length. This experiment does not suffer from the problem [45] that the ratio N / has to be precalculated. Moreover, they calculate the truncated Gauss sum not only for integer trial factors but also for rational arguments ξ = q/r . Gauss sums at rational arguments open up a new avenue towards factorization [46].
The experiment reported in [10,11] plays a very special role in this gallery of factorization experiments using Gauss sums: (i) it is the only one so far that has used a BEC, (ii) the readout utilizes the momentum distribution and (iii) it relies on a generalization of Gauss sums. Furthermore, they claim better visibility by using the probability distribution for higher momenta.
All of these studies have implemented the Gauss sum which is closely related to the ones discussed in this paper. Here M + 1 is the number of interfering paths, which could be the number of laser pulses, or the number of arms in the Michelson interferometer. With this type of Gauss sum, the idea of factorization is straightforward: when is a factor of N , N / is an integer. As a result, the phase of each term in the Gauss sum A (M) N ( ) is an integer multiple of 2π, and due to constructive interference, the value of the sum is unity. For a non-factor the ratio N / is a rational number, and due to the quadratic variation of the phase, the individual terms interfere destructively. This feature leads to the unique criterion for distinguishing factors from non-factors: for factors the sum A (M) N ( ) is unity, whereas for non-factors it is not.
However, a closer analysis [47] reveals the fact that for a subset of test factors, which are not factors, the Gauss sum A (M) N ( ) takes on values rather close to unity. It is therefore difficult to distinguish them from the real factors. These test factors have been called ghost factors. The number of ghost factors increases as the number N to be factored increases.
Two techniques to suppress ghost factors offer themselves: (i) a Monte-Carlo evaluation [8,13] of the complete Gauss sum and (ii) the use [48] of exponential sums with 1 j.

7
Ghost factors originate from the fact that the phase of consecutive terms in a Gauss sum such as in (4) can increase very slowly. To take terms of A (M) N randomly allows the Gauss sum to interfere destructively rather rapidly. This technique has been demonstrated in experiments with femtosecond pulses [13] and a 13-digit number could be factored with a very few pulses. Also an NMR experiment [8] followed this approach and factored a 17-digit number consisting of two prime numbers.
It is interesting to note that the argument for the factorization with the Gauss sum A (M) N ( ) does not make use of the fact that the phase varies quadratically. It is correct for any phase of the form m j , where j is an integer. The advantage of powers larger than two is that in this case the cancellation of neighboring terms is faster. This technique has been applied successfully in NMR experiments [8] for j = 5 and a 17-digit number could be factored.

Alternative proposals for Gauss sum factorization
It is interesting to compare and contrast the Gauss sums and our proposals for factoring numbers to other suggestions along these lines. Here, we refer especially to the pioneering algorithm outlined in [49] based on the Talbot effect. This method uses the intensity distribution of light in the near-field of an N -slit grating. The number N to be factored is encoded in the number of slits of period d. For a fixed separation z of the screen from the grating, we now vary the wavelength λ of the light. The factors of N emerge for those wavelengths where all maxima of the intensity pattern are equal in height. In appendix B, we show that in this case the intensity distribution follows from the Gauss sum: where ξ ≡ x/d is the scaled position on the screen and l ≡ λz/d 2 is the dimensionless Talbot distance. We emphasize that in contrast to the sum A (M) N defined by (4), the sum G given by (7) contains N rather than M + 1 terms. Moreover, N does not enter into the phase factors of G.
In [50], the idea of factorization with an N -slit interferometer [49] was translated into one with a single Mach-Zehnder interferometer. Furthermore, the work [50] suggests a way to test several trial factors, by connecting several Mach-Zehnder interferometers.
Another proposal [51][52][53][54] is based on wave packet dynamics in anharmonic potentials giving rise to quadratic phase factors. Here, the factors of an appropriately encoded number N can be extracted from the autocorrelation function. This quantity is in the form of a Gauss sum and experimentally accessible.
This approach is closely related to ideas [55,56] to use rotor-like systems with a quadratic energy spectrum for quantum computing. Initially, the wave packet is localized in space. At the revival time T rev the packet is identical to the initial one. However, it is not the revivals but rather the fractional revivals, that are interesting in the context of factorization. At times t = T rev /N , with N odd, the wave is localized at N equally spaced positions. If N is even, there exist only N /2 such positions. This phenomenon can be used to build a K -bit quantum computer [55,56] with K ≈ log 2 N . It can also be employed for factorization [57]. For times t = l/N , with N odd, there exist N maxima of the probability distribution if N and l are coprime. But if they share a common factor p that is l = p · r and N = p · q, we can only observe q maxima. 8 We conclude our discussion of alternative proposals for Gauss sum factorization by briefly mentioning the idea [58] of using two Josephson phase qubits, that are coupled to a superconducting resonator. Here, the time evolution generates a phase shift of φ k = 2π k 2 N / . With the help of a quantum phase measurement, the Gauss sum can be calculated.

Overview
This paper is organized as follows. In section 2, we introduce the continuous Gauss sum and demonstrate its potential to factor numbers using two examples. Moreover, a remarkable scaling relation of this type of Gauss sum allows us to use the realization of the Gauss sum for the number N to obtain information on the factors of another number N . We then turn in section 3 to an investigation of the properties of the continuous Gauss sum for integer arguments. This approach connects the Gauss sums central to this paper to the standard Gauss sums discussed in the mathematical literature. In this way, we establish rules on how to identify factors of a number using the continuous Gauss sum evaluated at integers. We devote section 4 to yet another type of Gauss sum and connect it to the continuous Gauss sum at integer values. Section 5 summarizes the key results that are relevant for part II of this series of papers.
In order to make the paper self-contained, we have included several appendices. In appendix A, we outline the quantum algorithm [39][40][41] for evaluating the phase of a specific class of Gauss sums. In order to provide a comparison with the ideas proposed in this paper, we then briefly summarize in appendix B the essential ingredients of the approach to factor numbers with an N -slit interferometer [49]. We conclude in appendix C by deriving the absolute value of a specific finite Gauss sum that is central to the discussion of revivals, and the factorization technique based on the continuous Gauss sum and the N -slit interferometer.

Continuous Gauss sum
In this section, we study the periodicity properties of the continuous Gauss sum with respect to the possibility of factoring numbers. Here, A and B denote two real numbers and the argument ξ assumes real values. The weight factors w m are centered around m = 0 and are slowly varying as a function of m. We establish three results: (i) when B/A is an integer we can use the continuous Gauss sums S to factor numbers. (ii) Maxima of |S(ξ ; A, B)| located at an integer ξ allow us to identify factors. (iii) By an appropriate scale transformation we can factor any number N using the Gauss sum corresponding to another number N .
In order to derive these results, we first motivate these properties of the Gauss sum and then derive a new representation. This function allows us to choose the parameters appropriate for this technique. Moreover, we show that it is also possible to factor even numbers.

A tool to factor numbers
We start our analysis of the continuous Gauss sum by considering the special case A = 1 and B = N , that is, In figure 1, we show |S N (ξ )| 2 for the example N = 33 = 3 × 11 and the Gaussian weight factors Our main interest is in the behavior of |S N (ξ )| 2 in the vicinity of candidate prime factors ξ = . Indeed, the insets of figure 1 at the bottom bring out most clearly distinct maxima at values of ξ corresponding to the factors = 3 and = 11. At non-factors such as = 5 or = 13 illustrated by the insets on the top, the continuous Gauss sum S 33 does not show any peculiarities. This example suggests that the continuous Gauss sum S N represents a tool for factorization.
and C = 51/35, we find that this maximum corresponds to the integer number ξ = 7. This feature is remarkable, because ξ = 7 is a factor of N ≡ 51/C = 35. As a consequence, the signal |S N (ξ )| contains information not only about the factors of N but also about other numbers N . This scaling property of the Gauss sums suggests to store a master curve |S N (ξ )| on a card small enough to be carried in the pocket, which can be used to factor any other number N , that is of the same order as N . For this reason, the scaling property of the Gauss sum and the associated possibility to factor many numbers have been jokingly called [59] 'pocket factorizator'.
In figure 4, we illustrate the working principle of the pocket factorizator for N = 35 and N = 65 starting from the original signal associated with N = 51. Candidate prime factors indicated on the left vertical axis are marked by horizontal lines. In order to find the adequate scale ξ given by (11) for the number N , we adapt the slope of the tilted line appropriate for N . On the right vertical axis, we depict numbers N < N and on the horizontal axis numbers N < N . In order to test whether the prime argument is a factor of N , we follow the horizontal line representing to the intersection with the tilted line. The ordinate ξ of the intersection point  yields the section of the signal, that has to be analyzed. When the signal displays a maximum at an integer value of ξ , we have found a factor of N as indicated by magnified insets of the signal.

A new representation
In the preceding section, we have shown for specific choices of the parameters A and B that the continuous Gauss sum S(ξ ; A, B) allows us to factor numbers. In the following sections, we now verify this property in a rigorous way.
For this purpose, we rewrite the sum, (8), in an exact way so as to bring out the features of S = S(ξ ; A, B) typical of the different domains of ξ . Here, we concentrate on arguments that are close to a fraction q/r of B. We use a method that has been developed in the context of fractional revivals of wave packets [27,28]. When we substitute the representation (12) of ξ into the term of the Gauss sum, that is quadratic in m, we find Next, we recall the representation of one sum by a sum of sums which yields Here, we have made use of the identity for integer s.
With the help of the Poisson summation formula

14
where f (ν) denotes the continuous extension of f n with f (n) ≡ f n for integer values of ν, we arrive at Here, w(µ) denotes the continuous extension of w m with w(m) ≡ w m . The substitution µ ≡ p + νr finally leads us to where we have also interchanged the summations over m and p.
As a consequence, we can represent S(ξ ; A, B) in the form with the finite Gauss sum [2] and the shape functions

The location and origin of maxima
According to (22) the continuous Gauss sum S in the neighborhood of ξ ∼ = q B/r consists of a sum of the products W (r ) m I (r ) m of the finite Gauss sum W (r ) m and the shape function I (r ) m . Its role stands out most clearly for the example of the continuous extension of the Gaussian weight function w m given by (10).
In this case, we can perform the integral, (24), and find the complex-valued Gaussian of width and centered around Here, we have introduced the abbreviations for the width at δ = 0 as well as together with the normalization constant It is the size of the width σ , that determines how many terms contribute to the sum over m in (22). Indeed, when σ < 1, that is, for a narrow Gaussian, only the m-value closest tom contributes, whereas when 1 < σ , that is, for a broad distribution, shape functions I (r ) m of many neighboring m-values have to be added up in order to yield S. In this case, the fact that I (r ) m is a complex-valued Gaussian with a quadratic phase variation as expressed by the last term in the exponential of (26) becomes important.
Indeed, we recall from appendix C that the absolute value |W (r ) m | of the finite Gauss sum is either constant as a function of m or oscillates between a constant and zero depending on r being odd or even. As a result all terms I (r ) m contribute with equal weight or not at all. Although the phases of W (r ) m vary rapidly [32] with m, they cannot compensate for the quadratic variation in m of the phase factor governing the shape function I (r ) m . As a result the sum over several m-values leads to a destructive interference and a small value for S. Figure 5 illustrates this single-maximum versus destructive interference-of-many-terms behavior for the signal |S 51 (ξ )| 2 depicted in the inset. The dominant maximum at ξ = (7/35)51 marked by a triangle arises solely from the term I (35) 7 . On the other hand, for ξ = (7/35)51 + 3/35, several terms I (35) m depicted by filled circles interfere destructively leading to a suppression of the signal.
Hence, the width σ of the Gaussian shape function (26) governs the value of S. According to the definition (27) of σ , the smallest value of σ appears for δ = 0. Provided σ 0 1 a single term in the sum, corresponding to the m-value m closest tom, will contribute. In this case, the size of the shape function I (r ) m is governed by exp[−(m −m) 2 /σ 2 0 ]. Obviously, the largest signal arises whenm is an integer m 0 , since then the argument of the Gaussian I (r ) m 0 vanishes. According to the definition (28) ofm, we find with δ = 0 for this optimal case the condition which for q = 1 yields the condition that B/A must be an integer; otherwise we cannot obtain a maximum.
We conclude by noting that due to the definition (12) of ξ the condition δ = 0 for a maximum to occur translates into the value for the location. Hence, the maxima of the continuous Gauss sum S appear for integer multiples of B/r . However, they only emerge provided σ 0 1 and B/A is an integer.

Condition for destructive interference
In the previous section, we have identified the decisive role of the width σ 0 in allowing for dominant maxima in S. In particular, we have established the necessary condition σ 0 1 for the occurrence of maxima. We now derive a criterion for the destructive interference of many shape functions I (r ) m in the sum (22). This property arises from the condition on the width, which implies that When we recall the constraint σ 2 0 1 necessary for the occurrence of a maximum which implies that 1 1/σ 2 0 , we can neglect the term unity in the square and require the condition 1 which is even more general than the inequality (35).
With the help of the definitions (29) and (30) of σ 0 and D, we find that As a consequence, the width m 2 depends on the minimal value of δ, that we want to discriminate from zero. For factoring the number N , we estimate the continuous Gauss sum at arguments with C = B/N . As a consequence, the parameter δ from (12) is given by and therefore |δ| is larger than B/(Nr ) if it is non-vanishing. As a result, the condition of (37) reduces to which is independent of r .
In summary, if m is larger than r and N , and B/A is integer, we can distinguish between δ = 0 and δ = 0. In this case, we see peaks if and only if δ = 0, which will help us to factor the number N as demonstrated in the following section.

Factorization
We now show that the continuous Gauss sum S(ξ ; A, B) given by (8) and represented for a Gaussian weight function w m defined by (10) by a sum of complex-valued Gaussians given by (22) offers a tool to factor numbers. Here, we distinguish between odd and even numbers to be factored. Needless to say, the last case is not of practical interest since we can always extract powers of 2 from an even number. Nevertheless, it is interesting from a principle point of view. In particular, it brings out the crucial role of the finite Gauss sum W (r ) m in our factorization scheme.

Odd numbers.
In the examples discussed in section 2.1, we have found factors by searching for maxima at arguments ξ which are integer multiples of C, that is, ξ = C. In section 2.3, we have shown that maxima correspond to arguments ξ = (q/r )B. As a consequence, the identity (12) transforms for maxima at ξ = C into When we define the number N to be factored by the units C and B of our system, that is, Here, we have to choose the two coprime integers q and r such that is an integer. The condition is only met if r corresponds to a factor of N and r must be odd for odd numbers N . As a result, we have derived the criterion for the factorization of odd N suggested in figures 1-4: if the Gauss sum S exhibits a maximum at the integer argument ξ = , then corresponds to a prime factor or a multiple of a factor of N .

Even numbers.
So far, we have utilized only the shape function I (r ) m to factor a number. Moreover, the technique is limited to odd numbers. We now show that the finite Gauss sum W (r ) m defined by (22) together with I (r ) m yields information on the factors of N when N is even. Even though the condition δ = 0 would allow for a maximum at the argument , we may still find a vanishing value of the continuous Gauss sum S. This behavior originates from the weights W (r ) m , which depend critically on the classification of r and q according to 2/r , for r even, rq/2 even and m even, 0, for r even, rq/2 even and m odd, 0, for r even, rq/2 odd and m even, √ 2/r , for r even, rq/2 odd and m odd (43) derived in appendix C. Indeed, the weights W (r ) m in the representation (22) of S vanish for specific combinations of r and q, thus leading to a suppression of the signal at certain integer arguments. For even r and even rq/2 the finite Gauss sum W (r ) m vanishes for odd values of the summation index m, whereas for even r and odd rq/2 we find that W (r ) m vanishes only for even values of m. Thus for even N , both maxima and zeros of |S(ξ ; A, B)| at integer arguments ξ = contain information about the factors of N as demonstrated in figure 6 for the example N = 30 = 2 × 3 × 5. Here, we find a vanishing signal for = 3 and = 5 as indicated by the left insets, whereas the signal shows pronounced maxima at = 10 = 2 × 5 and = 12 = 3 × 4. Obviously, these features are related to the factors 2, 3 and 5 of N = 30.

Discrete Gauss sum
So far, we have analyzed the continuous Gauss sum S and the special case S N in its dependence on the argument ξ , which assumes real numbers. We now restrict S N to integer arguments ξ ≡ and recall the identity exp(2π i m ) = 1. As a consequence, the continuous Gauss sum (9) reduces to  In the present section, we show that the restriction to integer arguments allows us to derive analytical expressions for S N ( ) in terms of the standard Gauss sum where a and b denote two integers. Its periodicity properties provide us with rules on how to factor numbers based on S N ( ).

New representation
For this purpose, we first cast S N ( ) into a new form that can be approximated in the limit of a broad weight function w m by the standard Gauss sum G. Indeed, the representation (14) of one 20 sum by a sum of sums yields the expression We evaluate the sum over n with the help of the Poisson summation formula (18) and find where we have introduced the Fourier transform of the continuous extension w(µ) of the weight factors. So far, the calculation has been exact. However, we now make an approximation that connects the sum S N ( ) given by (44) to the standard Gauss sum G defined by (45). For this purpose, we recall that according to the Fourier theorem the product of the widths m and x of the weight function w m and its associated Fourier transformw is constant. Since w m is very broad the distributionw (x) must be very narrow. Together with the fact that the argument ofw is ν/N with 1 N , the Fourier theorem allows us to restrict the sum over ν to the term ν = 0 only and we arrive 5 at Due to the normalization, the integral over w(µ) is equal to unity and we obtain the approximation for the discrete Gauss sum S N ( ) in terms of the standard Gauss sum G.

Analytical expressions
We now use the well-known results [2,[18][19][20] for the standard Gauss sum G to approximate S N ( ). Throughout the section, we assume that N = p × r contains the two integer factors p and r . Moreover, we distinguish two cases of the integer argument .

No common factor between and N .
In this case, we can take advantage of the relation [20] G (a, b) connecting the standard Gauss sum G(a, b) of the arguments a and b with the elementary Gauss sum G (1, b) of the arguments a = 1 and b through the Legendre symbol When we recall [20] the expression consisting of integers r = 4s + k, we obtain the approximation for the absolute value squared of the discrete Gauss sum S N ( ), provided and N do not share a factor.

A common factor between and N .
Next, we turn to the case when the argument is an integer multiple k of one of the factors of N , that is, = kp. Now, we find from (50) the identity which with the help of the factorization relation [2,[18][19][20] of the standard Gauss sum reduces to In the last step, we have also made use of the connection formula (51). The explicit expression (53) for G(1, b) finally yields the approximation 1, for r ∈ M 1 , M 3 , 0, for r ∈ M 2 (59) of |S N | 2 at integer multiples of the factor p.

Factorization
A comparison of the explicit expressions (55) and (59) for |S N ( )| 2 indicates a method to factor numbers. In order to illustrate this technique, we first assume N to be odd. In this case, N is an element of either M 1 or M 3 and we find according to (55) that |S N ( )| 2 is given by 1/N provided the argument and the number N do not share a common factor. Since the factors must be both odd, the value of |S N | 2 for being a multiple of a factor p reads p/N and is enhanced by p. The situation is slightly more complicated when N is even. Here, the value of |S N ( )| 2 at non-factors is either zero, which is the case if N is a member of M 2 , or 2/N , if N is a member of M 0 . However, at multiples of the factor p the value of |S N (kp)| 2 can be 2 p/N , p/N or zero depending on whether the other factor r is a member of M 0 , M 1 and M 3 or M 2 , respectively. In this case, there can even be two lines of |S N | 2 at factors.
This feature stands out clearly in the example of N = 40 = 5 × 2 3 = 10 × 4, which belongs to the set M 0 . As a result, at non-factors we find the values 2/40 = 1/20 as shown in figure 7. At the factor p = 5 the remaining factor r = 40/5 = 8 is an element of M 0 and the corresponding value of |S N | 2 is 2 × 5/40 = 1/4. Moreover, for the factor p = 8 the remaining factor r = 40/8 = 5 belongs to M 1 and therefore yields the value 8/40 = 1/5. The factor p = 20 leads us to the remaining factor r = 40/20 = 2, which belongs to M 2 and creates a vanishing signal.
We conclude this discussion on factoring numbers using the discrete Gauss sum S N ( ) by using the example of the number N = 42 = 2 × 3 × 7 = 10 × 4 + 2, which is an element of M 2 . As a result, all non-factors have a vanishing signal. The factors belong to the classes M 2 , M 1 or M 3 . Since the class M 0 does not appear, the values of |S N ( )| 2 at factors form only a single rather than two lines.

Reciprocate Gauss sum
In sections 2 and 3, we have analyzed the potential of two types of Gauss sums for the factorization of numbers. Both sums share the property that the number N to be factored and the variable, either in its continuous version ξ or as the discrete test factor , appear as the ratios ξ/N or /N . In the present section, we investigate yet another type of Gauss sum that is even more attractive in the context of factorization. Here, the roles of the variable and the number N to be factored are interchanged and the sum consisting of M + 1 terms emerges. Due to the appearance of the reciprocal of /N we call A (M) N ( ) the reciprocate Gauss sum. We emphasize that A (M) N ( ) has been realized in a series of experiments [6][7][8][9][10][11][12][13][14][15] and used to factor numbers as summarized in section 1. However, the application of the extension of A (M) N ( ) to a continuous variable as a tool for factorization is more complicated and has been analyzed in [46]. For this reason we concentrate in this section on integer arguments .
The sums S N ( ) and A (M) N ( ) are closely connected with each other. We now show that the Gauss reciprocity relation [42,60] allows us to express A ( −1) N ( ) in terms of the standard Gauss sum G. With the help of the exact analytical expressions for G, we then obtain closed-form expressions for |A ( −1) N ( )| and establish rules on how to factor numbers.

Gauss reciprocity relation
In this section, we consider the Gauss sum A (M) N ( ) for the special choice M ≡ − 1 for the truncation parameter M; that is, we discuss the properties of the complete reciprocate Gauss sum Here, for each argument the summation covers terms. The Gauss reciprocity relation [42,60] a−1 is essential in building the connection between the complete reciprocate Gauss sum of (61) and the standard Gauss sums G ( , N ). When we identify a = and b = N , we find the alternative representation At this point, it is useful to take advantage of the relation which follows when we introduce the summation index m ≡ k − 2N together with the identity exp(2π is ) = 1 for integers s. As a result we find that and (63) reduces to A comparison with (50) finally establishes the connection between the complete reciprocate Gauss sum A ( −1) N ( ) and the discrete Gauss sum S N ( ) discussed in the preceding section.

Analytical expressions
The connection (67) between the complete reciprocate sum A ( −1) N ( ) and the standard Gauss sum G( , 4N ) allows us to draw on the results of (53) and (57) to obtain explicit expressions for |A ( −1) N ( )|. Throughout this section, we assume for the sake of simplicity that the number N to be factored is odd. In complete analogy to section 3.2, we distinguish two cases for the argument .

No common factor between and N .
With the help of the factorization relation (57) of G, we find that which with the connection formula for G(a, b) and G(1, b), (51), together with the explicit result (53) for G (1, b) leads us to Therefore, the reciprocate Gauss sum takes on the value where we have used (67).

A common factor between and N .
Here we have = ks and N = r s, which with the help of the factorization relation (57) leads us to G(ks, 4r s) = sG(k, 4r ).
(72) Furthermore, we have to analyze if k and four share a common factor, which leads us to In the last step, we have again made use of the factorization relation (57).
In the case of k ∈ M 2 , it can be shown that 2r for each odd number r belongs to the class M 2 . Therefore, we find that where we have used (51) and (53). Thus, with (67) we obtain the expression for the absolute value of the Gauss sum.

Factorization
We now take advantage of the results obtained in the preceding section to factor an odd number N with the help of the signal |A (

Conclusions and discussion
In the present article, we have analyzed different schemes to factor numbers based on three classes of Gauss sums. We have developed analytical criteria for deducing the factors of a number N from a physical signal given by a Gauss sum, and have demonstrated the suggested schemes by numerical examples. The continuous version of Gauss sum factorization has a remarkable scaling property. As a result, a single realization of the Gauss sum for the number N yields information on the factors of another number N . The discrete version of this scheme rests solely on the analysis of Gauss sums at integer arguments. The Gauss reciprocity relation allowed us to establish a link with yet another type of Gauss sum. Here, the roles of the argument and the number to be factored are interchanged.
Unlike Shor's algorithm, the factorization schemes discussed in this paper do not feature a reduction of the computational resources. Nevertheless, we are convinced that this approach will open new perspectives on the connection between physics and number theory [20,53]. In particular, our work is motivated by the search for physical systems that reproduce Gauss sums. In this spirit, the results of this paper provide the mathematical background for part II, where we address physical realizations of Gauss sums.
The absolute value of G is given by provided that n is prime. All other cases of n can be reduced to that one. In the present case study, the quadratic Gauss sum plays a central role. However, only for c = 0, gcd(a, b)=1 and b squarefree, which means that b = n × q 2 , can we cast it into the form of a Gauss sum over a finite ring, where k b denotes the Legendre symbol. Hence, only in this case can we perform the algorithm proposed in [39,40].
Furthermore, we note that for the quadratic Gauss sum G(a, b, 0), it is very easy to estimate the phase γ , in contrast to the absolute value, which depends on the greatest common divisor of a and c. In section 3, we use this attribute of quadratic Gauss sums to factor numbers.

A.2. Outline of the algorithm
In order to bring out most clearly the main principles of this phase-determining algorithm [39,40], we choose the example of a finite ring Z/nZ over a prime n. If n is not prime, we have to first find the factors of n and then execute the algorithm for each factor of n. With the help of the phases corresponding to each factor, it is possible [39,40] to estimate the phase of the Gauss sum.
With the help of Shor's discrete log algorithm [61], the phase γ 1 of χ −1 (β) can be calculated in an efficient way. Hence, we are left with the task of finding the phase γ 2 of G(Z/nZ, χ, 1). The algorithm proceeds in four steps: first, we prepare the superposition state consisting of the state and the 'stale' component | . We emphasize that |χ is a superposition of only n − 1 orthonormalized states |x since χ (0) = 0 as shown in the next section.
In the next step, we perform a quantum Fourier transformation (QFT) exp 2πi x y n |y (A.8) of |χ , which leads us tô With the help of the definition of G, (A.1), we arrive at which reduces with the identity (A.5) tô In the third step, we produce the phase shift where γ 2 denotes the phase of G.
In the fourth and final step, we implement, with the help of the initial superposition state |ψ (A.6) and the transformed state |ψ (A.15), an algorithm for determining the phase γ 2 .
In [39,40], it is shown that this algorithm consisting of state preparation, QFT, creation of phase shift and phase estimation can be performed in polylogarithmic time.

A.3. Properties of multiplicative characters
In this section we verify the identity G(Z/nZ, χ , β) = χ −1 (β)G(Z/nZ, χ, 1), (A. 16) which is crucial to the algorithm discussed in the preceding section. For this purpose we first derive some properties of multiplicative characters and then use them to establish (A.16).
We start with the identity of the multiplicative character χ, which for y ≡ 1 yields that is, Likewise, we find from (A.17) for y ≡ 0 the relation which is only true for arbitrary x provided Next, we substitute y ≡ x −1 into (A.17) and arrive at which with the help of (A.19) reduces to As a consequence, we obtain the relation We are now in position to verify the identity (A. 16). For this purpose, we introduce the summation index y ≡ βx in the Gauss sum, (A.1), which reads Here, we emphasize that the summation has not changed due to the modular structure of the domain of arguments x of the Gauss sum. With the help of (A.24) and the definition (A.1) of G, we immediately arrive at (A.16).

Appendix B. Factorization with an N-slit interferometer
In this appendix, we summarize the essential ingredients of the pioneering proposal [49] by J F Clauser and J P Dowling to factor odd numbers using a Young N -slit interferometer. For a more elementary argument, see the appendix of [62]. We operate the interferometer with matter waves whose propagation is governed by the Schrödinger equation rather than light waves, whose evolution is described by the Maxwell equations. Needless to say, in the paraxial limit both wave equations agree.
We first derive an expression for the wave function on a screen located at a distance z from an N-slit grating with the period d. Screen and grating are parallel to each other. We then cast the Green's function into a form that allows us to derive a criterion for the factorization of an odd integer N . Here, we use a property of Gauss sums derived in appendix C.

B.1. Wave function on the screen
For the propagation of the initial wave function representing an array of N identical wave functions φ = φ(x) separated by d, we start from the Huygens integral [22] ψ(x, t) = N (t) is the Green's function of the N -slit problem with the dimensionless position variable ξ . When we can treat the motion along the z-axis classically, the time t translates into the longitudinal position z via the identity where v z is the velocity along the z-axis. N , that is, when r is non-vanishing, there will be a remainder R due to the summation over an incomplete unit cell. Indeed, we arrive at When we compare the sums in W (l) and the remainder R given by (B.21) and (B.23) we find that they only differ in their upper limits. Indeed, the summation in W (l) extends over the period l, whereas the one in R only contains r terms.

B.3. Criterion for factorization
Since the function k = k (ζ ) is sharply peaked when ζ is an integer s, the Green's function G has maxima at positions ξ = l/2 + s. Because N is odd, l must be also odd in order to be a factor of N . Hence, the phases interfere constructively at half-integers, that is, at ξ = q + 1/2 where q is an integer.
The weight of the peaks is given by |W (l) (ξ = q + 1/2)| 2 . As shown in appendix C it is equal to unity independent of q.
We therefore arrive at the following criterion [49] for finding factors of an odd number N : if l is a factor of N , the remainder R vanishes and the diffraction pattern consists of spikes at the positions x = (q + 1/2)d of identical height. If l is not a factor of N the remainder R leads to diffraction patterns, which interfere with these spikes. As a result, their heights are not identical anymore.
which yields A (r ) (n) = 1, for n = 0, 0, else. (C.9) In the last step, we have used the fact that a and r are coprime.
We conclude by analyzing the finite Gauss sum which is a special case ofW (r ) . Indeed, a comparison of (C.2) and (C.10) allows us to identify the parameters a = 2q, b = m and c = 0. However, the discussion is now slightly more complicated. If r is odd it cannot share a divisor with a = 2q and we can apply (C.1). In this case, only the Fourier term with n = 0 is non-vanishing. On the other hand, if r is even, it shares with a = 2q the factor 2, and also the term can be either zero if qr /2 + m is odd, or 2/r if it is even.