  Adiabatic quantum algorithms solve computational problems by slowly evolving
a trivial state to the desired solution. On an ideal quantum computer, the
solution quality improves monotonically with increasing circuit depth. By
contrast, increasing the depth in current noisy computers introduces more noise
and eventually deteriorates any computational advantage. What is the optimal
circuit depth that provides the best solution? Here, we address this question
by investigating an adiabatic circuit that interpolates between the
paramagnetic and ferromagnetic ground states of the one-dimensional quantum
Ising model. We characterize the quality of the final output by the density of
defects $d$, as a function of the circuit depth $N$ and noise strength
$\sigma$. We find that $d$ is well-described by the simple form
$d_\mathrm{ideal}+d_\mathrm{noise}$, where the ideal case $d_\mathrm{ideal}\sim
N^{-1/2}$ is controlled by the Kibble-Zurek mechanism, and the noise
contribution scales as $d_\mathrm{noise}\sim N\sigma^2$. It follows that the
optimal number of steps minimizing the number of defects goes as
$\sim\sigma^{-4/3}$. We implement this algorithm on a noisy superconducting
quantum processor and find that the dependence of the density of defects on the
circuit depth follows the predicted non-monotonous behavior and agrees well
with noisy simulations. Our work allows one to efficiently benchmark quantum
devices and extract their effective noise strength $\sigma$.
