  We consider a (small) quantum mechanical system which is operated by an
external agent, who changes the Hamiltonian of the system according to a fixed
scenario. In particular we assume that the agent (who may be called a demon)
performs measurement followed by feedback, i.e., it makes a measurement of the
system and changes the protocol according to the outcome. We extend to this
setting the generalized Jarzynski relations, recently derived by Sagawa and
Ueda for classical systems with feedback. One of the two relations by Sagawa
and Ueda is derived here in error-free quantum processes, while the other is
derived only when the measurement process involves classical errors. The first
relation leads to a second law which takes into account the efficiency of the
feedback.
