Table of Contents
Changes to this chapter were last made on 27 February 2005.
In Section 3.1 we described a fictitious system of noninteracting electrons in which a Slater determinant of spin-orbitals would be an exact solution. A more realistic molecular Hamiltonian operator representing a system of N electrons bound to M nuclei could include more than thirty-two terms all together [Brown, p. 118]. As the next step toward improved accuracy, however, we will consider the Hamiltonian operator written as (in S.I. units)
and in atomic units (a.u.) it is given by
The first term is the kinetic energy of the electrons, the second term is the kinetic energy of the nuclei, the third term is the electron-nucleus attraction energy, the fourth term is the electron-electron repulsion energy, and the last term is the nuclear repulsion energy. The double sums in the last two potential energy terms run over both sets of indices (i,j and A,B, respectively) excluding the self interaction terms and the factor of ½ is to prevent double counting (This can also be expressed with relational operator < in the sum instead of and no factor of ½).
At this point, we will apply the Born-Oppenheimer approximation and assume that the positions of the nuclei can be treated as though they are fixed relative to the faster moving electrons. In this approximation, the nuclear repulsion energy can be calculated separately from the electronic energy. In the first demonstration program, freeMQM-1.cpp, for example, the last step of the energy calculation is the adding of the nuclear repulsion energy to the electronic energy to obtain the total energy. The Hamiltonian that describes just the electronic degrees of freedom, without the kinetic and repulsion energy of the nuclei, is simply (in a.u.)
The last term in Eq. (5.3),
describes the electron-electron interactions; it is a nonlocal two-electron operator which prevents a single Slater determinant from being an exact solution to the many-body Schrödinger equation. Both the Hartree-Fock method and density-functional theory are approaches to solving the many-body problem which involve a transformation of the two-body operator into an effective one-body operator. In the Hartree-Fock theory this effective one-body operator will remain nonlocal, but in Kohn-Sham theory will be transformed into a local one-body operator.
In principle, we are interested in solving an eigenvalue problem of the form
where the total energy E can be written as a functional of the N-electron wavefunction
and in what follows we will assume that Ψ is normalized, . The symbol represents the integration metric over all spatial and spin coordinates
where, following convention, we have used the notation
to denote the combined spatial and spin coordinates. The notation for integration over the combined coordinate is given by
In practice, is expanded as a product of orthonormal one-electron spin-orbitals , as described in Section 3.3, and an energy minimization procedure will lead to an approximate solution. For a noninteracting system of electrons, the total energy can be easily calculated by using the following equation for the matrix elements of an arbitrary single-particle operator [Negele, p. 9]
and and are sets of single-particle states used to construct the many-body wavefunction. operates on a direct product space
and operates on , the subspace of the ith electron. By using Eq. (5.10), it is easy to see that the energy expectation value of the Hamiltonian operator of Section 3.1, describing a system of N noninteracting electrons, is simply the sum of the one-electron energies
If the Hamiltonian includes a two-electron operator, , then we can use the following expression to calculate its matrix elements
where and are sets of single-particle states used to construct the many-body wavefunction.
and the Coulomb integrals are given by
and the exchange integrals are
where the fact that has been used to include i = j in the sum. This is one point that must be kept in mind when trying to understand the physical meaning the energies being calculated. One may obtain, for example, one-electron atoms with a nonzero electron-electron repulsion energy and two electron atoms or molecules with a nonzero ground state exchange energy. Thus, caution must be exercised to be sure that no net self-interaction energy exists. In Hartree-Fock theory the self-interaction from the Coulomb contribution should be cancelled by exchange terms [Szabo,pp.86,135,210; Leach,p.51], but in density-function theory this kind of cancellation may require additional effort [Parr, p.181].[Back to Table of Contents] [Top of Chapter 5] [scienceelearning.org]
The Rayleigh-Ritz variational method tells us that a stationary value of the equation
will yield the solution to the eigenvalue problem in Eq. (5.5). In other words, we want to find a Ψ such that
with the constraint being the orthonormality of the orbitals
and the Lagrange multipliers, , form a Hermitian matrix, , [Szabo, p.118; Leach, p. 52]. If a solution to the stationary value problem exists, then it must satisfy the Euler-Lagrange equation, expressed here as a functional derivative
Using the definition of the functional derivative
applied to an arbitrary functional in three-dimensions
one can obtain the following expression for the functional derivative
where f is a function of y(r) and its derivatives . If we now apply the functional derivative to the various terms in Eq. (5.25), rewritten here in its expanded form,
respectively. Finally, for the last term we have
Collecting the terms together gives us the Hartree-Fock equations
where the Fock operator is given by
and the "core" Hamiltonian operator is defined as
being the Coulomb operator, and the exchange operator is
If we define the Hartree-Fock potential operator of the ith electron as
then the Fock operator can then be written as
where we have used the short-hand notation to label the coordinate of the ith electron. We can see that the electron-electron repulsion operator has been transformed into an effective one-electron operator in which is the average repulsive field experienced by the ith electron due to all the other electrons in the system.
A unitary transformation (i.e. ) allows us to diagonalize the matrix of Lagrange multipliers and write the Hartree-Fock equations in their canonical form
where the Hartree-Fock orbital energies are given by
By comparing Eq. (5.15) and Eq. (5.43), it can be seen that the Coulomb and exchange terms picked up an additional factor of two in the derivation of the Hartree-Fock equations. This additional contribution is because the sum of the orbital energies counts the electron-electron interactions twice and must be corrected for in the calculation of the total energy [Szabo, p. 125]. Thus, the total energy is
[Back to Table of Contents] [Top of Chapter 5] [scienceelearning.org]
One method of solving the Hartree-Fock equations is to expand the spatial part of the orbitals with a set of K basis functions ,
where the could represent any complete set of basis functions, but preferably they will be good approximations to the atomic orbitals so that a small subset will give reasonable results. A finite set of Slater-type orbitals (STO) or Gaussian type functions (GTF) [Szabo,p.153] are two common choices. For the moment, we will restrict ourselves to GTF's, which take the following form
where N is a normalization constant and L = l + m + n is used to identify Gaussian function as being s-, p-, d-, or f-type, etc., for L = 0, 1, 2, 3...(s, p, d, f,...), respectively. We will also use the notation that Greek letters μ, ν, σ, λ, etc., will be used to label the basis functions and Latin letters i, j, k,, etc., will label the orbitals, such as in Eq. (5.45) where the orbitals are expanded as a linear combination of the basis functions.
in the closed-shell restricted Hartree-Fock (RHF) formalism, where F is the Fock matrix, C is the matrix of molecular orbital coefficients, S is the overlap matrix, and is the diagonal matrix of orbital energies.
We will only mention at this point that the Roothaan-Hall equations are a special case valid for closed-shell systems in which , where, , labels the spin-up electrons, and labels the spin-down electrons. The generalization of the Roothaan-Hall equations are the Pople-Nesbet equations
valid for open-shell unrestricted spin-orbitals, and in this case the Fock matrix can be written as
for spin-up electrons ( ), with a similar expression for spin-down electrons ( ). J-K is the two-electron repulsion contribution to Fock matrix, with J being the Coulomb part and K is the exchange contribution. It should be noted that in density-functional theory (DFT), K will not be included in the Fock matrix; instead, the exchange terms will be accounted for by contributions from an exchange functional. Similarly, electron correlations, that is, the tendency of electrons to avoid each other, are not included in the Hartree-Fock approximation. In fact, the electron correlation energy is defined as the difference between the exact energy and the Hartree-Fock-limit energy
In DFT the electron correlation energy will be accounted for by a contribution from a correlation functional.
In the rest of this chapter, we will begin to work toward our first example problem, and for the sake of simplicity we will consider only closed-shell systems in the restricted Hartree-Fock formalism and not show the explicit spin dependence. In later chapters, however, spin degrees of freedom will need to be explicitly included in our discussion of excited states and optical processes. The Fock matrix for a closed-shell system expressed in terms of our basis functions is
and the overlap matrix S is
Here we have defined a "core" Hamiltonian as
The "core" part of the Fock matrix does not depend on the values of the expansion coefficients, , and remains constant throughout SCF energy minimization procedure. The matrix [Szabo,p.141; Thijssen,p.75] does depend on the expansion coefficients, and it includes contributions from both the Coulomb repulsion matrix and the exchange matrix
where the factor of two results from the assumption that we are dealing with a closed-shell system [Szabo,p.84]. The Coulomb and exchange matrices are related to the two-electron integrals as follows [Leach,p.58; Koch,p.96]
and again the factor of one-half is a result of the factor of two in our definition of the density matrix in the closed-shell restricted Hartree-Fock formalism
The two-electron integrals are given by
The two-electron integrals should not be confused with an overlap integral and following convention Greek letters , etc., will be used to label the basis functions and Latin letters i, j, k, etc., will label orbitals.
We are now ready to solve the Roothaan-Hall equations and calculate the orbital energies , the expansion coefficients , and the total energy E. To do this we will implement the self-consistent field (SCF) procedure as follows:
First, calculate all the matrix elements that remain constant throughout the calculation and are not changed by the SCF energy minimization procedure. These include the overlap matrix S, , , and V. The matrix V diagonalizes the overlap matrix, i.e.,
Make an initial guess for the coefficients, e.g.,
Using the coefficients , calculate the matrix G and add it to to obtain the Fock matrix F.
Calculate the matrix , and solve for the eigenvalues and eigenvectors. ε is a diagonal matrix containing the orbital energies, and C' is the matrix of new coefficients containing the eigenvectors in rows or columns, depending on whether one is programming in C/C++ or Fortran.
Perform the transformation back to the original basis At this point, we should be sure that C†SC=I, and C†FC should be diagonal.
Compare the total energy to the previous value, and if the difference is significant, repeat the procedures starting from step 3. At this point, one may also calculate the total energy using the new .
The results of Clementi and Davis  and Saunders  were used in the program to calculate the overlap matrix , the kinetic energy matrix , the electron-nucleus attraction energy matrix , and the two-electron repulsion energy matrix . is calculated by the function Smatrix, KE calculates the kinetic energy matrix , is calculated by the function e_nucl, is calculated by the function ERI, and the matrix elements are calculated by CalcHMatrix.[Back to Table of Contents] [Top of Chapter 5] [scienceelearning.org]
will not, in general, be eigenstates of the orbital angular momentum operators ; however, linear combinations of the Gaussians can be used to create functions of the form [Levine,p.463]
and, of course, a spherical form of the GTF can be written as
which are simultaneous eigenfunctions of . The real part of the spherical Gaussians can be obtained from
a form that closely resembles the STOs used to describe nonlinear molecules, i.e.,
The goal, however, is not to construct an eigenstate of the orbital angular momentum operators, which will not be possible for most molecules in the first place; rather it is to find an accurate solution to the Schrödinger equation using the minimum number of basis functions. For molecules, this will often require Gaussians with L-values that account for the properties of the constituent atoms.
The Cartesian GTFs can be further generalized to be used as part of a contracted basis set; these contracted Gaussian functions (CGF)[Szabo,p.155] are written as
where the dpμ are the contraction coefficients for a given CGF, and are the primitive Gaussian functions, which, in the case of CGFs, have the more general form
The functions in Eq. (5.54) are the kind used in the first example program, freeMQM-1.cpp. In Eq. (5.54), the constants carry the double indices of matrices, but in the example program freeMQM-1.cpp they will be stored as one-dimensional arrays. is the total-electronic-orbital-angular momentum quantum number of the atomic orbital represented by the CGF and should not be confused with the number of primitive Gaussian functions, also labeled L, used in the expansion of the CGF. In terms of the primitive Gaussian functions, the molecular orbitals now can be written as
The first example program freeMQM-1.cpp only offers three choices of basis sets: one non-contracted basis, 6-31G*, and 6-31G**. The non-contracted basis has the same exponents as the contracted s-type functions used in 6-31G* and 6-31G**. For both the hydrogen and helium atoms, the difference between 6-31G* and 6-31G** is that 6-31G** includes a single set of p-type polarization functions . (Please see Revision Note 0.112 and Revision Note 0.116 about the bug involving the use of the 6-31G** basis set.)[Back to Table of Contents] [Top of Chapter 5] [scienceelearning.org]
The first example program, freeMQM-1.cpp, calculates the ground state energy of the helium atom or the hydrogen molecule using the Hartree-Fock method, or by performing a density-functional calculation. At the moment, the user has the choice of three different basis sets found in the Basis_sets directory. The basis set files are in the GAMESS format , with an additional line of code describing the contents of the file (this requirement could easily be coded away). As can be seen from the GNUmakefile, the function prototypes and global variable definitions for freeMQM-1.cpp can be found in freeMQM-1.h. The routines in freeMQM-1.cpp also make function calls to functions in eigen.cpp that solve the eigenvalue problem. Choosing to perform the Hartree-Fock calculation for helium gives a total energy of -2.85516 a.u. All three basis sets give the same result. The non-contracted basis has the same exponents as the 6-31G* basis, and the fact that all three basis sets give the same result illustrates two points. First, the contraction coefficients dpμ are optimized properly. Second, the polarization functions included in 6-31G** do not contribute to the spherically symmetric ground state of the helium atom, as can be seen from the calculated values of the expansion coefficients .[Back to Table of Contents] [Top of Chapter 5] [scienceelearning.org]
The non-contracted basis gives a ground state energy of -1.12655 a.u. and a bond length of 1.389 a.u. The result using the basis 6-31G** is consistent with that found on page 192 and page 201 of Szabo and Ostlund , namely a total energy of -1.131 a.u. and a bond length of 1.385 a.u. As can be seen from the table below, the inclusion of the L=1 polarization functions in 6-31G** does give a moderate improvement over the contracted basis set without polarization functions, 6-31G*. In fact, in the program, the two hydrogen atoms are defined to lie along the z-axis, and as can be seen from the values of the coefficients C[I], it is only the z-polarization function that contributes to the molecular ground state wavefunction. In the program, the user may also vary the bond distance to find the energy minimum.
Table 5.1. Hartree-Fock results for H2.
|Basis Set||Ground State Energy||Bond length|
|Exact/Experiment||-1.174474983 a.u. (Exact [Lowe,p.232])||1.401 a.u. (Experiment )|
|non-contracted||-1.12655 a.u.||1.389 a.u.|
|6-31G*||-1.12683 a.u.||1.379 a.u.|
|6-31G**||-1.13133 a.u.||1.384 a.u.|
The program can read basis sets of the GAMESS format, but in most cases it does not know what to do with the information. The file freeMQM-1.cpp needs to be generalized to process most p-type and d-type basis sets.
The functions adapted from Clementi and Davis  and Saunders  are generally valid for any (i.e. s- ,p- , d-, and f-type ) GTF. This fact, however, is not taken advantage of in other parts of the program. The function that calculates the kinetic energy, KE, for example, makes calls to the function dSMatrix, which calculates derivatives of the S matrix. The function dSMatrix could easily be generalized to perform derivatives on any S matrix involving GTFs.
The main program, freeMQM-1.cpp, uses the function BuildG or the function BuildG4 to build the matrix , depending on whether one is performing a Hartree-Fock calculation or a density-functional calculation. The function BuildG was adopted from [Thijssen,see Eq. (4.86) and chapter 9 example program nucl_md.f], and it takes full advantage of symmetries to reduce the number of integrals that need to be performed. The function BuildG4 is used in the Hartree-Fock calculation and does not take advantage of any of the symmetry relations. It is a relic of the debugging process and should be eliminated.