Quantum Random Number Generator Based on LED

Quantum random number generators (QRNGs) produce random numbers based on the intrinsic probabilistic nature of quantum mechanics, making them true random number generators (TRNGs). In this paper, we design and fabricate an embedded QRNG that produces random numbers based on fluctuations of spontaneous emission and absorption in a Light-Emitting Diode (LED). To achieve a robust and reliable QRNG, we compare some usual post-processing methods and select the finite impulse response (FIR) method for a real-time device. This device could pass NIST tests, the generation rate is 1 Mbit/s and the randomness of the output data is invariant in time.

This century can be considered the beginning of the rapid development and dissemination of quantum information technology in almost all scientific and utility fields.Meanwhile, random numbers play a significant role in many aspects of information technology [1][2][3] .Applications of random numbers including symmetric key cryptography 4 , Monte Carlo simulation 5 , transaction protection 6 , and key distribution systems 7 will be more important in the era of quantum technology.
Traditionally, pseudo-random number generators (pseudo-RNGs) were based on deterministic algorithms and could not generate truly random numbers.On the other hand, quantum random number generators (QRNGs) can generate truly random numbers from the essentially probabilistic nature of quantum processes and can also provide higher bit rates instead of physical random number generators 8 .
In this work, we experimentally demonstrate a simple, inexpensive, and real-time QRNG based on the spontaneous emission and absorption of an LED and easily accessible at high speed.
First, we discuss spontaneous emission in an LED-QRNG device, which is widely recognized as the primary source of randomness.Following this, we provide a theoretical formalism that explains absorption as a secondary mechanism modifying output light, and demonstrate that absorption and spontaneous emission both contribute to randomness.
We will a) Corresponding Author: mohsen.akbari@khu.ac.ir then demonstrate the physical setup and illustrate an approach to maximize the quantum part of the signal.Finally, the post-processing procedures and results are discussed.
In an isotropic optical medium, the total spontaneous recombination rate R spon can be defined as 21 where r spon (E) denotes the spontaneous downward transitions in an electronic system and written as in which f u and f l are the probabilities that the upper and lower states involved in the transition are occupied, n b , m, e, and c are the refractive index, effective mass, electron charge, and the speed of light, respectively and the sum is taken over all pairs of states per unit volume whose energy difference is between E and dE.Moreover, the matrix element is averaged over all polarizations of the incident light, so, we can write where j = x, y, z.Furthermore, ψ u and ψ l are the wave functions of the upper and lower states, and k is the propagation vector of the radiation.After some derivation, we get the formula for the spontaneous recombination rate as where n and p are the concentrations of electrons and holes and B is given by 21 where ⟨|M | 2 ⟩ avg is the average of the squared matrix element over spins in the upper and lower bands, and V is the volume of the crystal.Further, we will see that R spon is the source of randomness due to the emission.
As discussed earlier, spontaneous emission is the primary mechanism for emitting light from an LED, and it is a quantumly random process 22,23 .Aside from that, we propose that absorption is a quantum entropy source in LEDs alongside spontaneous emission.
Beer-Lambert's law can be used as a starting point to show that absorption fluctuation affects light intensity as well.As shown in FIG.1(a), the electron-hole recombination process generates the light with intensity I 0 .Light may be absorbed when it passes through the active region that is expressed as where α represents the absorption coefficient of the object and L denotes the distance traveled by the light.Absorption occurs when an electron is excited by a photon.Despite the fact that Beer-Lambert law is applicable in the macroscopic region since light is treated as classical electromagnetic waves, it can be extended to the microscopic domain if one considers photon number decay due to the absorption of photons during the process 24 .Thus, we use time-dependent perturbation in order to determine the absorption coefficient 25,26 .
The interaction Hamiltonian for a generated photon into the active region is 25 : where E 0 , q, ω, and e q are the electric field amplitude, wavenumber, angular frequency, and polarization unit vector of the generated photon, respectively, and d = − e r denotes the light-induced electric field dipole moment.Considering the dipole approximation, we obtain: which d ul = ⟨ψ u |e q d|ψ l ⟩ is the dipole element for transition between ψ u and ψ l states.Upon solving the Schrödinger equation with a perturbation harmonic in time for H photon int , assuming an electron transitions from initial state l to final state u, the probability is 25,26 : where 2π ℏ |⟨ψ u |H photon int |ψ l ⟩| 2 refers to the transition rate probability, also known as Fermi's golden rule 26 , which is the basis for the randomness in absorption.Additionally, the absorption coefficient can be defined as 27 : where S represents the Poynting vector, and w ul /t is the transition probability per unit of time or the transition rate probability.Regarding Eqs. ( 7)- (10), one can derive α as 25 : Eq. ( 11) gives the absorption coefficient in terms of the density of states and the dipole element.
For any LED which αL ≪ 1, we can approximate Eq. ( 6) as 27 : In other words, the light intensity fluctuation includes fluctuations of I 0 , α, and L. Considering Eqs. ( 9), (10), the α depends on the transition rate probability and the energy of the generated photons.These terms are probabilistic and cause fluctuations in the light intensity.For example, wavelength broadening has been shown in FIG.1(c), which can directly cause a variation in the light intensity.For simplicity, we can average the L along the cavity and take it as a constant.Considering this, we define effective length L eff L0 0 I 0 e −αx dx = I 0 L eff (13)   where x represents the position of the generated photons and L 0 represents the active region length.After some calculation, we can reach Consequently, we no longer have to consider L as a random variable.So far we have discussed the theoretical foundation of our QRNG device, and FIG.1(a) illustrates a conceptual mechanism of spontaneous emission in an LED.We will now describe the setup of the experiment.The PCB circuit of the integrated optical and electronic components and the schematic process are shown in FIG.1(b) and 1(c), respectively.The detailed design block diagram of the QRNG module comprises three main parts.First, the quantum entropy source (LED).Second, the amplification of the signal received from LED by a photodetector (PD) and an amplifier (AMP).Finally, digitizing the amplified signal by an Analog-to-Digital Converter (ADC) with 12-bit resolution and 4 MSa/s sample rate and applying a post-processing procedure using a microprocessor.As demonstrated in FIG.2(a), the temporal waveforms of signal and noise are measured, indicating that the LED noise is dominant and the output signal oscillates irregularly and shows good randomness of intensity fluctuation.The signal distribution is given by the green histogram in FIG.2(b), and the Gaussian distribution and symmetry are demonstrated by comparing them with the red fitting curve 30 .Also, FIG.2(c), illustrates the spectral noise for three different situations: the power supply, the PD output when the LED is off (background noise), and the PD output when the LED is on.As can be seen, the LED noise is more dominant than the other noises.FIG.2(d) displays the intensity noise of the PD output voltage when the LED is on, indicating white noise.
To obtain high-quality random numbers, we should maximize the quantum part of the signal 5 .In this way, we aim to achieve an SNR formula for controlling the quantum part using a measurable variable.In the following, we derive the SNR based on the LED current.
The electric field inside the active region is described by where ϕ represents the phase fluctuations of the LED executes a Brownian motion and has a Gaussian probability distribution 22 .
It should be noted that quantum phase fluctuations are inversely proportional to the light intensity, whereas classical noises (e.g.flicker noise and occupation fluctuation) are independent of power 22,29 .Thus, the total phase fluctuations can be written as follows 22,23 : The contributions of quantum phase noise and classical phase noise are represented by Q I and C, respectively and ⟨•⟩ represents a statistical average.The variance of the photodetector AC voltage (V P D ) is given by where g and F are the gain of the photodetector and the background noise, respectively.Using Eqs ( 12),( 17) and converting the light intensity to current (I 0 = Jη ex ), we can derive where η ex and J are the external quantum efficiency and LED current, respectively.As mentioned earlier, we need to maximize the quantum part of the signal over the classical part to generate high-quality random numbers, so we define the SNR equation which shows the proportion of the quantum part of the signal over the classical part.As shown in FIG.3(a), A QS , A CS , and F were determined experimentally by measuring the variance of the photodetector voltage at different currents.The denominator represents the overall classical noise, which has two parts.Flicker noise and occupation noise from LEDs, as well as background noises (e.g.shot noise, flicker noise, and thermal noise).Aside from that, background noise is independent of LED current and is determined by the amplifier bias condition.
In addition, we have used a BJT amplifier to reduce the Flicker noise of the amplifier circuit.The results demonstrate that at low and high current ranges, either background noise or classical noise will dominate the quantum signal, while at medium currents (1 mA to 2 mA for our setup), the quantum signal will dominate, as shown in FIG.3(b) and predicted by Eq. ( 19).Therefore, we determined the optimal current range where the quantum signal is the strongest and the classical noise is minimal.
Typically, QRNGs use randomness extractors such as Toeplitz hashing to generate information-theoretically provable random numbers.
However, randomness extractions are too computationally intensive, especially for real-time embedded devices based on microprocessors.This will significantly decrease generation rate.We used simple post-processing suitable for microprocessors to avoid hardware complicity and low-speed generation rate.Aside from that, the purpose of standard RNGs is to generate a random uniform string, in which the raw numbers are processed to obtain a good-quality output with a uniform distribution.To achieve this, we explored three methods suitable for embedded real-time devices to convert the Gaussian distribution of the QRNG into a uniform distribution.The first approach involved a simple XOR (S-XOR) processing technique, where a single number from the ADC was XORed with the k th number following it.The second approach was the modified XOR (M-XOR) method, where the output of the ADC was XORed with a shift-rotated version of itself and then XORed with the k th number following it.The last approach is the finite impulse response (FIR) method 31 .The FIR method involves taking a weighted sum of past input samples, as described by Eq. ( 20), to analyze the input signal.This can help to reduce any unwanted noise or interference in the signal, leading to a higher-quality output.Studies have shown that the FIR method can also maintain the min-entropy of the generated random numbers.As a result, this method creates a more unpredictable result by scrambling the raw input data 32 .This technique consists of transforming a raw integer sample x(n) into an unbiased one y(n), by means of the relation: where b i = M !i!(M −i)! and M is the number of raw samples.After every technique, we have taken m-Least Significant Bit (m-LSB).
To establish a robust and reliable device we compare and evaluate three different post-processing procedures for real-time embedded systems that were introduced in the previous section.These methods were compared according to their processing time, their ability to maintain minimum entropy, and their ability to produce uniformly distributed random numbers that passed the National Institute of Standards and Technology (NIST) randomness test 33,34 .Min-entropy is defined as which indicates how random a distribution X is on {0, 1} n .The findings of this study are presented in Figs. 4 and 5, which illustrate the m-lsb values obtained through the application of three distinct post-processing methods, as well as the autocorrelation between the resultant data.As it has been shown in FIG. 5, the autocorrelation of post-processed data is below the standard deviation means the random data are not correlated 23 .The FIR method produced a uniform probability distribution at 10-lsb and passed the NIST randomness test, while the S-XOR and M-XOR methods produced uniformity at 5-lsb and 6-lsb, respectively.Table I presents the results of the NIST randomness  test for each approach.Our findings indicate that the S-XOR approach did not pass some of the NIST tests, as presented in Table I.Therefore, caution is necessary when relying solely on the uniform distribution achieved by the S-XOR approach.
The results assert that the FIR method is the most suitable approach for post-processing in real-time embedded systems.This method has been found to maintain the min-entropy of the random data, thereby improving the reliability and robustness of the device.Following a comparative analysis of three alternative methods, we have selected the FIR method for use in our device.To further verify the performance of our device, we conducted two tests to evaluate the performance of our device, including temperature tests to determine the impact of temperature on device performance and time duration tests to check the stability of device functionality over time.These tests have provided valuable insights into the effectiveness and reliability of the FIR method for post-processing in real-time embedded systems.FIGs.6(a) demonstrates the variation of the min-entropy of random data over time.The results show that the min-entropy remains almost constant, indicating that the fabricated device is robust and reliable over time.In addition, a temperature test was conducted to evaluate the device's durability and ability to withstand temperature variations.The results, illustrated in FIG.6(b), demonstrate that the device performs well and maintains its reliability and robustness even when subjected to temperature fluctuations.
Finally, our QRNG device now reaches a generation rate of 1 Mb/s and has the potential to attain higher rates by integrating additional LEDs in a parallel configuration.
In summary, we have fabricated a durable, low-power, cost-effective QRNG uses LED spontaneous emission.Results show that quantum signals dominate when the current is medium-to-low.Our research attempts to establish a link between absorption and LED temporal fluctuations as another source of quantum noise in an LED.Moreover, we evaluated various post-processing methods and discovered that the FIR approach is the most reliable and yields the highest min-entropy outcomes.Our device maintains a stable min-entropy over time and under variable temperatures, operates at a real-time rate of 1 Mb/s, and has passed all the NIST tests.These results provide a promising route for building efficient and practical QRNGs with potentially high bit rates.

FIG. 1 .
FIG. 1.(a) The process of light emission from an LED involves the application of a suitable voltage, which causes electrons and holes to recombine randomly in the active region.It is worth noting that the length of output for each photon is different.(b) The QRNG's PCB.The LED and detector are integrated into an opto-isolator (component 1).Component 2 is the BJT amplifier and component 3 is the regulator.(c) Diagram of QRNG.The LED's energy diagram illustrates the density of state for electrons and holes, with a varying absorption coefficient for each photon due to different frequencies.After emission, the photon is absorbed by the photodiode, and the output electrical signal is amplified, then digitized by an ADC and processed through a microprocessor.

FIG. 2 .
FIG. 2. (a) Temporal waveforms of the LED and amplifier circuit's quantum signal and classic noise, where quantum noise is the prevailing factor.The green curve indicates the LED noise, and the blue curve represents the amplified classical noise, and the orange curve illustrates the amplified battery noise.(b) The histogram distribution of the signal voltage is represented by the green bars, with the dashed lines indicating a well-fitted Gaussian distribution.(c) The spectral power density in three different conditions: the LED is off (classical noise), the LED is on (LED noise), and the battery.(d) The intensity noise indicates white noise when the LED is turned on.

FIG. 3 .
FIG. 3. (a) Photodetector voltage variance.The V PD variance is measured by a 12-bit ADC and fitted with the polynomial function described in Eq. (18a).(b)The figure presents the ratio of quantum signal to classical noise, revealing that as the LED current decreases, the SNR increases as per theoretical predictions.When the LED turns off, background noise dominates the quantum signal, causing a rapid drop from 1 to 0 mA.

FIG. 4 .FIG. 5 .
FIG. 4. The probability distribution of three post-processing approaches with different m-lsb values (m=6, m=7, m=8): (a) Simple XOR, (b) Modified XOR, and (c) FIR.The FIR method produces a perfectly uniform distribution, while the other two approaches exhibit some non-uniformity.

FIG. 6 .
FIG. 6.The figure depicts how the min-entropy changes over time and at different temperatures, indicating the device's dependable and consistent production of randomness over time (a) and different temperatures (b).

TABLE I
. Performance comparison of NIST results for S-XOR, M-XOR, and FIR methods.