Prime Number Decomposition using the Talbot Effect

We report on prime number decomposition by use of the Talbot effect, a well-known phenomenon in classical near field optics whose description is closely related to Gauss sums. The latter are a mathematical tool from number theory used to analyze the properties of prime numbers as well as to decompose composite numbers into their prime factors. We employ the well-established connection between the Talbot effect and Gauss sums to implement prime number decompositions with a novel approach, making use of the longitudinal intensity profile of the Talbot carpet. The new algorithm is experimentally verified and the limits of the approach are discussed.


Introduction
Diffraction is one of the most fundamental aspects of optics occurring when physical objects are described by waves. The corresponding interferences may lead to surprising phenomena such as a self-imaging of periodic structures as discovered by Talbot [1] and theoretically derived by Rayleigh [2]. The optical Talbot effect was later on studied theoretically in much detail, either by formulations in real space [3,4] or phase space [5,6], and experimentally observed with x-rays [7], electron beams [8], atomic matter waves [9,10] and surface plasmons [11,12]. Although the Talbot effect has been proven to be useful for various applications, we focus on a particular application, namely to decompose composite numbers into their prime factors. Since self-imaging is a general property of diffraction in the near field, the Talbot effect extends prime number decomposition to the field of classical optics, representing an alternative to factorizing algorithms known from quantum computation [13], albeit by purely classical means. This alternative approach was initially developed by Clauser and Dowling [14] and later linked to generalized Gauss sums [15], which constitute a practical tool to perform prime number decompositions [16]. This ability of Gauss sums was already proven in many experiments e.g. by using the temporal Talbot effect [17], different interferometers [18][19][20][21], Bose-Einstein condensates [22] or NMR techniques [23][24][25]. However, up to now there appears to be no experimental realization of the optical Talbot effect with the aim of performing prime number decomposition. This circumstance becomes less surprising when noticing that complete measurements of the two-dimensional intensity profile using coherent illumination, so called Talbot carpets [26], were not recorded until recently [27]. The goal of this paper is to connect the two dots.

Prime Number Decomposition using Gauss Sums
Our technique to implement prime number decompositions is based on the properties of Gauss sums, which exist in many different forms [16,28,29]. The discrete Gauss sum, showing the characteristic property of a quadratically occurring summation index, is defined as with l, N ∈ N and weight factors w m , where the latter is supposed to be a slowly varying function of m [16]. In view of the upcoming discussion, we assume the weight factor to be of the form w m = a sinc(ma) with a ∈ R + . Inserting this weight factor, exploiting the periodicity of the exponential function in m with period N and applying the Poisson summation formula, allows us where G(l, N) represents the so called complete Gauss sum (normalized by N), if the condition a < 2 / N holds. Employing the properties of the complete Gauss sum G(l, N) we can perform prime number decomposition [16]. To this aim, we assume that the number N to be factorized is odd and l a test factor. If l is no factor of N, we obtain from Eq. (2) |S N (l)| 2 = 1 / N , whereas if l is a prime factor p of N or a multiple k p of a prime factor, we find |S N (k p)| 2 = p / N . Hence, all prime factors of an odd number N can be uniquely identified by evaluating |S N (l)| 2 for all test factors l and comparing with the "line of factors p", given by f (p) = p / N (see Fig. 1).

The Talbot Effect
The Talbot effect is a diffraction phenomenon taking place in the near field behind a grating upon illumination with a plane wave. To derive the Talbot diffraction pattern, we assume an infinite periodic one-dimensional grating with slit width w and period d. The corresponding transmission function reads Within the Fresnel diffraction formalism we can propagate the electric field from the source plane with λ the wavelength and k the wave number. Since there are infinitely many slits, T(ξ) is a periodic function and can be decomposed into a Fourier series Combining Eqs. (4) and (5) and evaluating the integral yields where L T = 2d 2 / λ represents the so-called Talbot length, illustrating the self-imaging effect as The intensity at the grating is found by calculating the modulus square of the electric field amplitude leading to

Prime Number Decomposition using the Talbot Effect
In 2009 a precise measurement of a Talbot carpet [27], where also the intensity for fractional distances of the Talbot length had been determined, showed that the intensity distribution along the x-axis at the fractional distances z l ≈ l / N resembles a Gauss sum. This allows to perform prime number decomposition by counting the intensity maxima parallel to the grating at the distinct distances z l [27]. In this paper, however, we propose a different algorithm for prime number decomposition, based on another appearance of a Gauss sum within the Talbot carpet.
Considering the intensity distribution of Eq. (7) at a fixed lateral position x = qd, q ∈ N, and studying the intensity distribution along the z-axis, we obtain after a change of the summation index n = −m and exploiting the symmetry of the Fourier coefficients A m = A −m Eq. (8) resembles already the discrete Gauss sum S N (l). With Fourier coefficients A n = ( w / d ) · sinc[m( w / d )] it turns into a complete Gauss sum G(l, N), normalized by N, if the condition N < 2d / w holds. This can be seen by identifying w / d with a in Sec. (2). Note that this condition limits the numbers we can factorize via the dimensions of the used grating. Using this expression we can rewrite Eq. (8) as Altogether, this means that we can perform a prime number decomposition via a measurement of the Talbot effect when applying the following procedure: 1) Record the intensity profile of the Talbot carpet along the z-axis from any Talbot distance sL T to the next Talbot distance (s + 1)L T at some fixed slit position x = qd with s, q ∈ N.
3) Draw the line of factors from [1, I(z 1 )] to [N, I(z N )] and locate the intensities on or above this line to find the prime factors of N. If I (z l ) / I (z 1 ) ≈ 1 / N then l is no factor of N, if I(z l ) / I (z 1 ) ≈ l / N l is a factor of N.

Experimental Realization of the Talbot Effect with Focus on Prime Number Decomposition
To prove the above proposed algorithm for prime number decomposition, we designed the experimental setup shown in Fig. 2. Placing the grating in the focus of the Gaussian beam leads Fig. 2: Experimental setup: Light of a Nd:Yag laser with a wavelength λ = 532 nm is coupled into a single mode fiber SM F in order to obtain a well-defined single spatial mode. A collimation lens CF is placed at a distance of its focal length f behind the fiber, such that the beam waist of the resulting Gaussian beam is located at a distance f after the lens where the grating is located. A CMOS camera equipped with a 10× magnifying microscope objective is placed at a distance z behind the grating. Its sensor consists of 1280 × 1024 quadratic pixels with a side length of 5.2 µm. The camera was mounted on a translation stage which can travel 150 nm along the z axis.
to the following expression for the lateral electric field distribution at the position of the grating with the Gaussian beam waist σ. In this case the Fresnel diffraction integral is not calculated using a plane wave as input but a Gaussian distribution, such that the intensity behind the grating reads In order to record the full Talbot carpet for a diffraction grating with a period of d = 200 µm and a slit width of w = 10 µm, the measurement was automated to record with a CMOS camera images between L T = 150.4 µm and 2L T = 300.8 µm in steps of ∆z = 50 µm. From the collected data the Talbot carpet was reconstructed by stacking the measured intensity for each step, whereby each image was averaged over all rows along the y-axis (since the intensity does not depend on y). The resulting Talbot carpet is shown in Fig. 3 a. Besides the experimental data (green line) Fig. 3 b displays also the theoretical prediction (black dashed line) obtained by numerical evaluation of Eq. (11), demonstrating an excellent agreement between theory and experiment. As an example, Fig 3 c shows the decomposition of the number N = 27 using our new algorithm. As can be seen, the prime factors 3 and 9 lie above the line of factors connecting I(z 1 ) and I(z 27 ) and not as before on this line. The reason for this is due to the reduced intensity at z = 2L T compared to z = L T , stemming from the Fresnel diffraction. Hence I(z 27 = 2L T ) lies lower than I(z 1 = L T ) (see Fig.  3 b) causing the slope of the line of factors to be smaller than in the ideal case. This effect is small, but becomes more prominent for Gaussian beams compared to plane waves. This also leads to a slight decrease of the limit up to which numbers can be factorized, theoretically given by N < 2d / w . For the particular grating used, this means that we can decompose only numbers up to N = 29 and not as theoretically predicted up to N = 40. Nevertheless, the application of the discrete Gauss sum |S N (l)| 2 appearing in the Talbot carpet along the z-direction allows us to decompose numbers within the theoretical limit of the approach into their correct prime factors. Our approach reduces also the amount of required experimental data to the measurement of a single Talbot carpet. The latter contains the information for all possible numbers since encoding the number to be factorized is done by merely rescaling the z axis through z l .

Conclusion
We theoretically discussed the capabilities of the Talbot effect to perform prime number decomposition based on its mathematical analogy to a Gauss sum. We envisaged at first a diffraction grating with infinitely many slits illuminated by a plane wave. We then found that the properties of the ideal case are still valid for the realistic case of a diffraction grating with finite number of slits illuminated by a Gaussian beam. The theoretical investigations result in the first realization of the discrete Gauss sum |S N (l)| 2 using the longitudinal intensity profile of the Talbot effect. Our novel approach improves the amount of possible numbers that can be experimentally decomposed compared to existing factorization schemes based on the fractional Talbot effect. Nevertheless, we note that the Fourier coefficients of the grating transmission function yield a criterion that, depending on the geometry of the diffraction grating, limits the maximal number N that can be decomposed to rather low values. However, other interference phenomena that can be described by the discrete Gauss sum |S N (l)| 2 might yield less restrictive conditions and therefore enhance the possibility to implement prime number decompositions within a physical realization.

Funding
Erlangen Graduate School in Advanced Optical Technologies (SAOT) by the German Research Foundation (DFG) in the framework of the German excellence initiative, Staedtler Foundation, Universitätsbund Erlangen-Nürnberg e.V.