Recently, I begin to follow the geometry optimization tutorials (https://github.com/psi4/psi4numpy/blob/master/Tutorials/13_Geometry_Optimization/13a_Internal-Coordinates-Bmatrix.ipynb) of the psi4numpy. In this tutorial, the Ammonium molecule has been chosen as the example. In the tutorial, the author gave the codes about how to calculate redundant coordinate, such as bond, angle. However, for general, dihedral torsion should be calculated. Unfortunately, there is no codes about how to calculate it. Can you provide the general codes about calculating redundant coordinates from cartesian coordinates for me?
Thanks a lot,