Structure input using z-matrix internal coordinates
Creating a z-matrix geometry with z_create
Z-matrices offer a convenient way of defining small molecules by their internal coordinates (bond lengths, angles and dihedrals). ChemShell supports input in z-matrix format as well as Cartesians. The example water1.chm in setup_zmatrix shows how the z_create command is used to create a ChemShell z-matrix object:
z_create zmatrix=water_zmat.pun { zmatrix angstrom o h 1 oh h 1 oh 2 hoh variables oh 1.0 hoh 100.0 }
The data is written to the file water_zmat.pun in ChemShell's internal format.
If you need to represent a z-matrix object which you have in ChemShell format in a more easily edited form you can regenerate the input records which z_create would need to produce it. This example writes them to a file with .zmt extension.
# Write the zmatrix in record format to a file set fp [ open water.zmt w] puts $fp [ z_prepare_input zmatrix=water_zmat.pun ] close $fp
In general ChemShell operations (e.g. geometry optimisation with DL-FIND) require coordinates to be defined in Cartesian format. The command z_to_c is provided to convert from a z-matrix representation into Cartesians.
# Build the Cartesian coordinates z_to_c zmatrix = water_zmat.pun coords=water_xyz.pun # list_molecule coords=water_xyz.pun
Creating a z-matrix with symbols instead of atom numbers
An addition feature of the z-matrix specification is that symbols can be used instead of atom numbers, as in water2.chm.
% z_create zmatrix=water2.pun { zmatrix angstrom o h%1 o roh1 h%2 o roh2 h%1 ahoh variables roh1 1.0 roh2 1.0 ahoh 100. end } %
Note that the z-matrix definitions have been given relative to the atom names. It is therefore necessary to distinguish between the H-atoms.
The contents of the zmatrix object can be displayed using the z_list command, which also displays how the z-matrix translates into Cartesian coordinates.
% z_list zmatrix=water.zz1 Z-Matrix: Z-atoms: o 0 0.000 0 0.000 0 0.000 h 1 1.890 roh1 0 0.000 0 0.000 h 1 1.890 roh2 2 100.000 ahoh 0 0.000 Coordinates: o 0.000 0.000 0.000 h 0.000 0.000 1.890 h 1.861 0.000 -0.328 %
Mixed Internal/Cartesian specification
The script mixed.chm contains an example of the mixed internal/Cartesian format. Note the three dummy atoms, which ensure that the Cartesian part has same conventions (first atom at the origin, second at +z, third in the xz plane) as a normal z-matrix does.
z_create zmatrix=mixed_zmat.pun { coordinates angstrom X 0.000000 0.000000 0.000000 X 0.000000 0.000000 1.000000 X 1.000000 0.000000 1.000000 C 0.067040 0.116116 -0.096260 C 0.102104 0.176849 1.438115 H 1.102982 0.175567 -0.497154 C -0.644948 -1.117082 -0.670165 H -0.399446 1.042994 -0.497154 H -0.398469 -0.690168 1.920517 H 1.155516 0.209265 1.790997 H -0.396530 1.105339 1.790997 H -1.037310 -1.796673 0.112659 H -1.493227 -0.795720 -1.310015 zmatrix angstrom O 7 r14 13 a14 5 0.0000 H 14 r15 7 a15 13 t15 variables angstrom r14 1.110072 r15 1.000000 a14 107.517702 a15 120.000000 t15 179.999999 }