  Photon counting induces an effective nonlinear optical phase shift on certain
states derived by linear optics from single photons. Although this no
nlinearity is nondeterministic, it is sufficient in principle to allow scalable
linear optics quantum computation (LOQC). The most obvious way to encode a
qubit optically is as a superposition of the vacuum and a single photon in one
mode -- so-called "single-rail" logic. Until now this approach was thought to
be prohibitively expensive (in resources) compared to "dual-rail" logic where a
qubit is stored by a photon across two modes. Here we attack this problem with
real-time feedback control, which can realize a quantum-limited phase
measurement on a single mode, as has been recently demonstrated experimentally.
We show that with this added measurement resource, the resource requirements
for single-rail LOQC are not substantially different from those of dual-rail
LOQC. In particular, with adaptive phase measurements an arbitrary qubit state
$\alpha \ket{0} + \beta\ket{1}$ can be prepared deterministically.
