The Hamiltonian in classical mechanics is not always equal to the total energy of the system. I believe this is only true if there is only a potential field and no vector potential. However, in quantum mechanics for a particle in an EM field, even if a vector potential is used the energy operator E -> H. Is this an inconsistency? While H is not always equal to E in classical mechanics, H is still always regarded as the operator for E when there are not exclusively scalar potentials in QM? Thanks.