The Z-matrix format represents molecular coordinates using internal degrees of freedom (bond lengths, bond angles, and torsion angles) rather than Cartesian coordinates, eliminating the 6 redundant coordinates (3 translations and 3 rotations) present in XYZ files; for a molecule with n atoms, the Z-matrix contains n-1 bond lengths, n-2 bond angles, and n-3 torsion angles, ensuring all coordinates are unique and fully defining the molecular geometry.
Z-Matrix Format | Computational Chemistry Explained
Added:this video will discuss how to represent the coordinates of a molecule as a z Matrix so in our previous videos on XYZ files we noted that if we have n atoms then each of those atoms has an X Y and Z coordinate so we have three n coordinates but we also noted that only three n minus six of those three n minus 6 for non-linear polyatomics and three n minus 5 for linear but more often than not three n minus 6 unique coordinates because six of those are what we would call redundant coordinates so three of those were translations where we're net moving the entire molecule through space in X Y or Z and three of those are rotations where we're just rotating around some axis but we're not changing anything about the internal structure of the molecule so another alternative type of file or type of representation for molecular coordinates would be what's called a z Matrix and in a z Matrix you do have three n minus six coordinates so all of your coordinates are going to be unique so what you have in a z Matrix is you have n minus 1 Bond lengths if you have n atoms n minus two Bond angles and N minus three torsion angles as we've been discussing for the past few videos what those quantities are okay so if I wanted to represent a molecule and a z Matrix uh just having this line here for uh noting the line labeling labeling which atom this is but really I'd be starting in this column here with all the elements so the First Column I'd have for any atom I'd have just what element it is whether that's carbon hydrogen or something else indicating what the nucleus is so I have n of those types of lines and for the first atom we don't have any further specification because it's it doesn't matter where in space we put it it only matters where the rest of the atoms are relative to it so that gets rid of three of our redundant coordinates just having the first atom listed by itself then the second atom we list that its element and then we indicate what atom is it bonded to or not really even bonded to but what Atom are we measuring a distance relative to so in this case for atom 2 our only choice is atom1 for what we have it bonded to and the distance from that atom is the only thing that matters it doesn't matter what angle or what direction it is all that matters is how far away these two atoms are from one another and that gets rid of another two redundant coordinates so we have five redundant coordinates accounted for thus far by only having one unique internal coordinate for our two atoms then atom three we have declaring its element there then we say the atom number of what it's bonded to distance from that atom and then we say what completes a bond angle so angle three one two so angle between this hydrogen that carbon and that carbon and we say in degrees what is that angle 110.6 degrees in this case right and then that accounts for our sixth and final redundant coordinate so we have these six redundant coordinates which we never specified here and then every Atom from atom four up until atom n the rest of the entire molecule what we specify for each atom is three coordinates we specify its distance from a specified atom number we specify its Bond angle from those uh three sets of atom numbers and we specify in addition a torsion angle in this case this would be torsion four one two three and we're specifying here that that is negative 120 degrees so as you may have guessed from this at this point um I have two carbons here and six hydrogens so this is probably going to be an ethane molecule and indeed it is if I pull this up in Avogadro if I have them clicked on this label here this particular x y z file is coming from in all the directory structure of the stuff I've got here on uh from the GitHub from the computational chemistry Repository opening that inside the Jupiter notebook top level going to GM where I store all these geometries going to x y z directory then there's a bunch of XYZ files in that directory and this is actually the ethane dot XYZ file that I'm reading here and displaying in Avogadro so that's the XYZ file you get from the Z Matrix that we're building so we have things like if I want to measure using this measurement tool I can say Bond length one two was 1.512 angstroms so as we see there that's what that was three one two should be 1.09 angstroms 110.6 degrees so let's see click off of that where's three three one two 110.6 degrees 1.094 angstroms so that's all good atom four we have four one two three four one two three and that is a dihedral or torsion of negative 120 degrees angle of 110.6 and distance of 1.094. so notice here that atoms three and four aren't actually bonded and we don't need them to be bonded for this to work we just need them to be atoms that are already declared in our molecule so I don't have to have the Restriction that these are actually bonded to one another I just have to have the Restriction that anything I declare in atom 4 has to be above atom four so one two and three anything in atom five has to be above atom five six seven and eight all of them can only be declared in terms of atoms which are above them in the molecule and doing so otherwise will result in an error okay so that is the basic introduction to the Z Matrix I have additionally inside of that same repository if I go up to the geom directory I believe I have a subdirectory here called zmat zmat click on that where I have a bunch of different Z matrices for different types of molecules like it's a chloromethane if that'll load yep so that's in this case I'm basically just doing what an XYZ file would do number of atoms comment line and then the Z Matrix starting from there this isn't an official type of file format this is just something that I uh that I made up and put together but there's all those examples in that directory there then additionally if you go to the scripts directory and then down to Geometry analysis you'll notice there's this zmat2xyz dot Pi script and in there that script will take an input of a z Matrix file that you have declared in this sort of style that I've got there and it will convert that into an XYZ format for you so at doing an example in our from the top level notebooks directory and this geometry analysis notebook I've been using in this chapter I'm going to do run scripts geometry analysis zmat to XYZ and the file I'm going to run that on is this ethane.zmat so hit shift enter and there it produces for me an XYZ file from that Z matrix it's probably not going to be the exact same XYZ file I had before because as we mentioned XYZ coordinates do have all of these redundancies in them but it will be one which has the same internal degrees of freedom as this thing which we've been looking at in Avogadro
Up Next

Molecular Geometry Introduction: VSEPR Bonding Shapes
@KyleHermanEHT
131 views•2020-02-10

The Jablonski Diagram: Radiative and Non-Radiative Transitions | Photochemistry
@benedictugi8420
262 views•2025-07-15

Force Field Parameters in Computational Chemistry
@TMPChem
21K views•2017-03-16

Edible Water Bottles: A DIY Guide to Sodium Alginate Spherification
@ryan
10.5M views•2019-06-21
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Chemistry










![chapter 4 , structure of molecule [class 9] || class 9th chemistry](https://i.ytimg.com/vi_webp/1mC06ifLRrY/maxresdefault.webp)





























