# “No variables in Z-matrix” error in scan calculation of Gaussian

I asked a similar question earlier this year but I'm still stuck with a similar problem.

Basically I'm trying to implement a scan calculation using both a z-matrix and Cartesian coordinates. I have the optimized Cartesian coordinates for a nanotube and z-matrix for benzene; I would like to set up the calculation to calculate the potential energy of the system when the benzene molecule is a distance R away from the NT along the z-axis. I'm trying to scan from 2.5 to 5.5 angstroms in 0.1 A intervals.

I've read the Gaussian documentation and it seems like mixing Cartesian and z-matrix coordinates in a scan function is possible but I've tried many different inputs and I still get a "No variables in Z-matrix error."

Here is a my current input file

%mem=40GB
%nproc=4
#P BP86/6-31G scan

Scan using 1 unit nanotube with benzene at 2.5 A

0 1
[Nanotube Cartesian coordinates]

X
X 1 R1
C 2 XC 1 A1
C 2 XC 1 A1 3 60.0
C 2 XC 1 A1 4 60.0
C 2 XC 1 A1 5 60.0
C 2 XC 1 A1 6 60.0
C 2 XC 1 A1 7 60.0
X 3 R1 2 A1 1 0.0
H 3 HC 9 A1 2 180.0
H 4 HC 3 A2 2 180.0
H 5 HC 4 A2 2 180.0
H 6 HC 5 A2 2 180.0
H 7 HC 6 A2 2 180.0
H 8 HC 7 A2 2 180.0

Variables:
R1 2.5 25 0.1

Constants:
XC=1.39893
HC=1.09100
A1=90.0
A2=120.0


System in consideration

Visualization of the z-matrix

Some questions:

• Is there an issue with the route section? I tried replacing "scan" with "opt=modredundant" but that introduces its own errors and its clear I don't know what I'm doing.
• I suspect this is a syntax issue since the documentation for "z-matrix" and "scan" suggests it is possible to keep the nanotube coordinates frozen and just scan the benzene molecule. Is there an issue with my variables and constants section? I've looked at many sample calculations but I didn't find any that consider moving one molecule toward another. If someone can link me to relevant literature regarding (reaction coordinate calculations?) I'm more than willing to look into it; as for now this is the method my professor suggested.
• hm i was never good in the whole z-matrix stuff, but what do you actually want to do here? Why are you using that dummy atom? And if I understand it correctly you are putting the Dummy atom in a distance of R1 to the dummy atom itself? – DSVA Nov 18 '16 at 17:10
• Sorry if I was unclear, I'm trying to calculate the distance (R1) between the benzene and nanotube to which the potential energy of the system is minimum; like this. I used this z-matrix as I read somewhere that the first atom in the z-matrix can't have any parameters associated with it. I originally had the first entry as X 0 0.0 0.0 R1 (where R1 is the Cartesian z-coordinate) but I could not get that to work for the same reason. – Land Nov 18 '16 at 17:25
• ok, do you want to do a relaxed scan or not? z-matrix is usually relaxed (but you fixed everything in benzene and you want to have the NT fixed) and you need to use opt=z-matrix. If you want rigid scans, so only one coordinate changed, you need to use the scan keyword. – DSVA Nov 18 '16 at 17:31
• I believe I need a rigid scan but I might go ahead and try both approaches. I used the scan function but I'm still getting a "No variables in z-matrix" error. I also tried removing all the constants and replacing them with the equivalent values but my syntax apparently still doesn't request the scan of R1 from 2.5 to 5.5 in 0.1A increments. – Land Nov 18 '16 at 17:36

Ok, so I guess I'm on the right way now. Trying to fix such a complex system is always very difficult so what I did was using a similar system, I got one sodium atom instead of your NT and I'm moving the benzene away.

First of all: you got two different dummy atoms in there, atom 1 and atom 9, which I guess makes some problems. Also the extra lines between the sections are a problem.

So here's the input for this, for a first try just from 2.5 in 5 0.5 A steps which at least runs without any errors:

# opt=z-matrix hf/3-21g

Title Card Required

0 2
Na                 0.00000000    0.00000000    0.00000000
X 1 R1
C 2 XC 1 A1
C 2 XC 1 A1 3 60.0
C 2 XC 1 A1 4 60.0
C 2 XC 1 A1 5 60.0
C 2 XC 1 A1 6 60.0
C 2 XC 1 A1 7 60.0
H 3 HC 8 A2 2 180.0
H 4 HC 3 A2 2 180.0
H 5 HC 4 A2 2 180.0
H 6 HC 5 A2 2 180.0
H 7 HC 6 A2 2 180.0
H 8 HC 7 A2 2 180.0

XC=1.39893
HC=1.09100
A1=90.0
A2=120.0
R1 2.5 S 5 0.5


So here's the point. The format basically needs to be exact like this. Everything else will confuse Gaussian. You can substitute the "Na" line with your cartesian coordinates, but then the numbering in the z-matrix section changes! you have to adopt those numbers. Oh and of course if you got a more complex system than one atom you want to not only define the distance of that dummy atom but also the angles, so it's in the right position. You might also need to adept the whole matrix so the benzene has the right orientation in relation to the NT, so at least three atoms in there need to be somehow defined by atoms in the NT.

If you want to have fixed coordinates (what you labeled as constants) in the z-matrix, you can add them after a blank line just below the last section.

However, after a test run I'm not sure if it actually scanned that one coordinate, I just get one structure right now, I have to check how to do the scan correctly.

It works after adding that one 'S' in the coordinate which needs to be scanned.

• So to avoid any problems substituting the Cartesian NT coordinates, can I enter the NT coordinates and just append a dummy atom at X 0.0 0.0 0.0? I forgot to mention that I constructed both molecules so that they are centered on the x-y plane and a distance R1 apart on the z-axis; I wouldn't have to worry about reorienting the z-matrix as far as I can tell. I'll try this out. – Land Nov 18 '16 at 19:12
• I don't think that will work, since all atoms are counted from the top to the bottom. So for your input the first hydrogen atom is oriented at atom 3, 9 and 2. But after adding in the NT those atoms will be part of the NT. I also tried it, you need to get the number up by whatever amount of atoms you add before that. You also need to add the additional angles. I also did just an optimization and it gives the same result. So I'm pretty sure right now that scanning a coordinate which involves a dummy atom doesn't work. I guess that it get's deleted after gaussian build up it's coordinates – DSVA Nov 18 '16 at 19:27
• Ok, I did the input wrong. For scanning the bond length it's 'R1 = 2.5 S 5 0.5' – DSVA Nov 18 '16 at 19:42
• I attempted this but I'm still having issues. I updated the OP for clarity. If I can't use a dummy atom as part of the Cartesian NT coordinates, I don't think there is a way to build my z-matrix for benzene so that the benzene molecules moves away from the NT in the direction of the z-axis. My previous attempt involved just using Cartesian coordinates for the entire system and manually editing the z- axis coordinates for the benzene from 2.5 to 5.5 A but I have many other NT+arene combinations to consider so that would have taken a very long time. – Land Nov 19 '16 at 19:38
• but, do you even need those dummy atoms? I mean yes, you want to have your benzene centeres above the "benzene unit" in the NT and twisted by 60° from what I can see in the picture. But is this the lowest energy configuration? If it is you could just use the length between one of the carbons of the NT and one of the carbons of benzene and scan this, and the benzene will still stay centered above the NT unit. You won't get exact 0.1 A steps from center to center, but that doesn't really matter. – DSVA Nov 20 '16 at 17:48

This is a tedious job as a rigid scan as I am unaware of any GUI program that is able to handle a mixed style coordinate input and modification. DVSA's answer certainly goes into the right direction, but if I'm not mistaken it should perform a (moderedundant) optimisation instead of a scan.

As a start you need to prepare your Cartesian coordinates from your nanotube and insert dummy atoms in strategic places. I am using ChemCraft because it comes with extremely convenient tools. Most importantly in the edit menu there is an entry that lets you insert a dummy atom into the centre of a selected few atoms. Furthermore, you can resymmetrize your molecule later to ensure correct placement.

I placed X (49) in the centre of C (20), C (22), C (33), C (35) and directly above X (50). In the graphic I marked the coordinates which become most important later in construction. The Cartesian coordinates of X (50) will later be substituted and become the first line of the z-matrix.

You will need a very good 3D imagination to build the z-matrix from there, or you built the complete model first and measure angles and distances from there.
My anchor atoms will be X (49), C (22) and C (35) on the nanotube and X (50) for benzene. To get the alignment right, I am hard-coding the placement of the first carbon into the z-matrix, too. It will be directly above C (35).

It is important, that the geometry description block has no blank lines in it. When using the scan keyword all variables become constants. You will therefore need another block after the geometry specification without any blank lines. If you need to make comments, use ! at the beginning of the line.

The following input will probably do what you want. I have used pm6 as a semiempirical level of theory, because it needed to be quick.

#P pm6
scf(xqc)
scan

benzene nanotube scan

0 1
! 49 Fragment C48X nanotube
C        0.000000000      2.427540000      3.559669000
C        1.196378000      2.072187000      2.878637000
C        2.102311000      1.213770000      3.559669000
C        2.392756000      0.000000000      2.878637000
C        2.102311000     -1.213770000      3.559669000
C        1.196378000     -2.072187000      2.878637000
C        0.000000000     -2.427540000      3.559669000
C       -1.196378000     -2.072187000      2.878637000
C       -2.102311000     -1.213770000      3.559669000
C       -2.392756000      0.000000000      2.878637000
C       -2.102311000      1.213770000      3.559669000
C       -1.196378000      2.072187000      2.878637000
C       -1.196582000      2.072541000      1.430870000
C        0.000000000      2.404111000      0.720134000
C        1.196582000      2.072541000      1.430870000
C        2.082021000      1.202055000      0.720134000
C        2.393165000      0.000000000      1.430870000
C        2.082021000     -1.202055000      0.720134000
C        1.196582000     -2.072541000      1.430870000
C        0.000000000     -2.404111000      0.720134000
C       -1.196582000     -2.072541000      1.430870000
C       -2.082021000     -1.202055000      0.720134000
C       -2.393165000      0.000000000      1.430870000
C       -2.082021000      1.202055000      0.720134000
C       -2.082021000      1.202055000     -0.720134000
C       -1.196582000      2.072541000     -1.430870000
C        0.000000000      2.404111000     -0.720134000
C        1.196582000      2.072541000     -1.430870000
C        2.082021000      1.202055000     -0.720134000
C        2.393165000      0.000000000     -1.430870000
C        2.082021000     -1.202055000     -0.720134000
C        1.196582000     -2.072541000     -1.430870000
C        0.000000000     -2.404111000     -0.720134000
C       -1.196582000     -2.072541000     -1.430870000
C       -2.082021000     -1.202055000     -0.720134000
C       -2.393165000      0.000000000     -1.430870000
C       -2.392756000      0.000000000     -2.878637000
C       -2.102311000      1.213770000     -3.559669000
C       -1.196378000      2.072187000     -2.878637000
C        0.000000000      2.427540000     -3.559669000
C        1.196378000      2.072187000     -2.878637000
C        2.102311000      1.213770000     -3.559669000
C        2.392756000      0.000000000     -2.878637000
C        2.102311000     -1.213770000     -3.559669000
C        1.196378000     -2.072187000     -2.878637000
C        0.000000000     -2.427540000     -3.559669000
C       -1.196378000     -2.072187000     -2.878637000
C       -2.102311000     -1.213770000     -3.559669000
X       -1.041010500     -1.803083000      0.000000000
! 13 Fragment C6H6X benzene
X        49   scan        35   90.000      22   90.000
C        50   xcdist      49   90.000      35   00.000
C        50   xcdist      51   sixty       49   ninety
C        50   xcdist      52   sixty       49   ninety
C        50   xcdist      53   sixty       49   ninety
C        50   xcdist      54   sixty       49   ninety
C        50   xcdist      55   sixty       49   ninety
H        51   chdist      52  onetwen      53  oneeigh
H        52   chdist      53  onetwen      54  oneeigh
H        53   chdist      54  onetwen      55  oneeigh
H        54   chdist      55  onetwen      56  oneeigh
H        55   chdist      56  onetwen      51  oneeigh
H        56   chdist      51  onetwen      52  oneeigh
! 12 Fragment H12 nanotube cappings
H        0.000000000      2.646957000      4.621016000
H        2.292332000      1.323479000      4.621016000
H        2.292332000     -1.323479000      4.621016000
H        0.000000000     -2.646957000      4.621016000
H       -2.292332000     -1.323479000      4.621016000
H       -2.292332000      1.323479000      4.621016000
H       -2.292332000      1.323479000     -4.621016000
H        0.000000000      2.646957000     -4.621016000
H        2.292332000      1.323479000     -4.621016000
H        2.292332000     -1.323479000     -4.621016000
H        0.000000000     -2.646957000     -4.621016000
H       -2.292332000     -1.323479000     -4.621016000

scan           2.500      25    0.100
xcdist         1.396
chdist         1.086
sixty         60.000
ninety        90.000
onetwen      120.000
oneeigh      180.000



In my first attempt I forgot the hydrogens so I added them later on. Note that if you change the lines within the Cartesian blocks it does not matter, als long as you don't change the atom numbers of the anchors.

Here is the scan animation of my first attempt (without the hydrogens).

Note that the dummy atoms will be gone in the course of the calculation. Gaussian just needs them to unambiguously define the redundant coordinates.

If you want to run the calculation yourself, you should obtain this table:

 Summary of the potential surface scan:
N     scan         SCF
----  ---------  -----------
1     2.5000      1.14872
2     2.6000      1.12058
3     2.7000      1.10061
4     2.8000      1.08668
5     2.9000      1.07712
6     3.0000      1.07067
7     3.1000      1.06641
8     3.2000      1.06365
9     3.3000      1.06192
10     3.4000      1.06088
11     3.5000      1.06030
12     3.6000      1.06001
13     3.7000      1.05990
14     3.8000      1.05990
15     3.9000      1.05996
16     4.0000      1.06004
17     4.1000      1.06013
18     4.2000      1.06022
19     4.3000      1.06030
20     4.4000      1.06037
21     4.5000      1.06043
22     4.6000      1.06048
23     4.7000      1.06052
24     4.8000      1.06055
25     4.9000      1.06057
26     5.0000      1.06059
----  ---------  -----------


This whole project would probably be easier solved generating the different geometries by hand.