Quantum random number generation with uncharacterized laser and sunlight

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.


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 ording to the generation speed and the randomness reliability, quantum random number generators (QRNGs) can be categorized into the following three types.5][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.
5][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 ater, 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
Scheme As shown in Fig. 1, a conventional QRNG is composed of the randomness source and the detection device. 22In the source part, it consists of a light source and a state preparation device.
Generally, practical QRNGs 6-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 |+ = (|H +|V )/ √ 2, where Z = {|H , |V } 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 X = {|± = (|H ± |V )/ √ 2} and Z basis to measure according to a random seed.The random seed needed is exponentially smaller than the number of extracted random bits. 15ppose that the number of runs in total is N , including N X in the X basis and N Z in the Z basis.Due to the loss, the output of detection could be null.In this case, the number of qubits measured in total is n, including n X in the X basis and n Z in the Z 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 n X and n Z , but the positions of the effective X and Z measurements are still uniformly random.
• When measuring in the X 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 e pZ in the Z basis according to the bit error rate e bX in the X basis and its statistical deviation θ 23 according to where 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 e bX and decrease the number of extracted random bits.
• By utilizing the Toeplitz-matrix hashing method, 24 the phase error can be corrected by consuming n Z H(e bX + θ) number of bits with a failing probability of 2 −te . 25Thus, we can number of random bits and the final failure probability (in trace-distance measure) is given by ε Here, R 0 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 R f inal 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 X and Z 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 X and Z are not complementary to each other.In this case, we can make use of the general uncertainty relation for two general bases, 26 where {|x } and {|z } are respectively the eigenstates of X and Z , and H(Z ) and H(X ) are respectively the entropy of the measurement outcome of X and Z .In quantum random number generation, we can regard − log 2 max x ,z | x |z | 2 as the randomness that we can obtained by measuring an eigenstate of the X basis, and regard H(X ) as the amount of states that are required to distill the eigenstate 5,27 .That is, given N copies of the quantum state ρ, one can effectively first perform a dephasing operation in the X basis to collapse them into one of its eigenstates.Then we aim to distill the dephased state into a specific eigenstate, which costs N H(X ) 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 Note that the randomness output only depends on the term max x ,z | x |z | instead of a full description of the X and Z bases.
In addition, we also consider the case that the measurement efficiencies in the two eigenstates are different.Suppose the efficiencies of projecting onto |0 and |1 are given by η 0 and η 1 , respectively.Then according to the standard analysis in QKD 28 , the randomness output will be further modified to That is, the total randomness is rescaled with a factor 2 min(η 0 ,η 1 ) The maximum value of 1 can be achieved when η 0 = η 1 .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 max x,z | x |z | and the efficiency η 0 , η 1 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).
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 Finally, after appropriate attenuation, the pulse is separated by FPBS3 and detected by two upconversion single photon detectors with efficiency of 10%, dark count of 200 cps and dead time of 50 ns. 30In this way, we can choose to perform Z (X) basis measurement by setting ϕ c to be 0 (−π/4) and ϕ a to be 0 (π/4).The probability of measuring in the Z (X) basis is selected as 99.6% (0.4%) in our experiment and the average photon number per pulse is selected around 13.9 before detection to maximize the generation rate of random number.Generally, higher photon number per pulse brings higher error rate in the X basis and higher double clicks probability in the Z basis that need to be discarded, while lower photon number per pulse leads to lower n z .Thus, there is a tradeoff for choosing a proper average photon number.The details of optimizing the probability of measuring in the Z (X) 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 X and Z , an additional process is performed to estimate (5).Firstly, the input state is prepared as the eigenstate of Z basis, that is, the ratio of photon counting between detector 1 and detector 2 is above 30 dB under Z basis measurement.Then, in the X basis measurement, the ratio of photon counting between detector 1 and detector 2 is measured and the bound of −2 log max x ,z | x |z | 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 • . 31Thus, 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 1550±1.5 nm bandpass filter.
The optimal input state for the detection part is the eigenstate of X basis.However, input state with other polarization state does not affect the reliability of randomness.Although the error rate in the X 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 X 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 X basis measurement is 0.33% for laser and 0.21% 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.

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 10 −3 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 ran-domness 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
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 2 min(η 0 ,η 1 ) η 0 +η 1 depends on the efficiencies of the two detectors, and has a maximal value of 1 when the two efficiencies are equal.Thus, η 0 and η 1 are configured to be approximatively uniform (η = 10%) in our experiment.
The second term −2 log 2 max x ,z | x |z | 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.
t e is chosen as 100. 35Other terms are related to the average photon number λ per pulse before detection.A low average photon number lowers n z , while a high average photon number brings higher e pz and higher double click probability in the Z basis.We can rewrite the final random number generation rate as following Here, G stands for the repetition rate of squash speed and equal to 4 MHz in our experiment.
p z(single−click) is the probability that one and only one detector clicks for a pulse.As Poisson distribution for laser and multi-mode sunlight, where λ = λ • η.For large n X , e pZ and e bX 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.Figure 5: Relationship between the average photon number λ per pulse and final random number generation rate.r have the maximal value for λ = 13.9.In this experiment, λ is 14.4 for laser and is 11.6 for sunlight.The circle and the triangle denote the actual key generation rate for the two photon sources, respectively.These two values are slightly deviated from the theoretical curve owing to the imperfections.

(
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 α |H + β |V , where α 2 + β 2 = 1, 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 (|H ) and anti-clockwise (|V ) 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 ϕ c and ϕ a .After combined again in FPBS2, the state of output pulse is αe iϕc |H + βe iϕa |V , correspond to a unitary operation of U F .A fibre polarization controller is employed to perform an additional unitary operation of U C .Here,

Figure 1 :
Figure 1: Source independent randomness generation with uncharacterized light source and state preparation.

Figure 2 :
Figure 2: The setup of the experiment can be divided into the photon source and detection parts.In the detection part, a Sagnac type interferometer with a phase modulator (PM) is used to select the measurement basis by applying a controllable unitary operator.After proper attenuation, the photons are detected by two up-conversion single photon detectors.In the randomness source part, a photon source is modulated by an amplitude modulator (AM) and transmit through a polarized beam splitter (PBS), a half-wave plate (HWP) and a quarter-wave plate (QWP) to prepare the desired state.The photon source used here is a cw laser and the sunlight, and can be replaced by any other light if necessary.ISO: optical isolator; CIR: optical circulator; FPBS: fibre polarized beam splitter; ATT: attenuator; PC: polarization controller.

Figure 3 :
Figure 3: For our experiment, when the input state is |+ , the bit error rate close to zero.Rotating the HWP change the input state while the bit error rate.This Figure shows the relationship between the angle of HWP and the error rate.

Figure 4 :
Figure 4: The P value of NIST tests.Blue represents laser and red represents sunlight.
Data Availability Data available on request from authors.Acknowledgements 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 Competing Interests The authors declare that there are no competing interests.Correspondence Correspondence and requests for materials should be addressed to Cao Yuan (yuancao@ustc.edu.cn),Xiongfeng Ma (xma@tsinghua.edu.cn) or Cheng-Zhi Peng (pcz@ustc.edu.cn).