Week 40: Mean-field theories and Hartree-Fock equations

Morten Hjorth-Jensen
Department of Physics and Center for Computing in Science Education, University of Oslo, Norway

Week 40, September 29-October 3


Week 40, September 29-October 3, 2025

Thursday:

  1. Deriving the Hartree-Fock equations
  2. Efficient ways of implementing the Hartree-Fock algorithm
  3. Video of lecture at https://youtu.be/Qkfm_OKLdb8
  4. Whiteboard notes at URL:https://github.com/ManyBodyPhysics/FYS4480/blob/master/doc/HandwrittenNotes/2025/FYS4480October2.pdf"

Friday:

  1. Stability of Hartree-Fock equations and Thouless' theorem
  2. Video of lecture at https://youtu.be/GoamgpAOvxE
  3. Whiteboard notes at https://github.com/ManyBodyPhysics/FYS4480/blob/master/doc/HandwrittenNotes/2024/FYS4480October3.pdf
  4. Lecture Material: These slides and Szabo and Ostlund, sections 3.1-3.4
  5. Seventh exercise set at https://github.com/ManyBodyPhysics/FYS4480/blob/master/doc/Exercises/2025/ExercisesWeek40.pdf

Why Hartree-Fock?

Hartree-Fock (HF) theory is an algorithm for finding an approximative expression for the ground state of a given Hamiltonian. The basic ingredients are

$$ \hat{h}^{\mathrm{HF}}\psi_{\alpha} = \varepsilon_{\alpha}\psi_{\alpha} $$

with the Hartree-Fock Hamiltonian defined as

$$ \hat{h}^{\mathrm{HF}}=\hat{t}+\hat{u}_{\mathrm{ext}}+\hat{u}^{\mathrm{HF}} $$

Why Hartree-Fock?

  1. The term \( \hat{u}^{\mathrm{HF}} \) is a single-particle potential to be determined by the HF algorithm.
  2. The HF algorithm means to choose \( \hat{u}^{\mathrm{HF}} \) in order to have
$$ \langle \hat{H} \rangle = E^{\mathrm{HF}}= \langle \Phi_0 | \hat{H}|\Phi_0 \rangle $$

that is to find a local minimum with a Slater determinant \( \Phi_0 \) being the ansatz for the ground state.

  1. The variational principle ensures that \( E^{\mathrm{HF}} \ge E_0 \), with \( E_0 \) the exact ground state energy.

Why Hartree-Fock theory

We will show that the Hartree-Fock Hamiltonian \( \hat{h}^{\mathrm{HF}} \) equals our definition of the operator \( \hat{f} \) discussed in connection with the new definition of the normal-ordered Hamiltonian (see later lectures), that is we have, for a specific matrix element

$$ \langle p |\hat{h}^{\mathrm{HF}}| q \rangle =\langle p |\hat{f}| q \rangle=\langle p|\hat{t}+\hat{u}_{\mathrm{ext}}|q \rangle +\sum_{i\le F} \langle pi | \hat{V} | qi\rangle_{AS}, $$

meaning that

$$ \langle p|\hat{u}^{\mathrm{HF}}|q\rangle = \sum_{i\le F} \langle pi | \hat{V} | qi\rangle_{AS}. $$

Why Hartree-Fock theory

The so-called Hartree-Fock potential \( \hat{u}^{\mathrm{HF}} \) brings an explicit medium dependence due to the summation over all single-particle states below the Fermi level \( F \). It brings also in an explicit dependence on the two-body interaction (in nuclear physics we can also have complicated three- or higher-body forces). The two-body interaction, with its contribution from the other bystanding fermions, creates an effective mean field in which a given fermion moves, in addition to the external potential \( \hat{u}_{\mathrm{ext}} \) which confines the motion of the fermion. For systems like nuclei, there is no external confining potential. Nuclei are examples of self-bound systems, where the binding arises due to the intrinsic nature of the strong force. For nuclear systems thus, there would be no external one-body potential in the Hartree-Fock Hamiltonian.

Variational Calculus and Lagrangian Multipliers

The calculus of variations involves problems where the quantity to be minimized or maximized is an integral.

In the general case we have an integral of the type

$$ E[\Phi]= \int_a^b f(\Phi(x),\frac{\partial \Phi}{\partial x},x)dx, $$

where \( E \) is the quantity which is sought minimized or maximized.

Variational Calculus and Lagrangian Multipliers

The problem is that although \( f \) is a function of the variables \( \Phi \), \( \partial \Phi/\partial x \) and \( x \), the exact dependence of \( \Phi \) on \( x \) is not known. This means again that even though the integral has fixed limits \( a \) and \( b \), the path of integration is not known. In our case the unknown quantities are the single-particle wave functions and we wish to choose an integration path which makes the functional \( E[\Phi] \) stationary. This means that we want to find minima, or maxima or saddle points. In physics we search normally for minima. Our task is therefore to find the minimum of \( E[\Phi] \) so that its variation \( \delta E \) is zero subject to specific constraints. In our case the constraints appear as the integral which expresses the orthogonality of the single-particle wave functions. The constraints can be treated via the technique of Lagrangian multipliers

Variational Calculus and Lagrangian Multipliers

Let us specialize to the expectation value of the energy for one particle in three-dimensions. This expectation value reads

$$ E=\int dxdydz \psi^*(x,y,z) \hat{H} \psi(x,y,z), $$

with the constraint

$$ \int dxdydz \psi^*(x,y,z) \psi(x,y,z)=1, $$

and a Hamiltonian

$$ \hat{H}=-\frac{1}{2}\nabla^2+V(x,y,z). $$

Variational Calculus and Lagrangian Multipliers

We will, for the sake of notational convenience, skip the variables \( x,y,z \) below, and write for example \( V(x,y,z)=V \).

The integral involving the kinetic energy can be written as, with the function \( \psi \) vanishing strongly for large values of \( x,y,z \) (given here by the limits \( a \) and \( b \)),

$$ \int_a^b dxdydz \psi^* \left(-\frac{1}{2}\nabla^2\right) \psi dxdydz = \psi^*\nabla\psi|_a^b+\int_a^b dxdydz\frac{1}{2}\nabla\psi^*\nabla\psi. $$

We will drop the limits \( a \) and \( b \) in the remaining discussion. Inserting this expression into the expectation value for the energy and taking the variational minimum we obtain

$$ \delta E = \delta \left\{\int dxdydz\left( \frac{1}{2}\nabla\psi^*\nabla\psi+V\psi^*\psi\right)\right\} = 0. $$

Variational Calculus and Lagrangian Multipliers

The constraint appears in integral form as

$$ \int dxdydz \psi^* \psi=\mathrm{constant}, $$

and multiplying with a Lagrangian multiplier \( \lambda \) and taking the variational minimum we obtain the final variational equation

$$ \delta \left\{\int dxdydz\left( \frac{1}{2}\nabla\psi^*\nabla\psi+V\psi^*\psi-\lambda\psi^*\psi\right)\right\} = 0. $$

Variational Calculus and Lagrangian Multipliers

We introduce the function \( f \)

$$ f = \frac{1}{2}\nabla\psi^*\nabla\psi+V\psi^*\psi-\lambda\psi^*\psi= \frac{1}{2}(\psi^*_x\psi_x+\psi^*_y\psi_y+\psi^*_z\psi_z)+V\psi^*\psi-\lambda\psi^*\psi, $$

where we have skipped the dependence on \( x,y,z \) and introduced the shorthand \( \psi_x \), \( \psi_y \) and \( \psi_z \) for the various derivatives.

For \( \psi^* \) the Euler-Lagrange equations yield

$$ \frac{\partial f}{\partial \psi^*}- \frac{\partial }{\partial x}\frac{\partial f}{\partial \psi^*_x}-\frac{\partial }{\partial y}\frac{\partial f}{\partial \psi^*_y}-\frac{\partial }{\partial z}\frac{\partial f}{\partial \psi^*_z}=0, $$

which results in

$$ -\frac{1}{2}(\psi_{xx}+\psi_{yy}+\psi_{zz})+V\psi=\lambda \psi. $$

Variational Calculus and Lagrangian Multipliers

We can then identify the Lagrangian multiplier as the energy of the system. The last equation is nothing but the standard Schroedinger equation and the variational approach discussed here provides a powerful method for obtaining approximate solutions of the wave function.

Deriving the Hartree-Fock equations

We will derive the Hartree-Fock equations by expanding the single-particle functions in a known basis and vary the coefficients, that is, the new single-particle wave function is written as a linear expansion in terms of a fixed chosen orthogonal basis (for example the well-known harmonic oscillator functions or the hydrogen-like functions etc). We define our new Hartree-Fock single-particle basis by performing a unitary transformation on our previous basis (labelled with greek indices) as

$$ \begin{equation} \psi_p^{HF} = \sum_{\lambda} C_{p\lambda}\phi_{\lambda}. \label{eq:newbasis} \end{equation} $$

In this case we vary the coefficients \( C_{p\lambda} \). If the basis has infinitely many solutions, we need to truncate the above sum. We assume that the basis \( \phi_{\lambda} \) is orthogonal.

Hartree-Fock by varying the coefficients of a wave function expansion

It is normal to choose a single-particle basis defined as the eigenfunctions of parts of the full Hamiltonian. The typical situation consists of the solutions of the one-body part of the Hamiltonian, that is we have

$$ \hat{h}_0\phi_{\lambda}=\epsilon_{\lambda}\phi_{\lambda}. $$

The single-particle wave functions \( \phi_{\lambda}(\mathbf{r}) \), defined by the quantum numbers \( \lambda \) and \( \mathbf{r} \) are defined as the overlap

$$ \phi_{\lambda}(\mathbf{r}) = \langle \mathbf{r} | \lambda \rangle . $$

Hartree-Fock by varying the coefficients of a wave function expansion

In deriving the Hartree-Fock equations, we will expand the single-particle functions in a known basis and vary the coefficients, that is, the new single-particle wave function is written as a linear expansion in terms of a fixed chosen orthogonal basis (for example the well-known harmonic oscillator functions or the hydrogen-like functions etc).

We stated that a unitary transformation keeps the orthogonality. To see this consider first a basis of vectors \( \mathbf{v}_i \),

$$ \mathbf{v}_i = \begin{bmatrix} v_{i1} \\ \dots \\ \dots \\v_{in} \end{bmatrix} $$

Hartree-Fock by varying the coefficients of a wave function expansion

We assume that the basis is orthogonal, that is

$$ \mathbf{v}_j^T\mathbf{v}_i = \delta_{ij}. $$

An orthogonal or unitary transformation

$$ \mathbf{w}_i=\mathbf{U}\mathbf{v}_i, $$

preserves the dot product and orthogonality since

$$ \mathbf{w}_j^T\mathbf{w}_i=(\mathbf{U}\mathbf{v}_j)^T\mathbf{U}\mathbf{v}_i=\mathbf{v}_j^T\mathbf{U}^T\mathbf{U}\mathbf{v}_i= \mathbf{v}_j^T\mathbf{v}_i = \delta_{ij}. $$

Hartree-Fock by varying the coefficients of a wave function expansion

This means that if the coefficients \( C_{p\lambda} \) belong to a unitary or orthogonal trasformation (using the Dirac bra-ket notation)

$$ \vert p\rangle = \sum_{\lambda} C_{p\lambda}\vert\lambda\rangle, $$

orthogonality is preserved, that is \( \langle \alpha \vert \beta\rangle = \delta_{\alpha\beta} \) and \( \langle p \vert q\rangle = \delta_{pq} \).

This propertry is extremely useful when we build up a basis of many-body Stater determinant based states.

Note also that although a basis \( \vert \alpha\rangle \) contains an infinity of states, for practical calculations we have always to make some truncations.

Hartree-Fock by varying the coefficients of a wave function expansion

Before we develop the Hartree-Fock equations, there is another very useful property of determinants that we will use both in connection with Hartree-Fock calculations. This applies also to our previous discussion on full configuration interaction theory.

Consider the following determinant

$$ \left| \begin{array}{cc} \alpha_1b_{11}+\alpha_2sb_{12}& a_{12}\\ \alpha_1b_{21}+\alpha_2b_{22}&a_{22}\end{array} \right|=\alpha_1\left|\begin{array}{cc} b_{11}& a_{12}\\ b_{21}&a_{22}\end{array} \right|+\alpha_2\left| \begin{array}{cc} b_{12}& a_{12}\\b_{22}&a_{22}\end{array} \right| $$

Hartree-Fock by varying the coefficients of a wave function expansion

We can generalize this to an \( n\times n \) matrix and have

$$ \left| \begin{array}{cccccc} a_{11}& a_{12} & \dots & \sum_{k=1}^n c_k b_{1k} &\dots & a_{1n}\\ a_{21}& a_{22} & \dots & \sum_{k=1}^n c_k b_{2k} &\dots & a_{2n}\\ \dots & \dots & \dots & \dots & \dots & \dots \\ \dots & \dots & \dots & \dots & \dots & \dots \\ a_{n1}& a_{n2} & \dots & \sum_{k=1}^n c_k b_{nk} &\dots & a_{nn}\end{array} \right|= \sum_{k=1}^n c_k\left| \begin{array}{cccccc} a_{11}& a_{12} & \dots & b_{1k} &\dots & a_{1n}\\ a_{21}& a_{22} & \dots & b_{2k} &\dots & a_{2n}\\ \dots & \dots & \dots & \dots & \dots & \dots\\ \dots & \dots & \dots & \dots & \dots & \dots\\ a_{n1}& a_{n2} & \dots & b_{nk} &\dots & a_{nn}\end{array} \right| . $$

This is a property we will use in our Hartree-Fock discussions.

Hartree-Fock by varying the coefficients of a wave function expansion

We can generalize the previous results, now with all elements \( a_{ij} \) being given as functions of linear combinations of various coefficients \( c \) and elements \( b_{ij} \),

$$ \left| \begin{array}{cccccc} \sum_{k=1}^n b_{1k}c_{k1}& \sum_{k=1}^n b_{1k}c_{k2} & \dots & \sum_{k=1}^n b_{1k}c_{kj} &\dots & \sum_{k=1}^n b_{1k}c_{kn}\\ \sum_{k=1}^n b_{2k}c_{k1}& \sum_{k=1}^n b_{2k}c_{k2} & \dots & \sum_{k=1}^n b_{2k}c_{kj} &\dots & \sum_{k=1}^n b_{2k}c_{kn}\\ \dots & \dots & \dots & \dots & \dots & \dots \\ \dots & \dots & \dots & \dots & \dots &\dots \\ \sum_{k=1}^n b_{nk}c_{k1}& \sum_{k=1}^n b_{nk}c_{k2} & \dots & \sum_{k=1}^n b_{nk}c_{kj} &\dots & \sum_{k=1}^n b_{nk}c_{kn}\end{array} \right|=det(\mathbf{C})det(\mathbf{B}), $$

where \( det(\mathbf{C}) \) and \( det(\mathbf{B}) \) are the determinants of \( n\times n \) matrices with elements \( c_{ij} \) and \( b_{ij} \) respectively. This is a property we will use in our Hartree-Fock discussions. Convince yourself about the correctness of the above expression by setting \( n=2 \).

Hartree-Fock by varying the coefficients of a wave function expansion

With our definition of the new basis in terms of an orthogonal basis we have

$$ \psi_p(x) = \sum_{\lambda} C_{p\lambda}\phi_{\lambda}(x). $$

If the coefficients \( C_{p\lambda} \) belong to an orthogonal or unitary matrix, the new basis is also orthogonal. Our Slater determinant in the new basis \( \psi_p(x) \) is written as

$$ \frac{1}{\sqrt{N!}} \left| \begin{array}{ccccc} \psi_{p}(x_1)& \psi_{p}(x_2)& \dots & \dots & \psi_{p}(x_N)\\ \psi_{q}(x_1)&\psi_{q}(x_2)& \dots & \dots & \psi_{q}(x_N)\\ \dots & \dots & \dots & \dots & \dots \\ \dots & \dots & \dots & \dots & \dots \\ \psi_{t}(x_1)&\psi_{t}(x_2)& \dots & \dots & \psi_{t}(x_N)\end{array} \right|=\frac{1}{\sqrt{N!}} \left| \begin{array}{ccccc} \sum_{\lambda} C_{p\lambda}\phi_{\lambda}(x_1)& \sum_{\lambda} C_{p\lambda}\phi_{\lambda}(x_2)& \dots & \dots & \sum_{\lambda} C_{p\lambda}\phi_{\lambda}(x_N)\\ \sum_{\lambda} C_{q\lambda}\phi_{\lambda}(x_1)&\sum_{\lambda} C_{q\lambda}\phi_{\lambda}(x_2)& \dots & \dots & \sum_{\lambda} C_{q\lambda}\phi_{\lambda}(x_N)\\ \dots & \dots & \dots & \dots & \dots \\ \dots & \dots & \dots & \dots & \dots \\ \sum_{\lambda} C_{t\lambda}\phi_{\lambda}(x_1)&\sum_{\lambda} C_{t\lambda}\phi_{\lambda}(x_2)& \dots & \dots & \sum_{\lambda} C_{t\lambda}\phi_{\lambda}(x_N)\end{array} \right|, $$

which is nothing but \( det(\mathbf{C})det(\Phi) \), with \( det(\Phi) \) being the determinant given by the basis functions \( \phi_{\lambda}(x) \).

Hartree-Fock by varying the coefficients of a wave function expansion

In our discussions hereafter we will use our definitions of single-particle states above and below the Fermi (\( F \)) level given by the labels \( ijkl\dots \le F \) for so-called single-hole states and \( abcd\dots > F \) for so-called particle states. For general single-particle states we employ the labels \( pqrs\dots \).

We have

$$ E[\Phi] = \sum_{\mu=1}^N \langle \mu | h | \mu \rangle + \frac{1}{2}\sum_{{\mu}=1}^N\sum_{{\nu}=1}^N \langle \mu\nu|\hat{v}|\mu\nu\rangle_{AS}, $$

we found the expression for the energy functional in terms of the basis function \( \phi_{\lambda}(\mathbf{r}) \). We then varied the above energy functional with respect to the basis functions \( |\mu \rangle \).

Hartree-Fock by varying the coefficients of a wave function expansion

Now we are interested in defining a new basis defined in terms of a chosen basis as defined in Eq. \eqref{eq:newbasis}. We can then rewrite the energy functional as

$$ \begin{equation} E[\Phi^{HF}] = \sum_{i=1}^N \langle i | h | i \rangle + \frac{1}{2}\sum_{ij=1}^N\langle ij|\hat{v}|ij\rangle_{AS}, \label{FunctionalEPhi2} \end{equation} $$

where \( \Phi^{HF} \) is the new Slater determinant defined by the new basis of Eq. \eqref{eq:newbasis}.

Hartree-Fock by varying the coefficients of a wave function expansion

Using Eq. \eqref{eq:newbasis} we can rewrite Eq. \eqref{FunctionalEPhi2} as

$$ \begin{equation} E[\Psi] = \sum_{i=1}^N \sum_{\alpha\beta} C^*_{i\alpha}C_{i\beta}\langle \alpha | h | \beta \rangle + \frac{1}{2}\sum_{ij=1}^N\sum_{{\alpha\beta\gamma\delta}} C^*_{i\alpha}C^*_{j\beta}C_{i\gamma}C_{j\delta}\langle \alpha\beta|\hat{v}|\gamma\delta\rangle_{AS}. \label{FunctionalEPhi3} \end{equation} $$

Hartree-Fock by varying the coefficients of a wave function expansion

We wish now to minimize the above functional. We introduce again a set of Lagrange multipliers, noting that since \( \langle i | j \rangle = \delta_{i,j} \) and \( \langle \alpha | \beta \rangle = \delta_{\alpha,\beta} \), the coefficients \( C_{i\gamma} \) obey the relation

$$ \langle i | j \rangle=\delta_{i,j}=\sum_{\alpha\beta} C^*_{i\alpha}C_{i\beta}\langle \alpha | \beta \rangle= \sum_{\alpha} C^*_{i\alpha}C_{i\alpha}, $$

which allows us to define a functional to be minimized that reads

$$ \begin{equation} F[\Phi^{HF}]=E[\Phi^{HF}] - \sum_{i=1}^N\epsilon_i\sum_{\alpha} C^*_{i\alpha}C_{i\alpha}. \label{_auto1} \end{equation} $$

Hartree-Fock by varying the coefficients of a wave function expansion

Minimizing with respect to \( C^*_{i\alpha} \), remembering that the equations for \( C^*_{i\alpha} \) and \( C_{i\alpha} \) can be written as two independent equations, we obtain

$$ \frac{d}{dC^*_{i\alpha}}\left[ E[\Phi^{HF}] - \sum_{j}\epsilon_j\sum_{\alpha} C^*_{j\alpha}C_{j\alpha}\right]=0, $$

which yields for every single-particle state \( i \) and index \( \alpha \) (recalling that the coefficients \( C_{i\alpha} \) are matrix elements of a unitary (or orthogonal for a real symmetric matrix) matrix) the following Hartree-Fock equations

$$ \sum_{\beta} C_{i\beta}\langle \alpha | h | \beta \rangle+ \sum_{j=1}^N\sum_{\beta\gamma\delta} C^*_{j\beta}C_{j\delta}C_{i\gamma}\langle \alpha\beta|\hat{v}|\gamma\delta\rangle_{AS}=\epsilon_i^{HF}C_{i\alpha}. $$

Hartree-Fock by varying the coefficients of a wave function expansion

We can rewrite this equation as (changing dummy variables)

$$ \sum_{\beta} \left\{\langle \alpha | h | \beta \rangle+ \sum_{j}^N\sum_{\gamma\delta} C^*_{j\gamma}C_{j\delta}\langle \alpha\gamma|\hat{v}|\beta\delta\rangle_{AS}\right\}C_{i\beta}=\epsilon_i^{HF}C_{i\alpha}. $$

Note that the sums over greek indices run over the number of basis set functions (in principle an infinite number).

Hartree-Fock by varying the coefficients of a wave function expansion

Defining

$$ h_{\alpha\beta}^{HF}=\langle \alpha | h | \beta \rangle+ \sum_{j=1}^N\sum_{\gamma\delta} C^*_{j\gamma}C_{j\delta}\langle \alpha\gamma|\hat{v}|\beta\delta\rangle_{AS}, $$

we can rewrite the new equations as

$$ \begin{equation} \sum_{\beta}h_{\alpha\beta}^{HF}C_{i\beta}=\epsilon_i^{HF}C_{i\alpha}. \label{eq:newhf} \end{equation} $$

The latter is nothing but a standard eigenvalue problem.

We see that we do not need to compute any integrals in an iterative procedure for solving the equations. It suffices to tabulate the matrix elements \( \langle \alpha | h | \beta \rangle \) and \( \langle \alpha\gamma|\hat{v}|\beta\delta\rangle_{AS} \) once and for all. Successive iterations require thus only a look-up in tables over one-body and two-body matrix elements. These details will be discussed below when we solve the Hartree-Fock equations numerical.

Hartree-Fock algorithm

Our Hartree-Fock matrix is thus

$$ \hat{h}_{\alpha\beta}^{HF}=\langle \alpha | \hat{h}_0 | \beta \rangle+ \sum_{j=1}^N\sum_{\gamma\delta} C^*_{j\gamma}C_{j\delta}\langle \alpha\gamma|\hat{v}|\beta\delta\rangle_{AS}. $$

The Hartree-Fock equations are solved in an iterative waym starting with a guess for the coefficients \( C_{j\gamma}=\delta_{j,\gamma} \) and solving the equations by diagonalization till the new single-particle energies \( \epsilon_i^{\mathrm{HF}} \) do not change anymore by a prefixed quantity.

Hartree-Fock by varying the coefficients of a wave function expansion

Normally we assume that the single-particle basis \( |\beta\rangle \) forms an eigenbasis for the operator \( \hat{h}_0 \), meaning that the Hartree-Fock matrix becomes

$$ \hat{h}_{\alpha\beta}^{HF}=\epsilon_{\alpha}\delta_{\alpha,\beta}+ \sum_{j=1}^N\sum_{\gamma\delta} C^*_{j\gamma}C_{j\delta}\langle \alpha\gamma|\hat{v}|\beta\delta\rangle_{AS}. $$

The Hartree-Fock eigenvalue problem

$$ \sum_{\beta}\hat{h}_{\alpha\beta}^{HF}C_{i\beta}=\epsilon_i^{\mathrm{HF}}C_{i\alpha}, $$

can be written out in a more compact form as

$$ \hat{h}^{HF}\hat{C}=\epsilon^{\mathrm{HF}}\hat{C}. $$

Hartree-Fock by varying the coefficients of a wave function expansion

The Hartree-Fock equations are, in their simplest form, solved in an iterative way, starting with a guess for the coefficients \( C_{i\alpha} \). We label the coefficients as \( C_{i\alpha}^{(n)} \), where the subscript \( n \) stands for iteration \( n \). To set up the algorithm we can proceed as follows:

$$ \hat{h}_{\alpha\beta}^{HF}=\epsilon_{\alpha}\delta_{\alpha,\beta}+ \sum_{j = 1}^N\sum_{\gamma\delta} C_{j\gamma}^{(0)}C_{j\delta}^{(0)}\langle \alpha\gamma|\hat{v}|\beta\delta\rangle_{AS}. $$

Hartree-Fock by varying the coefficients of a wave function expansion

Solving the Hartree-Fock eigenvalue problem yields then new eigenvectors \( C_{i\alpha}^{(1)} \) and eigenvalues \( \epsilon_i^{HF(1)} \).

$$ \sum_{j = 1}^N\sum_{\gamma\delta} C_{j\gamma}^{(1)}C_{j\delta}^{(1)}\langle \alpha\gamma|\hat{v}|\beta\delta\rangle_{AS}. $$

The diagonalization with the new Hartree-Fock potential yields new eigenvectors and eigenvalues. This process is continued till for example

$$ \frac{\sum_{p} |\epsilon_i^{(n)}-\epsilon_i^{(n-1)}|}{m} \le \lambda, $$

where \( \lambda \) is a user prefixed quantity (\( \lambda \sim 10^{-8} \) or smaller) and \( p \) runs over all calculated single-particle energies and \( m \) is the number of single-particle states.

Using the density matrix

The equations are often rewritten in terms of a so-called density matrix, which is defined as

$$ \begin{equation} \rho_{\gamma\delta}=\sum_{i=1}^{N}\langle\gamma|i\rangle\langle i|\delta\rangle = \sum_{i=1}^{N}C_{i\gamma}C^*_{i\delta}. \label{_auto2} \end{equation} $$

It means that we can rewrite the Hartree-Fock Hamiltonian as

$$ \hat{h}_{\alpha\beta}^{HF}=\epsilon_{\alpha}\delta_{\alpha,\beta}+ \sum_{\gamma\delta} \rho_{\gamma\delta}\langle \alpha\gamma|V|\beta\delta\rangle_{AS}. $$

It is convenient to use the density matrix since we can precalculate in every iteration the product of two eigenvector components \( C \).

Code example

import numpy as np
class HartreeFock:
    def __init__(self, num_electrons, num_orbitals):
        self.num_electrons = num_electrons
        self.num_orbitals = num_orbitals
	# You would need to replace these by proper integrals
        self.h = np.random.rand(num_orbitals, num_orbitals)  # One-electron integrals
        self.coulomb = np.random.rand(num_orbitals, num_orbitals, num_orbitals, num_orbitals)  # Two-electron integrals
    def build_fock_matrix(self, density_matrix):
        fock_matrix = self.h.copy()
        for i in range(self.num_orbitals):
            for j in range(self.num_orbitals):
                fock_matrix[i, j] += np.sum(density_matrix * self.coulomb[i, j])
        return fock_matrix
    def build_density_matrix(self, coefficients):
        density_matrix = np.zeros((self.num_orbitals, self.num_orbitals))
        for i in range(self.num_electrons):
            density_matrix += np.outer(coefficients[:, i], coefficients[:, i])
        return density_matrix
    def diagonalize(self, fock_matrix):
        energy, coefficients = np.linalg.eigh(fock_matrix)
        return energy, coefficients
    def run(self, max_iter=100, tol=1e-6):
        coeffs = np.zeros((self.num_orbitals, self.num_electrons))
        density_matrix = np.zeros((self.num_orbitals, self.num_orbitals))
        for iteration in range(max_iter):
            fock_matrix = self.build_fock_matrix(density_matrix)
            energies, coeffs = self.diagonalize(fock_matrix)
            
            new_density_matrix = self.build_density_matrix(coeffs)
            if np.linalg.norm(new_density_matrix - density_matrix) < tol:
                print(f"Converged in {iteration} iterations")
                break
            density_matrix = new_density_matrix
        return energies, coeffs
# Example usage
if __name__ == "__main__":
    num_electrons = 2
    num_orbitals = 4
    hf = HartreeFock(num_electrons, num_orbitals)
    energies, coefficients = hf.run()
    print("Final energies:", energies)
    print("Final coefficients:", coefficients)

Hartree-Fock in second quantization and stability of HF solution

We wish now to derive the Hartree-Fock equations using our second-quantized formalism and study the stability of the equations. Our ansatz for the ground state of the system is approximated as (this is our representation of a Slater determinant in second quantization)

$$ |\Phi_0\rangle = |c\rangle = a^{\dagger}_i a^{\dagger}_j \dots a^{\dagger}_l|0\rangle. $$

We wish to determine \( \hat{u}^{HF} \) so that \( E_0^{HF}= \langle c|\hat{H}| c\rangle \) becomes a local minimum.

In our analysis here we will need Thouless' theorem, which states that an arbitrary Slater determinant \( |c'\rangle \) which is not orthogonal to a determinant \( | c\rangle ={\displaystyle\prod_{i=1}^{n}} a_{\alpha_{i}}^{\dagger}|0\rangle \), can be written as

$$ |c'\rangle=exp\left\{\sum_{a>F}\sum_{i\le F}C_{ai}a_{a}^{\dagger}a_{i}\right\}| c\rangle $$

Thouless' theorem

Let us give a simple proof of Thouless' theorem. The theorem states that we can make a linear combination av particle-hole excitations with respect to a given reference state \( \vert c\rangle \). With this linear combination, we can make a new Slater determinant \( \vert c'\rangle \) which is not orthogonal to \( \vert c\rangle \), that is

$$ \langle c|c'\rangle \ne 0. $$

To show this we need some intermediate steps. The exponential product of two operators \( \exp{\hat{A}}\times\exp{\hat{B}} \) is equal to \( \exp{(\hat{A}+\hat{B})} \) only if the two operators commute, that is

$$ [\hat{A},\hat{B}] = 0. $$

Thouless' theorem

If the operators do not commute, we need to resort to the Baker-Campbell-Hauersdorf. This relation states that

$$ \exp{\hat{C}}=\exp{\hat{A}}\exp{\hat{B}}, $$

with

$$ \hat{C}=\hat{A}+\hat{B}+\frac{1}{2}[\hat{A},\hat{B}]+\frac{1}{12}[[\hat{A},\hat{B}],\hat{B}]-\frac{1}{12}[[\hat{A},\hat{B}],\hat{A}]+\dots $$

Thouless' theorem

From these relations, we note that in our expression for \( |c'\rangle \) we have commutators of the type

$$ [a_{a}^{\dagger}a_{i},a_{b}^{\dagger}a_{j}], $$

and it is easy to convince oneself that these commutators, or higher powers thereof, are all zero. This means that we can write out our new representation of a Slater determinant as

$$ |c'\rangle=exp\left\{\sum_{a>F}\sum_{i\le F}C_{ai}a_{a}^{\dagger}a_{i}\right\}| c\rangle=\prod_{i}\left\{1+\sum_{a>F}C_{ai}a_{a}^{\dagger}a_{i}+\left(\sum_{a>F}C_{ai}a_{a}^{\dagger}a_{i}\right)^2+\dots\right\}| c\rangle $$

Thouless' theorem

We note that

$$ \prod_{i}\sum_{a>F}C_{ai}a_{a}^{\dagger}a_{i}\sum_{b>F}C_{bi}a_{b}^{\dagger}a_{i}| c\rangle =0, $$

and all higher-order powers of these combinations of creation and annihilation operators disappear due to the fact that \( (a_i)^n| c\rangle =0 \) when \( n > 1 \). This allows us to rewrite the expression for \( |c'\rangle \) as

$$ |c'\rangle=\prod_{i}\left\{1+\sum_{a>F}C_{ai}a_{a}^{\dagger}a_{i}\right\}| c\rangle, $$

which we can rewrite as

$$ |c'\rangle=\prod_{i}\left\{1+\sum_{a>F}C_{ai}a_{a}^{\dagger}a_{i}\right\}| a^{\dagger}_{i_1} a^{\dagger}_{i_2} \dots a^{\dagger}_{i_n}|0\rangle. $$

Thouless' theorem

The last equation can be written as

$$ \begin{align} |c'\rangle&=\prod_{i}\left\{1+\sum_{a>F}C_{ai}a_{a}^{\dagger}a_{i}\right\}| a^{\dagger}_{i_1} a^{\dagger}_{i_2} \dots a^{\dagger}_{i_n}|0\rangle=\left(1+\sum_{a>F}C_{ai_1}a_{a}^{\dagger}a_{i_1}\right)a^{\dagger}_{i_1} \label{_auto3}\\ & \times\left(1+\sum_{a>F}C_{ai_2}a_{a}^{\dagger}a_{i_2}\right)a^{\dagger}_{i_2} \dots |0\rangle=\prod_{i}\left(a^{\dagger}_{i}+\sum_{a>F}C_{ai}a_{a}^{\dagger}\right)|0\rangle. \label{_auto4} \end{align} $$

New operators

If we define a new creation operator

$$ \begin{equation} b^{\dagger}_{i}=a^{\dagger}_{i}+\sum_{a>F}C_{ai}a_{a}^{\dagger}, \label{eq:newb} \end{equation} $$

we have

$$ |c'\rangle=\prod_{i}b^{\dagger}_{i}|0\rangle=\prod_{i}\left(a^{\dagger}_{i}+\sum_{a>F}C_{ai}a_{a}^{\dagger}\right)|0\rangle, $$

meaning that the new representation of the Slater determinant in second quantization, \( |c'\rangle \), looks like our previous ones. However, this representation is not general enough since we have a restriction on the sum over single-particle states in Eq. \eqref{eq:newb}. The single-particle states have all to be above the Fermi level.

Thouless' theorem

The question then is whether we can construct a general representation of a Slater determinant with a creation operator

$$ \tilde{b}^{\dagger}_{i}=\sum_{p}f_{ip}a_{p}^{\dagger}, $$

where \( f_{ip} \) is a matrix element of a unitary matrix which transforms our creation and annihilation operators \( a^{\dagger} \) and \( a \) to \( \tilde{b}^{\dagger} \) and \( \tilde{b} \). These new operators define a new representation of a Slater determinant as

$$ |\tilde{c}\rangle=\prod_{i}\tilde{b}^{\dagger}_{i}|0\rangle. $$

Showing that \( |\tilde{c}\rangle= |c'\rangle \)

We need to show that \( |\tilde{c}\rangle= |c'\rangle \). We need also to assume that the new state is not orthogonal to \( |c\rangle \), that is \( \langle c| \tilde{c}\rangle \ne 0 \). From this it follows that

$$ \langle c| \tilde{c}\rangle=\langle 0| a_{i_n}\dots a_{i_1}\left(\sum_{p=i_1}^{i_n}f_{i_1p}a_{p}^{\dagger} \right)\left(\sum_{q=i_1}^{i_n}f_{i_2q}a_{q}^{\dagger} \right)\dots \left(\sum_{t=i_1}^{i_n}f_{i_nt}a_{t}^{\dagger} \right)|0\rangle, $$

which is nothing but the determinant \( det(f_{ip}) \) which we can, using the intermediate normalization condition, normalize to one, that is

$$ det(f_{ip})=1, $$

meaning that \( f \) has an inverse defined as (since we are dealing with orthogonal, and in our case unitary as well, transformations)

$$ \sum_{k} f_{ik}f^{-1}_{kj} = \delta_{ij}, $$

and

$$ \sum_{j} f^{-1}_{ij}f_{jk} = \delta_{ik}. $$

Thouless' theorem

Using these relations we can then define the linear combination of creation (and annihilation as well) operators as

$$ \sum_{i}f^{-1}_{ki}\tilde{b}^{\dagger}_{i}=\sum_{i}f^{-1}_{ki}\sum_{p=i_1}^{\infty}f_{ip}a_{p}^{\dagger}=a_{k}^{\dagger}+\sum_{i}\sum_{p=i_{n+1}}^{\infty}f^{-1}_{ki}f_{ip}a_{p}^{\dagger}. $$

Defining

$$ c_{kp}=\sum_{i \le F}f^{-1}_{ki}f_{ip}, $$

we can redefine

$$ a_{k}^{\dagger}+\sum_{i}\sum_{p=i_{n+1}}^{\infty}f^{-1}_{ki}f_{ip}a_{p}^{\dagger}=a_{k}^{\dagger}+\sum_{p=i_{n+1}}^{\infty}c_{kp}a_{p}^{\dagger}=b_k^{\dagger}, $$

our starting point.

Thouless' theorem

We have shown that our general representation of a Slater determinant

$$ |\tilde{c}\rangle=\prod_{i}\tilde{b}^{\dagger}_{i}|0\rangle=|c'\rangle=\prod_{i}b^{\dagger}_{i}|0\rangle, $$

with

$$ b_k^{\dagger}=a_{k}^{\dagger}+\sum_{p=i_{n+1}}^{\infty}c_{kp}a_{p}^{\dagger}. $$

Thouless' theorem

This means that we can actually write an ansatz for the ground state of the system as a linear combination of terms which contain the ansatz itself \( |c\rangle \) with an admixture from an infinity of one-particle-one-hole states. The latter has important consequences when we wish to interpret the Hartree-Fock equations and their stability. We can rewrite the new representation as

$$ |c'\rangle = |c\rangle+|\delta c\rangle, $$

where \( |\delta c\rangle \) can now be interpreted as a small variation. If we approximate this term with contributions from one-particle-one-hole (1p-1h) states only, we arrive at

$$ |c'\rangle = \left(1+\sum_{ai}\delta C_{ai}a_{a}^{\dagger}a_i\right)|c\rangle. $$

Thouless' theorem

In our derivation of the Hartree-Fock equations we have shown that

$$ \langle \delta c| \hat{H} | c\rangle =0, $$

which means that we have to satisfy

$$ \langle c|\sum_{ai}\delta C_{ai}\left\{a_{a}^{\dagger}a_i\right\} \hat{H} | c\rangle =0. $$

With this as a background, we are now ready to study the stability of the Hartree-Fock equations. This is the topic for week 40.

Hartree-Fock in second quantization and stability of HF solution

The variational condition for deriving the Hartree-Fock equations guarantees only that the expectation value \( \langle c | \hat{H} | c \rangle \) has an extreme value, not necessarily a minimum. To figure out whether the extreme value we have found is a minimum, we can use second quantization to analyze our results and find a criterion for the above expectation value to a local minimum. We will use Thouless' theorem and show that

$$ \frac{\langle c' |\hat{H} | c'\rangle}{\langle c' |c'\rangle} \ge \langle c |\hat{H} | c\rangle= E_0, $$

with

$$ {|c'\rangle} = {|c\rangle + |\delta c\rangle}. $$

Using Thouless' theorem we can write out \( |c'\rangle \) as

$$ \begin{align} {|c'\rangle}&=\exp\left\{\sum_{a > F}\sum_{i \le F}\delta C_{ai}a_{a}^{\dagger}a_{i}\right\}| c\rangle \label{_auto5}\\ &=\left\{1+\sum_{a > F}\sum_{i \le F}\delta C_{ai}a_{a}^{\dagger} a_{i}+\frac{1}{2!}\sum_{ab > F}\sum_{ij \le F}\delta C_{ai}\delta C_{bj}a_{a}^{\dagger}a_{i}a_{b}^{\dagger}a_{j}+\dots\right\} \label{_auto6} \end{align} $$

where the amplitudes \( \delta C \) are small.

The norm of \( |c'\rangle \) is given by (using the intermediate normalization condition \( \langle c' |c\rangle=1 \))

$$ \langle c' | c'\rangle = 1+\sum_{a>F} \sum_{i\le F}|\delta C_{ai}|^2+O(\delta C_{ai}^3). $$

The expectation value for the energy is now given by (using the Hartree-Fock condition)

$$ \langle c' |\hat{H} | c'\rangle=\langle c |\hat{H} | c\rangle + \sum_{ab>F} \sum_{ij\le F}\delta C_{ai}^*\delta C_{bj}\langle c |a_{i}^{\dagger}a_{a}\hat{H}a_{b}^{\dagger}a_{j}|c\rangle+ $$ $$ \frac{1}{2!}\sum_{ab>F} \sum_{ij\le F}\delta C_{ai}\delta C_{bj}\langle c |\hat{H}a_{a}^{\dagger}a_{i}a_{b}^{\dagger}a_{j}|c\rangle+\frac{1}{2!}\sum_{ab>F} \sum_{ij\le F}\delta C_{ai}^*\delta C_{bj}^*\langle c|a_{j}^{\dagger}a_{b}a_{i}^{\dagger}a_{a}\hat{H}|c\rangle +\dots $$

We have already calculated the second term on the right-hand side of the previous equation

$$ \begin{align} \langle c | \left(\{a^\dagger_i a_a\} \hat{H} \{a^\dagger_b a_j\} \right) | c\rangle&=\sum_{pq} \sum_{ijab}\delta C_{ai}^*\delta C_{bj} \langle p|\hat{h}_0 |q\rangle \langle c | \left(\{a^{\dagger}_i a_a\}\{a^{\dagger}_pa_q\} \{a^{\dagger}_b a_j\} \right)| c\rangle \label{_auto7}\\ & +\frac{1}{4} \sum_{pqrs} \sum_{ijab}\delta C_{ai}^*\delta C_{bj} \langle pq| \hat{v}|rs\rangle \langle c | \left(\{a^\dagger_i a_a\}\{a^{\dagger}_p a^{\dagger}_q a_s a_r\} \{a^{\dagger}_b a_j\} \right)| c\rangle , \label{_auto8} \end{align} $$

resulting in

$$ E_0\sum_{ai}|\delta C_{ai}|^2+\sum_{ai}|\delta C_{ai}|^2(\varepsilon_a-\varepsilon_i)-\sum_{ijab} \langle aj|\hat{v}| bi\rangle \delta C_{ai}^*\delta C_{bj}. $$ $$ \frac{1}{2!}\langle c |\left(\{a^\dagger_j a_b\} \{a^\dagger_i a_a\} \hat{V}_N \right) | c\rangle = \frac{1}{2!}\langle c |\left( \hat{V}_N \{a^\dagger_a a_i\} \{a^\dagger_b a_j\} \right)^{\dagger} | c\rangle $$

which is nothing but

$$ \frac{1}{2!}\langle c | \left( \hat{V}_N \{a^\dagger_a a_i\} \{a^\dagger_b a_j\} \right) | c\rangle^* =\frac{1}{2} \sum_{ijab} (\langle ij|\hat{v}|ab\rangle)^*\delta C_{ai}^*\delta C_{bj}^* $$

or

$$ \frac{1}{2} \sum_{ijab} (\langle ab|\hat{v}|ij\rangle)\delta C_{ai}^*\delta C_{bj}^* $$

where we have used the relation

$$ \langle a |\hat{A} | b\rangle = (\langle b |\hat{A}^{\dagger} | a\rangle)^* $$

due to the hermiticity of \( \hat{H} \) and \( \hat{V} \).

We define two matrix elements

$$ A_{ai,bj}=-\langle aj|\hat{v} bi\rangle $$

and

$$ B_{ai,bj}=\langle ab|\hat{v}|ij\rangle $$

both being anti-symmetrized.

With these definitions we write out the energy as

$$ \begin{align} \langle c'|H|c'\rangle& = \left(1+\sum_{ai}|\delta C_{ai}|^2\right)\langle c |H|c\rangle+\sum_{ai}|\delta C_{ai}|^2(\varepsilon_a^{HF}-\varepsilon_i^{HF})+\sum_{ijab}A_{ai,bj}\delta C_{ai}^*\delta C_{bj}+ \label{_auto9}\\ &\frac{1}{2} \sum_{ijab} B_{ai,bj}^*\delta C_{ai}\delta C_{bj}+\frac{1}{2} \sum_{ijab} B_{ai,bj}\delta C_{ai}^*\delta C_{bj}^* +O(\delta C_{ai}^3), \label{_auto10} \end{align} $$

which can be rewritten as

$$ \langle c'|H|c'\rangle = \left(1+\sum_{ai}|\delta C_{ai}|^2\right)\langle c |H|c\rangle+\Delta E+O(\delta C_{ai}^3), $$

and skipping higher-order terms we arrived

$$ \frac{\langle c' |\hat{H} | c'\rangle}{\langle c' |c'\rangle} =E_0+\frac{\Delta E}{\left(1+\sum_{ai}|\delta C_{ai}|^2\right)}. $$

We have defined

$$ \Delta E = \frac{1}{2} \langle \chi | \hat{M}| \chi \rangle $$

with the vectors

$$ \chi = \left[ \delta C\hspace{0.2cm} \delta C^*\right]^T $$

and the matrix

$$ \hat{M}=\left(\begin{array}{cc} \Delta + A & B \\ B^* & \Delta + A^*\end{array}\right), $$

with \( \Delta_{ai,bj} = (\varepsilon_a-\varepsilon_i)\delta_{ab}\delta_{ij} \).

The condition

$$ \Delta E = \frac{1}{2} \langle \chi | \hat{M}| \chi \rangle \ge 0 $$

for an arbitrary vector

$$ \chi = \left[ \delta C\hspace{0.2cm} \delta C^*\right]^T $$

means that all eigenvalues of the matrix have to be larger than or equal zero. A necessary (but no sufficient) condition is that the matrix elements (for all \( ai \) )

$$ (\varepsilon_a-\varepsilon_i)\delta_{ab}\delta_{ij}+A_{ai,bj} \ge 0. $$

This equation can be used as a first test of the stability of the Hartree-Fock equation.

© 1999-2025, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license