Skip to content

Preparing the Gaussian Input File

The example below performs a relaxed, 11-point scan of the O–H bond length in the formic acid dimer, from 0.90 Å to 1.10 Å in steps of 0.02 Å.

%nprocshared=1
%mem=2GB
%chk=formicacid-scan.chk
# opt=z-matrix b3lyp/6-31g

Title Card Required

0 1
 C
 H                  1            B1
 O                  1            B2    2            A1
 H                  3            B3    1            A2    2            D1    0
 O                  1            B4    3            A3    4            D2    0
 C                  5            B5    1            A4    3            D3    0
 H                  6            B6    5            A5    1            D4    0
 O                  6            B7    5            A6    1            D5    0
 O                  6            B8    5            A7    1            D6    0
 H                  8            B9    6            A8    5            D7    0
variables:
   B1             1.08977715
   B2             1.33055128
   B4             1.24983967
   B5             3.32414104
   B6             1.08977715
   B7             1.33055128
   B8             1.24983967
   B9             1.02059660
   A1           112.23346753
   A2           114.22074522
   A3           126.02834481
   A4           102.25181600
   A5           160.51358907
   A6            48.28017468
   A7            77.74818057
   A8           114.22074522
   D1          -179.93852601
   D2             0.05125513
   D3            -0.04591904
   D4          -179.85321821
   D5           179.99633016
   D6             0.03274383
   D7             0.00725467
constants:
   B3             0.90 s 10 0.02

Link 0 and Route Section

# opt=z-matrix b3lyp/6-31g
  • opt=z-matrix — tells Gaussian to optimize directly in the Z-matrix internal coordinates given below, rather than converting to its own default redundant internal coordinates. This is what allows a Z-matrix variable to be marked directly for scanning.
  • b3lyp/6-31g — the level of theory at which every point of the scan is optimized.

The Z-Matrix, Variables, and Constants

The molecule is described as a Z-matrix: each atom after the first is placed relative to earlier atoms using a bond length, a bond angle, and (from the fourth atom onward) a dihedral angle. The variables: block lists every parameter that is free to optimize. The constants: block lists parameters held fixed — and this is where the scan is defined:

constants:
   B3             0.90 s 10 0.02

This line means:

  • B3 — the Z-matrix variable being scanned (here, the O–H bond between atom 4 and atom 3).
  • 0.90 — the starting value, in Ångströms.
  • s 10 0.02 — take 10 additional steps of 0.02 Å each, for 11 total scan points: 0.90, 0.92, 0.94, … up to 1.10 Å.

At every one of those 11 values of B3, Gaussian fully re-optimizes all of the remaining variables (B1, B2, B4, B5, B6–B9, A1–A8, D1–D7) — this is what makes it a relaxed scan rather than a rigid one.


Scanning a Bond Angle or a Dihedral Angle Instead

The same syntax applies to any Z-matrix variable — only the coordinate type changes:

constants:
   A2             100.0 s 10 5.0

scans the bond angle A2 from 100° to 150° in ten 5° steps, and

constants:
   D1             0.0 s 11 30.0

scans the dihedral D1 through a full 360° rotation in eleven 30° steps. In every case the format is the same: start-value s nsteps step-size, and everything not marked as a scanned constant is relaxed at each point.


The Modredundant Alternative

Z-matrix scanning (used here) requires the whole molecule to be described as a Z-matrix and needs opt=z-matrix. A more flexible alternative, usable with ordinary Cartesian coordinates, is opt=modredundant, where the scan is specified by atom indices in a separate block after the coordinates:

# opt=modredundant b3lyp/6-31g

...Cartesian coordinates...

B 3 4 S 10 0.02
A 1 3 4 S 10 5.0
D 2 1 3 4 S 11 30.0

Here B, A, and D mark a bond, angle, or dihedral by the atom numbers involved, followed by the same S nsteps stepsize scan specification. Both approaches produce an identical style of relaxed scan — modredundant is generally preferred for larger or less symmetric molecules where writing a full Z-matrix by hand is inconvenient.