Refrigerators and heat pumps

Heat flows from cold to hot only when work drives it, so a refrigerator and a heat pump are the same machine judged by different coefficients of performance, $\frac{Q_L}{W}$ for cooling and $\frac{Q_H}{W}$ for heating.

From Thermodynamics.