  Deterministic optical quantum logic requires a nonlinear quantum process that
alters the phase of a quantum optical state by $\pi$ through interaction with
only one photon. Here, we demonstrate a large conditional cross-phase
modulation between a signal field, stored inside an atomic quantum memory, and
a control photon that traverses a high-finesse optical cavity containing the
atomic memory. This approach avoids fundamental limitations associated with
multimode effects for traveling optical photons. We measure a conditional
cross-phase shift of up to $\pi/3$ between the retrieved signal and control
photons, and confirm deterministic entanglement between the signal and control
modes by extracting a positive concurrence. With a moderate improvement in
cavity finesse, our system can reach a coherent phase shift of $\pi$ at low
loss, enabling deterministic and universal photonic quantum logic.
