Solution (source code)

= Solution

An initially occupied, isolated instantaneous <energy eigenstate> follows its changing eigenspace, acquiring a <dynamical phase> and generally a <Berry phase>. For smooth nondegenerate evolution, a useful local smallness condition is
$$
\boxed{\frac{\hbar|\langle m(t)|\dot H(t)|n(t)\rangle|}{|E_n(t)-E_m(t)|^2}\ll1\quad(m\ne n)}.
$$
A nonvanishing <spectral gap> and suitably smooth, slow driving throughout the evolution are needed; the local inequality alone is not a universal long-time error bound. Gap closure invalidates the simple nondegenerate approximation. A separated degenerate eigenspace may mix internally even when transitions out of it are suppressed.