## The Hamiltonian of a charged particle in a magnetic field

The Hamiltonian of a charged particle in a magnetic field is,

$$$H = \frac{1}{2m}\left(\vec{p}-q\vec{A}(\vec{r},t)\right)^2+qV(\vec{r},t).$$$

Here $\vec{A}$ is the vector potential. When a magnetic field is present, the kinetic momentum $m\vec{v}$ is no longer the conjugate variable to position. The conjugate variable to position is $\vec{p}=m\vec{v}+q\vec{A}$. In this section, this Hamiltonian will be derived starting from Newton's law.

The force on a charged particle is,

$$$\vec{F} = q\left(\vec{E} + \vec{v}\times \vec{B}\right).$$$

The force is a function of both the position and the velocity of the particle. To describe the motion of the charged particle quantum mechanically, one needs to construct the Hamiltonian. However, to find the conjugate variable the Lagrangian needs to be constructed first. The force is related to the Lagrangian by the Euler-Lagrange equation,

$$$\frac{d }{dt}\left(\frac{\partial \mathcal{L}}{\partial \dot{x}_i}\right) - \frac{\partial \mathcal{L}}{\partial x_i}=0.$$$

When the Lagrangian is substituted into the Euler-Lagrange equation, the result is Newton's law for the force in question. The Lagrangian is constructed from the force 'by inspection'. This means that we guess a Lagrangian and substitute it into the Euler-Lagrange equation. If the trial Lagrangian produces the correct form for Newton's law, that that is the Lagrangian we are seeking.

We assert that the appropriate Lagrangian is,

$$$\mathcal{L}=\frac{1}{2}mv^2-qV(\vec{r},t)+q\vec{v}\cdot\vec{A}(\vec{r},t).$$$

By substituting this Lagrangian into the Euler-Lagrange equations, we will show that it describes the motion of a particle of mass $m$ and charge $q$ in the presence of electric and magnetic fields described by the scalar potential $V$ and vector potential $\vec{A}$.

The Euler-Lagrange equation corresponding to the $x$ coordinate is,

$$$\frac{d }{dt}\left(\frac{\partial \mathcal{L}}{\partial v_x}\right) - \frac{\partial \mathcal{L}}{\partial x}=0.$$$

Here

$$$\frac{d }{dt}\left(\frac{\partial \mathcal{L}}{\partial v_x}\right) = \frac{d }{dt}\left(mv_x+qA_x\right) = m\frac{dv_x}{dt}+q\frac{dA_x}{dt} \\ = m\frac{dv_x}{dt}+q\left(\frac{dx}{dt}\frac{dA_x}{dx}+\frac{dy}{dt}\frac{dA_x}{dy}+\frac{dz}{dt}\frac{dA_x}{dz}+\frac{\partial A_x}{\partial t}\right) \\ = m\frac{dv_x}{dt}+q\left(v_x\frac{dA_x}{dx}+v_y\frac{dA_x}{dy}+v_z\frac{dA_x}{dz}+\frac{\partial A_x}{\partial t}\right),$$$

and

$$$\frac{\partial \mathcal{L}}{\partial x} = -q\frac{\partial V}{\partial x}+q\left( v_x\frac{\partial A_x}{\partial x} + v_y\frac{\partial A_y}{\partial x}+v_z\frac{\partial A_z}{\partial x}\right).$$$

Combing these results yields,

$$$m\frac{d v_x}{d t} = -q\left( \frac{\partial V}{\partial x} + \frac{\partial A_x}{\partial t}\right) +q\left( v_y\left(\frac{\partial A_y}{\partial x} -\frac{\partial A_x}{\partial y} \right) + v_z\left(\frac{\partial A_z}{\partial x} -\frac{\partial A_x}{\partial z} \right)\right).$$$

This is the $x$ component of Newton's law,

$$$m\frac{d \vec{v}}{dt} = q\vec{E} + q\vec{v}\times\vec{B},$$$

where,

$$$\vec{E} = -\nabla V -\frac{\partial \vec{A}}{\partial t}\hspace{1cm}\text{and}\hspace{1cm}\vec{B}=\nabla\times\vec{A}.$$$

The $y$ and $z$ components of Newton's law can similarly be determined from the Euler-Lagrange equations. This confirms that the Lagrangian that was asserted above is correct.

By definition, the conjugate variable to the position $x$ is,

$$$p_x = \frac{\partial \mathcal{L}}{\partial x}=mv_x+qA_x.$$$

The $mv_x$ component of the conjugate variable is called the kinetic momentum and the $qA_x$ component of the conjugate is called the field momentum. The notation can be confusing here. The variable $p_x$ is the conjugate variable to the $x$-coordinate, not the kinetic momentum.

A Legendre transformation is used to obtain the Hamiltonian from the Lagrangian,

$$$H = \vec{v}\cdot\vec{p}-\mathcal{L}.$$$

Using the expression for the Lagrangian from above,

$$$H = \vec{v}\cdot\vec{p}-\frac{1}{2}mv^2+qV(\vec{r},t)-q\vec{v}\cdot\vec{A}(\vec{r},t),$$$ $$$H = \vec{v}\cdot\left(m\vec{v}+q\vec{A}\right)-\frac{1}{2}mv^2+qV(\vec{r},t)-q\vec{v}\cdot\vec{A}(\vec{r},t),$$$ $$$H = \frac{1}{2}mv^2+qV(\vec{r},t).$$$

Thus the Hamiltonian for a charged particle in an electric and magnetic field is,

$$$H = \frac{1}{2m}\left(\vec{p}-q\vec{A}\right)^2+qV,$$$

The quantity $\vec{p}$ is the conjugate variable to position. It includes a kinetic momentum term and a field momentum term. So far, this derivation has been entirely classical. (Hamilton died long before anyone thought about quantum mechanics.) To make the transition to quantum mechanics we replace $\vec{p}$ by $-i\hbar\nabla$. The Schrödinger equation for a charged particle in a magnetic field is,

$$$i\hbar \frac{\partial \psi}{\partial t} = \frac{1}{2m}\left(-i\hbar\nabla -q\vec{A}(\vec{r},t)\right)^2\psi + qV(\vec{r},t)\psi.$$$