Quantum random number generation based on a perovskite light emitting diode

The recent development of perovskite light emitting diodes (PeLEDs) has the potential to revolutionize the ﬁ elds of optical communication and lighting devices, due to their simplicity of fabrication and outstanding optical properties. Here we demonstrate that PeLEDs can also be used in the ﬁ eld of quantum technologies by implementing a highly-secure quantum random number generator (QRNG). Modern QRNGs that certify their privacy are posed to replace classical random number generators in applications such as encryption and gambling, and therefore need to be cheap, fast and with integration capabilities. Using a compact metal-halide PeLED source, we generate random numbers, which are certi ﬁ ed to be secure against an eavesdropper, following the quantum measurement-device-independent scenario. The obtained generation rate of more than 10 Mbit s − 1 , which is already comparable to commercial devices, shows that PeLEDs can work as high-quality light sources for quantum information tasks, thus opening up future applications in quantum technologies.


I. INTRODUCTION
The recent development of perovskite photonic devices has had significant impacts in many fields due to their optical properties and low-cost fabrication [1,2].Perovskites kick-started a revolution as the building material for efficient solar cells [3], while more recently they are also showing great promise for the fabrication of efficient light-emitting diodes (LEDs) [4].Perovskite LEDs (PeLEDs) that operate at room temperature have already been developed [5], opening up the path for practical perovskite-based light sources.These devices have the potential to be a game changer in fields such as next-generation displays [6], general-purpose lighting [7] and optical communications [8], because PeLEDs possess narrow emission width and widely tunable bandgap, further motivating their use as practical devices [2,6].Another key advantage is that the fabrication process of perovskite devices can be solution-processed under ambient conditions, for example through spin-coating or inkjet printing.This allows the: (i) integration of perovskite photonics with complementary metal-oxide semiconductors without relying on epitaxial growth and opens up for emerging technologies in wearable, implantable and portable electronics; and (ii) a simpler manufacturing process, which is highly attractive due to a lower associated cost [9,10].Finally, recent results show advantages in the life cycle assessment (LCA) of perovskite photovoltaic cells compared with a silicon benchmark in terms of reduced energy payback time and reduced greenhouse gas emission factor [11,12], thus pointing out that PeLEDs might also have similar advantages in their LCA when compared with standard semiconductor solid-state devices, already pointing towards a more sustainable photonics industry.
The field of quantum information is largely dependent on technological advances provided by other areas in engineering and natural sciences.We have known for decades that the use of quantum systems for information processing opens up previously unreachable results such as carrying out some computation tasks under practical time [13] and the demonstration of the nonlocal behaviour of nature [14].However it was not until very recently that experimental demonstrations of a quantum advantage in computing [15,16] and conclusive non-locality tests [17] could be demonstrated.Major advances pushing forward many new applications in photonic quantum technologies include highly efficient single-photon detectors [18], integrated photonic circuits [19] and novel optical fibre designs [20].Some preliminary efforts have been made in order to use perovskite devices for quantum optics [21,22].However, perovskitebased devices are yet to be demonstrated in a complete quantum information processing task.
In our work we employ a metal-halide PeLED as the light source for a quantum random number generator (QRNG), providing a radical departure from the usual approach where solid-state light sources are usually employed (semiconductor LEDs or lasers) in quantum tech-nology applications.The generation of random numbers based on the outputs from measurements of quantum systems is highly attractive for practical applications, due to the unavoidably random nature of quantum processes [23].These numbers are used for a wide variety of applications, from encryption, on-line gaming and gambling, to computer simulations.Here we are able to produce a high-quality stream of random numbers from projective measurements on weak coherent polarisation states produced from the PeLED.The random bits are certified by the widely adopted National Institute of Standards and Technology (NIST) randomness test suite [24].Simultaneously, we resort to the measurement deviceindependent (MDI) [25] approach to certify the amount of private randomness that our system can produce in the hypothetical case that our detectors could be compromised by an eavesdropper.The MDI approach is of high relevance for QRNGs as the detectors are the devices that are most prone to being hacked by side-channel attacks [26].Our demonstration on the use of PeLEDs for the first time in a complete quantum information task paves the way for perovskite-based quantum technologies, opening up new possibilities towards the widespread deployment of quantum applications.Furthermore, the marriage of perovskite-based photonic devices with quantum information systems sets a path forward towards a more sustainable quantum technology industry, which will arguably become an issue as all areas of society must continuously lower their carbon footprint.

II. QUANTUM RANDOM NUMBER GENERATION
Intuitively, randomness is associated with the difficulty of characterising the evolution of all the parameters leading to a given complex process.This is the basic concept behind many commercial random number generators.Nonetheless, from a more stringent perspective of cryptography, it is desired that the privacy of the generated randomness can be certified even against an eavesdropper that has some extra knowledge of the device inner-workings and infinite computational power to analyse the data generated [27].This is only possible within the framework of quantum mechanics while exploiting the intrinsic randomness of the results of a quantum measurement [28].QRNGs are usually classified in terms of the amount of assumptions needed by the user to guarantee the privacy of the generated random bits against a malicious eavesdropper.QRNGs based on the modern device-independent (DI) approach provide the ultimate level of security, guaranteeing private randomness even against an eavesdropper that has fabricated the device itself [29][30][31][32][33][34].However, the requirements are quite demanding and they can only achieve modest random number generation rates.On the other end of the security spectrum lie standard device-dependent (DD) QRNGs that are capable of producing high random bit genera-tion rates, but where full characterisation of the entire system is needed [35][36][37][38][39]. Solutions based on reasonable assumptions about partial knowledge of the device, the so-called semi-device-independent (SDI) approaches [40], are the new trend for randomness generation as a high output throughput can be achieved with a higher level of security compared to traditional QRNGs [41? -51].These quantum random number generators represent an important breakthrough in physics and are strong contenders to replace the ones being used today in industry and academia.Nonetheless, this will only be possible if they are made compact, have low manufacturing cost, and can be integrated with other systems.If they are to be mass-produced, then the environmental footprint also becomes relevant.The use of PeLEDs for building modern QRNGs are therefore of ultimate importance since they can satisfy all these requirements simultaneously.We gather the generated raw bitrate of the previously mentioned QRNGs in Fig. 5, separated by security class, showing clearly that our result is already highly competitive.Bitrate [bps] [35] [36] [38] [39] [41] [42] [43] [44] [31] [46] [34] [32] [45] PeLED [37] [47] [33] [50] [49] The highly secure measurement-device independent (MDI) QRNG protocol, which belongs to the SDI class, can remarkably certify private randomness even in the case that the detectors are under the control of an eavesdropper [25,40].In the MDI scenario, a user in need of random numbers possesses a characterised state preparation device (P) but has to use an untrusted measurement device (M).This scenario has become of upmost practical relevance nowadays, as a side-channel attack to the detectors is the most common strategy for hacking quantum technologies [26].

III. MEASUREMENT-DEVICE-INDEPENDENT QUANTUM RANDOM NUMBER GENERATION USING PEROVSKITE LIGHT EMITTING DIODES A. Measurement-device-independent protocol
The basic idea is that P now works actively, by randomly preparing different states.One of the states is conventionally used for randomness generation, while the others will be used to check the measurement device.The randomness generation rate is only slightly affected because the testing states can be chosen seldom, and most of the experimental run will still be used for randomness generation.For instance, in our case the state 1/ √ 2(|H + i|V ) is used for randomness generation and the states |H and |V will be the testing ones.Whenever the state |H (|V ) is sent, only detector D 1 (D 2 ) should fire.Remarkably, from the success probabilities of recording the test states one can put an upper bound on the knowledge an eavesdropper can have about the generated random bit sequence.Formally speaking, and assuming the notation of [47], the preparation device is used to randomly prepare a state of a set, {ω x }, with x = {0, 1, 2}, which are measured by M, resulting in an outcome a.After several iterations, one estimates the probabilities p(a|ω x ).The maximal probability P g (x * ) of the eavesdropper guessing the outcome a for a given input x * , compatible with p(a|ω x ), is given by the solution to a simple numerical optimisation program defined in [25,47].Note that the eavesdropper aside of having control of the detectors, is allowed to even resort to quantum entanglement for guessing the outcomes a [47].Finally, the amount of private randomness that is certified per experimental round in the MDI scenario is given by the min-entropy: H min (x * ) = − log 2 P g (x * ).

B. Experimental setup and results
Our MDI-QRNG is schematically depicted in Fig. 6a.For each measurement round, the user chooses whether to prepare and send the test states, represented by horizontal or vertical polarisation states (ω 0 = |H and as the random number generation state.The states are produced from weak coherent states of light generated by the PeLED, which is housed in the preparation stage.A linear polariser is employed to filter out the unpolarised light produced by the PeLED before passing through a liquid crystal waveplate (LCWP) with a switching time of less than 50 ms, which is the element employed by the user to implement the choice of ω x .A ball lens with 50 mm focal length is used to collimate the light emitted from the PeLED, and a calibrated optical attenuator is needed to adjust the mean photon number per detection window, such that the probability to have multi-photon events at the single-photon detectors is negligible (< 0.28%).Both components are omitted for the sake of simplicity.In the MDI framework, the measurement stage is considered as a black box, which is able to output a signal "0" or "1" depending on the measurement result.Nothing else needs to be assumed about the measurement procedure to certify the privacy of the generated random numbers.In our implementation, the projection of the prepared states is done with an uncharacterised polarising beam splitter (PBS), which in principle should have the horizontal (|H ) and vertical (|V ) polarisation states associated to the output signals "0" and "1", respectively (see Fig. 6a).The measurement procedure is concluded with silicon single-photon avalanche detectors D 1 and D 2 (Perkin Elmer), with 25% overall detection efficiency at 800 nm.The output "0" or "1" of the measurement stage is registered by field programmable gate array (FPGA) electronics, whose output is then continuously streamed to a personal computer for storage and randomness extraction (see the Appendix).In the event that neither detector records the presence of a photon (for example due to absorption), that detection event is discarded and not stored.Similarly, if both detectors record the presence of a photon (either from noise in the detectors, from photons from the environment that couple to the fibers, or from multiphoton events) that detection event is also discarded.
In our experiment, before each measurement data block, a decision is randomly taken on whether that block will be used for randomness generation or to test the measurement device, as required in the MDI QRNG protocol [47].In our experiment, the user choice is provided by an external software-based random number generator, with a bias of 99% towards randomness generation mode.Please note that any source of randomness may be used, even the partial output of a previous run or another source the user trusts.In Fig. 3 we display the raw bit generation rate as a function of elapsed time of the experiment, where one can see that it attains a remarkably high maximal value of 10.35 Mbit s −1 between days 2 and 8 approximately, and an average of 9.01±1.30Mbit s −1 over the entire run.We observe stable performance approximately in the first 8 days, and then a slow decay due to degradation of the PeLED, with a constant current density applied of 0.24 mA cm −2 .Nevertheless after 22 days, the PeLED still has more than half of its original brightness.We also display the success probabilities recorded for either the |H or |V test states, when activated by the user, during the whole measurement run.Please note that the user switches seamlessly between the transmitted states with the liquid crystal waveplate.The overall random number generation rate does not suffer a penalty, since the test states are only used 1% of the time.In spite of the fact the emission rate from the PeLED deteriorates, there is no change in the success probability for the test states, showing there is no change in the certification of the privacy of the random numbers generated.The difference for the FIG. 2. Experimental setup and PeLED structure.a) Scheme of our measurement-device-independent quantum random number generator.On the left the preparation stage (P) creates the quantum states to be prepared depending on the user's choice of test or randomness generation states, while a measurement stage (M) produces the outputs "0" or "1" for each measurement round.The PeLED is housed inside the preparation stage, where it is used to produce weak coherent states.When the user decides to generate a random number, the superposition state |R = 1/ √ 2(|H + i|V ) is prepared with a fixed linear polariser followed by a liquid crystal waveplate.In order to verify the functioning of the measurement device, the user randomly chooses to prepare one of the test states |H or |V by electrically controlling the retardance of the waveplate.In our implementation the measurement device consists of an uncharacterised polarising beam splitter (PBS), which in principle should project the incoming states onto the orthogonal states |H and |V .The outputs of the PBS are connected to single-photon detectors D1 and D2.The outcomes "0" or "1" of (M) are read by field programmable gate array (FPGA) electronics.b) The structure of the employed perovskite diodes, with the biasing circuit indicated.c) Close-up photo of one of the PeLED samples mounted on an opto-mechanical mount.A coin worth one Swedish Crown (SEK) placed as a size reference.measured probabilities between both states, is from the different transmission/reflection coefficients of the polarising beam splitter in the M stage.The average success probability for the entire generated random bit sequence is P suc = 0.97 ± 0.01.This places an upper bound on the randomness generated per experimental round that is certified to be private against detector side-channel attacks.In our particular implementation it corresponds to H min = 0.71 ± 0.01 random bits, which is quite high considering the innovative aspects of our QRNG.

C. PeLED Material Structure
The structure of our PeLED is based on an indium tin oxide (ITO)-coated glass substrate (Fig. 6b).The active layer consists of formamidinium lead iodide perovskite, with approximately 50 nm thickness.This layer is sandwiched between the electron and hole transport layers which consist of polyethylenimine ethoxylated (PEIE)modified zinc oxide (ZnO) and poly(9,9-dioctylfluoreneco-N-(4-butylphenyl)diphenylamine) (TFB) (∼ 40 nm).They are followed by layers of molybdenum oxide (MoOx) (∼ 7 nm) and gold (∼ 80 nm) as the contact layer.In order to obtain highly stable PeLEDs, we used an additive of pimelic acid (PAC) [52].Under forward bias, electrons and holes injected into the perovskite layer recombine, efficiently generating photons with a central wavelength of 804 nm, with a spectral width of 41.6 nm full-width at half-maximum (Supplemental material).

D. Postprocessing and randomness tests
Following the Toeplitz randomness extraction procedure we test the randomness of the final random bit key.Initially, we plot the first 0.5 Mbit of the generated sequence as an image where every 8-bit gray-level pixel is encoded directly from the random sequence (Fig. 4a).We choose only a small subset in this example due to limitations in displaying the entire data as a single image with reasonable size.Nevertheless, one can clearly observe the randomness of the data as the figure is indistinguishable from noise.Then a randomly selected 5 Gbits of the entire generated random bit sequence is fed to the NIST randomness statistical test suite, a well-known benchmark for statistically certifying the randomness of a sequence [24].The test suite consists of 16 tests (listed in Fig. 4b and Fig. 4c), and for each test the original sequence is divided into b blocks of equal size.A typical block size is 1 million bits, which we have employed.The test result is a numerical value between 0 and 1 called a p-value, and a test is considered a pass if the corresponding result is above the confidence value of α = 0.01.Fig. 4b shows the average of the p-values for all data blocks in each test with the corresponding standard deviation, clearly showing the generated sequence passes all tests.Furthermore in Fig 4c we plot the proportion of blocks in each test that passes with a p-value greater than 0.01.Also shown is the confidence level for the minimum proportion of tests that must pass in order ensure randomness certification for the bit sequence (Appendix).

IV. CONCLUSION AND DISCUSSION
Perovskites have played a major role in the development of highly-efficient solar cells, thus greatly pushing solar power plants into becoming a major player in the production of electricity worldwide.The recent development of optoelectronic devices from perovskites is opening up the field of photonics for this revolutionary material.PeLEDs are poised to have significant impacts in the areas of solid-state lighting and optical communications, with its lower carbon footprint during its entire life cycle as well as optical and mechanical properties being major motivators for their use.These properties are extremely attractive to the blooming field of quantum technologies, specifically aiming towards the widespread deployment of applications, even down to the consumer level.Following this direction, we have showed for the first time that PeLEDs can be successfully employed to implement modern and highly secure quantum random number generation protocols.Our results (Fig. 5) place our QRNG among the best reported, including commercial devices [53], and thus allow the kick-start of a new multi-disciplinary field concerning quantum technology systems with perovskite light sources, while also pointing towards initiatives to make the quantum technology industry more sustainable.We successfully demonstrated that the generated sequence passes the stringent NIST randomness test suite, a widely recognized benchmark employed for the certification of randomness in a sequence of numbers.At the same time, we have also guaranteed the privacy of at least 71% of the generated random numbers by implementing our QRNG with the MDI approach.These results cement the start of a new line of research into perovskite quantum light sources aimed at producing more compact, robust andsustainable quantum technology devices that can eventually make its way onto consumer products, thus helping the democratisa- The generated raw bit sequence is buffered in the FPGA in blocks of 2 16 bits before they are streamed over a UDP protocol to a host computer acting as server for final storage.The server then stores the acquired data for each of the different states separately to facilitate i) security analysis, and ii) randomness extraction.We then generate close to perfectly uniform sequences of numbers by applying a Toeplitz hashing extractor to the generated raw bits recorded for the experiment rounds where the prepared state was |R .We first split the raw binary sequence into N sequences of length n which we then multiply with an n × m Toeplitz matrix to generate an output of m hashed bits, following the procedure in [55].Therefore we employ n = 400, and m is given by m = H − 2 log 2 ε where H = − log 2 max x∈{0,1} 8 Pr {X = x} is the minimum entropy when considering binary strings of length 8, and ε = 2 −100 is a security parameter derived from the leftover hash lemma [54].
The Toeplitz matrix T is defined at the beginning of the extraction procedure using a seed of n + m − 1 bits taken from the beginning of the raw sequence.These bits specify the elements of the first row and column of the matrix.As T can be reused for each of the subsequences, we obtain the final extracted sequence by concatenation of the results of the matrix multiplications T n 1 , T n 2 , ..., T n N , where the subscript indicates the sequence number [54,55].

B. Statistical testing
For each of the tests in the NIST 800-22 suite we compute the proportion r of sequences that yielded a p-value greater than the significance level α = 0.01 [24].We employ a confidence interval for the proportion of passed , as defined in [24], where b = 5000 is the number of sequences fed to the test.This results in a confidence interval of 0.9858 ≤ r ≤ 0.9942, where we consider a test passed if the proportions of sequences with p-values p i ≥ α fall within the interval.

SUPPLEMENTAL MATERIAL Fabrication and characterisation of the PeLEDs
The detailed procedure of PeLEDs fabrication can be found in our previous study [52].Briefly the cleaned ITO glass was spin coated with the ZnO layer under ambient conditions and then transferred to a nitrogenfilled glovebox where the PEIE, formamidinium lead iodide perovskite (formamidinium iodide (FAI):PbI 2 :PAC with molar ratios of 3:1:0.5 in dimethylformamide as the precursor solution) and TFB layers were spin coated and annealed (if necessary) in sequence.The MoOx and Au layers were evaporated and deposited at a base chamber pressure of ∼ 2×10 −6 mbar with a shadow mask to define the device area as 0.0725 cm 2 .
Electroluminescence performance was measured in the nitrogen filled glovebox.The optical spectrum was measured by a fibre integration sphere (FOIS-1) coupled with a QE Pro spectrometer (Ocean Optics), and is plotted in Fig. 5.The centre wavelength is at 804 nm, with a spectral width of 41.6 nm (full-width at half-maximum).
A Keithley 2400 sourcemeter was then used to apply a voltage bias to the device and simultaneously record the current flowing through it.During the test, only light emitting from the glass side of the device was collected.A home-made Labview program was used to control the test, collect data, and calculate the performance met-rics (EQE, Radiance, etc...) based on the collected data.EQE is a parameter that describes the efficiency of an LED which is defined by the ratio of the number of emitting photons to the number of injected carriers.The EQE can be obtained from the collected spectrum and current density described by the following equation: where φ(λ) is the spectral intensity (with units of W• nm −1 ), with wavelength λ, h is Planck's constant, c the speed of light, J is the measured current density, S the device area of the LED and q is the elementary charge.Radiance (with units of W•m 2 •Sr −1 ) is a metric to the emitted light power at a given solid angle of an LED, which is obtained by integrating the collected spectrum: The current density and the radiance for a given applied voltage is given in Fig. 6a, while the external quantum efficiency (EQE) is plotted in Fig. 6b as a function of the current density.More details of the fabrication and characterisation of the PeLEDs can be found in [52,56].

Measured photon number distribution
In order to characterise the photon statistics of our device combined with the detection system, we record the photon count number n during a time window τ of 250 µs emitted directly from the device, for three different values of the mean photon number N , adjusted with the electric current directly biasing the PeLED.The experiment is run several times for each τ interval, and the histogram of obtained n counts is plotted in Fig 7 .We fit in each case the poissonian probability distribution P n = ( N n e − N )/n!.As can be seen the recorded photon number distribution follows very closely the expected prediction.

FIG. 1 .
FIG. 1. Raw random bit generation rate of several quantum random number generators as a function of published year.The results are limited to those that employed single-photon detectors and are based on discrete variable quantum systems for direct comparison purposes.Our maximum sustained raw bit rate is 10.35 Mbit s −1 .

FIG. 3 .
FIG. 3. Performance of the quantum random number generator with a PeLED.Random number generation rate as a function of elapsed experiment time.Each blue dot corresponds to the average rate over 6 hours, and we obtain an overall average of 9.01 ± 1.30 Mbit s −1 , with a maximum sustained rate of 10.35 Mbit s −1 .Also shown are the probabilities to measure either the |H or |V test states, as required to test of the measurement device in the MDI protocol.Each test state is randomly chosen by the user with a 0.5% chance at the beginning of every measurement block.The insets show a higher time resolution sample of each test state data.Error bars come from assuming Poissonian statistics of the PeLED photon number distribution combined with the detection process.

FIG. 4 .
FIG.4.Quantum random number generation with PeLEDs.a) Sequence of generated random bits (0.5 Mbit in length) plotted as an image, where each pixel has an 8-bit gray-scale colour depth.b) Results of the NIST statistical test suite on 5 Gbits of the generated random sequence.Each of the sixteen tests of the suite is labeled on the x-axis, and on the y-axis is the numerical result for each test from 0 to 1, called the p-value.We employ a standard confidence value of 0.01, meaning a test is considered successful if its p-value above this number.Displayed are the average results of each test, with the standard deviation of the test results.c) Here we plot the proportion r of passed runs within each test.The significance level for a test to be considered passed is shown in the graph as the dashed red line (Appendix).

FIG. 6 . 15 FIG. 7 .
FIG. 6. Electro-optical characteristics of the employed PeLEDs.a) Current density and the radiance emitted by the PeLED as a function of the applied voltage.b) External quantum efficiency as a function of the current density.