  We demonstrate theoretically that waveguide-coupled cavities with embedded
two-level emitters can act as a highly efficient, high-fidelity quantum switch
for input photons in the waveguide. The switch reflects photons in the weak
emitter-cavity coupling regime and transmits photons in the strong coupling
regime. By calculating transmission and reflection spectra using the
input-output formalism of quantum optics and the transfer matrix approach, we
obtain the fidelity and efficiency of the switch in both regimes. We find that
three waveguide-coupled cavities can reflect a Gaussian wavepacket with a full
width at half-maximum of 0.5 nm with fidelity F_r = 98.1% and efficiency E_r =
96.8%, or transmit the wavepacket with fidelity F_t = 98.7% and efficiency E_t
= 99.2%.
