Category:
$\newcommand{\DD}[2][]{\frac{d^2 #1}{d^2 #2}}$
$\newcommand{\matrixelement}[3]{\langle#1|#2|#3\rangle}$
$\newcommand{\PP}[2][]{\frac{\partial^2 #1}{\partial #2^2}}$
$\newcommand{\dd}[2][]{\frac{d#1}{d#2}}$
$\newcommand{\pp}[2][]{\frac{\partial #1}{\partial #2}}$
$\newcommand{\average}[2]{\langle#1|#2|#1\rangle}$
$\newcommand{\Label}[1]{\label{#1}}$
$\newcommand{\Prime}{^{\prime}}$
Using the classical Hamiltonian and the correspondence rule \(\vec p \to -i\hbar \nabla\), the expression for the Hamiltonian operator for a charged particle is written giving the time dependent Schr\"{o}dinger equation. The Schrodinger equation retains its form under gauge transformations if the wave function is assumed to transform as
\[ \psi(\vec{r},t) \to \psi^\prime (\vec{r},t) =
e^{-i(q/c)\Lambda(\vec{r},t)}\psi(\vec{r},t). \]
Lagrangian for a charged particle
The Lagrangian for a particle, having charge $q$, and moving in electric and magnetic field described by vector potential $\vec{A}(\vec{r},t)$ and scalar potential $\phi(\vec{r},t)$ is given by \begin{equation} L = \frac{1}{2} m \vec{v}^{\,2} + \frac{q}{c}\, \vec{v}\cdot\vec{A}(\vec{r},t) - q \phi(\vec{r},t), \Label{EQ01} \end{equation} where $\vec{v}= \frac{d\vec{r}}{dt}$ is the velocity of the particle. You must verify that this is the correct Lagrangian by showing that it gives correct equations of motion. The classical Hamiltonian for a charged particle in electromagnetic field is easily obtained by first computing the canonical momentum $\vec{p}$ defined by \begin{eqnarray} \vec{p} = \dd[L]{\vec{v}} &=& m \vec{v} + \frac{q}{c}\vec{A}(\vec{r},t), \Label{EQ02} \\ \therefore \qquad \vec{v} &=& \frac{1}{m}\Big[ \vec{p} - \frac{q}{c}\vec{A}(\vec{r},t) \Big] . \Label{EQ03} \end{eqnarray} The Hamiltonian is seen to be \begin{eqnarray} H_\text{cl} &=& \vec{p}\cdot \dd[\vec{r}]{t} - L \Label{EQ04} \\ &=& \frac{1}{2m} \left(\vec{p}-\frac{q}{c}\vec{A}(\vec{r},t)\right)^2 + q \phi(\vec{r},t) \Label{EQ05} \end{eqnarray} Comparing this with the free particle Hamiltonian $\frac{\vec{p}^{\,2}}{2m}$, we see that the Hamiltonian in presence of electromagnetic field is obtained from the free particle Hamiltonian by making replacements \begin{equation} \vec{p} \to \vec{p} - \frac{q}{c} \vec{A}, \qquad \qquad H \to H + q \phi \Label{EQ06}. \end{equation} The Hamiltonian operator is obtained from \eqref{EQ06} using the quantization rule $\vec{p} \to -i\hbar\nabla$. This gives the time dependent Schr\"{o}dinger equation \begin{equation} i\hbar\dd[\psi]{t} = \frac{1}{2m}\left( -i\hbar \nabla -\frac{q}{c} \vec{A}\right)^2 \psi + q\phi(\vec{r},t) \psi. \Label{EQ07} \end{equation}
Gauge invariance
The electric and magnetic fields remain unchanged under gauge transformation of the potentials \begin{eqnarray} \vec{A} \to \vec{A}^\prime &=& \vec{A} -\nabla \Lambda(\vec{r},t), \Label{EQ08}\\ \phi \to \phi^\prime &=& \phi + \frac{1}{c} \pp[\Lambda(\vec{r},t)]{t} \Label{EQ09}. \end{eqnarray} Under a gauge transformation the change in Lagrangian \eqref{EQ01} is a total time derivative and hence the classical equations of motion remain unchanged. In quantum mechanics the Schr\"{o}dinger equation is not invariant under a gauge transformation of potentials alone.
Gauge transformation of wave function
Remembering that the wave function is not an observable, there is freedom to assign a transformation property to the wave function. Thus the wave function is assumed to transforms as \begin{equation} \psi(\vec{r},t) \to \psi^\prime (\vec{r},t) = e^{-i(q/c)\Lambda(\vec{r},t)}\psi(\vec{r},t). \Label{EQ10B} \end{equation} Then the Schr\"{o}dinger equation retains its form {\it i.t.} \(\psi\Prime\) obeys the equation \begin{equation} i\hbar\dd[\psi^\prime]{t} = \frac{1}{2m}\left( -i\hbar \nabla -\frac{q}{c} \vec{A}^\prime\right)^2 \psi + q\phi^\prime(\vec{r},t) \psi. \Label{EQ07A}. \end{equation} Thus the form of the Schrodinger equation does not change. It should be noted that the wave function, and the vector and scalar potentials are not physical quantities and are not measurable. The measurable quantities are average values of gauge invariant dynamical variables. The averages of gauge invariant quantities computed using the potentials $\vec{A}, \phi$ and the wave function $\psi$ will be the same as those computed using the transformed potentials $\vec{A}^\prime, \phi^\prime$ and transformed wave function $\psi^\prime$. For a system of several particles having charges \(q_k, k=1,...n\), the wave function \(\Psi(\vec{r}_1,.., \vec r_n,t)\) is assigned transformation property \begin{equation} \Psi(\vec{r}_1,.., \vec r_n,t) \to \Psi^\prime (\vec{r}_1,..,\vec r_n,t) = e^{-i\sum_k (q_k/c)\Lambda(\vec{r}_k,t)}\Psi(\vec{r}_1,...,\vec r_n,t). \Label{EQ10A} \end{equation} under gauge transformations \eqref{EQ08}, \eqref{EQ09}.