Thermodynamics of discrete quantum processes