We thank J.-H. Yeh and B. Palmer for the use of one of their cryogenic attenuators, which reduced thermal noise in the input waveguide line. This work was supported by the AFOSR MURI Quantum Photonic Matter (grant FA9550-16-1-0323), the Institute for Quantum Information and Matter, an NSF Physics Frontiers Center (grant PHY-1125565) with the support of the Gordon and Betty Moore Foundation, and the Kavli Nanoscience Institute at Caltech. D.E.C. acknowledges support from the ERC Starting Grant FOQAL, the MINECO Plan Nacional Grant CANS, the MINECO Severo Ochoa grant SEV-2015-0522, the CERCA Programme/Generalitat de Catalunya and the Fundacio Privada Cellex. M.M. is supported through a KNI Postdoctoral Fellowship. X.Z. is supported by a Yariv/Blauvelt Fellowship. A.J.K. and A.S. are supported by IQIM Postdoctoral Scholarships. P.B.D. is supported by a Hertz Graduate Fellowship Award. A.A.-G. is supported by the Global Marie Curie Fellowship under the LANTERN programme.

Reviewer information

Nature thanks Anton Kockum, Peter Lodahl and the other anonymous reviewer(s) for their contribution to the peer review of this work.