  Quantum thermodynamics explores novel thermodynamic phenomena that emerge
when interactions between macroscopic systems and microscopic quantum ones go
into action. Among various issues, quantum heat engines, in particular, have
attracted much attention as a critical step in theoretical formulation of
quantum thermodynamics and investigation of efficient use of heat by means of
quantum resources. In the present paper, we focus on heat absorption and
emission processes as well as work extraction processes of a quantum Otto
cycle. We describe the former as non-Markovian dynamics, and thereby find that
the interaction energy between a macroscopic heat bath and a microscopic qubit
is not negligible. Specifically, we reveal that the interaction energy is
divided into the system and the bath in a region of the short interaction time
and remains negative in the region of the long interaction time. In addition, a
counterintuitive energy flow from the system and the interaction energy to the
hot bath occurs in another region of the short interaction time. We quantify
these effects by defining an index of non-Markovianity in terms of the
interaction energy. With this behavior of the interaction energy, we show that
a non-Markovian quantum Otto cycle can switch functions such as an engine as
well as a heater or a heat pump by controlling the interaction time with the
heat bath. In particular, the qubit itself loses its energy if we shorten the
interaction time, and in this sense, the qubit is cooled through the cycle.
This property has a possibility of being utilized for cooling the qubits in
quantum computing. We also describe the work extraction from the microscopic
system to a macroscopic system like us humans as an indirect measurement
process by introducing a work storage as a new reservoir.
