  Quantum coherence inherently affects the dynamics and the performances of a
quantum machine. Coherent control can, at least in principle, enhance the work
extraction and boost the velocity of evolution in an open quantum system. Using
advanced tools from the calculus of variations and reformulating the control
problem in the instantaneous Hamiltonian eigenframe, we develop a general
technique for minimizing a wide class of cost functionals when the external
control has access to full rotations of the system Hamiltonian. The method is
then applied both to time and heat loss minimization problems and explicitly
solved in the case of a two level system in contact with either bosonic or
fermionic thermal environments.
