In order to find the equilibrium geometry of a molecule, its potential hyper surface (PHS) is optimized in Z-matrix coordinates. This requires a potential energy gradient expressed in internal coordinates. To do so the potential energy is written as V X if it is a function of cartesian coordinates and as V C if it is a function of Z-matrix coordinates. Furthermore denoting the Hadamard product with and the sum of Algorithm 3 Calculation of the analytical gradient for the coordinate transformation from cartesian to Z-matrix coordinates Initialize to zero.