The microcomputer as a teaching tool for molecular orbital theory

ings andlor machine-readable versions of their programs. Please read each ... John W. Moore, Director, Project SERAPHIM, Department of Chemistry, East...
0 downloads 0 Views 3MB Size
edited by JOHN W. MOORE

Bits and Pieces, 36 Guidelinesfor Authors of Bits and Pieces appeared in July 1986. Most authors of Bits and Pieces will make available listings andlor machine-readable versions of their programs. Please read each description carefully to determine compatibility with your own computing environment before requesting materials from any of the authors. Several programs described in this article and marked as such are available from Project SERAPHIM. Diskettes are available a t $5 per 5%-in. disk, $10 per 3%-in. disk; program listings and other written materials are available for $2 each; $2 domestic or $10 foreign postage and handling is required for each shipment. Make checks payable to Project SERAPHIM. T o order, or get a Project SERAPHIM Catalogue, write to: John W. Moore, Director, Project SERAPHIM, Department of Chemistry, Eastern Michigan University, Ypsilanti, MI 48197. (Project SERAPHIM is supported by NSF Science and Engineering Education Directorate.)

The Microcomputer as a Teaching Tool for Molecular Orbital Theory Susan M. Colwell and Nicholas C. Handy University Chemical Laboratory Cambridge CB2 IEW, United Kingdom The concept of a molecular orbital is now introduced at an early stage in a student's career. The time has probably passed when the applications demonstrated are the hydrogen molecule or a Huckel treatment of benzene. The arrival of the sophisticated microcomputer enables the student to he introduced to molecular orbital calculations at a level much closer to the reality of research, without the complication of using a mainframe computer. This is especially relevant now that students are encouraged to undertake mini research projects during their first-degree training. In this context we have develooed a stand-alone FORTRAN computer program, for microcomputers that will perform Self-Consistent-Field calculations for closed-shell molecules. We believe that such a program is a very useful aid to the teaching of theoretical chemistry, as i t gives the student a feel for the ah initio computation of potential energy surfaces. T o understand the theory behind the SCF program, a student must of course appreciate (1)the variationalprinciple, (2) the representation of the molecular orbital as alinear combination of atomic basis functions (Gaussians), (3) the form of the SCF wavefunction, the Slater determinant, (4) the need for the evaluation of a laree number of two-electron integrals, and (5) the iterative n a t k e of the SCF procedure. Bytyping in the geometry of themolecule, its symmetry, and the basis set, the student rapidly appreciates the ab initio method. He will see the integrals being transferred block by block to the hard disk, and then being read back again during the SCF cycles-at the same time he will ohserve the convergence of the SCF procedure. Our program, MICROMOL, was written so that it would ~

~

~~~

Table 1. Things for Test Calculations Using MICROMOL on an IBM PClAT NO.of basis Basis set STO-3G DZ 6-316 4-310 3-21G 3-21G 3-21G DZ STO-3G STO-3G

t~nctions

Symmetry

EnergyB

Enerov ". and gradient'

7 14 15 15 17 26 30 24 26 36

Tims in oeconds.

run on the first generally available microcomputer of sufficient size (the IBM PCIXT), but as it is written in standard FORTRAN 77 and as machine-dependent features have been avoided it should run on anv IBM-comvatible microcomputer with 6 1 0 ~ 1of , accessible HA41.1 a 1i)hlb hard disk and a FOR'I'RAN vomwiler. So iar thr vrorram has been run successfully on IBM PCIXT, IBM PCIAT, Olivetti, Ericsson. and Texas Instrument microcomvuters and is currently being tested on a Hewlett Packard &crocomputer. The wropram will verform calculations on molecules conto 12 atoms and can handle a maximum of 63 sisting bf contracted Gaussian basis functions of s, p, and d types. A large number of test calculations have been carried out on the IBM PC/XT and PCIAT. These are detailed in a previous naner (1).hut some examoles are eiven in Table 1 0; aver;; the IBM P C ~ ran T 6 0 times more slowly than the IBM 3081D, which is the University of Cambridge's standard mainframe computer. The IBM PCIAT ran 75 times more slowlv than the mainframe but with a standard accelerator hoardfitted can be speeded up by afactor of five. This would seem to indicate that the microcomputers are slow, but, if instead of CPU time, one considers the time elapsed between submitted a job and seeing the results, these timings become much more competitive. On the mainframe, most medium or large calculations have to be run as batch jobs, and so, depending on the length of the job queues, the student may have to wait many hours or even overnight for the return of his job. On a microcomputer, however, the job will run immediately, and the student can watch its progress.

up

~

'Warning: Some microcomputers, although apparently having more than 640Kb of memory do not have it all to the operatingsystem. For example, an IBM PC~ATwith 1Mb RAM configured as 512Kb base memory and 512Kb on an expansion board has only 512Kb accessible to DOS. it is necessary to have 128Kb on a separate expansion board to bring the base memory up to the required 640Kb. Volume 65 Number 1 January 1968

21

Another feature of present-day microcomputers that is especially useful for instructional purposes is their interactive graphics capability. An extended version of o w program can use the results of an SCF run to calculate the electron density of the molecule. The student can then choose aplane through the molecule, and the program will display a colorcoded map of the electron density. He can then rotate and translate this plane of section to build up a complete picture of the electron density surface. For the student who wishes to go further, MICROMOL has the ability to evaluate the energy gradient aEIaXj, where Xi is a nuclear coordinate. Gradient theory is one of the major advances in ah initio methodology in the last 15 years, and it enables the automatic location of stationary points on the ootential enerw surface. In ~articular.the location of the minimum energy geometry is an automatic procedure of this Droeram. Once this eeometrv has been found. the program also has the ability to caiculate the energy second derivatives a2EIaXiaXj using finite differences of energy gradients; these are then used to calculate the harmonic frequencies of vibration of the molecule. I t is this second aspect of MICROMOL, connected to gradient theory, that makes it such an attractive tool and that brings the student toward the problems that are tackled in modern ah initio quantum chemistry. We are in the nrocess of extendine our oromam to form a Computer ~ s s i s i e dLearning package a i g e d i t the nonspecialist undergraduate chemist. The menu-driven package will guide the student through the process of setting up a data set for a quantum chemistry calculation. The program will instruct the student on how to choose basis sets, specify molecular peometry, etc., and he or she will have the option of using those from a standard on-line library, or of specifying his or her own. The student will be able to display pictures of basis functions and also of nuclear geometry to check whether he or she is doing a calculation on the molecule he or she intends. The student can then specify the type of calculation he or she wishes to perform, that is, an energy, gradient, force constant, or geometry optimization, and the program will guide him or her to a sensible choice of various parameters. and then rive him or her a roueh estimate of how long the job will take. Once thestudent t e b the package he or she is satisfied with the data set, the iob will run, and the student can either watch i t run, or comeback whenit has finished. The student can then run the second part of the CAL package, which will analyze the results graphically. He or she will be able to display the electron density as described above, draw the molecular orbitals, or display pictures of the normal modes and watch the molecule vibrate when he or she excites a oarticular mode. As an example of t h e research use of MICROMOL we report some calculations on HIS ...HF. There has been much interest in the literature recently in gas-phase studies of hydrogen-bonded complexes and related theoretical work. These systems are bound by a few kilocalories per mole, and in many cases involve diatomic and triatomic molecules. This is not the place to refer t o the vast literature on this subject; we merely refer to one set of calculations by our group (2) on the complexes H3N...HCN, HCN ...HCN, HCN...HF, and H 2 0...HF, where the leading references may be found. There have been very few studies of the complex HzS...H F (3), and so we decided to study this a t the SCF level on the IBM PCIAT. It is necessarv in these studies to use good basis sets, and so in the ah iniGo jargon, a 4-31G** basis set was used (4) (49 contracted Gaussian basis functions, 102 primitives). The geometry on the complex H2S...H F was optimized allowing.all the nuclear positions to vary. This optimized geometry i;s given in ~ i ~ u1rtogether e with the geometries of the monomers HnS and HF, which were also optimized. As with most SCF calculations, the monomer bond lengths are too short by about 0.01 A. On the formation of the complex, it is seen that the donor (HF) uu

22

Journal of Chemical Education

MONOMERS

Figure 1. Geometry of the complex HIS calculated by MICROMOL.

...HF and the monomers H Z and HF as

approaches one of the lone pairs of H B , with an 0.004 A increase in the bond length of HF. This increase in the bond length is rather smaller than that typically found in these complexes, but the S..F distance is larger than typical, and so the HF is distorted less. The binding energy is calculated from E[(HzS...HF) = -498.6933 hartree] -E[(HB) = -398.6758 hartree] -E(HF) = -100.0120 hartree], to he 3.4 kcal/mol (1 hartree = 627 kcallmol). The spectroscopist uses the fundamental frequencies as a fingerprint for a molecule, and so he or she is interested to know the shift in these frequencies on the formation of the complex, so that he or she has evidence of its formation. In Table 2 the frequencies calculated by MICROMOL are presented. both for the monomer and the comvlex. and the shifts are also given in parentheses. It is seen, as with must tvpical SCF calculations, that the frequencies of the monu(see ref 4). Gut experience tells us Airs are too large by 10% that the shifts will he reliable. Note the significant shift to

Table 2. Harmonlc Frequencfes and Frequency Shifts of H,S, HF, and the HydrogenPondedComplex H2S HF (In em-' as Calculated by MICROMOL

...

Vibration 1 (HF) 1 (HIS symm stretch) 2 (H2Sbend) 3 (Hasasym shetch) "slretchn "bend" "shear"

Monomer

Complex

Shill

4507 2881 1329 2894

4417 2889 1328 2901 93 111.154 413,452

-90 8 -1 7

-

-

the red of the HF frequency, corresponding to its increased bond length. Note also that the frequencies of H2S change little from the monomer. New intermolecular freauencies are present on the formation of the complex, commonly called stretch. bend. and shear. these are small, and mav be observable tumicrokave s p e r t ~ o ~ c u ~ iWe s t i are . only aware of m e exoerimental studv on this comolex ( 5 ) ,this predicts 129 cm-"for the intermo~cularstretch, and 320 cm? for the bend. This calculation demonstrates that the microcomputer has to be considered not only as a teaching aid, but also as a significant aid to research scientists (even to quantum chemists who are number crunchers). These calculations on H&HF and the monomers took a total of 400 hours on the IBM PCIAT. (Note that with one of the available accelerator boards inserted, this would be reduced by a factor of five.) Their cost on a mainframe would he considerable, probably in excess of the cost of the PCIAT! Further information on MICROMOL is available from the authors.

cuts through the center of the hydrogen atom with both distance and polar angle. One type of two-dimensional mapping draws the contours of the orbital. An orbital's contour lines are similar to the eeoeraohic contours of a hillside. Geographic contours are &c& parallel to the earth's surface that pick out lines of equal altitude. Orbital contours are slices parallel to the cross section that pick out lines of equal value of the wave function for the orbital. A second type of two-dimensional mapping produces a pseudo-three-dimensional plot of the orbital. Using the cross section as a base plane, the values of the wave function for the orbital at different locations are mapped as a distance above or below the base plane. The procedure produces a picture of the "hill" through which the contour cuts were made. The algorithm to produce the two-dimensional plots proceeds as follows. Load the (x, y ) array of scaled values representing the solution to the Schroedinger equation for the orbital. Step through the points in the array sequentially. For contour plots In a cell whose corners are (r,y), (r + 1,y), (r,y + 1) and (x + 1, v + 1-, ) * ~

Orbital Plots of the Hydrogen Atom

If a predetermined contour value is neither greater nor less than the orbital value at any corner, then draw a point. For pseudo-three-dimensional plots Draw straight line segments from the orbital value at ( x , y) to the value at ( x + 1, y). Project the picture onto a two-dimensionalviewing plane.

Michael Llebl Mount Michael Benedictine High School Elkhorn, NE 68022 Orbitals give coherence to many aspects of chemical behavior because they describe the electron density of regions ahout a nucleus. For examnle orbitals helo exolain theaeometry of chemical bonds. A; a result, orbitals &e now f;ndamental to the study of chemistry. Unfortunately, the mathematical methods required to generate orhitals are not simple. For that reason, introducing students to the concept of orbitals is prohlematic. On the other hand, when students can visualize orhitals, their imoortance and utility becomes apparent. The software described in this articleenables a 48K Apple I1 with a single disk drive to plot the orhitals of the hydrogen atom in one, two, or three dimensions. The software works in the following manner. Solutions to the Schroedinger equation for the 1s orbital through all the 3d orbitals have been stored as arrays of binary values on disk. When an orbital is selected. the aoorooriate solution is .. . loaded from disk into memory. Then a drawing routine is called to trace out a oicture of the orbital. Five Woes of plots are available. ~ a d i a plots i show the orbital's variation-with distance from the nucleus. I'olar plots centered on the nucleus show the orbital's variation wkh polar angle. Two-dimensional plots of orhitals map the variation of cross-sectional

Three-dimensional plots yield the most complete view of the orbital. These plots draw contour lines that encompass the regions about the nucleus with high electron density. The algorithm to produce these plots is as follows. Load the (x, y, z) array of scaled values representing the solution to the Schroedinger equation for the orbital. Step through the points in the array sequentially. In a cell whose corners are ( x , y, z), (X 1, y, z), (x, y + 1, z ) and

+

(x + L Y + L d

If a predetermined contour value is neither greater nor less than the orbital value at any corner, then draw a point. In a cell whose corners are ( x , y, z ) , (x + 1, y, z ) , ( x , y, z + 1) and (x+ l,Y,L+l)

Ifapredeterrninedcontour value is neifhergreatrr nor l e s ~ t h n n the orbital value at any corner, then drawn point. Project the picture onto a two-dimensionalviewing plane

T o aid in visualizing the orbitals, both the three-dimensional plots and the pseudo-three-dimensional plots can be rotated

r

--

RFlDIFlL FUNCTION

I Figure 2. Radial plot of the 2p orbital.

SPHERICFlL HFlRMONIC FUNCTION

POLAR PLOT

Figure 3. Polar plot 01 the p, orbital Volume 65

Number 1 January 1988

23