  The unavoidable irreversible losses of power in a heat engine are found to be
of quantum origin. Following thermodynamic tradition a model quantum heat
engine operating by the Otto cycle is analyzed. The working medium of the model
is composed of an ensemble of harmonic oscillators. A link is established
between the quantum observables and thermodynamical variables based on the
concept of canonical invariance. These quantum variables are sufficient to
determine the state of the system and with it all thermodynamical variables.
Conditions for optimal work, power and entropy production show that maximum
power is a compromise between the quasistatic limit of adiabatic following on
the compression and expansion branches and a sudden limit of very short time
allocation to these branches. At high temperatures and quasistatic operating
conditions the efficiency at maximum power coincides with the endoreversible
result. The optimal compression ratio varies from the square root of the
temperature ratio in the quasistatic limit where their reversibility is
dominated by heat conductance to the temperature ratio to the power of 1/4 in
the sudden limit when the irreversibility is dominated by friction. When the
engine deviates from adiabatic conditions the performance is subject to
friction. The origin of this friction can be traced to the noncommutability of
the kinetic and potential energy of the working medium.
