Quantum random number generation (QRNG) leveraging intrinsic quantum uncertainty has attracted significant interest in the field of integrated photonic architecture, with applications in quantum cryptography, tests of quantum nonlocality, and beyond. The demand for compact, low-energy consumption, robust, fast, and cost-effective QRNGs integrated into photonic chips is highlighted, whereas most previous works focused on bulk optics. Here, based on the metalens array entangled source, we experimentally realized a miniaturized, high-dimensional quantum random number generator via a meta-device without post-randomness extraction. Specifically, the device has a high-density output with 100 channels per square millimeter. This chip-scale quantum randomness source can obtain random number arrays without post-randomness extraction and enable compact integration for quantum applications needing secure keys or randomness. Our approach demonstrates potential in secure key generation and randomness for quantum applications.
INTRODUCTION
In the digital era, the safeguarding of sensitive information represents a critical challenge across industries and sectors, such as finance, healthcare, government, and technology, where the integrity and confidentiality of data are paramount. As traditional encryption methods increasingly succumb to advanced and artificial intelligence (AI)-driven hacking techniques,1 the urgency for implementing enhanced security measures has intensified. Quantum random numbers, derived from the principles of quantum mechanics, offer a robust solution to these vulnerabilities. These numbers, generated through quantum random number generators, are inherently unpredictable and truly random, making them ideal for fortifying encryption and authentication systems against cyberattacks.2,3 With the rise of big data, cloud computing, and advanced AI, the integration of quantum random numbers into data security protocols is not only advantageous but also essential. This quantum approach not only promises to revolutionize the landscape of information security but also aligns with the increasing complexity and demands of global data protection standards.
The development of quantum technologies drives the demand for quantum random numbers in applications such as quantum key distribution (QKD)4,5 and verification of Bell's inequality.6 Random numbers are sequences of numbers that are unpredictable and independent. They are uniformly distributed over a given range, meaning that each number has an equal probability of occurrence. To verify the basic physical principles of quantum mechanics, Ture random number generators (TRNGs) are developed such as cosmic photons' arrival times offer an avenue for generating random numbers, not only as a source of randomness but also for closing the freedom-of-choice loophole in quantum nonlocality tests.7 Quantum mechanical phenomena, like the uncertainty principle and entanglement, are a promising approach for generating truly random numbers. Device-independent Quantum random number generations (QRNGs) provide random numbers with the highest security among TRNGs. For example, source-device-independent quantum random number generation leverages the arrival time of photons from untrusted entangled sources and the nonlocal dispersion cancelation effect for heightened security and high-speed random number generation.8 Device-independent QRNGs provide high security in complex setups. QRNGs based on simpler trusted devices can be applied to more scenarios. Practical high-speed quantum random number generators have emerged, using the timing of single-photon detection as raw data and achieving impressive bit rates of 109 Mbps after bias reduction and randomness extraction.9 Another applicable way to generate QRNG from trusted device is photon number parity verification, using multiplexed transition-edge sensors to resolve up to 100 photons and generate unbiased random numbers based on coherent state parity.10 Random number generation is a core component of quantum technologies. In the past, most work was based on bulky optical elements and random number generators. Miniaturized high-dimensional QRNG devices have the potential to be used in personal communication terminals based on quantum technologies, such as communication protocols containing Bell's inequality verification through multiple channels in personal terminals. Quantum optical chips are indeed a crucial area with many uses,11 including continuous-variable QKD.12 The demand for compact, low-energy consumption, robust, fast, and cost-effective QRNGs integrated into photonic chips is highlighted.13,14
Metasurfaces enable flexible control over light wavefronts and have been integrated into compact quantum devices for applications such as quantum state preparation and modulation, placing demands for further miniaturized quantum components like sources of true randomness. Metasurfaces are a kind of high-performance platform composed of subwavelength antennas. They are compact and easy to integrate15–30 and are widely used in the context of quantum research.31–40 Very recently, the learned metasurfaces for 360° structured light,25 have achieved a remarkable technological breakthrough in 3D imaging and holographic projection and thus, opening new horizons for applications in photonics interaction and high-dimensional quantum technology. The realization of high-dimensional quantum light sources has achieved tremendous success. Standing on the shoulders of giants,31 we have developed a realization of a high-dimensional quantum random number generator in a miniaturized form factor. We experimentally realized a high-dimensional quantum random number generator based on our metalens array. We propose a high-dimensional random number generator leveraging a high-dimensional entangled photon source. We harnessed a quantum random number array by collecting photons emitted from a β barium borate (BBO) crystal pumped by a continuous-wave (CW) laser diode with arrival time differences following a Poisson distribution. Utilizing a metalens array combined with spontaneous parametric downconversion (SPDC) in the BBO crystal, we recorded the time differences of photon arrivals, obtaining a high-dimensional quantum random number array without post-randomness extraction. AI systems, while improving the efficiency of information processing, can also be exploited by malicious actors to pose threats to information security. Our generated sequence of random numbers can pass NIST randomness tests and resist attacks against a Generative Adversarial Network (GAN) model, as Fig. 1 shows. In this context, it is crucial to proactively address information security challenges by establishing a robust information security protection system. This involves not only advancing the adoption of quantum random numbers but also examining the potential security threats posed by AI in the information security domain. Only by taking a technology-driven approach can we build a trustworthy digital world that instills confidence in its users.
RESULTS
The working principle of high-dimensional quantum random number generator
The details of the numerical simulation and fabrication of the metalens array are shown in supplementary material Note 1. In our QRNG array scheme, the CW laser focuses through a metalens array into a BBO crystal to generate nonlinear effects and form an SPDC photon pair array. The experimental setup is shown in Fig. 2(a). See more details in the supplementary material Note 2. A CW laser passes through a metalens array to generate an SPDC photon pair array. The number of arrival photons is less than one in each reference period . The photon is detected by a Single photon counting module (SPCM, SPCM-800-14-FC). The SPCM has a dead time of 22 ns and a maximum count rate of 37 Mcps with continuous light illumination. To measure the timing of photon arrival, we use high-performance timing measurement electronics with a time-to-digital converter (TDC, SIMINICS FT1040) operating with a time resolution of 128 ps. The arrival time transfers the original random bits into the personal computer (PC) through USB3.0 and then uses the selected reference time as the “start” of TDC and the SPCM detection signal as “stop” to record which time bin the photon arrives at and to finally output a random number.
For an ideal uniform distribution, the probability of a photon detection falling into a certain bin is , each time bin has a time duration . The resulting arrival time is compared with the reference period where . When a single photon is detected in a certain time bin, the label of the time bin is recorded as a time tag, converted into binary, and finally output as the final random number. When selecting the length of the time bin, the coincidence count time width as shown in Fig. 2(b) is considered, and the standard deviation is around . We select a coincidence count period of four standard deviations as to ensure that 99.99% of coincidence events are recorded while avoiding recording noise signals.
In our experiment, the number of time bins is , the time bin duration is , and the time reference period is . In the test, we collected raw data at a rate of 200 kps. Within a reference period, the average number of photons that can be detected is about 0.005, which is far less than 1. It can be considered that the photon arrival time obeys the Poisson distribution. The details of generating quantum random numbers and evaluation of randomness are shown in the supplementary material Note 3.
QRNG from one metalens
QRNG from metalens array
Here, we present high-dimensional QRNG from a metalens array. Our metalens array is a 10 × 10 array, but, limited by the number of SPCMs. We only select four metalenses as an example to illustrate the feasibility of high dimensions. Two light spots from the same metalens separately produce a random number. The optical image of the metalens array and the associated light spots are displayed in Fig. 4(a). A quantum random number array is generated by counting the coincidences between each pair of light spots. The results of the NIST randomness test suite are displayed in Fig. 4(b). Every random number stream drawn from various sources passes the test. Figures 4(c) and 4(d) illustrate the random number's physical unclonability. The resemblance between random numbers produced by each metalens is demonstrated using the inter-correlation function and the inter-Hamming distance, which show peaks at 1024 and 0, respectively. This is precisely the optimal value and indicates no similarity between the random number streams obtained from each metalens source.
To obtain secure random numbers, we provide the calculation of the minimum entropy. The minimum entropy is defined as where is the detection event probability.9 All eight random sequences in our experiment are given in Table I. All results are close to 1, which is the minimum entropy of standard uniform distribution with 16 variations. Note that we do not use any randomness extractor here, which is one of the advantages of our approach.
Against GAN attack
Data-driven machine learning demonstrates impressive capabilities in modeling data using probability distributions. It can be utilized to learn the statistical patterns of certain pseudo-random numbers and analyze their vulnerabilities. The key idea behind machine learning is to learn statistical distribution in data to perform specific tasks. Real random numbers should have the characteristic of a uniform probability distribution within a given range. Machine learning models cannot learn from QRNG that does not follow any data distribution. A more detailed introduction of the attack of machine learning is shown in the supplementary material Note 4.
Generating a sequence of random numbers with a uniform probability distribution requires that every possible value has an equal probability of being generated. However, neural networks are models based on deterministic algorithms whose outputs are determined by inputs and learned parameters, and they are better at learning complex data distributions. Even though the output sequences obtained by training a neural network appear to be close to a uniform distribution, they are still obtained through a specific calculation process and do not possess true randomness. A neural network can be viewed as a large function approximator. We can train a neural network to generate the output of a pseudo-random number generator (PRNG).43,44
To test the randomness of our QRNG, we developed a GAN, a sophisticated machine learning framework, to serve as an adversarial force. GAN aims to learn the statistical characteristics and the corresponding conditional probability distribution model of the dataset and generate fake samples similar to real data. The GAN attacks on well-known PRNGs demonstrated the ability of GANs to learn pseudo-randomness with specific statistical patterns.44,45 If our QRNG is a PRNG, GAN can learn and crack it. Should the QRNG embody true randomness and eschew any discernible distribution, the GAN will invariably struggle to replicate a similarly random sequence. If the GAN fails to accurately simulate the QRNG output in this struggle, it indicates the true randomness of our QRNG. GAN46,47 has two modules in the framework: a generator and a discriminator. The observable variable is X, and the target variable is Y. The discriminator establishes the decision boundary to distinguish between real and fake data. The generator learns the statistical model of the joint probability distribution on X × Y and generates new data using the obtained probability model. The discriminator is a conditional probability model P (Y | x = x), which refers to the distribution probability of target Y given the observation x. The generator is a dependent probability model P (X | y = y), which is the probability of the distribution of observation X given the target y.
Figure 5(a) demonstrates the architecture of the proposed GAN generator for 1D random number generation. A 128-dimensional noise vector with uniform distribution is projected onto a high-level convolutional representation with the same spatial extent but 512 channels. Each channel contains a specific characteristic response pattern. By increasing the number of feature channels, the network can learn more abstract features at different levels. Four fractionally stridden convolutions are further applied to increase the spatial length of the feature maps while reducing the number of channels. In this up-sampling process, the redundant information is reduced. The features interact with each other and are fused for better integration. To reduce the risks of vanishing and exploding gradient problems, batch normalization48 and leaky ReLU49 are applied after each convolution operation, except for the final convolutional layer. The high-dimensional representation is finally transformed into a 2048-dimensional vector output. The final layer employs the sigmoid activation function to regulate the output from 0 to 1. Figure 5(b) displays the framework of the proposed 1D GAN discriminator used for distinguishing between true and false random numbers. The 2048-dimensional random number input vector is projected onto a 128-dimensional feature representation with 512 channels through four 1D convolutions. Such an encoder architecture is designed to extract rich feature representations that can capture important features and patterns in the input data. The encoder can gradually capture higher-level abstract features and develop a comprehensive understanding of the input. This high-level feature representation is then converted into a probability value ranging from 0 to 1.
To compare the randomness produced by the GAN vs that from our metalens array QRNG, we analyzed the inter-correlation function and inter-Hamming distance between the GAN stream and every QRNG stream. The inter-correlation function showed a peak at 0 in Fig. 5(c), while the inter-Hamming distance peaked at 1024 in Fig. 5(d). These optimal values precisely indicate no similarity for the randomness generated from the GAN and the metalens array. Thus, our QRNG output successfully demonstrated decorrelated randomness on par with computationally created random sequences from the GAN. This further verifies the quantum randomness originating from the intrinsic uncertainty of photons emitted by independent metalenses.
DISCUSSION
In summary, we have experimentally realized the generation of high-dimensional quantum random number arrays using metalens arrays. In contrast to previous bulk optics implementations relying on beam splitters, our approach condenses 100 metalenses within a 1 mm2 footprint. The device has a high-density output with 100 channels per square millimeter, yielding a miniaturized quantum randomness source without post-randomness extraction. There are some alternative physical processes used in QRNGs that can be applied in a similar method to metalens array. Please refer to the supplementary material Note 5, for more details. With the development of on-chip light sources and detectors, it is believed that the size of the completed device will be further reduced. This compact form factor and ease of integration conferred by the metasurface platform signifies advances for miniaturized quantum meta-devices.
MATERIALS AND METHODS
Metalenses design
The metalenses are made up of twelve distinct kinds of nanopillars with variable radii to offer phases between 0 and 330°. The nanopillars are positioned precisely to satisfy the focal lens's phase requirements. The nanopillars' geometrical information is carefully designed by numerical simulation in COMSOL Multiphysics, which has a height of 800 nm and a period of 200 nm. See the supplementary material Note 1, for more details.
Sample fabrication
The sapphire substrate is cleaned by hydrogen baking and coated with a GaN layer using metal-organic chemical vapor deposition (MOCVD), with trimethylgallium (TMGa) and ammonia as precursors. A SiO2 layer is deposited by plasma-enhanced chemical vapor deposition (PECVD) and patterned by electron-beam lithography (EBL) and Cr evaporation, forming a hard mask for the nanopillars. The GaN layer is etched by inductively coupled plasma reactive ion etching (ICP-RIE) using the SiO2 mask, creating the metalens arrays. The SiO2 layer is removed by buffered oxide etch (BOE), leaving the final sample. The detailed fabrication process is shown in supplementary material Fig. S1. The process of fabricating GaN metalenses through reactive ion beam etching is elaborated upon with greater detail in other research articles.50
Measurement setup
A 405 nm laser produces entangled photons via spontaneous parametric downconversion in a BBO crystal. The incident beam is focused on the crystal by the metalens array. The emitted light is collected by a objective lens and filtered by a 405 nm notch filter (Semrock NF03-405E-25) and a 475 nm bandpass filter to eliminate the pump light. A polarizing beam splitter (MPBS642, LBTEK) separates the two entangled photons with horizontal and vertical polarization, respectively. A He-Ne laser calibrates the position of the optical elements. A tunable delay line adjusts the path length of the vertically polarized photon. Both horizontally and vertically polarized photons are coupled to multimode fibers and detected by single photon diodes. An 808 nm bandpass filter (Semrock LL01-808-25) removes residual pump light and ambient light. The detected photons are recorded by a time-to-digital converter for further analysis. A qCMOS camera verifies the alignment of the metalens and the BBO. See the supplementary material Note 2, for more details.
GAN model training
The two modules play with each other in a zero-sum game where one's gain is the other's loss. Given a random number sequence that may be either a real sequence from a real physical QRNG or a fake sequence generated by the generator, the discriminator should determine whether the sequence is real or fake. On the contrary, the generator tries to generate a fake sequence that can fool the discriminator. In training, two modules try to complete their conditional probability model. After training, the generator masters the distribution of real data to generate new random number sequences.
Batch normalization is employed after the second, third, and fourth convolutional layers. Similar to the generator, the activation functions of the former four convolutional layers are leaky ReLU. A probability output of 0 indicates a fake sample, while a probability output of 1 signifies a real sample. There are no fully connected or pooling layers in the generator and discriminator. The padding operations are employed to adjust the output size of the convolutional layers.
The generator transforms a low-dimensional random vector into a high-dimensional sample that closely resembles a real sample. Typically, the generator exhibits greater complexity and possesses more trainable parameters than the discriminator. Our discriminator comprises approximately 755 thousand trainable parameters, whereas the generator consists of around 17 × 106 trainable parameters. The generator's parameters are approximately 24 times that of the discriminator. Establishing a coordinated and balanced training process between the generator and discriminator is crucial. Optimizing the generator is a more challenging task. The initial learning rate of GAN should be relatively small. An excessive learning rate may lead to instability in the training process, manifesting as an imbalance in the game between the generator and the discriminator, making it difficult for GAN to reach a convergence state. After hyperparameter attempts, the initial learning rates for the discriminator and the generator are 2 × 10−6 and 1.3 × 10−6, respectively. As the training progresses, the discriminators, which have a relatively more straightforward task, tend to improve steadily. To ensure a balanced interplay between the two components, it is beneficial to maintain a higher learning rate for the generator during the later stages of training. This can be achieved by setting the learning rate decay factor of 0.95 for the generator and 0.9 for the discriminator every 200 epochs. This approach facilitates faster learning and adaptation of the generator to the feedback provided by the discriminator. To avoid overfitting, the regularization coefficients for the discriminator and generator are 0.001 and 0.023, respectively.
We employed the Adam Optimizer ( for discriminator and generator). The batch size was 16 on a Nvidia GeForce RTX 3090 GPU. After 2000 epochs (1 000 000 iterations) of training, the final and converged to approximately 0.5, realizing Nash equilibrium.54 When a GAN converges, the output of the generator becomes consistent with the distribution of real samples, and the discriminator cannot accurately distinguish them. At this time, the discriminator's judgment of real samples and generated samples is almost random, so the probability of output is close to 0.5.
Device modeling and assumptions
-
Dark count: The dark counts can be disregarded compared to the count rate, as the dark counts for the SPCM amount to only 100 counts per second.
-
Detector and metalens efficiency: Considering the efficiency of two detectors, and , and the efficiency of the metalens , the total detection efficiency is . Thus, we can refine the probability distribution of photon pairs generated through SPDC.
-
Dead time: The SPCM has a dead time of . Dead time is a period that a detector is inactive after detection that does not affect the randomness of the raw data.22
- Multiphoton pair emission from the nonlinear crystal: When k photon pairs appear in a period, every k detection event will be announced for an ideal detector without dead time. However, in the experiment, only the first detection event is recorded as the raw data. Therefore, for a detection event, the conditional probability of getting the result given that k photons appear in a period,where . Considering the probability distributions of the pair number of SPDC generation Equation (M7), the maximum probability occurs when the photon drops into the first time bin,
The TDC exhibits a time resolution of 16 ps, rendering its impact negligible compared to the SPCM. After the photon arrives at the SPCM, the output signal, denoted by the function , is influenced by the jitter-rising edge of the square wave output that conforms to a Gaussian distribution. Specifically, the arrival time of the photon at the SPCM is represented as , while the time indicated by the rising edge of the SPCM output square wave is denoted as is the jitter caused by SPCM, obeying the normal distribution, . We denote the two generated photons with subscripts s and i. The true value of the time difference between these two photons is represented by . The measured value of the time difference is
The expected full width at half maximum (FWHM) of the time difference statistics between two SPDC photons is influenced by instrumental jitter in the measurement values , obeying . Finally, we have FWHM , which is very close to the experimental fitting value .
SUPPLEMENTARY MATERIAL
See the supplementary material for details on the design, processing, and characterization of metalens array; experimental details of random number generation; details on methods used for randomness extraction and verification; and details on generative adversarial networks.
ACKNOWLEDGMENTS
This work is supported by the University Grants Committee/Research Grants Council of the Hong Kong Special Administrative Region, China (Project No. AoE/P-502/20, CRF Project: C1015-21E; C5031-22G, GRF Project: CityU15303521; CityU11305223; CityU11310522; CityU11300123, and Germany/Hong Kong Joint Research Scheme: G-CityU 101/22), City University of Hong Kong (Project No. 9380131, 9610628, and 7005867), and the National Natural Science Foundation of China (Project No. 62375232).
AUTHOR DECLARATIONS
Conflict of Interest
The authors have no conflicts to disclose.
Author Contributions
Yubin Fan, Shufan Chen, and Xiaoyuan Liu contributed equally to this work.
Yubin Fan: Conceptualization (equal); Data curation (equal); Formal analysis (equal); Investigation (equal); Methodology (equal); Project administration (equal); Resources (equal); Software (equal); Validation (equal); Visualization (equal); Writing – original draft (equal); Writing – review & editing (equal). Shufan Chen: Conceptualization (equal); Data curation (equal); Formal analysis (equal); Investigation (equal); Methodology (equal); Software (equal); Validation (equal); Visualization (equal); Writing – original draft (equal); Writing – review & editing (equal). Xiaoyuan Liu: Data curation (equal); Methodology (equal); Software (equal); Validation (equal); Visualization (equal); Writing – original draft (equal). Xiaoyu Che: Data curation (equal); Formal analysis (equal); Visualization (equal). Xiaodong Qiu: Conceptualization (equal); Methodology (equal); Resources (equal); Validation (equal). Mu Ku Chen: Funding acquisition (equal); Resources (equal). Din Ping Tsai: Conceptualization (equal); Formal analysis (equal); Funding acquisition (equal); Investigation (equal); Methodology (equal); Project administration (equal); Supervision (equal); Validation (equal); Writing – review & editing (equal).
DATA AVAILABILITY
The data that support the findings of this study are available within the article and its supplementary material.