Cooling by heating in the quantum optics domain