Summary This document describes in great detail how to navigate the Linux Red Hat Terminal to bring up GaussView, use GaussView to create a simple atomic or molecular simulation input file, and then use Gaussian to solve the electronic structure of the atom or molecule. Load and Open GaussView to start example 1. Log on to the opteron.crc.nd.edu front end machine (type: ssh X opteron.crc.nd.edu) 2. cd into the folder you are using for this class. Once in that folder, create a folder for this session. 3. Modules a. The University of Notre Dame owns licenses to several pieces of software that we can all use. It stores these software in modules. b. To see the software currently loaded, type: module list c. To see the software that is available, type: module avail d. For this class we will be using Gaussian and GaussView a lot. Gaussian is the actual code that does the calculation while Gaussview is a graphical user interface used to create input files and view output files. In order to load this software, type: module load gaussview/5.08 and press enter. Loading GaussView also loads Gaussian automatically. e. To open GaussView, type gv & i. The & allows you to run programs in the background and still have a command prompt to work with Example: Optimizing NH 3 4. When you open GaussView, 3 windows appear: the Gaussview program, a New window, and a GaussView tips window. You can close the GaussView tips window. 5. Building a molecule a. From the GaussView 5.08 window, select View Builder to bring up the molecule builder b. In the builder window, click on the 6 C button, which allows you to add an element fragment to your molecule. A periodic table will appear. c. From the periodic table, select Nitrogen. d. At the bottom of the periodic table, it shows you what fragments are available for that particular atom. For nitrogen, the default fragment is nitrogen with 3 bonds e. To build this fragment, click anywhere in the New window. i. An NH 3 molecule should appear. GaussView automatically attaches hydrogens if the fragment you select has dangling bonds. This can sometimes be inconvenient. If you do not want hydrogens you should select the Atom fragment. ii. As long as the 6 C button (in Builder window) is selected, every click in the New Window produces whatever fragment is selected. This is great if you are creating a molecule but inconvenient if you simply want to modify an existing molecule. You must select a different option in the Builder window to avoid adding extraneous atoms. A good choice is the inquire button, which is the icon showing a question mark and a ruler. It is normally used to measure distances, etc. 6. Setting up a calculation a. We can now set up a Gaussian input file that will tell Gaussian how to optimize the electronic structure of NH3. To do this, in the GaussView window, select Calculate Last updated 2/9/2012 by Jason Bray 1
Gaussian Calculation Setup i. A box labeled Gaussian Calculation Setup and containing information on the calculation will appear. b. We want to optimize our structure, so in order to do this, go to the Job Type tab. c. Click on the drop down menu and select Optimization d. More options will appear i. We want to optimize to a minimum, so that box is ok 1. If we wanted to optimize to a transition state, we would change this drop down menu to TS(Berny) ii. We don t need to calculate force constants so the default is ok iii. If you wanted a tighter convergence criterion, you would click on that box, but for this example leave it unchecked e. Next, go the Method tab; in this tab, you define your basis set and other electronic structure parameters i. For all of the calculations you will be doing, you will want to perform a ground state calculation, so leave the default setting in this menu ii. In the second drop down menu, you select the specific method you want to use to calculate your molecule with 1. In this case, we will use the default HartreeFock 2. If you choose a different method, such as DFT, other options will appear iii. In the third drop down menu, we want to use the default Default Spin; this will be the case for the majority of your calculations iv. On the next line, we choose the basis set 1. For this example, choose 3-21G v. The next two drop down menus we will leave blank. The first is if we want to add diffuse functions. The second is used if we want to add polarizability. vi. Obviously the charge for this molecule is 0 so we leave the default vii. For this calculation set the Spin to be Singlet f. In the Title tab, give your job a name, such as NH3 Optimization g. The Link 0 tab, sets up some of the parameters of the computer you will run the job on i. Memory Limit Specify to be 100 MW ii. Chkpoint File Default name 1. For most of the calculations you will perform, the checkpoint file is not needed and since it is a huge file, it will just take up much needed space. 2. However, if you wish to look at the molecular orbitals or electrostatic potential maps, then it will be needed. iii. Readwrite File - Don t save iv. Linda Workers - Don t use v. Shared Processors Specifies how many processors you want to run your job on 1. For this example, specify 2 2. For larger systems, you may want to specify more processors. h. In the General tab, uncheck Write Connectivity and check Additional Print i. Selecting Additional Print prints more information in the output file, this will be useful for some of your homework assignments i. The rest of the tabs we will not use for this job but in some instances those might prove useful. Particularly useful is the additional keywords box. As useful as Gaussview is, it does not contain all of the possible commands/keywords used with the Gaussian program. Last updated 2/9/2012 by Jason Bray 2
Here you can enter additional keywords separated by spaces for example, hfs gfprint pop=full. You will have to use some of these keywords for your homework. For other Gaussian keywords you can check http://www.gaussian.com/g_tech/g_ur/l_keywords09.htm. i. hfs specifies the Hartree Fock Slater method ii. gfprint and pop=full print extra orbital information in the output file. 7. In order to save, click Edit at the bottom of the window a. A new window will pop up asking you if you want to save, click Save b. Save the file in the folder you made earlier for this lab session i. Save it as something that will help you know what it is such as: NH3 ii. Gaussian adds the extension.com to input files. 8. Once you save, a new window will appear, showing you the input file in the vi text editor. If you are fluent in vi you can edit using this window if needed. Otherwise, close this window. 9. Once you close the input file, a new window will appear asking if you would like to submit the input file. Click Cancel. If you click OK, Gausview will attempt to run the Gaussian program on the front end machine. We are not allowed to do that. 10. Open the newly created input file in your favorite editor (emacs, gedit, etc.) to verify that all is well and make any changes as needed. Submitting jobs to the CRC computers 11. Now that we have our input file setup, we want to submit it to the CRC computers. The CRC computers are public computers that anyone on campus (with a CRC account) can submit jobs to. 12. In order to submit to the CRC computers, we must first be logged into a CRC front end machine (you should already be logged in to opteron) 13. To submit your job to the CRC computers, you will need a submission script. I have already made a basic submission script. First, cd into the folder that contains the Gaussian input file you just created. To gain a copy of submission script, type the following in the command prompt: cp /afs/crc.nd.edu/user/w/wschnei1/cbe547/gaussian_lab/gaussian09script./yourjobname a. This will copy the file gaussian09script from the class directory to the file named yourjobname (submission script) located in the directory you are currently in. 14. Type ls and you will see that you now have the file yourjobname in your directory. 15. To view and edit the submission script, type emacs yourjobname & and press enter. An emacs window with the contents your submission script should have opened. 16. I now will go through what the file means a. #! /bin/csh i. tells us what type of shell we are using, in this case the Cshell ii. the shell allows an interface for users b. #$ -pe smp 2 i. smp specifies which parallel environment we will be submitting our jobs to. ii. 2 indicates the number of processors that we are requesting to use iii. usually one must ensure that the parallel environment you submit to, the number of processors you specify here, and the number of processors you specified in the input file are all consistent c. #$ -M yournetid@nd.edu i. first change the yournetid part to your netid ii. this specifies that the job scheduler will email you Last updated 2/9/2012 by Jason Bray 3
d. #$ -m abe i. this specifies that the scheduler will email you when the job either begins (b), is aborted (a), or ends (e). e. module load gaussian/09 i. this loads the gaussian program onto the CRC computer that will run your job f. g09 inputfile.com i. This command initiates Gaussian version 09 and tells it to look for the input file named inputfile.com 17. For each new job you want to run, it is useful to make a separate directory containing a new input file and a copy of this submission script, appropriately named of course. 18. Once you are done making the necessary changes, type Ctrlx Ctrls. This saves the file. 19. We are now ready to submit our job to the CRC computers. Exit emacs by typing Ctrlx Ctrlc. 20. Return to your terminal prompt, you should be in the folder that contains both your input file (NH3.com) and your submission script (yourjobname). It is important that both the input file and the job file are contained in the same folder, if they are not, your job will not run. At the terminal prompt type: qsub yourjobname and press enter. This submits your job using the script we just edited. To submit any job, you will always use the qsub command. 21. To see the status of your job, enter: qstat u netid a. qw means your job is in the queue but has not run yet b. t means your job is transmitting to the processors c. r means your job is currently running Viewing Output Files 22. The main output file of Gaussian is.log file 23. Since it will take a little bit before everyone s job finishes, we will look at my example output file. 24. To do this, in the terminal command line, type: cp /afs/crc.nd.edu/user/w/wschnei1/cbe547/dmccalma/nh3test/optimization/nh3opt.log./ 25. Open the example output file in emacs by typing emacs NH3opt.log & and pressing enter 26. The first part of the log file tells you about the Gaussian program and what you input into the program. Since we ran an optimization, it steps through the optimization of the molecule. 27. The easiest way to see the different optimization steps is, in emacs, type Ctrls This will search the upcoming sections of the document for whatever you type next (there is a corresponding command for searching previous sections of the document, Ctrlr) In the mini command line in emacs you will see: I-search: 28. Type: optimization Emacs will take you to the first instance of this word in the document. 29. If you type Ctrls again, it will take you to the next instance of optimization. Keep hitting Ctrls until you come to the instance where it says: Optimization completed. Stationary point found. Above this line, it will tell you if the molecule converged according to four different criteria. Make sure that each one says YES. There can be instances where it says that the optimization completed but one of the criteria will say NO. If this occurs, you will need to run the simulation from this starting point and try and optimize the structure again. 30. If the optimization did not complete, this line will instead say: Optimization failed. Again, if this occurs, you will want to run the optimization again starting from this last point. 31. Next, you will want to visualize the output. Even though the log file says that the optimization was completed, it is possible that the structure is not the one you would have predicted or you may get something undesirable or weird, so make sure that you always visualize the output. Last updated 2/9/2012 by Jason Bray 4
32. To visualize the output, in GaussView click File Open. Change the file type to Gaussian Output Files (*.out *.log) and open the NH3opt.log file. You would also use this file to generate a new input file in GaussView if you needed to continue your job from this point. 33. The optimized structure will pop up. Obviously for this simple molecule, it is what we expect. 34. To find the optimized energy of this structure, click on Results Summary. A summary box will pop up. The energy is listed in Hartrees. 35. You can see what the bond lengths are by clicking on the Inquire tool (in the Builder or at the top of the GaussView window) and selecting two of the atoms. When you do this the bond length will be shown in the message bar at the bottom of the window (make sure your mouse isn t hovering over any of the atoms). You can also see what the bond angles are by clicking on three atoms in sequence. The angle will be displayed instead of the bond length. 36. To view the occupancies of the orbitals click on Edit MOs. You can save this diagram by clicking on the Diagram tab followed by Export Picture. You can create images of molecular orbitals following the same procedure below for electrostatic potentials (with a couple small differences that you can figure out on your own). Creating Electrostatic Potential (ESP) Maps in GaussView: 37. Copy the example checkpoint file by typing cp /afs/crc.nd.edu/user/w/wschnei1/cbe547/dmccalma/nh3test/optimization/nh3opt.chk./ 38. Now open this file with Gaussview by selecting File Open, setting file type to Gaussian Checkpoint files (*.chk), and selecting the file you want to open 39. Select Results Surfaces. A Surfaces and Contours window should pop up. 40. Select the Cube Actions drop down menu. a. Select New Cube. b. In the Type box using the drop down menu select Total Density. c. Leave all options as the default. d. Select OK. e. A line of data will appear in the Cubes Available box. It should say Electron density from Total SCF Density. 41. Select the Surface Actions drop down menu. Select New Mapped Surface. a. In the window select the second radio button Generate values only at surface points b. From the drop down menu, select ESP. Leave other options the same and choose OK. c. A line of data will appear in the Surfaces Available box, and a colored isosurface should appear in the molecule window. The isosurface is represents a uniform charge density, and the electrostatic potential is mapped onto this isosurface with a colormap representation. d. You may have to edit the scale in the display window to make the colormap transition smoothly from red through yellow and green to blue. 42. To change the display a. Select View Display Format b. Click on the Surface tab. c. At the format drop down menu select either mesh, solid, or transparent. d. The Z-Clip slider (min to max) can also be adjusted to alter the way the surface is viewed. i. It may be used to remove the foremost portions of the image to allow views into the interior of the molecular display. 43. To save the image select File Save Image File a. Name it whatever you want Last updated 2/9/2012 by Jason Bray 5
b. Choose your favorite image file format c. Select the button at the bottom that says White Background d. You may want to change the box with a 3 to a 1 or 2, so the pictures are not huge. e. Click OK Practice 44. If there is time remaining in the session begin homework 2. Last updated 2/9/2012 by Jason Bray 6