This example emphasizes the difference between the primitive internal coordinate and the corresponding Z-matrix coordinate. The Z-matrix coordinate has to account for attached references, while the definition of the primitive coordinate assumes that the rest of the molecule is fixed. In the first case the Z-matrix coordinate (O 3 , C 2 , C 1 ) and the primitive coordinate coincide. In the second case however it would be inconsistent to just take the derivative after the primitive coordinate (O 3 , C 2 , C 1 ). In the following, we evaluate the derivatives after (O 3 , C 2 , C 1 ), using HF/STO-3G, is 0.007 932 E h rad -1 and 0.019 948 E h rad -1 respectively for the differently referenced Z-matrices. With the previous discussion in mind the derivatives of cartesian coordinates with respect to bonds, angles, and dihedrals in the Z-matrix shall be evaluated, while keeping track of the change of reference frames. This gradient is especially important because it will allow us to transform energy gradients analytically from cartesian to Z-matrix coordinates. Then it is possible to perform geometry optimizations purely in Z-matrix coordinates although most electronic structure methods yield energy gradients in cartesian coordinates.