Optical quantum random number generators: a comparative study

Quantum random number generators give the opportunity to, in theory, obtain completely unpredictable numbers only perturbed by the noise in the measurement. The obtained data can be digitalized and processed so that it gives as a result a uniform sequence of binary random numbers without any relation with the classical noise in the system. In this work we analyze the performance of optical QRNGs with three different arrangements: a homodyne detector measuring vacuum fluctuations, a homodyne detector measuring amplified spontaneous emission from an EDFA and a spontaneous emission phase noise-based generator. The raw data from the experiments is processed using a Toeplitz extractor, giving as a result sequences of binary numbers capable of passing the NIST Statistical Test Suite.


Introduction
It is apparent that information technologies and cryptography are the most demanding industries for random numbers, and therefore random number generation devices. There are however many other uses that heavily depend on random number generation, like the gambling industry or fundamental investigation.
Random number generators can be classified into three categories (Mannalath et al. 2022): 185 Page 2 of 10 (1) Pseudorandom number generators (PRNG): seemingly random numbers are generated by means of an algorithm. The output sequence is hard to distinguish from a truly random one, but its order is totally predefined.
(2) True random number generators (TRNG): a. Physical random number generators: random numbers are generated upon measurements of classic systems parameters with chaotic behaviors; in special, chaos in lasers has been successfully used as a source of random bits at high frequencies (Kanter et al. 2010;Li et al. 2010;Li et al. 2018;Uchida et al. 2008). Output sequences are usually considered random, but at a fundamental level they are deterministic. b. Quantum random number generators (QRNG): random numbers are generated based on the uncertainty inherent to quantum physics (Gabriel et al. 2010).
In the last years, many experiments have been conducted relying on the quantum nature of light. In particular several authors have shown the operation of homodyne detectors in laboratory setups (Collett et al. 1987;Herrero-Collantes and Garcia-Escartin 2017) that can be extended to commercial use (Huang and Zhou 2019;Qi 2017;Raffaelli et al. 2018). There have also been shown major improvements obtained with the introduction of an Erbium-Doped Fiber Amplifier EDFA (Qi 2017). Those experiments used, nonetheless, different components, circuits and measurement equipment. In this paper we will present a thorough comparison of these methods, using a homogeneous setup for all of them. On top of that, we will conduct new experiments destined to analyze the influence of parameters such as laser power, EDFA pumping power or laser wavelength on a QRNG based on a homodyne receptor.
Classical monochromatic light waves have a quantum mechanical equivalence known as coherent states, which can be represented as a superposition of the photon number states. Unlike classical electromagnetic waves, phase and photon number of a coherent state have uncertainty in them and are always fluctuating around their average values.
The zero photon number state, more commonly known as the vacuum state, possesses a non-zero energy originated from a randomly fluctuating electromagnetic field (Glauber 1963) present even in the absence of photons. Measuring these random fluctuations will be one source of randomness in our experiments. The second source of randomness will rely on the phenomenon of amplified spontaneous emission (ASE) present in an EDFA, in which random noise from the spontaneous emission in the medium with population inversion is in turn amplified by stimulated emission in the medium. Lastly, we used as a source of randomness the phase noise resulting from spontaneous emission on two independent lasers operating at the same frequency.

Experimental setup
We present eight experiments based on the same laboratory setup, under the same conditions and with the same pieces of equipment (see Table 1), so the influence of laser wavelength or EDFA pumping power on QRNGs based on vacuum fluctuations or ASE as a randomness source can be compared and studied.
The general homodyne detector setup consists of a 50:50 beam splitter, in which a laser is connected with a source of randomness (vacuum fluctuations/ASE). The outputs of the beam splitter are sent to two photoreceptors by optical fiber cables of the same length to avoid phase delays between the branches.
Both photodiodes must have similar characteristics so that the classical noise and oscillations from the laser get canceled out by taking the photocurrent difference which is proportional to the shot noise of the laser (Schumaker 1984;Yuen and Chan 1983).
The digitized difference of the photocurrents is recorded with an oscilloscope at a sampling frequency of 250 MS/s and 8 bits of resolution.

Vacuum fluctuations measurement
In experiments 1, 2, and 3 ( Fig. 1a) the quantum noise was obtained by measuring the vacuum fluctuations in the electromagnetic field. Experiments 1 and 3 used a laser source of 1549.32 and 1308.8 nm respectively. Experiment 2 was designed to measure the effect of an unbalanced setup: one 1-meter fiber was used to connect the splitter to the first photodiode, while two 1-meter fibers were used in the connecting between the splitter and the second photodiode, thus changing the length of the path that each light beam has to go through. The optical source was the same 1549.32 nm laser from experiment 1. Laser sources, photodiodes, and beam splitter in the setup were the ones contained in the OptoSci ED-WDM kit.

ASE measurement
In experiments 4, 5, 6, and 7 (Fig. 1b) the setup is modified so ASE becomes the source of the quantum noise to be measured. That was accomplished by connecting an EDFA to the beam splitter input that was left open in experiments 1, 2, and 3. The used EDFA (from OptoSci ED-AMP kit) reaches saturation with a pumping power of 20 mW, so powers of 10 mW and 13 mW were selected in order to stay away from the upper limit.
Once again, two different laser wavelengths (1549.32 and 1308.8 nm) were alternatively connected to the first input of the beam splitter.

Vacuum fluctuations with channel multiplexing
In experiment 8 (Fig. 1c), two independent 1550 nm lasers were connected to the inputs of the beam splitter, thus producing a beat between the phase noise of both signals.

Electronic (non-quantum) noise measurement
Electronic noise measurements were performed by sampling the input signal in the oscilloscope while keeping the laser sources off. Four types can be distinguished: (1) Electronic noise #1: tests without EDFA. Noise sources are photodiodes and the oscilloscope.
(2) Electronic noise #2: tests with EDFA at 10 mW pumping power. Noise sources are ASE, photodiodes, and the oscilloscope. (3) Electronic noise #3: tests with EDFA at 13 mW pumping power. Noise sources are ASE, photodiodes, and the oscilloscope. (4) Electronic noise #4: tests with a single laser to avoid noise beat. Noise sources are the photodiode, the oscilloscope, and the laser.

Noise types and entropy
For each experiment, 5 × 10 5 samples of data have been recorded. The same number of samples have been taken for each of the four electronic noise types. These sequences have been then undergone a normality test battery (Chi-square goodness of fit test, Lilliefors test, Kolmogorov-Smirnov test, and Jarque-Bera test) thus ensuring they fit a Gaussian distribution as predicted by theory (Glauber 1963) (except for experiment number 8).
The means and variances of the 11 Gaussian distributions are shown in Table 2:  The signals recorded in each test are the combination of noises from quantum and nonquantum sources, being the latter unwanted because of not being purely non-deterministic.
Taking into account that both noises have different nature and origin, we can consider the quantum and the electronic noise to be independent (Sanguinetti et al. 2014;Ma et al. 2013), so the variance of the quantum noise can be calculated by subtracting the variance due to the electronic noise from the variance of the signal measured in the experiment (Table 3, second column).
For measuring and comparing the uncertainty of the sequences obtained in the different experiments, we calculated the min-entropy of experiments 1-7 as where N = {x1, x2,...,x k } is the set of measurements with probabilities p i for i = 1,...,k [12].
As the noise distribution in experiment 8 is not gaussian, an special analysis was required. The min-entropy was estimated by calculating the amount of bits that can be influenced by three standard deviations of the non-quantum noise associated to the experiment.
With an 8-bit digitalization of the raw data, the min-entropy calculation is shown in Table 3, third column: It can be observed that entropy obtained in tests 4 and 6 is significantly higher than the others, thus demonstrating that min-entropy, and therefore, the random bits generation rate, increases with EDFA's pumping power.
Tests 5 and 7 yielded the lowest values for the min-entropy, thus showing that EDFA's improvement can only be leveraged by a laser with a wavelength within the amplification range.
Entropy values from tests 1, 2 and 3 are very similar, which can lead us to think that neither wavelength nor fiber-optic links length make a difference. However, when comparing autocorrelation values for tests 1 and 2 (Fig. 2), a clear advantage of the balanced fibers setup over the unbalanced one is appreciated.
The two-laser setup from test 8 yields similar min-entropy values to those involving an EDFA.

Randomness extractors
The relatively low-entropy gaussian noise data obtained from the generator needs to be postprocessed with a randomness extractor, which will output a shorter, uniformly distributed sequence with higher entropy.
There are different techniques for this purpose, from which the Toeplitz matrix hashing has been chosen (Mansour et al. 1993;Krawczyk 1994) due to the high rate of generation it allows.
With this formula we computed for each experiment the length of the output sequence required for obtaining a security parameter of = 2 −50 when setting an input length n = 5000 . These results are shown in Table 4.
The output random sequence is finally generated according to the following procedure: (1) We generated a sequence seed of d = n + m − 1 uniformly distributed pseudorandom numbers in the range { 0,1}.
(2) From the previous sequence { a i }, we built a Toeplitz matr ix T ∈ M n×m ∕a ij = a i+1,j+1 ∀a ij ∈ T.
(3) The output non-binary vector is calculated as O � = S × T.
(4) Finally, a binarizing technique is applied so we get the final true random sequence

Randomness evaluation
Given a finite sequence of numbers, it is impossible to determine with absolute certainty whether they are random or not: a series of apparently random numbers may have a large repetition period so it is unnoticed and, conversely, a perfectly random sequence of numbers can show some repetitive patterns produced by chance.
Having that in mind, we decided to subject the outcome of our experiments to the NIST Statistical Test Suite (Bassham et al. 2010), consisting of a battery of 15 tests that compare different parameters of the sequence under study against the ones expected from a homogeneous random one. A test will be regarded as passed if the obtained p-value is over 0.01.
Our results (Fig. 3) show a high proportion of successful tests, with some values under 0.01 in experiments 1, 2, 3, 5 and 8. In spite of these under threshold values, since their proportion is very low, we can conclude with a high probability that the sequences are random and uniformly distributed.

Conclusion
It is possible to build a discrete quantum random number generator based on a homodyne detector.
The random number generation rate can be increased by using the ASE from and EDFA instead of solely the vacuum fluctuations.
Random bits generation rate increases with EDFA's pumping power while an imbalance in the length of the optical paths in the setup increases the autocorrelation coefficients of the measurements.
Finally, it is demonstrated that the use of two lasers provides better entropy values and higher random generation rates than setups relying on a single laser and vacuum fluctuations.
Author contributions All authors contributed to the study conception and design. Material preparation and data collection were performed by Marcos Troncoso-Costas and David Alvarez-Outerelo. Data processing