  We study quantum annealing in the quantum Ising model coupled to a thermal
environment. When the speed of quantum annealing is sufficiently slow, the
system evolves following the instantaneous thermal equilibrium. This
quasistatic and isothermal evolution, however, fails near the end of annealing
because the relaxation time grows infinitely, therefore yielding excess energy
from the thermal equilibrium. We develop a phenomenological theory based on
this picture and derive a scaling relation of the excess energy after
annealing. The theoretical results are numerically confirmed using a novel
non-Markovian method that we recently proposed based on a path-integral
representation of the reduced density matrix and the infinite time evolving
block decimation. In addition, we discuss the crossover between the adiabatic
and quasistatic regimes and propose experiments on the D-Wave quantum annealer.
