GaussTutorial_JLP

Embed Size (px)

Citation preview

  • 8/2/2019 GaussTutorial_JLP

    1/6

    Tutorial on Ab Initio Reaction Free Energy Calculations

    Julio L. Palma and Victor S. Batista

    Department of Chemistry, Yale University, P.O. Box 208107, New Haven CT 06520-8107

    1 Introduction

    This tutorial introduces the reader to ab initio calculations of reaction free energies, allowingthe students of CHEM505 to solve Exercise 4 in Lecture4 by using the software packageGaussian. For a more information on the Gaussian code and its tools the reader can consultthe Gaussian reference manual.

    The tutorial describes how to prepare input files for geometry optimization and calcula-tions of thermochemical data as illustrated for simple examples. In addition, a descriptionof key sections of the output log files is presented with instructions on how to extract resultsfrom the log file and how to launch calculations in the Bulldog L cluster.

    2 Gaussian Input

    The Gaussian input is a simple file that can be divided basically in three section: commands,title, system specification. The command section will contain the type of calculations (forexample: optimizations, single point calculation, transition state search and others), levelof theory, basis set, etc. The title sections is only one line and can say whatever you wantbut I recommend it describes what kind of calculation you are doing so it could be easyto keep track of your jobs. And in the system specifications the first line will indicate thecharge and spin multiplicity of the system followed by the system coordinates. In generalit is common to name your input file with .com extension. A blank line should be includedbetween sections as well as at the end of the input file.Here is a simple example of for the Hydrogen molecule. We could name it H2.com.

    #P b3pw91/aug-cc-pVDZ opt

    H2 molecule optimization

    0 1

    H 0.0000000 0.00000000 0.0000000000

    H 0.0000000 0.00000000 0.5900000000

    The first line indicates that is a DFT calculation (b3pw91 functional with aug-cc-pVDZbasis set) to optimize the system. I used H2 molecule optimization as a title for obviousreasons and the charge is 0, multiplicity is 1 (2*S+1) and the coordinates followed theformat: Atom Symbol, X, Y, Z.

    1

    http://www.chem.yale.edu/~batista/CHEM505/Lecture4.ppshttp://www.gaussian.com/g_tech/g_ur/g09help.htmhttp://www.gaussian.com/g_tech/g_ur/g09help.htmhttp://www.chem.yale.edu/~batista/CHEM505/Lecture4.pps
  • 8/2/2019 GaussTutorial_JLP

    2/6

    I personally prefer to use a text editor (i.e. vi) to edit my input files but you could useGaussView. To prepare your input file in GaussView first open Gaussview, you can drawyour molecules right away. To edit the type of calculation, go to the menu Calculate >Gaussian Calculation Setup. You can choose level of theory, basis set, calculation type, etc.Save your file as filename.com.

    For a more detail explanations on how to use GaussView you can consult IET Tutorialand the on-line GaussView Reference.

    3 Geometry Optimization

    To perform a Geometry optimization, the Opt keyword needs to be used in the commandline. See the example of the hydrogen molecule in the previous section file.To execute Gaussian you need to type the following in the Terminal:

    $ g09 < "inputfile" > "outputfile"

    for example for our H2.com input file it would be like this:$ g09 < H2.com > H2.log

    and it will generate and output file named H2.log. Once the output file has been generatedand the job has finished, first I would check if the job finished successfully, by successfullyI mean there were not memory problems, or the time limit was not exceeded just as anexample. I would look at the end of the output file and see the legend: Normal terminationof Gaussian .... . After checking this, I would see if the job calculated what I wantedthe why I wanted, remember that the code does not know chemistry. For instance, in theoptimization job for Hydrogen molecule I want to make sure it optimized my structure, oneway to know this I would be by making sure the job converged. Open the output file and

    search for the word Converged, this word will be found for every optimization cycle thatwas done. You may see something like this in the beginning:

    Item Value Threshold Converged?

    Maximum Force 0.209932 0.000450 NO

    RMS Force 0.209932 0.000300 NO

    Maximum Displacement 0.140004 0.001800 NO

    RMS Displacement 0.197995 0.001200 NO

    Obviously the job has not converged. If the optimization has been done successfully youwill find this:

    Item Value Threshold Converged?Maximum Force 0.000001 0.000450 YES

    RMS Force 0.000001 0.000300 YES

    Maximum Displacement 0.000001 0.001800 YES

    RMS Displacement 0.000002 0.001200 YES

    2

    http://www.chem.yale.edu/~batista/CHEM505/iet_tutorial.pdfhttp://www.gaussian.com/g_tech/gv5ref/gv5ref_toc.htmhttp://www.gaussian.com/g_tech/gv5ref/gv5ref_toc.htmhttp://www.chem.yale.edu/~batista/CHEM505/iet_tutorial.pdf
  • 8/2/2019 GaussTutorial_JLP

    3/6

    It is useful to visualize the structure with the help of software like Molden or evenGausView, just in case of existing local minima. In this case for the Hydrogen moleculeis not needed. If in the last cycle the convergence has not been achieved you will need torestart the optimization starting form the last point of the job until convergence is achieved.

    The energy of the optimized structure will be the energy of the last cycle, I prefer to

    obtain this energy using the terminal and the command grep:

    $ grep "SCF Done" h2.log

    the output will look like this:

    SCF Done: E(RB3PW91) = -1.14645136521 A.U. after 6 cycles

    SCF Done: E(RB3PW91) = -1.17387102242 A.U. after 6 cycles

    SCF Done: E(RB3PW91) = -1.17419360107 A.U. after 5 cycles

    SCF Done: E(RB3PW91) = -1.17419650054 A.U. after 5 cycles

    SCF Done: E(RB3PW91) = -1.17419650054 A.U. after 1 cycles

    We are interested in the last value, in this case E= -1.17419650054 which is the value ofthe last cycle of the calculation and the units are in Hartree.

    4 Thermochemical Properties

    To calculate Thermochemical properties such as Enthalpy, Entropy and Gibbs Free Energy,we need to perform a frequency calculation using the keyword Freq. Start with the opti-mized structure and use the command line:

    #P b3pw91/aug-cc-pVDZ freq

    Indeed, you could actually run the optimization and frequency calculation in the samejob with the command:

    #P b3pw91/aug-cc-pVDZ opt freq

    It will only calculate the frequencies once the structure is optimized. Of course, youshould remember that it will take longer and it may require more memory than if you runtwo separate jobs.

    In case you run separate jobs I would like to remind you that if you run the calculations

    in one folder it is better to use different names for the files since existing ones could beoverwritten, for example, the optimization files could be named h2.com and h2.log and forthe frequency calculation h2freq.com and h2freq.log for the input and the output respectively.

    To read the output from the frequency calculation job, I first would check that there areno imaginary energy values, which would indicate the system is not fully optimized. In theoutput file search for the word Frequencies, and you will find the following section:

    3

  • 8/2/2019 GaussTutorial_JLP

    4/6

    1

    SGG

    Frequencies -- 4369.9928

    Red. masses -- 1.0078

    Frc consts -- 11.3396

    IR Inten -- 0.0000

    In case one or more values of frequencies are negative then that indicates the system isnot optimized and another optimization with more strict convergence parameters need to bedone. Of course for Hydrogen molecule there is only one vibrational mode.

    Also, if the word Thermochemistry is searched the following section will be found:

    Zero-point correction= 0.009956 (Hartree/Particle)

    Thermal correction to Energy= 0.012316

    Thermal correction to Enthalpy= 0.013260

    Thermal correction to Gibbs Free Energy= -0.001575

    Sum of electronic and zero-point Energies= -1.164241Sum of electronic and thermal Energies= -1.161880

    Sum of electronic and thermal Enthalpies= -1.160936

    Sum of electronic and thermal Free Energies= -1.175772

    E (Thermal) CV S

    KCal/Mol Cal/Mol-Kelvin Cal/Mol-Kelvin

    Total 7.728 4.968 31.224

    Electronic 0.000 0.000 0.000

    Translational 0.889 2.981 28.080

    Rotational 0.592 1.987 3.143Vibrational 6.247 0.000 0.000

    As shown, you have the Gibbs Free Energy, Enthalpy and Entropy. Be aware of the use ofdifferent units. For more details in the theory and Gaussian calculations of these propertiesI strongly recommend to read: Thermochemistry in Gaussian.

    But basically the absolute Enthalpy is obtained form the line: Sum of electronic andthermal Enthalpies, the absolute Gibbs Free Energy is obtained from:Sum of electronicand thermal Free Energies.

    5 G of Reactions

    With the information shown in the previous section it is possible to calculate GRXN,HRXN and SRXN.For example for the following reaction:

    4

    http://www.gaussian.com/g_whitepap/thermo.htmhttp://www.gaussian.com/g_whitepap/thermo.htm
  • 8/2/2019 GaussTutorial_JLP

    5/6

    A + 2B C + D + E

    The optimization and frequency calculation for all the species need to be performed.From the frequency calculation job we can extract the Gibbs Free Energy, Enthalpy and

    Entropy for each specie and calculate the GRXN:

    GRXN = [GC +GD +GE] [GA + 2GB]

    and similar expressions for HRXN and SRXN.Here is an example from Chem. Commun. 22: 2231-2233 (2007), also presented in

    Lecture 4 of CHEM505. The Dehydrogenation of Cyclohexane, where the temperature whenthe reaction is spontaneous is Td= 599K as shown in the following picture:

    - 3 H2

    !"#$%&&'$

    !()!"*#+$

    6 ExampleTo obtain these value of Td, optimize and do a frequency calculation for all the speciesinvolved. In the paper, DFT was used and b3pw91 was the functional with aug-cc-pVDZbasis set. Notice that for the H2 molecule you do not need to do the calculation since it wasthe example I used, although I still recommend you to do it so you can verify your job.The values obtained for the Enthalpies are:

    Benzene: -232.078750 h

    Cyclohexane: -235.645767 h

    Hydrogen molecule: -1.160936 h

    And the values for Entropy are:

    Benzene: 69.153 Cal/mol-K

    Cyclohexane: 74.624 Cal/mol-K

    Hydrogen molecule: 31.224 Cal/mol-K

    With these values is straight forward to obtain the value of Td. The value I obtained wasTd=598.42 K.

    5

    http://www.chem.yale.edu/~batista/CHEM505/odile.pdfhttp://www.chem.yale.edu/~batista/CHEM505/odile.pdfhttp://www.chem.yale.edu/~batista/CHEM505/odile.pdfhttp://www.chem.yale.edu/~batista/CHEM505/odile.pdfhttp://www.chem.yale.edu/~batista/CHEM505/Lecture4.ppshttp://www.chem.yale.edu/~batista/CHEM505/Lecture4.ppshttp://www.chem.yale.edu/~batista/CHEM505/odile.pdf
  • 8/2/2019 GaussTutorial_JLP

    6/6

    7 Running jobs in the Bulldog Clusters at Yale

    If you have access to the Bulldog Clusters, the following scripts may be useful to submityour jobs.For cluster BulldogL:

    #!/bin/bash

    #PBS -N test

    #PBS -r n

    #PBS -j oe

    #PBS -q batista

    #PBS -l walltime=24:00:00,nodes=1:ppn=8,mem=42gb

    #PBS -V

    pwd

    time g09 < "Path"/"inputfile" > "Path"/"outputfile"

    Remember to change paths and names the input and output files.For cluster BulldogJ and K:

    #PBS -l select=1:ncpus=4:mem=5gb

    #PBS -l walltime=24:00:00

    #PBS -N test

    #PBS -q batista -W group_list=batista

    cd $PBS_O_WORKDIR

    export PATH=/usr/local/cluster/hpc/Applications/Gaussian:$PATH

    export g09root=/usr/local/cluster/hpc/Applications/Gaussiansource $g09root/g09/bsd/g09.profile

    export GAUSS_SCRDIR="Path scratch dir"

    g09 "Path"/"inputfile" > "Path"/"outputfile"

    Remember to change path of Scratch directory, paths and names of input and output files.

    6