### Building Z matrices using Molden

There are three common ways of obtaining a starting geometry for molecular modelling:
1. Import a previously measured or calculated geometry, e.g. from a crystal structure
2. Build the molecule using on-screen building facilities in a modelling program such as Arguslab
3. Create a Z matrix by hand, or using a Z matrix editor such as Molden
• Method 1 is good if you have access to a previous geometry
• Method 2 is best for unsymmetric organic molecules
• Method 3 is good for relatively simple molecules with symmetry, where symmetry must be retained during geometry optimisation, e.g. because it is known from spectroscopy that the molecule has this symmetry
• It is also useful for coordination numbers greater than four, e.g. in octahedral complexes, which PC modelling programs do not always cope with very well

#### What is a Z matrix?

• The most obvious way of specifying a molecular geometry is to give x, y and z coordinates of each of its atoms, usually in Angstrom units on Cartesian axes, as in an .xyz file or a MDL .mol file.   The positions of the atoms relative to each other would be defined with three less coordinates than this, e.g. by defining one atom to be at position 0,0,0
• As chemists, we think of molecular geometry in terms of bond lengths, angles, etc., rather than as atomic coordinates from which such parameters can be derived
• The amount of information (i.e. number of numbers required), in the minimum table of bond lengths, angles, etc. required to define the molecule, is the same as in a table of Cartesian coordinates such as an .xyz file
• This minimum table of relationships between atoms is called a Z matrix
• It is an alternative coordinate system
• Programs such as Molden or Gaussian can easily calculate Cartesian coordinates from a Z matrix by elementary three-dimensional trigonometry
• They can also perform the reverse transformation, but the resulting Z matrix may not be of much use to a chemist, since the order of the atoms, in specifying what is connected to what, is critical to whether it can easily be altered, e.g. to change a substituent
• If you are going to use Z matrices, it is better to construct them yourself

#### Models of PCl5 and its derivatives

In this exercise, you will construct starting geometries for tetrahedral [PCl4]+, trigonal bipyramidal PCl5, and octahedral [PCl6]-.  These are chosen as the simplest common examples of related species in all three major geometries, which can be modelled by the pm3 method.  In future exercises, you will optimise the geometries and calculate modes of vibration for them

#### Using Molden to construct [PCl4]+

• Before you can do this exercise you must have opened a signon to unix in the time-sharing computer aidan, using Secure Shell Client and Exceed.  Molden can be used only with an X-windows server such as Exceed
• In order to get at Molden easily you must also have set up your unix id to use BWT's commands.  That is assumed in the following instructions
• In your xterm window, from your signon directory work, change to the directory g98, by giving the command
• cd g98
• This is where you will create your own molecular model files in the unix file system, and keep them for use in a later drylab
• Give the command
• molden
remembering to use only lower case letters
• A black Molden window and a blue Molden control window full of buttons open
• If there is room, pull the black window towards the left of the screen, and the blue window towards the right, so that they do not overlap
• It does not matter if they do, but it is less convenient:  from the blue window you can always go to the black window by clicking its title bar, while from the black window clicking the right mouse button brings forward the control window and any others that Molden has opened
• Under Draw Mode, click Solid, Ball & Stick
• This will give you balls to click on when you are creating a model:  it is difficult to click on wire models
• This will make balls which are easier to see
• Click ZMAT Editor.  A blue Zmatrix Editor window with a blank fawn pane within it appears
• To start, click Add Line.  A Periodic Table appears.  If you wanted a double or triple bond length to the previous atom, you would now click the appropriate button, before selecting the element, but this is the first atom, and anyway we will work on the assumption of single bonds in these species
• You should model [PCl4]+ first.  Always give the central atom first, so click on phosphorus in the Periodic Table
• A large purple ball will appear in the black window, and a red P at the top of the Z matrix pane.  This is the atom to which the next atom will be related
• Click Add Line again, and select chlorine
• You now get a message 'Select 1 Atoms to define the connectivity of this Center'
• When you move the mouse cursor over the black window, it changes to square target, which Molden uses for picking
• Click on the centre of the phosphorus atom in the black window
• You now have a green chlorine ball joined to the purple phosphorus ball
• Select the Zmatrix Editor window by clicking on an unoccupied place of its blue background
• You now have the second line of the Z matrix, which shows that Cl is connected to atom 1 (which is P) with a bond length of 2.02 Angstroms, which is a good enough starting guess
• Add a second chlorine:  this time you get the message 'Select 2 Atoms to define the connectivity of this Center'
• Click the title bar of the black window to bring it all into view
• You need to click first the atom to which the new chlorine is to be connected, i.e. the purple phosphorus, then the atom to which a bond angle is to be defined, i.e. the chlorine
• If your PC has its beep enabled, you should hear a beep when you pick an atom, but if not, be careful to aim at the centres of the balls, as you will have no acknowledgement that you have clicked until it is too late and you have clicked the balls in the wrong order
• If that happens at any time in these exercises, rub out the wrong line of the Z matrix by clicking Delete Line, and repeat adding the atom, before you go on any further
• Because you are defining new atoms relative to previous ones, you must correct mistakes as you go along
• You now have a bent triatomic molecule
• The new, third line of the Z matrix shows a bond length to atom 1 (P) and a bond angle through that atom to atom 2, which is the first chlorine you added
• The bond angle defaults to the tetrahedral angle, which happens to be what you need for this geometry
• For the next chlorine atom you add, you will be asked to select three atoms
• In the remaining exercises, some thought is needed about strategy at this point, but here we can do the obvious
• Select P as the first atom again
• For the second atom, use the same chlorine as last time, i.e. the one horizontally situated relative to the phosphorus, since the second, third and fourth chlorine atoms all have the same angle to the first one
• A fawn line is drawn along the P-Cl bond
• The third atom to be selected is one to which a dihedral angle is to be defined
• Click on the other chlorine atom
• In the new, fourth line of the Z matrix, the final columns have been filled in, showing a dihedral angle of 1200 to atom 3, which is the second chlorine you added
• This also is conveniently correct for a tetrahedron
• To illustrate what this means, which you must understand before you can proceed, right click on the black background of the model window, to raise the Molden Control window
• Click the Dihedral button
• In the white pane at the bottom of the Molden Control window, you get the message 'Click on four atoms !'
• In the black, model window, select the atoms in the same order as implied by the line of the Z matrix, i.e. click the new chlorine atom (sticking towards you) first (since that is the atom whose Z matrix line it is), then the phosphorus
• The fawn indicator lines must be drawn as you go along, otherwise you have not succeeded in clicking on the centres of the balls
The third atom to select is the bond angle chlorine (horizontal), and the fourth atom is the dihedral atom chlorine (pointing upwards)
• The three fawn indicator lines, with the last one going through space between the two ligands, describe a very distorted letter Z, which is why this system of coordinates is called a Z matrix
• So that you can see it better, you are going to turn the model so that you look down the middle, connecting line of this Z, i.e. from the 'bond distance atom' P to the 'bond angle atom' Cl
• First click on the black spot at the bottom right of the controls window
• This causes sticky mouse pointer rotation
• (Anywhere) in the black model window, carefully left drag horizontally to the right, until the 'bond angle chlorine' disappears completely behind the phosphorus
• You are now looking down the centre line of the Z
• You see the bond to the new chlorine atom (at the bottom of the window) and the bond to the 'dihedral atom chlorine' (at the top of the window) both as projections on a plane perpendicular to the centre line of the Z (from the 'bond distance atom' P to the 'bond angle atom' Cl)
• You see that to go from the projection of the bond to the new atom, to the projection of the bond to the 'dihedral atom', you need to turn your head clockwise by 1200
• The entry in the Dihedral column of the Z matrix is (+)120.0
• When you have finished constructing your tetrahedron, the view you are now looking at will be down a three-fold axis, so you knew already that the dihedral angle should be 1200
• Restore the original view by left dragging until the 'bond angle chlorine' is back on the left side of the window
• The bottom chlorine should still have a red circle around it, because that is still the current atom in the Z matrix
• Add the fourth chlorine in exactly the same way as the previous, third chlorine, i.e. use the horizontal chlorine as the bond angle atom, and the top chlorine as the dihedral angle atom
• This is a clearer way of doing it than using the previous chlorine as the dihedral angle atom
• The fourth ligand appears at the back of the model
• The dihedral angle in the last line of the Z matrix is shown as 2400, which is the same as -1200
• Try clicking this dihedral angle box in the Z matrix, and backspace to completely delete the number.  Type in -1200 and click Apply Changes to current Z-Mat  Nothing should happen to the appearance of the model
• A negative dihedral angle means an anticlockwise rotation relative to the bond to the dihedral angle atom

#### Saving and Symmetry

Now you have a model (though not an optimised one yet) of [PCl4]+.  Your next job is to save it for later
• First save the model as a simple .xyz file of Cartesian coordinates, which Molden will create for you
• At the bottom of the Zmatrix Editor window, click the Cartesian button, then XYZ
• In the 'File name ?' box, type pcl4.xyz then click Write Z-Matrix
• A 'Successfully wrote file:' message appears
• You can look at the file you have just written, as follows
• In another xterm window (if you created only one when you signed on, create another now by xterm & in your Secure Shell Client window) cd to g98 and enter dir
• You should see a directory listing including your file pcl4.xyz
• Give the command more pcl4.xyz, in which you can pick up the name of the file from the directory listing by X-windows copy and paste, which you should practice
• You will see that phosphorus, atom 1 in your Z matrix, has been given the coordinates 0,0,0
• The first Cl differs only in z coordinate, so it lies along the z axis
• The second Cl lies in the xz plane, and the other two are symmetrically on each side of it, with equal but opposite y coordinates
• Next you will save the model as a Z matrix
• Leave the second xterm window open and select the Molden Zmatrix Editor window
• Click the Gaussian button at the bottom of the window
• Alter the file name to pcl4.com, which has the file name extension for command files for Gaussian
• Click Write Z-Matrix
• Give the command more pcl4.com in your spare xterm window
• You will see a Z matrix just like the one in Molden, but with variable names instead of bond lengths, angles, or dihedral angles
• Underneath the Z matrix is a list of these variables and the numeric values they have at present
• This is all ready for a modelling program to change the values as it optimises the geometry
• Next you will fix the symmetry of the species (so that an unsophisticated modelling program will not change it)
• Go back to the Molden Zmatrix Editor window
• For a regular tetrahedron, you need to fix all the angles as constant, and make all the bond lengths be variable but tied together so that they always have the same value
• This is done by using the same variable name for all the bond lengths in the written-out Z matrix, and using actual numbers rather than variable names for all the constants in the Z matrix
• You need to use the simulation of a unix mouse middle button for this.  On a simple two-button mouse, this is pressing both buttons at once, while on a wheel mouse it may be pushing the wheel inwards.  Whichever it is, do it to to the bond length box for the second chlorine (atom 3) in the Z matrix
• A message 'Click on a Z-matrix Bondlength' appears (further down the window)
• Left click on the bond length for the first chlorine (atom 2).  The linked bond length turns yellow to show that it is now dependent
• Repeat the process for the other two chlorine bond lengths
• After this, only the first chlorine bond length should be independently variable (grey background)
• Now treat all the bond angles and dihedral angles similarly, but select constant instead of link from the dropdown list
• No further click is required, and the angle box turns green to show that it is a happily fixed constant
• In the end, the only variable (grey background) left in the whole Z matrix should be the one bond length
• Now click Write Z-matrix to overwrite your previous file pcl4.com
• Look at its contents again in the spare xterm window
• Now you will see that there is only the one variable below the matrix for the modelling program to optimise

#### A model of PCl5

This molecule, with trigonal bipyramidal symmetry, is known in the gas phase, though the solid is [PCl4]+[PCl6]-.  Besides having to type in some angles yourself, the difference of this case from that of [PCl4]+ is that one of the angles, between the two apical (axial) bonds, is 1800.
• However distorting your eyesight, a Z must have two bends in it, otherwise it is not a Z
• In other words, you cannot define a dihedral angle if either of the two bond angles connecting the four atoms is 1800, because the projection of one of the end bonds would be a point, not a line to which a dihedral angle could be defined
• This is a problem which occurs for linear groups such as azide or terminal carbonyl, or in linear arrangements within higher symmetry systems such as trigonal bipyramidal or octahedral
• For the bigger coordination numbers, the solution is simple:  you just have to define the atoms in an order such that they can all be at a non-linear angle to a previously defined pair
• For the trigonal bipyramid, if you add one of the apical ligands first, and try to define the other ligands relative to it, you will get stuck when you come to the other apical ligand trans to it
• If you start with one of the equatorial ligands, none of the remaining ligands is trans to it, so there is no problem
• It is easiest here to start the model from nothing, rather than modify the previous one, so click New Z-mat, which rubs out the old one
• Add phosphorus and the first two chlorine atoms to produce the bent triatomic molecule as before
• Now edit the bond angle from the default tetrahedral angle, to 1200, the equatorial angle in a trigonal bipyramid
• Click Apply Changes to current Z-Mat
• Now add the third equatorial chlorine
• Molden sets its bond angle to 1200, the same as the previous
• It knows about trigonal planar species, so it sets the dihedral angle to 1800, in other words, the angle about one of the three two-fold axes
• What would happen if you set the dihedral angle to 00?  Try it, then set it back to 1800
• Now add the first apical chlorine, defining it relative to the first two chlorines as before
• Alter the bond angle to 900
• Whoops!  Something a bit non chemical has happened to the model!  You have a strong bond between the new chlorine and one of the others, when really there should only have been Van der Waals interaction
• Clearly, the dihedral angle is wrong, and is causing the atoms to be closer than the sum of their covalent radii, so Molden thinks they should be displayed as bonded
• Like an .xyz file, the data within Molden does not contain bond information:  it decides what to display as bonded and what not, purely from interatomic distances, as it goes along
• What it labels as BondLength in its Zmatrix Editor window may not be the length of a chemical bond:  it is just the distance between the two atoms.  However, when, as now, you add lines to a Z matrix, it sets the default distance appropriately for a bond between the two elements
• What should the dihedral angle be?
• If in doubt, left click on the dihedral angle in the Z matrix, then turn the model so that the green ringed (a bit hard to see against the green ball!) 'bond angle' chlorine is at the back
• The red ringed chlorine is the new one
• What should its dihedral angle be to the blue ringed 'dihedral angle' chlorine?
• Set the dihedral angle to this value and click Apply Changes to current Z-Mat
• Add the other apical ligand in the same way, setting the bond angle to the first equatorial chlorine to 900
• What should the dihedral angle be this time, to make the final apical chlorine come out trans to the first?
• Do it
• Save the Cartesian XYZ file as pcl5.xyz, as before, remembering to change the output format as well the file name before clicking Write Z-Matrix
• To set the symmetry, again all the angles are known constants, so make them green as before
• There are now two different bond lengths, one for equatorial ligands and one for apical ligands
• They are all the same at present, because Molden does not know about trigonal bipyramids, but they will not be after optimisation by Gaussian
• Link the second and third equatorial chlorine bond lengths (atoms 3 and 4) to the first (atom 2), and the second apical bond length (atom 6) to the first (atom 5)
• You should have two bond lengths left on grey backgrounds
• Change the apical bond length to a bit longer, e.g. 2.2, and click Apply Changes to current Z-Mat
• The linked bond length changes automatically to follow the variable one
• The reason for making this adjustment is so that Gaussian does not think you meant the two kinds of bond lengths to stay equal, even though you did not assign them to the same variable.  Modelling programs can get too clever sometimes in trying to read your mind
• Change to Gaussian output format and write the Z matrix as pcl5.com

#### A model of [PCl6]-

• Do this in the same way as for the trigonal bipyramid
• Think of the first ligand you add as defining an axis, and the next four ligands as being equatorial about that axis, so they all have 900 bond angles to the first, and various dihedral angles to each other
• The real difficulty is, that because of the symmetry of the system, the ligands keep getting in the way when you need to click three atoms in adding the next one
• You just have to keep turning the molecule round
• It will be easier to see if you make it smaller by zooming out using the Out button on the control panel, and setting shading on using the Shade button
• Click on the last dihedral angle done in the Zmatrix Editor window, so as to label the balls with coloured rings
• Remember that the second atom to click, after phosphorus, is the green ringed ball, and the third atom is the blue ringed ball
• Rotate the molecule so that you can see the centres of all three of these balls, before you click on Add Line.  Once you are into the Add Line conversation, you can no longer rotate the molecule, which is a deficiency of this version of Molden
• If you get stuck in this way, just add the atom to anywhere in the molecule, and then remove it with Delete Line
• Note that you cannot add the final, axial ligand in the same way:  to avoid the 1800 bond angle, you must chose one of the 'equatorial' ligands, e.g. atom 3, to define the bond angle to
• Then you can define the dihedral angle as back to the first chlorine (atom 2), when it will be 1800
• As for the tetrahedral case, make all the angles constant and link the last five bond lengths to chlorine to the first
• Save in Cartesian XYZ and Gaussian formats, as pcl6.xyz and pcl6.com respectively
• Exit from Molden by clicking the Skull and Crossbones button, OK
Remember that to log off from unix, you enter exit in each xterm window, to close it, then exit in the Secure Shell Client window.  Finally close the Secure Shell Client window.