Does quantum randomness betray a program?
Verdict
No. In the raw quantum bits tested, no signature of a pseudorandom generator appears, while the same tests expose four simple generators used as controls. One point must be stated at the outset: the rule set before the analysis is triggered by the IBM data as published, but the cause is identified — one of the nine machines stayed stuck at 0 or at 1 for entire series — and this defect does not have the structure of a generator. Setting it aside was decided after seeing the data; we report it as such.
This “no” has a limited scope: it rules out a simulation that would draw its quantum measurements from a simple generator, not a simulation that would use a cryptographic-quality generator, which is indistinguishable in principle.
Explanation
If the world were a simulation, the result of every quantum measurement, 0 or 1, would have to be produced. Physics says this result is unpredictable by nature. A computer cannot produce true randomness: it manufactures it with a computational recipe. A thrifty simulation would use a fast and simple recipe, and simple recipes leave fingerprints: repetitions, hidden regularities, a structure that can be recovered by computation.
So we took sequences of 0s and 1s produced by real quantum experiments and published by their authors, and we searched them for these fingerprints. First difficulty: most public sources of quantum randomness pass their results through a mathematical “mixer” before publishing them. This mixer is designed to erase all structure; testing its output says nothing about the source. We tested these data anyway, but they do not count in the verdict.
Two raw sources remain: an entangled-photon device at the University of Portland (Oregon), which publishes its bits as they are, and nine IBM quantum computers that were asked millions of times to flip a coin with a single qubit. The photons pass every test. The IBM machines give slightly too many 0s, a known defect explained by their authors; once this imbalance is corrected, they pass. One of them, Belem, stayed stuck for entire series of measurements: a fault, not a computational recipe.
The controls behave as expected: the simple recipes are exposed, including a very widespread generator that nonetheless passes the official NIST battery; the sophisticated recipes are not, and neither are the digits of the square root of 2, even though they are perfectly computable. This is the limit of this test: a carefully built simulation would leave no trace of this kind.
Detailed analysis
1. What is testable
A statistical test only informs about the last processing step applied to a sequence of bits: an output hashed by a cryptographic function looks like perfect randomness whatever the input. We tested 41,674,752 bits, of which 20,703,232 are raw:
| Dataset | Origin | Processing | Bits |
|---|---|---|---|
| parity | polarization-entangled photons (Kavulich et al., 2021) | none | 6,400,000 |
| ibm | one qubit, Hadamard gate, measurement; nine machines (Root and Becker, 2024) | none | 14,303,232 |
| anu | vacuum fluctuations, ANU | AES-128 | 16,777,216 |
| beacon | NIST Beacon 2.0 | SHA-512 | 4,194,304 |
Only parity and ibm inform about the nature of quantum randomness. The raw data of the NIST loophole-free Bell test (2015) were not used: their measurement choices combine physical sources and a pseudorandom source, and their detection results are not uniform bits. For the Beacon, the published chain of commitments was checked on 8,191 consecutive pairs.
2. Level 1: the NIST SP 800-22 battery
The 15 tests of the official battery are reimplemented and reproduce the 64 p-values of Appendix B of the document to within 6.9 × 10−7 (2.0 × 10−5 for one test). The data are cut into 38 sequences of 106 bits; the 6,624 p-values form a single family corrected by the Holm method at an overall level of 1%.
- parity: 1,102 p-values, no rejection (smallest adjusted p-value: 0.81); proportion of bits equal to 1: 0.49998.
- anu and beacon: no rejection (smallest adjusted p-value for anu: 0.44).
- ibm: 473 rejections out of 1,944; proportion of bits equal to 1: 0.4871, a deviation of −97.5 standard deviations. Without the Belem machine, the von Neumann extractor, which removes a constant bias exactly, leaves 3,297,358 bits and no rejection out of 512 p-values (0.17): the failures come from the bias described by the authors.
3. Level 2: the signatures of a generator
The NIST battery says whether a sequence departs from ideal randomness, not why. Three tests target the defects specific to algorithmic generators:
- Linear complexity. The Berlekamp-Massey algorithm gives the length \(L\) of the shortest linear feedback shift register that reproduces a segment of \(n\) bits. For a random sequence, \(L\simeq n/2\); any linear generator over \(\mathrm{GF}(2)\) whose state has fewer than \(n/2\) bits gives \(L\lt n/2\). Segments of 50,000 bits, read continuously or one bit in 48 and one in 64: a state of up to 25,000 bits is covered.
- Repetitions. Each 64-bit window is compared with all the others; the expected number of identical pairs is of the order of 1.1 × 10−6. A single repetition would signal a period or a reused seed.
- Long-range correlations. Autocorrelation at lags 17 to 65,536, with Bonferroni correction.
Main family, Holm at 1% on 54 p-values: parity rejects nothing (1.00); its maximum deviation of \(L\) from \(n/2\) is 2; no repetition; long-range correlations: 0.91. anu and beacon reject nothing. ibm rejects 3 times.
4. The IBM rejections: a stuck machine
The IBM data consist of 1,746 runs of 8,192 shots. 17 of them are constant (10 entirely 0, 7 entirely 1) and 6 others are more than 99% constant; all come from the Belem machine. The 1.03 × 1010 pairs of identical windows are all sequences of equal bits: among windows of ordinary composition, there are 0. A frozen output is not the output of a pseudorandom generator: it is the absence of output.
Setting Belem aside was decided after seeing the data: it is therefore a secondary analysis, with its own Holm correction, and the result of the initial rule remains published. On the other eight machines (13,254,656 bits), level 2 rejects nothing (14 p-values, smallest adjusted p-value 0.58); the maximum deviation of \(L\) from \(n/2\) is 2 and there is no repetition. A correlation at lag 1 exists (0.0047, or 15.5 standard deviations): a short-range measurement defect, unrelated to the structure of a generator. Level 1 rejects 341 times out of 1,782 there, because of the bias.
5. The controls
The same pipeline is applied to 4,194,304 bits from each known generator; the script stops if a control does not behave as expected.
| Generator | Expected | Result (smallest adjusted p-values, levels 1 and 2) |
|---|---|---|
| LFSR of degree 20 | detected | detected: \(L\) = 20, repetitions |
| LFSR of degree 31 | detected | detected: \(L\) = 31, \(\log_{10}p\) = −15,033 |
| 32-bit LCG | detected | detected: spectral test, long-range correlations |
| Mersenne Twister | detected | detected by level 2 alone: \(L\) = 19,937, \(\log_{10}p\) = −3,048; NIST battery silent (1.00) |
| PCG64 | not detected | nothing (0.32; 0.50) |
| SHA-256 in counter mode | not detected | nothing (0.33; 1.00) |
| Binary digits of \(\sqrt{2}\) | not detected | nothing (1.00; 1.00) |
The Mersenne Twister shows that level 2 adds real sensitivity to the official battery. PCG64, SHA-256 and \(\sqrt{2}\) show that an entirely deterministic sequence can have no detectable signature.
6. Limitations
- A cryptographic-quality generator is indistinguishable: this test rules out a simulation that would use a simple generator, not a carefully built simulation. The SP 800-22 document says so itself: no set of tests replaces cryptanalysis.
- Coverage of level 2: a linear generator is detected only if its state has fewer than 25,000 bits; a repetition, only if the period is shorter than the data.
- Modest raw volume, and neither of the two raw sources is certified by a loophole-free Bell test.
- Excluding the Belem machine is an a posteriori decision; its cause is documented and the raw result published.
- The ANU and Beacon datasets measure only the quality of AES-128 and SHA-512.
7. Reproduce
The data are rebuilt by telecharger.py, which checks their hashes; analyse.py then runs offline in under two minutes, self-tests included.
Sources
- J. T. Kavulich, B. P. Van Deren, M. Schlosshauer, Searching for evidence of algorithmic randomness and incomputability in the output of quantum random number generators, Physics Letters A 388, 127032 (2021), arXiv:2101.01238; data: Zenodo 4440318.
- B. P. Van Deren, J. T. Kavulich, M. Schlosshauer, Parity-based, bias-free optical quantum random number generation with min-entropy estimation, arXiv:2006.11425.
- O. Root, M. Becker, Does True Randomness Exist? Efficacy Testing IBM Quantum Computers via Statistical Randomness, arXiv:2401.12250; data: DOI 10.5281/zenodo.10542216.
- J. Y. Haw et al., Maximization of Extractable Randomness in a Quantum Random-Number Generator, arXiv:1411.4512.
- NIST, A Reference for Randomness Beacons: Format and Protocol Version 2, NISTIR 8213.
- L. K. Shalm et al., A strong loophole-free test of local realism, arXiv:1511.03189.
- NIST, A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications, SP 800-22 Rev. 1a.