For shorter cycle times the working medium cannot follow adiabatically the change in the external parameter. This leads to friction-like phenomena. Extra power is required to drive the system faster. The signature of such dynamics is the development of coherence causing extra dissipation. Surprisingly the dynamics leading to friction is quantized meaning that frictionless solutions to the adiabatic expansion /compression can be found in finite time. As a result, optimization has to be carried out only with respect to the time allocated to heat transport. In this regime the quantum feature of coherence degrades the performance. Optimal frictionless performance is obtained when the coherence can be cancelled.