  We analyze the effect of impurity on the work output and efficiency of
quantum Otto and quantum Carnot heat cycles, modeled as a single quantum
particle in an infinite square well (ISW) potential, which is the working
substance. We solve this quantum mechanical system perturbatively up to first
and second order in strength of the impurity for strong and weak coupling
regimes, respectively. We derive the analytical expressions of work and
efficiency for the strong coupling regime to the first order in the strength
parameter. The threshold value of the strength parameter in weak coupling is
obtained up to which the numerical result agrees with the perturbative result
for a repulsive and attractive impurity. To our surprise, an embedded impurity
unlocks new operational phases in the system, such as a quantum heat engine,
quantum refrigerator, and quantum cold pump. In addition, the efficiency of the
quantum Otto heat engine is seen to reach Carnot efficiency for some parameter
regimes. The cooling power and coefficient of performance of the quantum
refrigerator and quantum cold pump are non-trivially affected by the impurity.
