## Chapter 5. Including Electron-Electron Interactions and the Hartree-Fock Approximation.

Development note Changes to this chapter were last made on 27 February 2005.

## 5.4. The basis sets in more detail.

Basis functions constructed from Gaussian type functions (GTF), written previously as

and, of course, a spherical form of the GTF can be written as

which are simultaneous eigenfunctions of  ${\stackrel{^}{\mathbf{L}}}^{2}\text{\hspace{0.17em}and\hspace{0.17em}}{\stackrel{^}{L}}_{z}$. 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.

For most three-dimensional problems, Cartesian GTFs [113] will be used [114][Szabo, p. 181;Levine,p.462],

where the d are the contraction coefficients for a given CGF, and  ${\phi }_{p}\left(\mathbf{r}\right)$  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  ${d}_{\mathrm{p\mu }}\text{,}{\alpha }_{\mathrm{p\mu }}\text{,}{l}_{\mathrm{p\mu }}\text{,}{m}_{\mathrm{p\mu }}\text{, and}{n}_{\mathrm{p\mu }}$  carry the double indices of matrices, but in the example program freeMQM-1.cpp they will be stored as one-dimensional arrays.  $L={l}_{\mathrm{p\mu }}+{m}_{\mathrm{p\mu }}+{n}_{\mathrm{p\mu }}$  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  $\text{(i.e.,}L=1\text{)}$.  (Please see Revision Note 0.112 and Revision Note 0.116 about the bug involving the use of the 6-31G** basis set.)

## 5.6. The Hartree-Fock method applied to our first atom: helium.

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 [52], 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 d 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  ${C}_{\mathrm{\mu i}}$.

## 5.7. The Hartree-Fock method applied to our first molecule: hydrogen.

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 [1], 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.

3. The main program, freeMQM-1.cpp, uses the function BuildG or the function BuildG4 to build the matrix  ${G}_{\mathrm{\mu \nu }}$, 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.