The variational method is a powerful technique in quantum mechanics that allows us to approximate the ground state energy and wave function of a system when the exact solution is difficult or impossible to obtain analytically. The key idea behind this method is the variational principle, which states that the expectation value of the energy calculated using any trial wave function will always be greater than or equal to the true ground state energy of the system.
Let | \psi_0 \rangle be the exact ground state wave function of the system, with energy eigenvalue E_0. We know that:
\mathbf H| \psi_0 \rangle = E_1| \psi_0 \rangle
Multiplying both sides by \langle \bar \psi_0 | and integrating over all space, we get:
\int \langle \bar \psi_0 |\mathbf H| \psi_0 \rangle\,d\tau = E_1\int \langle \bar \psi_0 |\psi_0 \rangle\,d\tau
Using the Hermitian property of the Hamiltonian operator and the normalization condition of the wave function, we can rewrite the equation as:
\langle \psi_0 |\mathbf H| \psi_0 \rangle = E_1
Now, let | \phi \rangle be any arbitrary trial wave function, which is not necessarily equal to | \psi_0 \rangle. We can express | \phi \rangle as a linear combination of the complete set of eigenfunctions of the Hamiltonian operator:
| \phi \rangle = \sum_n c_n | \psi_n \rangle
where | \psi_n \rangle are the eigenfunctions of \mathbf H with eigenvalues E_n, and c_n are the expansion coefficients.
Using this expansion, we can calculate the expectation value of the Hamiltonian operator with respect to the trial wave function | \phi \rangle:
\begin{aligned} \langle \bar \phi |\mathbf H| \phi \rangle &= \sum_n \bar c_n \langle \bar \psi_n | \mathbf H \sum_m c_m | \psi_m \rangle \\ &= \sum_n\sum_m \bar c_n c_m\langle \bar \psi_n | \mathbf H| \psi_m \rangle \\ &= \sum_n\sum_m \bar c_n c_m E_m\delta_{nm} \\ &= \sum_n |c_n|^2E_n \end{aligned}
Since the ground state energy E_0 is the lowest eigenvalue of \mathbf H, and \sum_n |c_n|^2 = 1 (normalization condition), we can write:
\langle \bar \phi | \mathbf H| \phi \rangle = \sum_n |c_n|^2E_n = \left(1 - |c_1|^2\right)E_1 + \sum_{n=2} |c_n|^2E_n \geq E_1
Therefore, we have proven that the expectation value of the Hamiltonian operator with respect to any trial wave function | \phi \rangle is always greater than or equal to the true ground state energy E_1:
\langle \bar \phi | \mathbf H| \phi \rangle \geq E_1
The variational allows us to find approximate solutions to the ground state energy and wave function by minimizing the expectation value of the energy with respect to the trial wave function.
As example for this method, it is possible to consider the behavior of an electron in an infinite well with an applied electric field (for which an analytic solution has been derived here).
The Hamiltonian is:
\mathbf H = -\frac{1}{\pi^2}\frac{\mathrm d^2}{\mathrm d\xi^2} + f\left(\xi-\frac{1}{2}\right)
As trial function, we can consider an unknown linear combination of the first two states of the unperturbed well:
\phi_\text{trial}(\xi) = \frac{\sqrt 2}{\sqrt{1+ \alpha^2}} \left[\sin\left(\pi\xi\right) + \alpha\sin\left(2\pi\xi\right)\right]
It is necessary to have a corrective factor in front to ensure that the function are normalized correctly so that the expectation value is properly computed.
It is the possible to compute the expectation of the energy:
\langle E_\alpha \rangle = \langle \bar \phi_\text{trial} |\mathbf H| \phi_\text{trial} \rangle = \langle \bar \phi_\text{trial} |(\mathbf H_0 + \mathbf H_1)| \phi_\text{trial} \rangle
with:
\begin{aligned} & \mathbf H_0 = -\frac{1}{\pi^2}\frac{\mathrm d^2}{\mathrm d\xi^2} \\ & \mathbf H_1 = f\left(\xi-\frac{1}{2}\right) \end{aligned}
Computing the two parts:
\langle \bar \phi_\text{trial} |\mathbf H_0| \phi_\text{trial} \rangle = \frac{1}{1+ \alpha^2} \left(\varepsilon_1 + \alpha^2 \varepsilon_2\right) = \frac{1}{1+ \alpha^2} \varepsilon_1\left(1 + 4 \alpha^2 \right)
which correspond to an unperturbed set of energies and:
\begin{aligned} \langle \bar \phi_\text{trial} |\mathbf H_1| \phi_\text{trial} \rangle & = \frac{2}{1+ \alpha^2} \int_0^1 \left[\sin\left(\pi\xi\right) + \alpha\sin\left(2\pi\xi\right)\right]f\left(\xi -\frac{1}{2}\right)\left[\sin\left(\pi\xi\right) + \alpha\sin\left(2\pi\xi\right)\right]\mathrm d\xi \\ & = \frac{2}{1+ \alpha^2} \int_0^1 \left[\sin\left(\pi\xi\right) + \alpha\sin\left(2\pi\xi\right)\right]^2f\left(\xi -\frac{1}{2}\right)\mathrm d\xi = \frac{1}{1+ \alpha^2}\left(-\frac{32f\alpha}{9\pi^2}\right) \end{aligned}
Summing together:
\langle \eta_\alpha \rangle = \frac{1}{1+ \alpha^2} \left[ \varepsilon_1\left(1 + 4 \alpha^2 \right) -\frac{32f\alpha}{9\pi^2} \right]
To find the minimum it is necessary to compute the derivative of the expression \langle \eta_\alpha \rangle with respect to \alpha is given by:
\frac{\mathrm{d} \langle \eta_\alpha \rangle}{\mathrm{d}\alpha} = \frac{54 \pi^2 \alpha \varepsilon + 32 (\alpha^2 - 1) f}{9 \pi^2 (\alpha^2 + 1)^2}
if taking as example f =3 and remembering \varepsilon_1 = 1:
\frac{\mathrm{d} \langle \eta_\alpha \rangle}{\mathrm{d}\alpha} = \frac{32\alpha^2 + 18\pi\alpha-32}{3\pi^2(1 + \alpha^2)^2}
The zeros of the numerator are given by the following solutions:
\begin{aligned} \alpha_1 & = \frac{-9 \pi^2 + \sqrt{1024 + 81 \pi^4}}{32} \approx 0.17463 \\ \alpha_2 & = \frac{-9 \pi^2 - \sqrt{1024 + 81 \pi^4}}{32} \approx -5.72629 \end{aligned}
The value for the lowest energy is:
\alpha_1 = 0.175
which compared with 0.174 from a finite matrices expansion on 4 eigenfunctions. With this value, the approximated value of \langle \eta_1 \rangle is:
\langle \eta_1 \rangle \approx 0.90563
Which compares with 0.9042 from the finite matrices approximation or 0.90419 from the exact solution.
\alpha_2 is giving the approximated value of \langle \eta_2 \rangle as:
\langle \eta_2 \rangle \approx 4.09437
Which compares with 4.02763 from the finite matrices approximation or 4.02746 from the exact solution, so this method works well in general mostly for the ground state energy.