Skip to main content

Thank you for visiting You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

Device-independent randomness expansion with entangled photons


With the growing availability of experimental loophole-free Bell tests1,2,3,4,5, it has become possible to implement a new class of device-independent random number generators whose output can be certified6,7 to be uniformly random without requiring a detailed model of the quantum devices used8,9,10. However, all these experiments require many input bits to certify a small number of output bits, and it is an outstanding challenge to develop a system that generates more randomness than is consumed. Here we devise a device-independent spot-checking protocol that consumes only uniform bits without requiring any additional bits with a specific bias. Implemented with a photonic loophole-free Bell test, we can produce 24% more certified output bits (1,181,264,237) than consumed input bits (953,301,640). The experiment ran for 91.0 h, creating randomness at an average rate of 3,606 bits s–1 with a soundness error bounded by 5.7 × 10−7 in the presence of classical side information. Our system allows for greater trust in public sources of randomness, such as randomness beacons11, and may one day enable high-quality private sources of randomness as the device footprint shrinks.

This is a preview of subscription content, access via your institution

Relevant articles

Open Access articles citing this article.

Access options

Buy article

Get time limited or full article access on ReadCube.


All prices are NET prices.

Fig. 1: Schematic of the experiment and trial structure.
Fig. 2: Source, stations and layout.
Fig. 3: Tradeoff between the expected expansion ratio and the desired success probability.
Fig. 4: Entropies as a function of the number of blocks processed in our protocol run.

Data availability

Source data are available for this paper. All other data that support the plots within this paper and other findings of this study are available from the corresponding authors upon reasonable request.

Code availability

The code that produces the results presented in this work is available from the corresponding authors upon reasonable request.


  1. Hensen, B. et al. Loophole-free Bell inequality violation using electron spins separated by 1.3 kilometres. Nature 526, 682–686 (2015).

    Article  ADS  Google Scholar 

  2. Shalm, L. K. et al. Strong loophole-free test of local realism. Phys. Rev. Lett. 115, 250402 (2015).

    Article  ADS  Google Scholar 

  3. Giustina, M. et al. Significant-loophole-free test of Bell’s theorem with entangled photons. Phys. Rev. Lett. 115, 250401 (2015).

    Article  ADS  Google Scholar 

  4. Rosenfeld, W. et al. Event-ready Bell test using entangled atoms simultaneously closing detection and locality loopholes. Phys. Rev. Lett. 119, 010402 (2017).

    Article  ADS  Google Scholar 

  5. Li, M.-H. et al. Test of local realism into the past without detection and locality loopholes. Phys. Rev. Lett. 121, 080404 (2018).

    Article  ADS  Google Scholar 

  6. Colbeck, R. Quantum and Relativistic Protocols for Secure Multi-party Computation. PhD thesis, Trinity College, Univ. Cambridge (2006);

  7. Colbeck, R. & Kent, A. Private randomness expansion with untrusted devices. J. Phys. A 44, 095305 (2011).

    Article  ADS  MathSciNet  Google Scholar 

  8. Bierhorst, P. et al. Experimentally generated random numbers certified by the impossibility of superluminal signaling. Nature 556, 223–226 (2018).

    Article  ADS  Google Scholar 

  9. Liu, Y. et al. Device-independent quantum random-number generation. Nature 562, 548–551 (2018).

    Article  ADS  Google Scholar 

  10. Zhang, Y. et al. Experimental low-latency device-independent quantum randomness. Phys. Rev. Lett. 124, 010505 (2020).

    Article  ADS  Google Scholar 

  11. Interoperable randomness beacons. NIST (2020).

  12. Bell, J. S. On the Einstein Podolsky Rosen paradox. Phys. Phys. Fiz. 1, 195–200 (1964).

    MathSciNet  Google Scholar 

  13. Pironio, S. et al. Random numbers certified by Bell’s theorem. Nature 464, 1021–1024 (2010).

    Article  ADS  Google Scholar 

  14. Liu, Y. et al. High-speed device-independent quantum random number generation without a detection loophole. Phys. Rev. Lett. 120, 010503 (2018).

    Article  ADS  Google Scholar 

  15. Shen, L. et al. Randomness extraction from Bell violation with continuous parametric down-conversion. Phys. Rev. Lett. 121, 150402 (2018).

    Article  ADS  Google Scholar 

  16. Dupuis, F., Fawzi, O. & Renner, R. Entropy accumulation. Commun. Math. Phys. 379, 867–913 (2020).

    Article  ADS  MathSciNet  Google Scholar 

  17. Arnon-Friedman, R., Dupuis, F., Fawzi, O., Renner, R. & Vidick, T. Practical device-independent quantum cryptography via entropy accumulation. Nat. Commun. 9, 459 (2018).

    Article  ADS  Google Scholar 

  18. Knill, E., Zhang, Y. & Fu, H. Quantum randomness generation by quantum probability estimation with quantum side information. Preprint at (2018).

  19. Zhang, Y., Fu, H. & Knill, E. Efficient randomness certification by quantum probability estimation. Phys. Rev. Res. 2, 013016 (2020).

    Article  Google Scholar 

  20. Miller, C. A. & Shi, Y. Universal security for randomness expansion from the spot-checking protocol. SIAM J. Comput. 46, 1304–1335 (2017).

    Article  MathSciNet  Google Scholar 

  21. Abellán, C., Amaya, W., Mitrani, D., Pruneri, V. & Mitchell, M. W. Generation of fresh and pure random numbers for loophole-free Bell tests. Phys. Rev. Lett. 115, 250403 (2015).

    Article  ADS  Google Scholar 

  22. Bell, J. S. Speakable and Unspeakable in Quantum Mechanics 2nd edn (Cambridge Univ. Press, 2004).

  23. Zhang, Y., Knill, E. & Bierhorst, P. Certifying quantum randomness by probability estimation. Phys. Rev. A 98, 040304(R) (2018).

    Article  ADS  Google Scholar 

  24. Knill, E., Zhang, Y. & Bierhorst, P. Generation of quantum randomness by probability estimation with classical side information. Phys. Rev. Res. 2, 033465 (2020).

    Article  Google Scholar 

  25. Mauerer, W., Portmann, C. & Scholz, V. B. A modular framework for randomness extraction based on Trevisan’s construction. Preprint at (2012).

  26. De, A., Portmann, C., Vidick, T. & Renner, R. Trevisan’s extractor in the presence of quantum side information. SIAM J. Comput. 41, 915–940 (2012).

    Article  MathSciNet  Google Scholar 

  27. Coudron, M. & Yuen, H. Infinite randomness expansion with a constant number of devices. In Proc. 46th Annual ACM Symposium on Theory of Computing (STOC’14) 427–436 (ACM, 2014).

  28. Miller, C. A. & Shi, Y. Robust protocols for securely expanding randomness and distributing keys using untrusted quantum devices. In Proc. 46th Annual ACM Symposium on Theory of Computing (STOC’14) 417–426 (ACM, 2014).

  29. Chung, K.-M., Shi, Y. & Wu, X. Physical randomness extractors: generating random numbers with minimal assumptions. Preprint at (2014).

  30. Marsili, F. et al. Detecting single infrared photons with 93% system efficiency. Nat. Photon. 7, 210–214 (2013).

    Article  ADS  Google Scholar 

Download references


We thank C. Miller and S. Glancy for help with reviewing this paper. This work includes contributions of the National Institute of Standards and Technology, which are not subject to US copyright. The use of trade names does not imply endorsement by the US government. The work is supported by the National Science Foundation RAISE-TAQS (award 1839223); European Research Council projects AQUMET (280169) and ERIDIAN (713682); European Union project FET Innovation Launchpad UVALITH (800901); the Spanish MINECO projects OCARINA (grant ref. PGC2018-097056-B-I00), Q-CLOCKS (PCI2018-092973) and the Severo Ochoa programme (SEV-2015-0522); Agència de Gestió d’Ajuts Universitaris i de Recerca project (2017-SGR-1354); Fundació Privada Cellex and Generalitat de Catalunya (CERCA program); Quantum Technology Flagship project macQsimal (820393); Marie Skłodowska-Curie ITN ZULF-NMR (766402); and EMPIR project USOQS (17FUN03).

Author information

Authors and Affiliations



L.K.S. and Y.Z. led the project and contributed equally to this work. Y.Z. and E.K. devised the protocol, and L.K.S., M.J.S and M.D.M. performed the experiment and collected the data. L.K.S., J.C.B., C.S., M.J.S., M.D.M., C.A., W.A., M.W.M., R.P.M. and S.W.N. contributed to the experimental design and setup. Y.Z., M.A.A., H.F., J.O. and E.K. developed the security analysis method and conducted the data analysis. L.K.S., Y.Z., M.A.A. and E.K. wrote the manuscript.

Corresponding authors

Correspondence to Lynden K. Shalm or Yanbao Zhang.

Ethics declarations

Competing interests

The authors declare no competing interests.

Additional information

Peer review information Nature Physics thanks Renato Renner and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Supplementary Information

Supplementary discussions on the protocol for randomness expansion as well as its implementation and data analysis, Figs. 1–3 and Tables I–V.

Source data

Source Data Fig. 3

Estimated expansion ratios and success probabilities.

Source Data Fig. 4

Running entropies of the inputs and outputs in our experiment.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Shalm, L.K., Zhang, Y., Bienfang, J.C. et al. Device-independent randomness expansion with entangled photons. Nat. Phys. 17, 452–456 (2021).

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:

This article is cited by


Quick links

Nature Briefing

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing