Linear Variational Method#

What You Need to Know

  • The variational method is a powerful tool for estimating upper bounds and approximations for ground-state energies in a wide range of quantum mechanical problems.

  • It plays a key role in electronic structure theories, such as Hartree-Fock.

  • The linear variational method seeks solutions to the Schrödinger equation by representing trial wavefunctions as linear combinations of simple, computationally efficient functions, such as Gaussians or exponentials.

  • By applying the linear variational method, the Schrödinger equation is transformed into a linear algebra problem, where the goal is to find eigenvalues (representing energies) and eigenvectors (providing coefficients for the linear combination).

Linearizing the problem#

  • How does linearization help us in practice? In a typical QM problem, we are attempting to solve for the wavefunction(s) and energy(ies) for a given Hamiltonian. If the Hamiltonian is such that solving the problem exactly is too challenging (e.g. any two or more electron problem) we can expand the wavefunction in a basis and attempt to solve the problem that way. We start with

ψϕ=nNcnfn
  • Truncating this expansion at any finite n leads to an approximate solution. Also, what the variational principle tells us is that we can minimize the energy with respect to variational paramters cn and still have EϕE0.

Smallest example#

  • We will illustrate this idea and the general matrix construction with a simple example of two basis functions (N=2)

ϕ=c1f1+c2f2
  • There is currently no need to define these functions explicitly so we will leave them as generic functions f1 and f2. We now solve for the energy

Eϕ=ϕ|H^|ϕϕ|ϕ=c1f1+c2f2|H^|c1f1+c2f2c1f1+c2f2|c1f1+c2f2
Eϕ=c12H11+2c1c2H12+c22H22c12S11+2c1c2S12+c22S22
  • Hij=fi|H^|fj Hamiltonian matrix element expressed in basis of f

  • Sij=fi|fj S matrix element or overlap integral expressed in basis of f. This one measures how similiar fi is to fj.

Eigenvalue Problem#

  • Since EϕE0 for any trial function ϕ, we can minimize the energy Eϕ by varying the parameters c1 and c2.

  • To minimize with respect to c1, we differentiate Eϕ with respect to c1 and set the derivative equal to zero:

    Eϕc1=0=c1(H11ES11)+c2(H12ES12)
  • Similarly, minimizing with respect to c2 gives:

    Eϕc2=0=c1(H12ES12)+c2(H22ES22)
  • These two coupled linear equations can be expressed compactly as a matrix equation:

    [H11ES11H12ES12H12ES12H22ES22][c1c2]=0
  • The matrix on the left can be rewritten as the difference between two matrices:

    ([H11H12H12H22]E[S11S12S12S22])[c1c2]=0
  • Rearranging, we can write:

    [H11H12H12H22][c1c2]=E[S11S12S12S22][c1c2]
  • In more compact matrix notation, this becomes:

  • By left-multiplying both sides by S1, we transform this into a standard eigenvalue problem:

    S1Hc=EIc
  • Therefore, the minimum energies correspond to the eigenvalues of S1H, and the variational parameters that minimize the energies are the eigenvectors of S1H.

Breaking problem down to matrix eigenvalue eigenvector problem

In the equation

S1Hc=EIc,

I represents the identity matrix. Its role in this context is essential to express the equation as a standard eigenvalue problem.

  1. Eigenvalue Problem Form:

    In linear algebra, a standard eigenvalue problem is written as:
    $Av=λIv,$
    where:

    • A is a square matrix,

    • λ is a scalar eigenvalue,

    • I is the identity matrix, and

    • v is the corresponding eigenvector.

    The identity matrix I ensures that λ scales the eigenvector v without altering its direction. The eigenvalue problem is about finding the values of λ and their associated v.

  2. Connecting to S1Hc=EIc:
    Here, S1H acts as the operator A in the standard eigenvalue problem.

    • S1H is a matrix resulting from left-multiplying H by the inverse of S.

    • c represents the eigenvector.

    • E is the eigenvalue (corresponding to the energy in the quantum mechanical system).

    The identity matrix I is explicitly included to highlight that E is a scalar multiplying the vector c. This ensures that the left-hand side (a matrix operation) matches the right-hand side (a scaled vector).

  3. Why S1 Appears:
    Initially, we had:
    $Hc=ESc,whichcannotdirectlybeinterpretedasaneigenvalueproblembecauseofthepresenceof\mathbf{S}(theoverlapmatrix).Totransformthisintoastandardform,wepremultiplybothsidesby\mathbf{S}^{-1}:S1Hc=ES1Sc.Since\mathbf{S}^{-1}\mathbf{S} = \mathbf{I},thissimplifiesto:S1Hc=EIc.$

  4. How to Interpret This as an Eigenvalue Problem:
    The equation now has the form of a standard eigenvalue problem:
    $Av=λIv,$
    where:

    • A=S1H is the effective matrix to diagonalize,

    • λ=E are the eigenvalues, corresponding to the energy levels,

    • v=c are the eigenvectors, containing the coefficients of the trial wavefunctions.

  5. Physical Interpretation:
    Solving the eigenvalue problem S1Hc=EIc gives the approximate energies (E) of the quantum system as eigenvalues and the corresponding variational parameters (c) as eigenvectors. The identity matrix I is crucial for preserving the standard form of the eigenvalue problem, ensuring proper mathematical and physical interpretation.

Example: Particle in a Box#

Let’s consider a free particle in 1D bounded to 0xa. The Hamiltonian for such a system is simply the kinetic energy operator

H^=22md2dx2

While we can have solved this problem analytically, it will be instructive to see how the variational solution works. We start by approximating ψ(x) as an expansion in two basis functions

ψ(x)c1x(ax)+c2x2(ax)2

where the basis functions are f1(x)=x(ax) and f2(x)=x2(ax)2 and c1 and c2 are the variational parameters (/linear coefficients of basis functions). In order to solve for the variational energies and wavefunctions given this expansion we must construct the Hamiltonian matrix, H, and the basis function overlap matrix, S. We will then compute and diagonlize the S1H matrix. Recall,

Hij=fi|H^|fj

and

Sij=fi|fj

In this problem, we have two basis functions

f1(x)=x(ax)

and

f2(x)=x2(ax)2

Computing the matrix elements:#

H11=x(ax)|H^|x(ax)
=ax|H^|axax|H^|x2x2|H^|ax+x2|H^|x2
=ax|H^|x2+x2|H^|x2

where the last equality holds because the second derivative of x with respect to x is zero. Let’s now investigate each of these integrals

x|H^|x2=0ax22md2dx2x2dx=2m0axdx=2a22m

Similarly we should get

x2|H^|x2=2a33m

Thus

H11=a2a22m+2a33m=2a36m
H22=x2(ax)2|H^|x2(ax)2
=a2x2|H^|a2x22a2x2|H^|2ax3+a2x2|H^|x42ax3|H^|a2x2+4ax3|H^|ax32ax3|H^|x4+x4|H^|a2x22x4|H^|ax3+x4|H^|x4
=2a73m+32a7m62a75m+2a72m122a75m+22a7m2a75m+2a7m62a77m
=2a7105m
H12=H21=2a530m

We can now complete the Hamiltonian matrix, H,

H=2a3m[16a230a230a4105]

It can also be shown that S is

S=a510[13a214a214a463]
Hide code cell source
import numpy as np
from scipy.linalg import eig, inv, eigh

# Lets adopt simpler units
a = 1.0
hbar = 1.0
m = 1.0

S = np.array([[1.0/30.0, 1.0/140.0],[1.0/140.0,1.0/630.0]])
H = np.array([[1.0/6.0,1.0/30.0],[1.0/30.0,1.0/105.0]])

e, v = eig(inv(S) @ H) #e, v = eigh(H, S) #Same values eigh is for hermitian matrices

print("Eigenvalues:", e)
print("First eigenvector:", v[:,0])
Eigenvalues: [ 4.93487481+0.j 51.06512519+0.j]
First eigenvector: [-0.66168489 -0.74978204]

So we see that the smallest energy in this basis is

Eϕ=4.93492m

How does this compare to the analytic solution? We need to recall that for particle in a box we have:

En=n2π222ma2

Plugging in for the ground state, n=1, and a=1 since that is what we used numerically above we get

E1=π2224.93482m

So we can see that our variational solution worked out well for the energy. Now how about the wavefunction?

Hide code cell source
# plot wavefunction
import matplotlib.pyplot as plt
from scipy import integrate
%matplotlib inline
# x values
x = np.arange(0,1,0.01)
# exact wavefunction
psi1Exact = np.sqrt(2)*np.sin(np.pi*x) 
plt.plot(x,psi1Exact,'k-',label="Exact",lw=3)
# variational basis function wavefunction
psi1Var = v[0,0]*x*(1-x) + v[1,0]*x**2*(1-x)**2
norm = np.sqrt(integrate.simps(np.power(psi1Var,2),x))
plt.plot(x,-psi1Var/norm,'r--', label="Variational")
plt.legend()
<matplotlib.legend.Legend at 0x7f9083657a90>