# Interpretation of the terms in classical hamiltonian of a charged particle in a magnetic field

For a particle of charge $$q$$ in a homogeneous magnetic field along $$z$$-axis, $$\vec{B}=B\hat{z}$$, its classical Hamiltonian is given by $$H=\frac{(\vec{p}-q\vec{A})^2}{2m}.$$ In the gauge $$\vec{A}=\frac{1}{2}(-yB,xB,0)$$, the hamiltonian can be written as $$H=\frac{\vec{p}^2}{2m}-\frac{q}{2m}(-yp_x+xp_y)B+\frac{q^2B^2}{8m}(x^2+y^2)$$ or $$H=\frac{\vec{p}^2}{2m}-\frac{q}{2m}L_z B+\frac{q^2B^2(x^2+y^2)}{8m}$$ The second term can be interpreted as the usual energy of a dipole in a magnetic field, $$-\vec{\mu}\cdot\vec{B}$$, classically. The third term is bewildering since it is present even when the charge is at rest in the B field.

How does one interpret the third term at the classical level? It's a nonzero contribution to energy even when the charged particle is at rest. Usually, there should be no contribution to energy if a charged particle is at rest in a magnetic field.

• Related. It might be a duplicate. In a comment there: "The classical Hamiltonian isn't gauge invariant. But the equations of motion are." Dec 11, 2023 at 16:24
• But when we have chosen a gauge, shouldn't each term in the Hamiltonian correspond to some energy (e.g., kinetic energy, potential energy, or some other interaction energy...)? Dec 11, 2023 at 16:33
• Then maybe look here. (All I'm doing is googling your questions, and also following sidebar links in the "Linked" and "Related" categories! So that's a good habit to get into.) Perhaps you're ignoring the energy in the EM field, too, as you are only writing down a Hamiltonian for a particle influenced by an external field. Dec 11, 2023 at 16:44

The thing is, the momentum $$\vec{p}$$ that occurs in the Hamiltonian is the canonical momentum, not the kinetic momentum. For a classical particle, the thing that we can measure is $$\vec{x}(t)$$ and its derivatives, including $$\dot{\vec{x}}(t) = \vec{v}(t)$$, the velocity. The problem is that the canonical momentum is related to the velocity by $$\vec{p} = m\vec{v} + q \vec{A}$$, which means that its value isn't gauge-invariant because $$\vec{A}$$ changes under a gauge transformation, but $$\vec{v}$$ does not. You can understand the Hamiltonian in terms of gauge-invariant quantitites as $$H = m|\vec{v}|^2 /2$$. You can't use this form of the Hamiltonian to get the equations of motion, though, because that formalism depends on the Hamiltonian begin a function on the phase space defined by $$(x,p)$$ coordinates (and the symplectic structure on that phase space).
This relates to what commenters are saying about the equations of motion being gauge invariant because one of the equations of motion is the one that defines $$\dot{\vec{x}} = \partial H / \partial \vec{p} = (\vec{p} - q \vec{A})/m$$, which is gauge invariant. The one for $$\dot{\vec{p}} = -\partial H/\partial\vec{x}$$, after you take the partial derivatives on $$H(x,p)$$, can be rewritten as an equation for $$\dot{\vec{v}}$$ that is gauge-invariant because the acceleration is an observable quantity.