  The design of quantum hardware that reduces and mitigates errors is essential
for practical quantum error correction (QEC) and useful quantum computation. To
this end, we introduce the circuit-Quantum Electrodynamics (QED) dual-rail
qubit in which our physical qubit is encoded in the single-photon subspace of
two superconducting microwave cavities. The dominant photon loss errors can be
detected and converted into erasure errors, which are in general much easier to
correct. In contrast to linear optics, a circuit-QED implementation of the
dual-rail code offers unique capabilities. Using just one additional transmon
ancilla per dual-rail qubit, we describe how to perform a gate-based set of
universal operations that includes state preparation, logical readout, and
parametrizable single and two-qubit gates. Moreover, first-order hardware
errors in the cavities and the transmon can be detected and converted to
erasure errors in all operations, leaving background Pauli errors that are
orders of magnitude smaller. Hence, the dual-rail cavity qubit exhibits a
favorable hierarchy of error rates and is expected to perform well below the
relevant QEC thresholds with today's coherence times.
