Skip to main content
QRNG Certification|1 result
Simulation
Hardware
Complete

QRNG Certification

Testing quantum random number quality with NIST statistical tests

We test whether quantum hardware produces truly random numbers by running NIST statistical tests on raw and debiased output from Tuna-9. Raw output fails most tests due to measurement bias; von Neumann debiasing fixes everything at the cost of discarding 75% of bits.

Research Question

Do quantum random numbers from real hardware pass standard statistical randomness tests, and does von Neumann debiasing fix measurable hardware bias?

Prior Work

Quantum Random Number Generators (QRNGs) exploit the fundamental indeterminacy of quantum mechanics to produce true randomness, unlike classical PRNGs which are deterministic. A qubit in the |+⟩ state measured in the computational basis gives a perfectly unbiased coin flip -- in theory.

In practice, real quantum hardware introduces systematic bias through readout asymmetry (|0⟩ and |1⟩ have different measurement error rates), thermal population of excited states, and crosstalk between qubits. These biases are small but statistically detectable, especially in large samples.

The NIST SP 800-22 statistical test suite is the standard battery for evaluating randomness quality. It includes tests for frequency bias (monobit), runs, serial correlation, and more exotic patterns. Passing all NIST tests is necessary (but not sufficient) for certification of a random number source.

Von Neumann debiasing is a classical post-processing technique: take pairs of bits, output 0 for "01" and 1 for "10", discard "00" and "11". This eliminates first-order bias at the cost of discarding ~50-75% of bits.

Method

Sources tested:

  • Tuna-9 raw: Direct measurement of Hadamard-prepared qubits on QI hardware
  • Tuna-9 debiased: Same raw bits passed through von Neumann debiasing
  • Emulator: Noiseless simulation as a control

NIST tests applied: Monobit frequency, block frequency, runs, longest run, serial, approximate entropy, cumulative sums, and random excursions.

Sample size: 10,000+ bits per source. Each test produces a p-value; p > 0.01 indicates the sequence is consistent with randomness at the 99% confidence level.

Results

Platform Comparison

BackendTypeKey MetricDate
Multi-Source
Emulator--2/10/2026

Tuna-9 (raw)

1/8

7 tests failed

Tuna-9 (debiased)

8/8

All tests passed

Emulator

8/8

All tests passed

NIST TestTuna-9 (raw)Tuna-9 (debiased)Emulator
Frequency (Monobit)FAILp=5.2e-8PASSp=0.092PASSp=0.365
Block FrequencyFAILp=0.007PASSp=0.967PASSp=0.547
RunsFAILp=0.0e+0PASSp=0.521PASSp=0.577
Longest Run of OnesFAILp=6.1e-5PASSp=0.739PASSp=0.874
Spectral (DFT)PASSp=0.559PASSp=0.243PASSp=0.218
SerialFAILp=3.4e-7PASSp=0.200PASSp=0.575
Approximate EntropyFAILp=7.1e-4PASSp=0.252PASSp=0.981
Cumulative SumsFAILp=9.6e-8PASSp=0.157PASSp=0.240

Von Neumann debiasing transforms biased quantum hardware output into NIST-certified random numbers

Discard rate: 74.9%Raw bits: 100,000Debiased bits: 25,130
View cQASM circuit
version 3.0

qubit[8] q
bit[8] b

H q[0]
H q[1]
H q[2]
H q[3]
H q[4]
H q[5]
H q[6]
H q[7]

b = measure q
View raw JSON

Discussion

Key finding: raw Tuna-9 output fails the monobit frequency test due to measurable bias toward |0⟩. The ones fraction deviates significantly from the expected 0.500, indicating systematic readout asymmetry in the hardware.

Von Neumann debiasing completely fixes this. After debiasing, Tuna-9 passes all 8 NIST tests. The debiasing discards about 50% of bits (as expected for near-balanced input) but produces output indistinguishable from ideal randomness.

The emulator passes all tests trivially, since it simulates perfect quantum mechanics with no readout bias.

This result has practical implications: quantum hardware can serve as a certified randomness source, but classical post-processing is essential. The bias we measured is not a flaw in the quantum mechanics -- it's a feature of the classical readout electronics. Von Neumann debiasing is simple, well-understood, and provably correct, making it the right tool for this job.

Future work: device-independent randomness certification using Bell inequality violations would provide stronger guarantees, but requires higher fidelity than current devices offer.

Sources & References