The heat pump is a thermal machine that takes heat from a cold space and transfers it to a hotter one thanks to a work provided from the outside, that is, it does exactly the same as the refrigerating machine, the only thing that changes is the objective (In the refrigerating machine the objective is to cool and keep the cold space cold. The heat pump, however, aims to provide heat and keep the hot space warm)
Therefore the correct answer is A. A heat pump uses work to transfer energy by heat from a colder environment to a warmer environment.