  In this paper, we study a general linear networked system that contains a
tunable memory subsystem; that is, it is decoupled from an optical field for
state transportation during the storage process, while it couples to the field
during the writing or reading process. The input is given by a single photon
state or a coherent state in a pulsed light field. We then completely and
explicitly characterize the condition required on the pulse shape achieving the
perfect state transfer from the light field to the memory subsystem. The key
idea to obtain this result is the use of zero-dynamics principle, which in our
case means that, for perfect state transfer, the output field during the
writing process must be a vacuum. A useful interpretation of the result in
terms of the transfer function is also given. Moreover, a four-nodes network
composed of atomic ensembles is studied as an example, demonstrating how the
input field state is transferred to the memory subsystem and how the input
pulse shape to be engineered for perfect memory looks like.
