# Pros and cons of Cartesian vs. Z-matrix representations of molecules?

Over the course of my studies, I have switched largely from using Z-matrix representations of molecular geometries in calculations to Cartesian representations.

The software that I use now makes it easy to add the sorts of constraints/restraints/transits that I would have previously used Z-matrices for, and I know that Z-matrix geometries can be problematic in large molecules* where minute changes in a bond angle or dihedral (due, for instance, to rounding errors/low-quality gradients) can result in large movements in peripheral atoms.

What pros or cons exist for either geometry definition that I don't know about? What circumstances recommend one representation over another?

*Or small molecules with silly Z-matrices.

Cartesian Space

In Cartesian space, three variables (XYZ) are used to describe the position of a point in space, typically an atomic nucleus or a basis function. To describe the locations of two atomic nuclei, a total of 6 variables must be written down and kept track of. The general ruling is that for Cartesian space, 3N variables must be accounted for (where N is the number of points in space you wish to index).

Internal Coordinates

Z-matrices use a different approach. When dealing with Z-matrices, we keep track of the relative positions of points in space. Cartesian space is 'absolute' so to speak. A point located at (0,0,1) is an absolute location for a coordinate space that extends to infinity. However, consider a two atom system. The translation of the molecule through space (assuming a vacuum) will have no affect on the properties of the molecule. An H2 molecule centered around the origin (0,0,0) is no different from the same H2 molecule being centered around (1,1,1). However, say we increase the distance between the hydrogen atoms. We now have altered the molecule in such a way that the properties of that molecule has changed. What did we change? We simply changed the bond length, one variable. We increased the distance between the two atoms by some length R. With Z-matrices, we keep tabs on internal coordinates: bond length (R), bond angle (A), and torsional/dihedral angle (T/D). Using internal coordinates reduces our 3N requirement set by the Cartesian space down to a 3N-6 requirement (for non-linear molecules). For linear molecules we keep tabs on 3N-5 coordinates. When performing complex computations, the less you have to keep track of, the less expensive the computation.

Symmetry

Consider the following molecule, H2O. We know from experience that this molecule has C2V symmetry. The OH bond lengths should be equivalent. When using some sort of optimizing routine, you may want to specify symmetry in your system. With a Z-matrix, the process is very straightforward. You would construct your Z-matrix to define the OH(1) bond as being equivalent to the OH(2) bond. Whatever program you use should automatically recognize the constraint and will optimize your molecule accordingly giving you an answer based off a structure that is constrained to C2v symmetry. With Cartesian space this is not guaranteed. Rounding errors can cause your program to break symmetry, or your program may not be very good at guessing the point group of your molecule based on the Cartesian coordinates alone.

Picking the Right One

As a preface, programs like Gaussian convert your Cartesian coordinate space (or your pre-defined Z-matrix) into redundant internal coordinates before proceeding with an optimization routine unless you specify it to stick with Cartesians or your Z-matrix. I warn you that specifying your program to optimize using Cartesian coordinates makes your calculation much more expensive. I find that I will explicitly specify 'Z-matrix' when I know I'm dealing with high symmetry and when I know my Z-matrix is perfect.

You will want to use Z-matrices on systems that are rather small. If dealing with systems with high symmetry, Z-matrices are almost essential. They can be rather tricky to implement and you will likely spend some time figuring out the proper form of your Z-matrix through trial-and-error. If you wish to scan a particular coordinate, Z-matrices are also very helpful as you can tell a program to scan across a bond length, angle or torsion with ease (as long as you've properly defined that coordinate in your Z-matrix).

I use Cartesian coordinates for large systems, systems with very little or no symmetry, or when I'm in a hurry.

• This seems to be a pretty comprehensive answer! Regarding your comment about the reduction of degrees of freedom in the Z-matrix specification w/r/t Cartesians, I would have thought the smaller number of variables would result in virtually meaningless performance improvements for nontrivial molecules. – Richard Terrett May 2 '12 at 13:22
• Richard, the problem is that there can be very many specific scenarios where Cartesian space can actually be more efficient than using internals. My post generalizes some rules-of-thumb so to speak. Efficiency within a certain application is not as straightforward as you may think (see jcp.aip.org/resource/1/jcpsa6/v127/i23/p234105_s1 for an example). I just thought I should clarify this point. – LordStryker May 2 '12 at 14:00

Ring systems (like benzene) are the canonical example of when Z-matrices go awry. A Z-matrix cannot contain all the bond coordinates of the ring. One either has to suffer an intrinsically asymmetric description of a highly symmetric system, which is both intellectually unsatisfying and can lead to practical numerical convergence issues arising from broken symmetries, or otherwise define one or more dummy atoms in the Z-matrix, which is then no longer a minimally redundant description of the system.

The choice of coordinate system really depends on the intended calculation. There are more than two choices of coordinate system that can be used, by the way. While internal coordinates are often erroneously considered synonymous with Z-matrices, there are in fact many other internal coordinate systems that are not Z-matrices, such as pairwise distance coordinates or the various redundant internal coordinate systems.

Some specific examples:

• Redundant internal coordinates are the most efficient known coordinate systems for carrying out geometry optimizations. Roughly speaking, the redundancy is useful for avoiding singularities in nonredundant systems like Z-matrices, and minimizing the correlations (lack of independence) between coordinates that occur in coordinate systems like Cartesian coordinates that result in large off-diagonal cross terms in the Hessian matrix. You can find more details in the original literature which is cited in any quantum chemistry package's user manual.
• If you are coding up analytic gradients, these tend to be simplest in Cartesian coordinates because you don't have to worry about curvilinear effects in the Hessian matrix. Non-Cartesian coordinates have extra terms in gradient expressions arising from Jacobians; these can be fairly expensive to calculate.

• Z-matrices themselves are often useful when creating interpolations along a specific internal coordinate like a specific torsional mode, because they are an internal coordinate system that is not redundant and hence allow various internal coordinates to be varied independently.

• Very helpful answer! I'm especially interested in your mention of pairwise distance coordinates. Is this just a distance matrix? Wouldn't it be very inefficient given its maximum redundancy? – Richard Terrett May 12 '12 at 6:25
• Yes. I don't think I said anything about whether it was actually found to be useful for any particular application... – Jiahao Chen May 12 '12 at 7:06
• Distance matrices are actually quite handy in certain situations. It is very simple to convert from Cartesian coordinates to a distance matrix, and relatively easy to transform back into Cartesians. The distance matrix also has the very useful property of being translationally and rotationally invariant. – uLoop Jan 30 '18 at 12:56