Quantum nondemolition measurement of small photon numbers by Rydberg-atom phase-sensitive detection | Synapse