Quantum Random Number Generator

Quantum Random Number Generator (QRNG) generates random bits from the probabilistic outcome of a quantum measurement. A light source feeds a beam splitter, and the two output ports are each monitored by a single-photon detector; which detector clicks on a given pulse is fundamentally unpredictable, and that unpredictability is the source of randomness.

1. What This Protocol Does

Photons from the light source are directed onto a beam splitter and subsequently measured by two detectors, labelled Detector + and Detector −. The two possible detector outcomes provide the two possible random outcomes used to generate a binary random sequence.

A detection at Detector + can be associated with one binary value, while a detection at Detector − is associated with the other. Since the outcome of a quantum measurement cannot be predicted deterministically, the resulting sequence provides a source of quantum randomness.

The QRNG setup can therefore be viewed as:

QRNG optical layout

The QRNG optical layout: a light source feeds a beam splitter, whose two outputs are monitored by detectors D1 and D2.

The generated random bits can be used in applications such as cryptography, quantum key distribution, simulation, and random sampling.

2. How the Setup Works

On the canvas, the QRNG is represented by a light source connected to a beam splitter. The two output ports of the beam splitter are connected to two single-photon detectors.

Component

Role

Light Source

Produces optical pulses at the configured repetition frequency and mean photon number.

Beam Splitter

Separates the incoming optical field into two output paths, one leading to each detector.

Detector +

Monitors one beam-splitter output; a click contributes one binary outcome.

Detector −

Monitors the other beam-splitter output; a click contributes the other binary outcome.

Quantum Channel

The optical link between components; length, attenuation, and polarization fidelity can be configured.

3. The Physics in Brief

The QRNG relies on the intrinsically probabilistic outcome of a quantum measurement. When a photon enters a beam splitter, its quantum state is divided between the two output paths. For an ideal 50:50 beam splitter, the photon has equal probability of being detected at either output:

Input photon → Beam splitter → (Detector + or Detector −)
\[P(+) = 0.5 \qquad P(-) = 0.5\]

The detector outcomes are converted into binary values, for example using the convention Detector + → 0, Detector − → 1 (the reverse assignment can equally be used; changing the assignment only relabels the bits and does not affect the randomness of the sequence).

A series of measurement outcomes therefore produces a binary random sequence \(b_1, b_2, b_3, \ldots, b_n\) where each bit can take one of two possible values, \(b_i \in \{0, 1\}\). For an ideal balanced system, the expected probability of obtaining either binary value is:

\[P(0) = P(1) = 0.5\]

Thus, for a sufficiently long sequence, the number of 0s and 1s is expected to be approximately equal. In the practical simulator, non-ideal effects such as detector inefficiency, dark counts, timing jitter, channel attenuation, and other component imperfections can modify the detected events and consequently affect the statistical properties of the generated random sequence.

4. Configurable Parameters

Each component can be expanded in the right-hand panel to adjust its physical parameters.

4.1 Light Source

Parameter

Meaning

Frequency (Hz)

Repetition frequency of the optical source; determines how frequently optical pulses are generated.

Mean Photon Number

Average number of photons associated with each optical pulse.

4.2 Detectors

The QRNG uses two detectors, Detector + and Detector −, each configured independently:

Parameter

Range

Meaning

Dead Time

0 - 25000

Minimum interval after a detection during which the detector is unavailable for another detection event.

Jitter

0 - 10⁻⁹ s

Timing uncertainty associated with the detector response.

Mean Response Time

0 - 5⁻⁹ s

Mean temporal response time of the detector.

Coupling Efficiency

0 - 1

Fraction/probability representing how efficiently incoming photons are coupled into the detector.

Dark Count Rate

0 - 100000

Rate of detector clicks occurring without a corresponding incident photon.

Detection Efficiency

0 - 1

Probability that a photon reaching the detector produces a detection event.

4.3 Beam Splitter

The beam splitter forms the central optical component of the QRNG setup. It separates the incoming optical signal into two output paths leading to Detector + and Detector −. The two detector outcomes provide the binary outcomes required for random-number generation.

4.4 Quantum Channel

Parameter

Meaning

Channel Type

Selects the optical-fibre or free-space channel model.

Length (km)

Physical propagation distance through the channel.

Attenuation (dB/m)

Optical loss introduced during propagation.

Light Speed (m/s)

Propagation speed used by the channel model.

Polarization Fidelity

Fidelity describing preservation of the optical polarization during transmission.

4.5 Measurement

Parameter

Meaning

Fidelity

Quality/fidelity associated with the measurement process; can be varied to investigate the effect of non-ideal measurement conditions on the generated random sequence.

4.6 Input Parameters

Parameter

Meaning

No. of Bits

Number of random bits requested from the QRNG simulation.

Simulation Time (ms)

Total time window over which the QRNG simulation is performed.

For example, the interface may allow 128 bits to be requested with a simulation time of 80 ms.

5. Running the QRNG

  1. Open the QRNG module in AnuQrana.

  2. Configure the Light Source parameters.

  3. Expand Detector + and Detector − and configure the detector parameters.

  4. Configure the Quantum Channel parameters.

  5. Adjust the Measurement Fidelity if required.

  6. Under Input Parameters, select the required No. of Bits.

  7. Set the desired Simulation Time.

  8. Verify the optical connection between the light source, beam splitter, and both detectors.

  9. Click RUN ▶ to execute the simulation.

  10. The simulator generates the requested random-bit sequence from the detector measurement outcomes.

6. Reading the Results

After the simulation, the generated detector outcomes are used to construct the random binary sequence. For an ideal balanced setup, the two detector outcomes are expected to occur with approximately equal probability, so for a sufficiently long sequence the number of zeros and ones should approach approximately equal values.

For example, a generated sequence may have the form:

[ 0110100111010010 ]

where each bit corresponds to one of the two detector outcomes. The exact sequence cannot be predicted in advance; however, statistical properties of a sufficiently long sequence can be analysed to evaluate its randomness.

Changing the physical parameters provides a way to study how non-ideal components affect the generated random sequence:

  • Increasing dark count rate introduces additional detector events that are not caused by incident photons.

  • Reducing detection efficiency decreases the probability of detecting an incoming photon.

  • Reducing coupling efficiency reduces the fraction of photons successfully coupled into the detector.

  • Increasing channel attenuation increases optical losses before detection.

  • Increasing dead time can prevent closely spaced detection events from being registered.

  • Increasing timing jitter introduces uncertainty in the detection time.

These parameters allow the QRNG simulation to model conditions that are closer to practical quantum-random-number-generation systems rather than an idealized quantum measurement.

Instance methods

run()

Starts the SimPy process for the protocol: drives the light source through the configured Simulation Time, propagates pulses through the beam splitter and quantum channel, and records detector clicks until the requested No. of Bits have been generated (or the simulation window elapses).

results()

Returns the generated binary sequence together with the underlying click counts for Detector + and Detector −. Only meaningful after run() has completed.

reset()

Clears the accumulated bit sequence and detector counts so the same protocol instance can be reused for a fresh trial on the same timeline.