We present a quantum memory protocol for photons that is based on the direct
control of the transition dipole moment. We focus on the case where the
light-matter interaction is enhanced by a cavity. We show that the optimal
write process (maximizing the storage efficiency) is related to the optimal
read process by a reversal of the {\it effective time} τ=∫dtg2(t)/κ, where g(t) is the time-dependent coupling and κ is the
cavity decay rate. We discuss the implementation of the protocol in a
rare-earth ion doped crystal, where an optical transition can be turned on and
off by switching a magnetic field.Comment: 7 pages, 6 figure