I am trying to understand a part of I.E.P.'s answer here.
I.E.P. states that one can see from the following Hamiltonian, $$ H = \frac{1}{2m}|{\bf p}+q{\bf A}|^2 +q \phi \tag{8.35} $$ that the magnetic field does not work on the charged particle, and thus does not contribute to the energy.
How can one see that directly from this Hamiltonian?
The corresponding Lagrangian for this system is
\begin{equation} L = \frac{1}{2} m\dot{\bf r}^2 - q \phi + q \dot{\bf r}\cdot {\bf A}. \tag{8.32} \end{equation}
by Goldstein's matrix formulation to the Hamiltonian formalism, since $L$ is not a homogeneous function of degree 2, $H$ is not equal to kinetic energy + potential energy. HOWEVER, Goldstein does state that
There is now a linear term in the generalized velocities such that the matrix $\mathbf{a}$ has the elements $q A_i$. Because of this linear term in $V$, the Hamiltonian is not $T + V$. However, it is still in this case the total energy since the “potential” energy in an electromagnetic field is determined by $\phi$ alone.
Can I have some help also in how to reconcile the above quote of Goldstein's with his comment about $H\neq E$ unless $L$ is a homogeneous function of the velocities squared?