The elementary example operates under quasi equilibrium conditions. Its main quantum feature is the discrete energy level structure. More realistic devices operate out of equilibrium possessing friction heat leaks and finite heat flow. Quantum thermodynamics supplies a dynamical theory required for systems out of equilibrium such as heat engines, thus, inserting dynamics into thermodynamics. The theory of open quantum systems constitutes the basic theory. For heat engines a reduced description of the dynamics of the working substance is sought, tracing out the hot and cold baths. The starting point is the general Hamiltonian of the combined systems: