Extracting random numbers from quantum tunnelling through a single diode

Random number generation is crucial in many aspects of everyday life, as online security and privacy depend ultimately on the quality of random numbers. Many current implementations are based on pseudo-random number generators, but information security requires true random numbers for sensitive applications like key generation in banking, defence or even social media. True random number generators are systems whose outputs cannot be determined, even if their internal structure and response history are known. Sources of quantum noise are thus ideal for this application due to their intrinsic uncertainty. In this work, we propose using resonant tunnelling diodes as practical true random number generators based on a quantum mechanical effect. The output of the proposed devices can be directly used as a random stream of bits or can be further distilled using randomness extraction algorithms, depending on the application.

Random number generators (RNGs) are important in diverse applications such as cryptography, simulations, testing, address generation, and gaming 1 . Many current implementations rely on pseudo-random number generators, but information security requires true random numbers for sensitive applications like key generation in banking, defence or even social media. True random number generators are systems whose outputs cannot be determined, even if their internal structure and response history are known 1 . It has been demonstrated that true random numbers can be obtained from different sources such as noise 2 , chaotic systems 3 and quantum phenomena 4 . The main advantage of using sources of quantum noise is its intrinsic uncertainty, as opposed to the predictability of classical sources of noise. In this work, we propose using quantum tunnelling in a simple semiconductor structure, namely a resonant tunnelling diode (RTD). These devices are practical and scalable sources of randomness whose behaviour is governed by quantum physics at room temperature. The semiconductor nature of RTD's, and the simple system proposed to read random numbers from them, makes them a promising candidate for integration into microelectronic systems. The potential to integrate single elements RNGs into current technologies makes them resistant to frequency injection and biasing attacks, which affect state-of-the-art RNGs such as those based on free running oscillators 5 . The output of these devices can be directly used as a random stream of bits or can be further distilled using randomness extraction algorithms, depending on the application.
Resonant tunnelling diodes are the technological realisation of a semiconductor quantum well (QW) with finite rectangular barriers 6,7 . They consist of a thin, narrow band-gap semiconductor structure acting as a quantum well between two wide band-gap semiconductor tunnelling barriers 8,9 . Beyond the tunnelling barriers, highly doped regions of the narrow band-gap semiconductor are usually referred to as the emitter/collector regions, analogous to those in traditional bipolar transistors. Recently, resonant tunnelling devices using quantum dots 10,11 , atomic-scale defects 12 , graphene 13,14 and other two-dimensional materials 15,16 have been demonstrated, and this has renewed the interest in investigating resonant tunnelling and its applications using new materials. A high-resolution image of a typical RTD used in this work 8 , consisting of a square mesa (containing the quantum well structure) and an air bridge (for electrical connection), can be seen in Fig. 1a.
When swept with a DC voltage source, RTDs show the characteristic N-shaped I-V curve of negative differential resistance devices. A typical RTD characteristic is shown in Fig. 1b. The current obtained on the first slope of the curve arises due to the resonant tunnelling process 6,17 that gives this device its name. Here, the bias voltage has shifted the first QW state between the emitter's Fermi level and the lower edge of its conduction band, facilitating the resonant tunnelling of electrons and allowing a reasonably high current to be measured. Once the confined level falls below the conduction band, a sudden drop in current can be observed, as there are no more occupied states in the emitter aligned with the QW state. Further increase of the voltage leads to an increase in the current due to other conduction processes such as thermionic emission of hot electrons over the two tunnelling barriers 17 . The sudden current drop occurring between the two conduction regimes appears as a narrow resonance in the I-V characteristics. The bistability 18 and fast switching characteristics 19 emerging from the sharp NDR resonance of RTDs make them promising candidates for applications in multi-valued logic circuits 20 , random-access memories 21 , multi-function logic gates 22 , chaotic signal generation 3,23,24 , single-photon switching 25 , unique device identification 26 and terahertz oscillators 27,28 .
Due to their N-shaped NDR characteristics, the RTD's current is a single-valued function of voltage whereas the opposite is not true, as current values between those of the peak (I p ) and the valley (I v ) exhibit multiple voltage levels 18 due to the different conduction mechanisms. Using a current source in that range can result in two different scenarios: a low-resistance state (L) corresponding to the first positive differential resistance (PDR) region, and a high-resistance state (H) corresponding to the second PDR region. The instability of the NDR region 29,30 prevents the system from staying in that voltage range for long times, pushing the system to one of the two PDR branches. Ramping the current up and down results in a hysteresis cycle 31,32 between these two resistance states as shown in Fig. 1b.
For the experiments carried on in this work we used a set of RTDs fabricated as described elsewhere 8 . In particular the chips we used contain hundreds of RTDs of different sizes (4,9,16, and 25 μm 2 ), whose current-voltage characteristics scale with size, with minor differences between individual devices due to the fabrication process 26 , i.e. the current density-voltage characteristics are similar for all the device sizes. In the text only the results for 4 μm 2 and 9 μm 2 devices are shown for the sake of brevity. Figure 1 shows that sweeping current across the device results in a hysteresis cycle. The forward sweep takes place in the first PDR region up to a threshold near the peak current where the voltage is pushed to the second PDR region of the curve. Once that threshold is passed, ramping down the current will not push the voltage back to the first PDR region until the valley current is reached. Our measurements show that the switching threshold from one state to the other is not a fixed value but is statistically distributed near the resonance current, I p (Fig. 1c). As expected, currents above I p will always send the system to the second PDR region as the low-resistance branch does not reach that current range, and setting the current below I v will always give the low resistance state for similar reasons. On the other hand, working between I v and I p results in a non-deterministic switching behaviour, as the state change from one slope to the other happens at different values each time following a probability distribution as shown in the histogram of Fig. 1c. The origin of the uncertainty on the response of the RTD to current sources is most likely related to the charge build-up and trap filling in the quantum well and adjoining regions. This leads to shifts in the energy of the confined level 6,18 , dynamically altering the threshold at which resonant tunnelling occurs. To further characterise this stochastic switching behaviour and exploit its possibilities as an eventual random number generator, we performed a series of experiments using current pulse trains of varying amplitude and frequency. A Keithley 2602B source-measure unit (SMU) is programmed to send periodic current pulses of a fixed amplitude and length. For the sake of simplicity and keeping a small parameter space, the duty cycle of the pulse trains is kept at 50%, while varying the amplitude and pulse width. The voltage drop across the RTD is measured with the SMU at the end of each pulse, resulting in a value either in the first or second PDR regions. Alternatively, the output voltage can be measured using a fast oscilloscope to characterise the time response of the system. A schematic of the experimental setup is shown in Fig. 2.

Results and Discussion
Analysing the time response of different RTDs to current pulse trains shows that the random behaviour of the switching threshold is a dynamic process. This relates to the time that it takes the system to jump between the first and second PDR regions. When the source is set at a fixed current, the device will start conducting in the first PDR region of the I-V curve, i.e. that dominated by resonant tunnelling through the first quantum well state, and after a period of time it will jump into the second PDR region. A typical example of this behaviour can be seen in Fig. 3, with some pulses staying at the low state, some jumping straight to the high state and a few of them undergoing the jump during the pulse.
This dynamic switching behaviour can be related to the charge accumulation in the quantum well or in charge traps distributed along the structure, which are known to have an influence in the behaviour of RTDs 6,18 . The charge and discharge of these features lead to a shift in the energy of the confined quantum level, thus allowing switching from one tunnelling mechanism to another. The quantum nature of the randomness generation of this system emerges from the charge accumulation in the quantum well and charge traps, which is known to be a dynamic process that can take from picoseconds to hundreds of milliseconds 6 , which fits well with our experimental results.
In order to operate RTDs as sources of randomness, we can exploit the aforementioned random dynamic switching to obtain a stream of random bits. By sourcing current pulses to an RTD and measuring the voltage drop across the device at a given time, i.e. at the end of each pulse, we will obtain a value that corresponds either to the first or second PDR regions. To simplify the description of the operation we will denote these two states as  L and H respectively. The experiment shows that the L/H ratio depends both on the current level and the pulse width, which allows us to easily change the probability distribution of the output, as shown in Fig. 4.
Considering the dynamic behaviour described above, the output will be a random distribution of L and H values with characteristics depending upon the amplitude and width of the pulses. For low currents and short pulses the distribution will be strongly biased towards L, while high currents and long times will make the output more likely to be H. Tuning these two parameters allows us to set the probability distribution of the output. This can be explained by considering that the charge trapping, which is responsible for the switching between the two conduction mechanisms, is a probabilistic effect itself. A higher current corresponds to a larger number of electrons crossing the device in a given time, so more charge can be trapped, assuming a fixed probability. Likewise, if the pulse is longer, it is more probable that at the end of the pulse the trapped charge is enough to push the confined level to higher energies and facilitate the alternative conduction path.
Most applications employing random numbers, such as cryptography, require an unbiased uniform output distribution. In other cases, shifted or skewed distributions might be required. For example, a shifted probability distribution can be useful for simulating the random path of a particle subject to a certain potential, or they may be used in gambling or stock market predictions. One potential advantage of an RTD-based random number generator is that its average output can be modified in operando, which can be exploited for more complex simulations.
Our experiments show that, although the underlying principle of operation of the RTD as an RNG is the quantum tunnelling through the resonant structure, it is convoluted with classical thermal noise and other types of noises from the measurement equipment. Variations in the environment temperature and electrical noise can influence the output of the proposed RNG. Our experiments show a slow drift correlated to the evolution of the room temperature. Although this effect can be considered to add up to the randomness itself, as it will push the L/H ratio out of the set point in a random way, it is undesirable for most applications. Also, it adds a strong source of classical noise to a device that is intended to be used as a quantum random number generator. The use of a simple feedback mechanism to correct for temperature swings mitigates the effect of thermal drift, as it is a very slow process compared to pulse period. Regardless, the operating principle discussed still involves a classical measurement of a quantum process, making the system subject to any classical sources of noise that can obfuscate the pure quantum randomness.
The problem of discriminating between classical and quantum randomness sources has already been addressed in previous work, and there exist randomness extraction algorithms specifically designed to distil the output from quantum RNGs to obtain uniformly distributed random numbers. As an example, we used the double-hash function algorithm suggested by Frauchiger et al. 33 , which is computationally efficient and could be implemented in hardware. The resulting data successfully passes the 15 tests in the NIST randomness test suite 34 with a significance level of 0.05 (5%). Specific details on testing are given in the supplementary information.

Conclusion
In this paper, we have shown how the uncertainty in the switching between two conduction mechanisms in a resonant tunnelling diode can be exploited to produce a random number generator. This uncertainty emerges from the charge accumulation process in the quantum well and surrounding traps states. These charges alter the energy landscape for the incoming electrons, eventually impeding them to undergo a resonant tunnelling process and forcing them to conduct exclusively via thermionic emission.
The operating voltages of the two conduction states can be easily mapped to digital logic to generate a random bit stream. Although the raw output of the proposed scheme is still affected by classical noise, it can be used for many applications requiring random numbers. Distilling the raw output using a double-hash function to correct the effect of the classic environment results in bit streams that complies with the NIST suite of randomness tests, a standard in random number generator testing for cryptographic applications.
Although the random bit generation speed shown in our experiment is low compared to state-of-the-art random number generators, this is due to the particular choice of our experimental setup. The charge trapping process to which we attribute the random switching behaviour can take place in the range of picoseconds to hundreds of milliseconds, so in principle nothing prevents using faster pulsed sources up to even GHz. Thus, we consider that it is physically possible to increase the bit rate by several orders of magnitude, but the steps required to do that require further engineering research that is beyond the scope of this proof of concept paper.
One of the advantages of RTDs used in this study is that the operating voltage levels can be easily interfaced with logic levels in microelectronics. In the example above, the first PDR region lays below 0.4 V, i.e. before the resonance. At the working currents this means that the L level will be close to this voltage. The corresponding H level for that current projected to the second PDR region corresponds to around 1.15 V.