Solution (source code)

= Solution

The <Legendre transform> cancels the velocity-linear magnetic term. Expressing velocities in terms of <momenta> gives
$$
\boxed{H=\frac{p_r^2}{2m}+\frac{p_\theta^2}{2mr^2}+\frac{[p_z-qA(r)]^2}{2m}.}
$$
The <Hamiltonian> is time independent and hence conserved. It equals <kinetic energy> because a static <magnetic field> does no <work>; its dependence on $A$ is through the <mechanical momentum> combination.