A heat pump is a system used to heat or cool an enclosed space or domestic water by transferring thermal energy from a cooler space to a warmer space using the refrigeration cycle, moving heat in the opposite direction in which heat transfer would take place without the application of external power. When used to cool a building, a heat pump works like an air conditioner by transferring heat from inside the building to the outdoors. When used to heat a building, the heat pump operates in reverse: Heat is transferred into the building from the outdoors. Common heat pump types are air source heat pumps, ground source heat pumps, water source heat pumps and exhaust air heat pumps. Heat pumps are also often used in district heating systems.