Solution
= Solution
Let $\mathcal E=\sqrt{m^2c^4+c^2\pi^2}$. <Hamilton's equations> give
$$
\boxed{\dot r_i=\frac{c^2\pi_i}{\mathcal E},\qquad\dot p_i=q\sum_j\dot r_j\partial_iA_j-q\partial_i\phi.}
$$
Subtracting $q\,dA_i/dt$ from the second equation gives the familiar <Lorentz force>, $\dot\pi=q(E+\dot r\times B)$, with $E=-\nabla\phi-\partial_tA$ and $B=\nabla\times A$. This also checks the signs of both potential terms.