Quantum Random Number Generation with Uncharacterized Laser and Sunlight
Abstract
The entropy or randomness source is an essential ingredient in random number generation. Quantum random number generators generally require well modeled and calibrated light sources, such as a laser, to generate randomness. With uncharacterized light sources, such as sunlight or an uncharacterized laser, genuine randomness is practically hard to be quantified or extracted owing to its unknown or complicated structure. By exploiting a recently proposed source-independent randomness generation protocol, we theoretically modify it by considering practical issues and experimentally realize the modified scheme with an uncharacterized laser and a sunlight source. The extracted randomness is guaranteed to be secure independent of its source and the randomness generation speed reaches 1 Mbps, three orders of magnitude higher than the original realization. Our result signifies the power of quantum technology in randomness generation and paves the way to high-speed semi-self-testing quantum random number generators with practical light sources.
Shanghai Branch, National Laboratory for Physical Sciences at Microscale and Department of Modern Physics, University of Science and Technology of China, Shanghai 201315, China.
Synergetic Innovation Center of Quantum Information and Quantum Physics, University of Science and Technology of China, Hefei, Anhui 230026, China.
Center for Quantum Information, Institute for Interdisciplinary Information Sciences, Tsinghua University, Beijing 100084, China.
Introduction
Random numbers play a vital role in various tasks, such as cryptography,[1] numerical simulation,[2] and lottery. For example, in the well-known quantum key distribution (QKD) protocol proposed by Bennett and Brassard,[3] the security is guaranteed by random choices of the encoding and measurement bases. Distinct from deterministic evolution of classical processes, quantum mechanics endows the capability of generating genuine randomness by collapsing the coherence in the measurement basis.[4, 5]
According to the generation speed and the randomness reliability, quantum random number generators (QRNGs) can be categorized into the following three types. Practical QRNGs, which assume well characterized devices, normally have a fast generation speed.[6, 7, 8] Fully self-testing QRNGs, which adopt no assumptions on device implementations, generally have a low randomness generation speed owing to the stringent requirements.[9, 10, 11, 12, 13] Semi-self-testing QRNGs lies somewhere in between, which have certain assumptions of device implementations while have high randomness generation speed in the meantime.[14, 15, 16, 17, 18, 19, 20, 21] We refer to Ref. [22] for a detailed review of the developments of different types of QRNGs. For these three types, a trade-off between the randomness generation speed and the randomness reliability exists in practice. In many tasks such as QKD, both the randomness generation speed and the reliability are required in order to ensure the key generation rate and the security. For those tasks, semi-self-testing QRNGs serve as promising candidates that fulfill both requirements.
Recently, several semi-self-testing QRNG schemes have been proposed.[14, 15, 16, 17, 18, 19, 20, 21] By assuming the underlying dimension and the independence of the source and the measurement, a QRNG scheme[14] has been proposed such that the output randomness can be self-tested. While, as the randomness is certified by the input and output statistics, the random number generation rate is only about 23 bps. The generation rate was further improved to the order of MHz with input and output statistics and weaker assumptions.[18, 19] Later, with trusted measurement but uncharacterized randomness source, a source-independent (SI) QRNG scheme is proposed,[15] where the randomness generation speed is analyzed to be comparable to practical QRNGs that has characterized devices. Conventionally, QRNGs make use of special light sources, such as lasers, and specific physical model to characterize the randomness source. With more common light sources, such as sunlight, and no assumptions of the randomness origin, the SI-QRNG scheme can still faithfully generate random numbers.
In this work, we explore randomness generation with general light sources, laser and sunlight without assuming the physical structures. By exploiting the SI-QRNG scheme[15] and considering practical issues of measurement device imperfections, we experimentally demonstrate the possibility of fast and reliable randomness generation.
Results
0.1 Scheme
As shown in Fig. 1, a conventional QRNG is composed of the randomness source and the detection device.[22] In the source part, it consists of a light source and a state preparation device. Generally, practical QRNGs[6, 7, 8] make use of specific models to describe the structure of the randomness source. While the SI-QRNG scheme[15] supplies the possibility of randomness generation without assuming neither the light source nor the state preparation devices.

First, we review the concept of SI-QRNG based on the scheme of Ref. [15]. The source independent randomness generation procedure is summarized by source, squashing, random sampling, parameter estimation, and randomness extraction, as follows.
-
•
The state preparation device is expected to prepare the light in the polarization state of , where is the computational basis. While no assumption is made on the photon source, it is untrusted and could be controlled by Eve. Thus, the actual prepared quantum state may have an arbitrary and unknown dimension. Randomness can still be quantified and extracted with the following steps.
-
•
The squashing process maps arbitrary quantum states into qubits and vacuum states. The vacuum components are regarded as loss. In practice, the squashing process can be realized by adding a series of spectrum, spatial and temporal filters to post-select the expected optical modes.
-
•
In the measurement, we randomly choose the and basis to measure according to a random seed. The random seed needed is exponentially smaller than the number of extracted random bits.[15]
Suppose that the number of runs in total is , including in the basis and in the basis. Due to the loss, the output of detection could be null. In this case, the number of qubits measured in total is , including in the basis and in the basis. It is worth noting that this protocol is loss tolerance. In the ideal case, the measurement device chooses the measurement basis after confirming the received state is not a vacuum state. In practice, the measurement basis is chosen before the confirmation of loss, which is usually done by observing whether detectors click or not. However, the detection device does not anticipate the position of losses. Thus the effect of loss only decreases and , but the positions of the effective X and Z measurements are still uniformly random.
-
•
When measuring in the basis, the result of is defined to be an error, and a double click is considered as a half error. Then, we can evaluate the phase error in the basis according to the bit error rate in the X basis and its statistical deviation [23] according to
(1) where . Here is the ratio of the basis measurement. is the binary Shannon entropy function.
Since the dimension of the source is unlimited, it may emit multiphoton states. When using threshold detectors, multiphoton states may cause double clicks, which directly contribute to the error rate and decrease the number of extracted random bits.
- •
Here, is the number of extracted random bits without considering the imperfections of the measurement devices. In practice, the measurement bases may not be exactly complementary to each other, and the detection efficiencies of the two detectors might be different. With a slight modification to Eq. (2), the number of extracted random bits with imperfect measurement devices can still be quantified when these imperfections are characterized. On the other hand, dark counts of the detectors may also increase the phase error rate and decrease the number of extracted random bits. Since the dark counts are independent with respect to the measurement basis, the effect of dark counts can be regarded as noise of the photon source which has already been considered in the analysis.
In the original theoretical proposal, the and basis measurements are assumed perfect. In our work, we also take measurement imperfections into account. Specifically, we consider the case that the actual measurement bases and are not complementary to each other. In this case, we can make use of the general uncertainty relation for two general bases,[26]
(3) |
where and are respectively the eigenstates of and , and and are respectively the entropy of the measurement outcome of and . In quantum random number generation, we can regard as the randomness that we can obtained by measuring an eigenstate of the basis, and regard as the amount of states that are required to distill the eigenstate [27, 5]. That is, given copies of the quantum state , one can effectively first perform a dephasing operation in the basis to collapse them into one of its eigenstates. Then we aim to distill the dephased state into a specific eigenstate, which costs copies of states. For each eigenstate, it generates randomness. Therefore, the total randomness obtained is and each state generates randomness on average. In practice, the dephasing and distillation process can be equivalently achieved with the recently proposed coherence distillation protocols, which can be further reduced to a randomness extraction procedure. Therefore, the final randomness output for two general imperfect bases is
(4) |
Note that the randomness output only depends on the term instead of a full description of the and bases.
In addition, we also consider the case that the measurement efficiencies in the two eigenstates are different. Suppose the efficiencies of projecting onto and are given by and , respectively. Then according to the standard analysis in QKD[28], the randomness output will be further modified to
(5) |
That is, the total randomness is rescaled with a factor . The maximum value of 1 can be achieved when . Here, we assume that the adversary has no information of the detection efficiency mismatch, otherwise there may exist attacks in analogy to the time-shift attack from QKD[29]. With such an assumption, the factor can be understood as a simple strategy that we randomly discard the measurement outcome of the higher efficiency detector such that the effective efficiencies of the two detectors are the same.
In experiment, the term and the efficiency can be first measured during a calibration procedure on the measurement device. Then, the SI-QRNG scheme can be applied to produce randomness according to the randomness rate formulas in Eq. (5).
0.2 Experimental realization
As shown in Fig. 2, the experiment setup can be accordingly divided into two parts, the randomness source part and the detection part. While the detection part should be elaborately designed and carefully calibrated, the randomness source part can be uncharacterized or even untrusted.
In the detection part, filters in several dimensions are employed to rule out unexpected optical modes. Spectral filters, including two 100 GHz DWDMs and several interference filters, are used to guarantee that only photons with expected wavelength can enter, and the isolation on unwanted wavelength is over 60 dB. The coupling of single mode fibre excluded unwanted spatial modes. Finally, photons arrived at wrong time will be inspected and eliminated by a time-digital converter (TDC). The selection of measurement basis is realized by a Sagnac type interferometer and a phase modulator (PM) to obtain high visibility and stability, as shown in Fig. 2. For an input pulse with arbitrary polarization state of , where , it is split by a fibre polarized beam splitter (FPBS2) when entering the Sagnac interferometer. The length of fibre from PM to one port of FPBS2 is 25.2 meter shorter than to the other port. Thus, the time for the clockwise () and anti-clockwise () parts of the split pulses reach the PM are separated by around 126 ns, and finally back to FPBS2 at the same time. By carefully control the PM, the two parts of pulse can be applied by different phase, named and . After combined again in FPBS2, the state of output pulse is , correspond to a unitary operation of . A fibre polarization controller is employed to perform an additional unitary operation of . Here,
(6) |
Finally, after appropriate attenuation, the pulse is separated by FPBS3 and detected by two up-conversion single photon detectors with efficiency of , dark count of 200 cps and dead time of 50 ns.[30] In this way, we can choose to perform () basis measurement by setting to be 0 () and to be 0 (). The probability of measuring in the () basis is selected as () in our experiment and the average photon number per pulse is selected around before detection to maximize the generation rate of random number. Generally, higher photon number per pulse brings higher error rate in the basis and higher double clicks probability in the basis that need to be discarded, while lower photon number per pulse leads to lower . Thus, there is a tradeoff for choosing a proper average photon number. The details of optimizing the probability of measuring in the () basis and the average photon number per pulse is discussed in Methods.

As aforementioned, the detection may have imperfections. Therefore, the detection part is first calibrated by an auxiliary cw laser diode with expected wavelength of 1550.12 nm. Considering the imperfect measurement basis of and , an additional process is performed to estimate in (5). Firstly, the input state is prepared as the eigenstate of basis, that is, the ratio of photon counting between detector 1 and detector 2 is above 30 dB under basis measurement. Then, in the basis measurement, the ratio of photon counting between detector 1 and detector 2 is measured and the bound of is calculated to be 0.952.
Although the randomness source part can be untrusted, to demonstrate the high generation rate of the setup, a carefully calibrated randomness source is realized. An amplitude modulator (AM) is used to modulate the input photons to pulses with frequency of 4 MHz and the full width at half maximum (FWHM) of 100 ns. Another fibre polarized beam splitter (FPBS1), a half-wave plate (HWP) and a quarter-wave plate (QWP) is used to prepare the desired polarization state for the detection part.
As the photon source can be any light that does not need to be trustable, the choice of photon source is flexible. Here, we also demonstrate the use of the most common light in the nature — the sunlight, as the photon source to generate random numbers. A collimator mounted on an equatorial mount is placed on the rooftop to collect sunlight into a single mode fibre. The sun can be approximately considered as a area light source with divergence angle around 0.5∘.[31] Thus, a common collimator with focus length of 11 mm is enough to collect sufficient photon intensities. About 49 nW of light can be collected into single mode fibre under a good weather after filtered by a 15501.5 nm bandpass filter.
The optimal input state for the detection part is the eigenstate of basis. However, input state with other polarization state does not affect the reliability of randomness. Although the error rate in the basis will increase and the random number generation rate will reduce. By rotating the HWP in randomness source part to different angles, the relationship between the input state and the error rate of basis measurement is shown as Fig. 3. Under the near optimal condition with the input state of , we performed the experiment for both laser and sunlight. The error rate in the basis measurement is for laser and for sunlight. The quantum random number generation rate is 1.81 Mbps for laser and 1.72 Mbps for sunlight. The detailed results is shown as Table 1. The extracted random bits can pass NIST randomness test as shown in Fig. 4.
Photon source | Laser | Sunlight |
---|---|---|
APD1 click at Z basis (count) | 1733623848 | 1638255301 |
APD2 click at Z basis (count) | 1843484418 | 1725825404 |
Bit error rate at X basis (%) | 0.33 | 0.21 |
Time (s) | 1800 | 1800 |
0.001 | 0.001 | |
Extracted raw number (bit) | ||
Generation rate (bps) |


Discussion
In this work, we theoretically modified the SI-QRNG scheme by considering practical issues of measurement devices and experimentally demonstrated the applicability of the scheme in generating reliable and fast random numbers. Compared to the proof of principle demonstration in the theoretical work[15] whose randomness generation rate is about Mbps, our implementation improved the generation speed over 3 orders. Therefore, our SI-QRNG scheme can be applied in many scenarios where both the randomness generation speed and reliability are required. The randomness generation rate here is mainly limited by the detection rate of the single photon detector. Improving the detection rate of the single photon detector can thus further increase the randomness generation rate.
Our result highlighted the power of the state-of-the-art quantum technology. In previous works, it was shown that randomness can be obtained by measuring the intensity of an LED light with a mobile phone[32] or by measuring the arrival time of photons from cosmic sources[33, 34]. However, such QRNG schemes are based on physical models of the LED light or the cosmic source. In our work, we showed that such assumptions are not necessary. Even with a common light in the nature — sunlight, we can still generate randomness both reliably and fast. Since no assumption is made on the photon source, the coherence or photon number statistics of the photon source does not affect the randomness of the extracted bits. In future works, by exploiting the SI-QRNG scheme, it is also interesting to modify (in theory) and realize (in experiment) those QRNG schemes such that the assumption of the source is removed.
Methods
0.3 Optimizing the generation rate
To optimize the final quantum random number generation rate, some proper parameters should be chosen or measured in Eq. (5). The first term depends on the efficiencies of the two detectors, and has a maximal value of 1 when the two efficiencies are equal. Thus, and are configured to be approximatively uniform () in our experiment. The second term depends on the accuracy of controlling the PC and the PM. Due to the imperfection of the actual measurement basis, this term is calculated to be 0.952. is chosen as 100.[35] Other terms are related to the average photon number per pulse before detection. A low average photon number lowers , while a high average photon number brings higher and higher double click probability in the Z basis. We can rewrite the final random number generation rate as following
(7) |
Here, G stands for the repetition rate of squash speed and equal to 4 MHz in our experiment. is the probability that one and only one detector clicks for a pulse. As Poisson distribution for laser and multi-mode sunlight,
(8) |
where . For large , and can be regarded as the same. The relationship between and the final raw rate is shown int Fig. 3. The optimal is about 14.4. For sunlight, the actual of 11.6 is slightly deviated from the optimal value, due to the intensity fluctuate of sunlight. However, for a wide range of the random number generation rate is not obviously dropped.

Data available on request from authors.
Y.-H.L., X.H., Y.C. and J.Y. designed the experiment; Y.-H.L., X.H., Z.-P.L. and J.-Y.G. performed research; Y.-H.L., X.H., and X.Y. analyzed data; X.Y. and X.M. provided the theoretical support; Q.Z., C.-Z.P. and J.-W.P. supervised the project. All authors contributed to the research and the preparation of the manuscript.
This work was supported by the National Natural Science Foundation of China (under Grant No. 11654005, U1738201, U1738142), the National Key Research and Development Program of China (under Grant No. 2017YFA0303901), the Shanghai Sailing Program, and the Chinese Academy of Sciences (CAS). Yuan Cao was supported by the Youth Innovation Promotion Association of CAS (under Grant No. 2018492). This is a post-peer-review, pre-copyedit version of an article published in npj Quantum Information. The final authenticated version is available online at: http://dx.doi.org/10.1038/s41534-019-0208-1.
The authors declare that there are no competing interests.
Correspondence and requests for materials should be addressed to Cao Yuan ([email protected]), Xiongfeng Ma ([email protected]) or Cheng-Zhi Peng ([email protected]).
References
- [1] Shannon, C. E. Communication theory of secrecy systems. The Bell System Technical Journal 28, 656 (1949).
- [2] Metropolis, N. & Ulam, S. The monte carlo method. Journal of the American Statistical Association 44, 335 (1949).
- [3] Bennett, C. H. & Brassard, G. Quantum cryptography: Public key distribution and coin tossing. In Proceedings of the IEEE International Conference on Computers, Systems and Signal Processing, 175 (IEEE Press, New York, 1984).
- [4] Yuan, X., Zhou, H., Cao, Z. & Ma, X. Intrinsic randomness as a measure of quantum coherence. Phys. Rev. A 92, 022124 (2015).
- [5] Yuan, X., Zhao, Q., Girolami, D. & Ma, X. Interplay between local quantum randomness and non-local information access. arXiv preprint arXiv:1605.07818 (2016).
- [6] Yuan, Z. L. et al. Robust random number generation using steady-state emission of gain-switched laser diodes. Appl. Phys. Lett. 104, 261112 (2014).
- [7] Abellán, C. et al. Ultra-fast quantum randomness generation by accelerated phase diffusion in a pulsed laser diode. Opt. Express 22, 1645 (2014).
- [8] Nie, Y.-Q. et al. The generation of 68 Gbps quantum random number by measuring laser phase fluctuations. Rev. Sci. Instrum. 86, 063105 (2015).
- [9] Pironio, S. et al. Random numbers certified by Bell’s theorem. Nature 464, 1021 (2010).
- [10] Giustina, M. et al. Bell violation using entangled photons without the fair-sampling assumption. Nature 497, 227 (2013).
- [11] Liu, Y. et al. Device-independent quantum random-number generation. Nature 562, 548 (2018).
- [12] Bierhorst, P. et al. Experimentally generated randomness certified by the impossibility of superluminal signals. Nature 556, 223 (2018).
- [13] Liu, Y. et al. High-speed device-independent quantum random number generation without a detection loophole. Phys. Rev. Lett. 120, 010503 (2018).
- [14] Lunghi, T. et al. Self-testing quantum random number generator. Phys. Rev. Lett. 114, 150501 (2015).
- [15] Cao, Z., Zhou, H., Yuan, X. & Ma, X. Source-independent quantum random number generation. Phys. Rev. X 6, 011020 (2016).
- [16] Marangon, D. G., Vallone, G. & Villoresi, P. Source-device-independent ultrafast quantum random number generation. Phys. Rev. Lett. 118, 060503.
- [17] Avesani, M., Marangon, D. G., Vallone, G. & Villoresi, P. Source-device-independent heterodyne-based quantum random number generator at 17 Gbps. Nature Communications 9, 5365 (2018).
- [18] Brask, J. B. et al. Megahertz-rate semi-device-independent quantum random number generators based on unambiguous state discrimination. Phys. Rev. Applied 7, 054018 (2017).
- [19] Rusca, D. et al. Practical self-testing quantum random number generator based on an energy bound. arXiv preprint arXiv:1904.04819 (2019).
- [20] Xu, B. et al. High speed continuous variable source-independent quantum random number generation. Quantum Science and Technology 4, 025013 (2019).
- [21] Gehring, T. et al. 8 GBit/s real-time quantum random number generator with non-iid samples. arXiv preprint arXiv:1812.05377 (2018).
- [22] Ma, X., Yuan, X., Cao, Z., Qi, B. & Zhang, Z. Quantum random number generation. npj Quantum Inf. 2, 16021 (2016).
- [23] Fung, C.-H. F., Ma, X. & Chau, H. F. Practical issues in quantum-key-distribution postprocessing. Phys. Rev. A 81, 012318 (2010).
- [24] Mansour, Y., Nisan, N. & Tiwari, P. The computational complexity of universal hashing. Theoretical Computer Science 107, 121 (1993).
- [25] Ma, X., Fung, C.-H. F., Boileau, J.-C. & Chau, H. F. Universally composable and customizable post-processing for practical quantum key distribution. Computers & Security 30, 172 (2011).
- [26] Coles, P. J., Berta, M., Tomamichel, M. & Wehner, S. Entropic uncertainty relations and their applications. Rev. Mod. Phys. 89, 015002 (2017).
- [27] Winter, A. & Yang, D. Operational resource theory of coherence. Phys. Rev. Lett. 116, 120404 (2016).
- [28] Fung, C.-H. F., Tamaki, K., Qi, B., Lo, H.-K. & Ma, X. Security proof of quantum key distribution with detection efficiency mismatch. Quantum Inf. Comput. 9, 0131 (2009).
- [29] Qi, B., Fung, C.-H. F., Lo, H.-K. & Ma, X. Time-shift attack in practical quantum cryptosystems. Quantum Inf. Comput. 7, 073 (2007).
- [30] Shentu, G.-L. et al. Ultralow noise up-conversion detector and spectrometer for the telecom band. Opt. Express 21, 13986 (2013).
- [31] Fontani, D. et al. Solar divergence collimators for optical characterisation of solar components. International Journal of Photoenergy 2013, 610173 (2013).
- [32] Sanguinetti, B., Martin, A., Zbinden, H. & Gisin, N. Quantum random number generation on a mobile phone. Phys. Rev. X 4, 031056.
- [33] Handsteiner, J. et al. Cosmic bell test: Measurement settings from milky way stars. Phys. Rev. Lett. 118, 060401 (2017).
- [34] Wu, C. et al. Random number generation with cosmic photons. Phys. Rev. Lett. 118, 140402 (2017).
- [35] Ma, X. et al. Postprocessing for quantum random-number generators: Entropy evaluation and randomness extraction. Phys. Rev. A 87, 062327 (2013).