Blog Archives

Calculating NMR shifts – Short and Long Ways


Nuclear Magnetic Resonance is a most powerful tool for elucidating the structure of diamagnetic compounds, which makes it practically universal for the study of organic chemistry, therefore the calculation of 1H and 13C chemical shifts, as well as coupling constants, is extremely helpful in the assignment of measured signals on a spectrum to an actual functional group.

Several packages offer an additive (group contribution) empirical approach to the calculation of chemical shifts (ChemDraw, Isis, ChemSketch, etc.) but they are usually only partially accurate for the simplest molecules and no insight is provided for the more interesting effects of long distance interactions (vide infra) so quantum mechanical calculations are really the way to go.

With Gaussian the calculation is fairly simple just use the NMR keyword in the route section in order to calculate the NMR shielding tensors for relevant nuclei. Bear in mind that an optimized structure with a large basis set is required in order to get the best results, also the use of an implicit solvation model goes a long way. The output displays the value of the total isotropic magnetic shielding for each nucleus in ppm (image taken from the Gaussian website):

Magnetic shielding (ppm):
  1  C    Isotropic =    57.7345   Anisotropy =   194.4092
   XX=    48.4143   YX=      .0000   ZX=      .0000
   XY=      .0000   YY=   -62.5514   ZY=      .0000
   XZ=      .0000   YZ=      .0000   ZZ=   187.3406
  2  H    Isotropic =    23.9397   Anisotropy =     5.2745
   XX=    27.3287   YX=      .0000   ZX=      .0000
   XY=      .0000   YY=    24.0670   ZY=      .0000
   XZ=      .0000   YZ=      .0000   ZZ=    20.4233

Now, here is why this is the long way; in order for these values to be meaningful they need to be contrasted with a reference, which experimentally for 1H and 13C  is tetramethylsilane, TMS. This means you have to perform the same calculation for TMS at -preferably- the same level of theory used for the sample and substract the corresponding values for either H or C accordingly. Only then the chemical shifts will read as something we can all remember from basic analytical chemistry class.

GaussView 6.0 provides a shortcut; open the Results menu, select NMR and in the new window there is a dropdown menu for selecting the nucleus and a second menu for selecting a reference. In the case of hydrogen the available references are TMS calculated with the HF and B3LYP methods. The SCF – GIAO plot will show the assignments to each atom, the integration simulation and a reference curve if desired.

The chemical shifts obtained this far will be a good approximation and will allow you to assign any peaks in any given spectrum but still not be completely accurate though. The reasons behind the numerical deviations from calculated and experimental values are many, from the chosen method to solvent interactions or basis set limitations, scaling factors are needed; that’s when you can ask the Cheshire Cat which way to go

If you don’t know where you are going any road will get you there.

Lewis Carroll – Alice in Wonderland

Well, not really. The Chemical Shift Repository for computed NMR scaling factors, with Coupling Constants Added Too (aka CHESHIRE CCAT) provides with straight directions on how to correct your computed NMR chemical shifts according to the level of theory without the need to calculate the NMR shielding tensor for the reference compound (usually TMS as pointed out earlier). In a nutshell, the group of Prof. Dean Tantillo (UC Davis) has collected a large number of isotropic magnetic shielding values and plotted them against experimental chemical shifts. Just go to their scaling factors page and check all their linear regressions and use the values that more closely approach to your needs, there are also all kinds of scripts and spreadsheets to make your job even easier. Of course, if you make use of their website don’t forget to give the proper credit by including these references in your paper.

We’ve recently published an interesting study in which the 1H – 19F coupling constants were calculated via the long way (I was just recently made aware of CHESHIRE CCAT by Dr. Jacinto Sandoval who knows all kinds of web resources for computational chemistry calculations) as well as their conformational dependence for some substituted 2-aza-carbazoles (fig. 1).

1-s2.0-S0022286018310330-fx1_lrg

Journal of Molecular Structure Vol 1176, 15 January 2019, Pages 562-566

The paper is published in the Journal of Molecular Structure. In this study we used the GIAO NMR computations to assign the peaks on an otherwise cluttered spectrum in which the signals were overlapping due to conformational variations arising from the rotation of the C-C bond which re-orients the F atoms in the fluorophenyl grou from the H atom in the carbazole. After the calculations and the scans were made assigning the peaks became a straightforward task even without the use of scaling factors. We are now expanding these calculations to more complex systems and will contrast both methods in this space. Stay tuned.

Advertisements

Error for Gaussian16 .log files and GaussView5


There’s an error message when opening some Gaussian16 output files in GaussView5 for which the message displayed is the following:

ConnectionGLOG::Parse_Gauss_Coord(). 
Failure reading oriented atomic coordinates. Line Number

We have shared some solutions to the GaussView handling of *chk and *.fchk files in teh past but never for *.log files, and this time Dr. Davor Šakić from the University of Zagreb in Croatia has brought to my attention a fix for this error. If “Dipole orientation” with subsequent orientation is removed, the file becomes again readable by GaussView5.

Here you can download a script to fix the file without any hassle. The usage from the command line is simply:

˜$ chmod 777 Fg16TOgv5
˜$ ./Fg16TOgv5 name.log

The first line is to change and grant all permissions to the script (use at your discretion/own risk), which in turn will take the output file name.log and yield two more files: gv5_name.log and and name.arch; the latter archive allows for easy generation of SI files while the former is formatted for GaussView5.x.

Thanks to Dr. Šakić for his script and insight, we hope you find it useful and if indeed you do please credit him whenever its due, also, if you find this or other posts in the blog useful, please let us know by sharing, staring and commenting in all of them, your feedback is incredibly helpful in justifying to my bosses the time I spent curating this blog.

Thanks for reading.

fchk file errors (Gaussian) Missing or bad Data: RBond


We’ve covered some common errors when dealing with formatted checkpoint files (*.fchk) generated from Gaussian, specially when analyzed with the associated GaussView program. (see here and here for previous posts on the matter.)

Prof. Neal Zondlo from the University of Delaware kindly shared this solution with us when the following message shows up:

CConnectionGFCHK::Parse_GFCHK()
Missing or bad data: Rbond
Line Number 1234

The Rbond label has to do with the connectivity displayed by the visualizer and can be overridden by close examination of the input file. In the example provided by Prof. Zondlo he found the following line in the connectivity matrix of the input file:

2 9 0.0

which indicates a zero bond order between atoms 2 and 9, possibly due to their proximity. He changed the line to simply

2

So editing the connectivity of your atoms in the input can help preventing the Rbond message.

I hope this helps someone else.

Dealing with Spin Contamination


Most organic chemistry deals with closed shell calculations, but every once in a while you want to calculate carbenes, free radicals or radical transition states coming from a homolytic bond break, which means your structure is now open shell.

Closed shell systems are characterized by having doubly occupied molecular orbitals, that is to say the calculation is ‘restricted’: Two electrons with opposite spin occupy the same orbital. In open shell systems, unrestricted calculations have a complete set of orbitals for the electrons with alpha spin and another set for those with beta spin. Spin contamination arises from the fact that wavefunctions obtained from unrestricted calculations are no longer eigenfunctions of the total spin operator <S^2>. In other words, one obtains an artificial mixture of spin states; up until now we’re dealing only with single reference methods. With each step of the SCF procedure the value of <S^2> is calculated and compared to s(s+1) where s is half the number of unpaired electrons (0.75 for a radical and 2.0 for triplets, and so on); if a large deviation between these two numbers is found, the then calculation stops.

Gaussian includes an annihilation step during SCF to reduce the amount of spin contamination but it’s not 100% reliable. Spin contaminated wavefunctions aren’t reliable and lead to errors in geometries, energies and population analyses.

One solution to overcome spin contamination is using Restricted Open Shell calculations (ROHF, ROMP2, etc.) for which singly occupied orbitals is used for the unpaired electrons and doubly occupied ones for the rest. These calculations are far more expensive than the unrestricted ones and energies for the unpaired electrons (the interesting ones) are unreliable, specially spin polarization is lost since dynamical correlation is hardly accounted for. The IOP(5/14=2) in Gaussian uses the annihilated wavefunction for the population analysis if acceptable but since Mulliken’s method is not reliable either I don’t advice it anyway. 

The case of DFT is different since rho.alpha and rho.beta can be separated (similarly to the case of unrestricted ab initio calculations), but the fact that both densities are built of Kohn-Sham orbitals and not true canonical orbitals, compensates the contamination somehow. That is not to say that it never shows up in DFT calculations but it is usually less severe, of course for the case of hybrid functional the more HF exchange is included the more important spin contamination may become. 

So, in short, for spin contaminated wavefunctions you want to change from restricted to unrestricted and if that doesn’t work then move to Restricted Open Shell; if using DFT you can use the same scheme and also try changing from hybrid to pure orbitals at the cost of CPU time. There is a last option which is using spin projection methods but I’ll discuss that in a following post. 

Grimme’s Dispersion DFT-D3 in Gaussian #CompChem


I was just asked if it is possible to perform DFT-D3 calculations in Gaussian and my first answer was to use the following  keyword:

EmpiricalDispersion=GD3

which is available in G16 and G09 only in revision D, apparently.

There are also some overlays that can be used to invoke the use dispersion in various scenarios:

IOp(3/74=x) Exchange and Correlation Potentials

-77

-76

-60

-59

DSD-PBEP86 (double hybrid, DFT-D3).

PW6B95-D3.

B2PLYP-D3 (double hybrid, DFT-D3).

B97-D (DFT-D3).

IOp(3/76=x) Mixing of HF and DFT.

-33 PW6B95 and PW6B95-D3 coefficients.

IOp(3/124=x) Empirical dispersion term.

30

40

50

Force dispersion type 3 (Grimme DFT-D3).

Force dispersion type 4 (Grimme DFT-D3(BJ)).

Force dispersion type 5 (Grimme D3, PM7 version).

 

The D3 correction method of Grimme defines the van der Waals energy like:

$\displaystyle E_{\rm disp} = -\frac{1}{2} \sum_{i=1}^{N_{at}} \sum_{j=1}^{N_{at...
...{6ij}} {r_{ij,{L}}^6} +f_{d,8}(r_{ij,L})\,\frac{C_{8ij}} {r_{ij,L}^8} \right ),$

where coefficients $ C_{6ij}$ are adjusted depending on the geometry of atoms i and j. The damping D3 function for is:

$\displaystyle f_{d,n}(r_{ij}) = \frac{s_n}{1+6(r_{ij}/(s_{R,n}R_{0ij}))^{-\alpha_{n}}},$

where the values of s are adjustable parameters fit for the exchange-correlation functionals used in each calculation.

Quick note on WFN(X) files and MP2 calculations #G09 #CompChem


A few weeks back we wrote about using WFN(X) files with MultiWFN in order to find σ-holes in halogen atoms by calculating the maximum potential on a given surface. We later found out that using a chk file to generate a wfn(x) file using the guess=(read,only) keyword didn’t retrieve the MP2 wavefunction but rather the HF wavefunction! Luckily we realized this problem very quickly and were able to fix it. We tried to generate the wfn(x) file with the following keywords at the route section

#p guess=(read,only) density=current

but we kept retrieving the HF values, which we noticed by running the corresponding HF calculation and noticing that every value extracted from the WFN file was exactly the same.

So, if you want a WFN(X) file for post processing an MP2 (or any other post-HartreFock calculation for that matter) ask for it from the beginning of your calculation in the same job. I still don’t know how to work around this or but will be happy to report it whenever I do.

PS. A sincere apology to all subscribers for getting a notification to this post when it wasn’t still finished.

Partial Optimizations with Gaussian09


Sometimes you just need to optimize some fragment or moiety of your molecule for a number of reasons -whether because of its size, your current interest, or to skew the progress of a previous optimization- or maybe you want just some kind of atoms to have their positions optimized. I usually optimize hydrogen atoms when working with crystallographic files but that for some reason I want to preserve the rest of the molecule as refined, in order to keep it under a crystalline field of sorts.
Asking Gaussian to optimize some of the atoms in your molecule requires you to make a list albeit the logic behind it is not quite straightforward to me. This list is invoked by the ReadOptimize keyword in the route section and it includes all atoms by default, you can then further tell G09 which atoms are to be included or excluded from the optimization.
So, for example you want to optimize all atoms EXCEPT hydrogens, then your input should bear the ReadOptimize keyword in the route section and then, at the end of the molecule specification, the following line:

atoms notatoms=H

If you wish to selectively add some atoms to the list while excluding others, here’s an example:

atoms=C H S notatoms=5-8

This list adds, and therefore optimizes, all carbon, hydrogen and sulfur atoms, except atoms 5, 6, 7 and 8, should they be any of the previous elements in the C H S list.
The way I selectively optimize hydrogen atoms is by erasing all atoms from the list -using the noatoms instruction- and then selecting which are to be included in the list -with atoms=H-, but I haven’t tried it with only selecting hydrogen atoms from the start, as in atoms=H

noatoms atoms=H

I probably get very confused because I learned to do this with the now obsolete ReadFreeze keyword; now it sometimes may seem to me like I’m using double negatives or something – please do not optimize all atoms except if they are hydrogen atoms. You can include numbers, ranks or symbols in this list as a final line of your input file.

Common errors (by common I mean I’ve got them):

Lets look at the end of an input I just was working with:

>  AtmSel:  Line=”P  0″
>  Maximum list size exceeded in AddBin.
>  Error termination via Lnk1e in…

AtmSel is the routine which reads the atoms list and I was using a pseudopotential on phosphorous atoms, I placed the atoms list at the end of the file but it should be placed right after the coordinates and the connectivity matrix, should there be one, and thus before any external basis set or pseudopotential or any other specification to be read by Gaussian.

As a sort of test you can use the instruction:

%kjob l103
%chk=myfile.chk
...

at the Link0 section (where your checkpoint is defined). This will kill the job after the link 103 is finished, thus you will only get a list of what parameters were frozen and which were active. Then, if things look ok, you can run the job without the %kjob l103 instruction and get it done.

As usual I hope this helps. Thanks for reading except to those who didn’t read it except for the parts they did read.

Efficient use of the clipboard on GaussView


Editing large molecules on a seemingly simple visualizer as GaussView can be a bit daunting. I’m working on a follow up of that project we recently published in JACS but now we require to attach two macrocycles to the organometallic moiety; the only caveat is that this time we don’t have any crystallographic data with which to start. Generating a 3D model of this structure is already hard enough and even when you managed to do it there are many degrees of freedom that in some cases can lead to unrealistic geometries after optimization.

I recently came across a simple way to edit a large complicated molecule by optimizing the fragments separately and then joining them in a new molecule by using the clipboard. This rather simple method, that I for one had never exploited has just saved me a few good hours.

Copy a molecule (CTRL+C) and it will go to the clipboard as a molecular fragment for which you can define a new hot atom and thus bind it to the other fragment as you would with the regular builder. I strongly suggest to use a “New Molecule Group” instead of editing over an existing molecule. Also, if you are using the “paste” button, observe that it has three different options; you may want to use the last one “append to existing molecule” or you will have your fragments in different windows.

And remember, dihedral angles are your best friends.

Atoms in Molecules (QTAIM) – Flash lesson


As far as population analysis methods goes, the Quantum Theory of Atoms in Molecules (QTAIM) a.k.a Atoms in Molecules (AIM) has become a popular option for defining atomic properties in molecular systems, however, its calculation is a bit tricky and maybe not as straightforward as Mulliken’s or NBO.

Personally I find AIM a philosophical question since, after the introduction of the molecule concept by Stanislao Cannizzaro in 1860 (although previously developed by Amadeo Avogadro who was dead at the time of the Karlsruhe congress), the questions of whether or not an atom retains its identity when bound to others? where does an atom end and the next begins? What are the connections between atoms in a molecule? are truly interesting and far deeper than we usually consider because it takes a big mental leap to think about how matter is organized to give rise to substances. Particularly I’m very interested with the concept of a Molecular Graph which in turn is concerned with the way we “draw lines” to form conceptual molecules. Perhaps in a different post we can go into the detail of the method, which is based in the Laplacian operator of the electron density, but today, I just want to collect the basic steps in getting the most basic AIM answers for any given molecule. Recently, my good friend Pezhman Zarabadi-Poor and I have used rather extensively the following procedure. We hope to have a couple of manuscripts published later on. Therefore, I’ve asked Pezhman to write a sort of guest post on how to run AIMALL, which is our selected program for the integration algorithm.

The first thing we need is a WFN or WFX file, which contains the wavefunction in a Fortran unformatted file on which the Laplacian integration is to be performed. This is achieved in Gaussian09 by incluiding the keyword output=wfn or output=wfx in the route section and adding a name for this file at the bottom line of the input file, e.g.

filename.wfn

(NOTE: WFX is an eXtended version of  WFN; particularly necessary when using pseudopotentials or ECP’s)

Analyzing this file requires the use of a third party software such as AIMALL suite of programs, of which the standard version is free of charge upon registration to their website.

OpenAIMStudio (the accompanying graphical interface) and select the AIMQB program from the run menu as shown in figure 1.

 

Figure 1

Figure 1

Select your WFN/WFX file on which the calculation is to be run. (Figure 2)

 

Figure 2

Figure 2

You can control several options for the integration of the Laplacian of the electron density as well as other features. If your molecules are simple enough, you may go through with a successful and meaningful calculation using the default settings. After the calculation is finished, several result files are obtained. We’ll work in this tutorial only with *.mpgviz (which contains information about the molecular graph, MG) and *.sum (which contains all of  needed numerical data).

Visualization of the MG yields different kinds of critical points, such as: 1) Nuclear Attractor Critical Points (NACP); 2) Bond Critical Points (BCP); 3) Ring CP’s (RCP); and 4) Cage CP’s (CCP).

Of the above, BCP are the ones that indicate the presence of a chemical bond between two atoms, although this conclusion is not without controversy as pointed out by Foroutan-Njead in his paper: C. Foroutan-Nejad, S. Shahbazian and R. Marek, Chemistry – A European Journal, 2014, 20, 10140-10152. However, at a first approximation, BCP’s can help us to explore chemical interactions.

Now, let’s go back to visualizing those MGs (in our examples we’ve used methane and ethylene and acetylene). We open the corresponding *.mpgviz file in AIMStudio and export the image from the file menu and using the save as picture option (figure 3).

Figure 3

Figure 3

The labeled atoms are NACP’s while the green dots correspond to BCP’s. Multiplicity of a bond cannot be discerned within the MG; in order to find out whether a bond is a single, double or triple bond we have to look into the *.sum file, in which we’ll take a look at the bond orders between pairs of atoms in the section labeled “Diatomic Electron Pair Contributions and Delocalization Data” (Figure 4).

Figure 4

Figure 4

Delocalization indexes, DI’s, show the approximate number of electrons shared between two atoms. From the above examples we get the following DI(C,C) values: 1.93 for C2H4 and 2.87 for C2H2; on the other hand, DI(C,H) values are  0.98 for CH4, 0.97 in C2H4 and 0.96 in C2H2. These are our usual bond orders.

This is the first part of a crash tutorial on AIM, in my opinion this is the very basics anyone needs to get started with this interesting and widespread method. Thanks to all who asked about QTAIM, now you have your long answer.

Thanks a lot to my good friend Dr Pezhman Zarabadi-Poor for providing this contribution to the blog, we hope you all find it helpful. Please share and comment.

Some .fchk files wont open in GaussView5.0 (Update)


A couple of weeks ago I posted a solution for a common error regarding .fchk files that will display the error below when opened with GaussView5.0. As I expected, this error has to do with the use of diffuse functions in the basis set and is related to a change of format between Gaussian versions.

CConnectionGFCHK::Parse_GFCHK()
Missing or bad data: Alpha Orbital Energies
Line Number 1234

Although the method described in the previous post works just fine, the following update is a better approach. Due to a change of spelling between G03 and G09 (which has been corrected for G09 but not available for GV versions prior to 5.0.9) one must change “independent” for “independant

To make the change directly from the terminal the following command is needed:

sed -i 's/independent/independant/g' file.fchk

Alternatively you can redirect the output to a new file

sed -e 's/independent/independant/g' file.fchk > newfile.fchk

if you want to keep the old version and work with a new one.

Of course this edition can be performed manually with any text editor available (for example if you work in Windows) but solutions from the terminal always seem easier and a lot more fun to me.

Thanks to Dr. Fernando Cortés for sharing his insight into this issue.

%d bloggers like this: