  The large available Hilbert space and high coherence of cavity resonators
makes these systems an interesting resource for storing encoded quantum bits.
To perform a quantum gate on this encoded information, however, complex
nonlinear operations must be applied to the many levels of the oscillator
simultaneously. In this work, we introduce the Selective Number-dependent
Arbitrary Phase (SNAP) gate, which imparts a different phase to each Fock state
component using an off-resonantly coupled qubit. We show that the SNAP gate
allows control over the quantum phases by correcting the unwanted phase
evolution due to the Kerr effect. Furthermore, by combining the SNAP gate with
oscillator displacements, we create a one-photon Fock state with high fidelity.
Using just these two controls, one can construct arbitrary unitary operations,
offering a scalable route to performing logical manipulations on
oscillator-encoded qubits.
