While heat only flows from hotter objects to colder objects, it is possible to pump heat in the opposite direction. For instance, a refrigerator removes heat from the already-cold interior (making it colder) and pumps it into the warmer environment. A simple way to do this is to use a working substance which is made colder than the cold object (so that heat can flow into the working substance), and then made hotter than the hot object (so that heat can flow out of the working substance). It requires work to change the working substance in this way, and so the pattern of energy flow is the reverse of that of a heat engine.
Coefficient of Performance
\(COP\)
--
Heat pumps can serve two different purposes in practice: some (like refrigerators or air conditioners) are meant to make cold objects colder, while others are meant to make warm objects warmer, like the interior of a house in winter. We can classify a heat pump's ability by its coefficient of performance (COP), which varies depending on whether the pump is used for heating or cooling:
$$COP={Q_C\over W_{in}}\hbox{ for cooling}$$ $$COP={Q_H\over W_{in}}\hbox{ for heating}$$
Unlike efficiency, these can be greater than 100%, and aren't usually stated as percentages. For instance, a refrigerator with a COP of 5 requires 10W of power for every 50W of of heat it extracts from its interior. Like efficiency, however, the COP is also the ratio of what you want (work for heat engines, heat flow for heat pumps) to what you need to provide to get it (heat for heat engines, work for heat pumps).