  Resonating valence bond (RVB) states are a class of entangled quantum many
body wavefunctions with great significance in condensed matter physics. We
propose a scheme to synthesize a family of RVB states using a cavity QED setup
with two-level atoms (with states $\vert 0 \rangle$ and $\vert 1 \rangle$)
coupled to a common photon mode. In the lossy cavity limit, starting with an
initial state of $M$ atoms excited and $N$ atoms in the ground state, we show
that this setup can be configured as a Stern Gerlach experiment. A measurement
of photon emission collapses the wavefunction of atoms onto an RVB state
composed of resonating long-ranged singlets of the form
$\frac{1}{\sqrt{2}}[\vert 0 1 \rangle - \vert 1 0 \rangle]$. Each emitted
photon reduces the number of singlets by unity, replacing it with a pair of
lone spins or `spinons'. As spinons are formed coherently in pairs, they are
analogous to Cooper pairs in a superconductor. To simulate pair fluctuations,
we propose a protocol in which photons are allowed to escape the cavity
undetected. This leads to a mixed quantum state with a fluctuating number of
spinon pairs -- an inchoate superconductor. Remarkably, in the limit of large
system sizes, this protocol reveals an underlying quantum phase transition.
Upon tuning the initial spin polarization ($M-N$), the emission exhibits a
continuous transition from a dark state to a bright state. This is reflected in
the spinon pair number distribution which can be tuned from sub-poissonian to
super-poissonian regimes. This opens an exciting route to simulate RVB states
and superconductivity.
