Background#
This page details what molecular geometry standardization is and its value, as well as the mathematics of MolOrient, and existing algorithms/software similar to MolOrient.
Molecular Geometry Standardization#
Molecular geometry standardization is the act of enforcing a set of rules on a molecular geometry to ensure that every translated or rotated copy of a molecule is mapped to the same canonical position and orientation. In most settings, this is done by way of the principal axes of inertia. Reproducibility is a motivation for standardization. Certain methods, such as grid-based DFT, are not rotationally invariant, meaning that changing a molecule’s orientation can affect its results[Gill et al., 1993]. A molecule’s orientation also affects how electronic structure packages treat symmetry: irreducible representation labels depend on the choice of axes, and because point groups are detected with finite tolerances, a nearly symmetric structure may be assigned different point groups. Thus, a well-defined and deterministic orientation is crucial.
Mathematics#
MolOrient utilizes Standard Nuclear Orientation by Gill et al. Contrary to most orientation conventions, this utilizes nuclear positive charge instead of mass for translations and the inertia tensor. The inertia tensor, which is a 3x3 symmetric real matrix, is diagonalized with a from-scratch eigensolver. The eigenvalues are calculated by Viéte’s Trigonometric Method for the cubic characteristic polynomial. The eigenvectors (principal axes) are calculated via cross products of the tensor’s columns[Kopp, 2008]. Every operation has a precision guard of at least 2 decimal places past the user’s specified significant figures.
Precision and symmetry tolerance#
--precision also sets how close two moments of inertia (or two coordinates)
must be to count as equal. In SNO the tolerance is relative, about
10^-(p-2) (capped at 10^-(p/2+8)), so a nearly symmetric molecule can be
treated as symmetric at low precision and as asymmetric at high precision, and
be oriented differently. Input rounded to 7 decimals stops looking symmetric
above about p = 6. For an asymmetric top, the sign of each axis is chosen once,
on the unrounded geometry, with the same tolerance; the result is then rounded.
NWChem orientation (--nwchem) follows NWChem and uses absolute thresholds
that do not depend on --precision. Molecules whose moments differ by more than
NWChem’s 1e-4 bohr²·amu threshold, however nearly degenerate (large
near-symmetric molecules, or small ones given coarsely rounded coordinates),
are oriented as asymmetric tops, so their in-plane axes follow input noise
exactly as in NWChem.
Existing Software#
Electronic structure packages will have their own geometry standardization, such as NWChem[Aprà et al., 2020] and GAMESS[Barca et al., 2020]. These are necessary to exploit symmetry in calculations. Both of these packages use a mass-weighted inertia tensor as opposed to Gill et al.’s nuclear charge-weighted inertia tensor. The electronic structure package Q-Chem[Shao et al., 2015] uses Gill et al.’s Standard Nuclear Orientation for its orientation, however it does not use fixed-precision for its calculations, so it is susceptible to floating-point noise. In addition to precision, MolOrient is lightweight compared to these packages; it only has three dependencies rather than being embedded in a full electronic structure package. While NWChem and GAMESS utilize Gill et al.’s orientation convention, the infrastructure of MolOrient, such as the eigensolver, classes, and trig series functions are not dependent on one specific convention. For example, the implementation of NWChem’s orientation convention is only one file, nwchem_orientation.py, and a small addition to cli.py was made to switch between MolOrient’s convention and NWChem’s.
MolSym[Goodlett et al., 2024] is a similar package to MolOrient, with molecular symmetrization being one of its main functionalities. In this, the coordinate frame is constructed using symmetry, contrary to MolOrient, which uses principal axes to construct the frame, using symmetry only for spherical tops. A C1 molecule in MolSym will receive no rotation, but in MolOrient, the molecule will still receive an rotation based on its principal axes. MolSym uses double precision, while MolOrient uses Decimals. Orientation is secondary in MolSym; it is mainly used for point group detection and SALCs.
Another similar package is RDKit[Landrum et al., 2026], which has a function named CanonicalizeConformer. One main difference is that CanonicalizeConformer uses a covariance matrix as opposed to the inertia tensor. The weights are determined by heavy atoms, each with a unit weight and hydrogens excluded by default, while MolOrient uses nuclear positive charge and includes hydrogens. CanonicalizeConformer lacks a rigorous tie-breaking system for highly symmetric molecules and near-degenerate eigenvalues, meaning the input orientation influences the final orientation.
Because MolOrient is a package focused entirely on Decimals, it was necessary to create from-scratch functions. A high-precision math package, such as mpmath[The mpmath development team, 2023], would not have sufficed. mpmath uses its own object, mpf, to represent floating-point numbers. A constant conversion of Decimal to mpf back to Decimal would have inevitably resulted in precision loss due to binary rounding. mpmath also performs its calculations in binary, while Decimal uses base-10 arithmetic.
References#
Peter M. W. Gill, Benny G. Johnson, and John A. Pople. A standard grid for density functional calculations. Chemical Physics Letters, 209(5–6):506–512, 1993. doi:10.1016/0009-2614(93)80125-9.
Joachim Kopp. Efficient numerical diagonalization of hermitian $3\times 3$ matrices. International Journal of Modern Physics C, 19(3):523–548, 2008. doi:10.1142/S0129183108012303.
E. Aprà, E. J. Bylaska, W. A. de Jong, N. Govind, K. Kowalski, T. P. Straatsma, M. Valiev, H. J. J. van Dam, Y. Alexeev, J. Anchell, V. Anisimov, F. W. Aquino, R. Atta-Fynn, J. Autschbach, N. P. Bauman, J. C. Becca, D. E. Bernholdt, K. Bhaskaran-Nair, S. Bogatko, P. Borowski, J. Boschen, J. Brabec, A. Bruner, E. Cauët, Y. Chen, G. N. Chuev, C. J. Cramer, J. Daily, M. J. O. Deegan, T. H. Dunning, Jr., M. Dupuis, K. G. Dyall, G. I. Fann, S. A. Fischer, A. Fonari, H. Früchtl, L. Gagliardi, J. Garza, N. Gawande, S. Ghosh, K. Glaesemann, A. W. Götz, J. Hammond, V. Helms, E. D. Hermes, K. Hirao, S. Hirata, M. Jacquelin, L. Jensen, B. G. Johnson, H. Jónsson, R. A. Kendall, M. Klemm, R. Kobayashi, V. Konkov, S. Krishnamoorthy, M. Krishnan, Z. Lin, R. D. Lins, R. J. Littlefield, A. J. Logsdail, K. Lopata, W. Ma, A. V. Marenich, J. Martin del Campo, D. Mejia-Rodriguez, J. E. Moore, J. M. Mullin, T. Nakajima, D. R. Nascimento, J. A. Nichols, P. J. Nichols, J. Nieplocha, A. Otero-de-la-Roza, B. Palmer, A. Panyala, T. Pirojsirikul, B. Peng, R. Peverati, J. Pittner, L. Pollack, R. M. Richard, P. Sadayappan, G. C. Schatz, W. A. Shelton, D. W. Silverstein, D. M. A. Smith, T. A. Soares, D. Song, M. Swart, H. L. Taylor, G. S. Thomas, V. Tipparaju, D. G. Truhlar, K. Tsemekhman, T. Van Voorhis, Á. Vázquez-Mayagoitia, P. Verma, O. Villa, A. Vishnu, K. D. Vogiatzis, D. Wang, J. H. Weare, M. J. Williamson, T. L. Windus, K. Woliński, A. T. Wong, Q. Wu, C. Yang, Q. Yu, M. Zacharias, Z. Zhang, Y. Zhao, and R. J. Harrison. NWChem: past, present, and future. The Journal of Chemical Physics, 152:184102, 2020. doi:10.1063/5.0004997.
G. M. J. Barca, C. Bertoni, L. Carrington, D. Datta, N. De Silva, J. E. Deustua, D. G. Fedorov, J. R. Gour, A. O. Gunina, E. Guidez, T. Harville, S. Irle, J. Ivanic, K. Kowalski, S. S. Leang, H. Li, W. Li, J. J. Lutz, I. Magoulas, J. Mato, V. Mironov, H. Nakata, B. Q. Pham, P. Piecuch, D. Poole, S. R. Pruitt, A. P. Rendell, L. B. Roskop, K. Ruedenberg, T. Sattasathuchana, M. W. Schmidt, J. Shen, L. Slipchenko, M. Sosonkina, V. Sundriyal, A. Tiwari, J. L. Galvez Vallejo, B. Westheimer, M. Włoch, P. Xu, F. Zahariev, and M. S. Gordon. Recent developments in the general atomic and molecular electronic structure system. The Journal of Chemical Physics, 152:154102, 2020. doi:10.1063/5.0005188.
Y. Shao, Z. Gan, E. Epifanovsky, A. T. B. Gilbert, M. Wormit, J. Kussmann, A. W. Lange, A. Behn, J. Deng, X. Feng, D. Ghosh, M. Goldey, P. R. Horn, L. D. Jacobson, I. Kaliman, R. Z. Khaliullin, T. Kuś, A. Landau, J. Liu, E. I. Proynov, Y. M. Rhee, R. M. Richard, M. A. Rohrdanz, R. P. Steele, E. J. Sundstrom, H. L. Woodcock, III, P. M. Zimmerman, D. Zuev, B. Albrecht, E. Alguire, B. Austin, G. J. O. Beran, Y. A. Bernard, E. Berquist, K. Brandhorst, K. B. Bravaya, S. T. Brown, D. Casanova, C.-M. Chang, Y. Chen, S. H. Chien, K. D. Closser, D. L. Crittenden, M. Diedenhofen, R. A. DiStasio, Jr., H. Dop, A. D. Dutoi, R. G. Edgar, S. Fatehi, L. Fusti-Molnar, A. Ghysels, A. Golubeva-Zadorozhnaya, J. Gomes, M. W. D. Hanson-Heine, P. H. P. Harbach, A. W. Hauser, E. G. Hohenstein, Z. C. Holden, T.-C. Jagau, H. Ji, B. Kaduk, K. Khistyaev, J. Kim, J. Kim, R. A. King, P. Klunzinger, D. Kosenkov, T. Kowalczyk, C. M. Krauter, K. U. Lao, A. Laurent, K. V. Lawler, S. V. Levchenko, C. Y. Lin, F. Liu, E. Livshits, R. C. Lochan, A. Luenser, P. Manohar, S. F. Manzer, S.-P. Mao, N. Mardirossian, A. V. Marenich, S. A. Maurer, N. J. Mayhall, C. M. Oana, R. Olivares-Amaya, D. P. O'Neill, J. A. Parkhill, T. M. Perrine, R. Peverati, P. A. Pieniazek, A. Prociuk, D. R. Rehn, E. Rosta, N. J. Russ, N. Sergueev, S. M. Sharada, S. Sharma, D. W. Small, A. Sodt, T. Stein, D. Stück, Y.-C. Su, A. J. W. Thom, T. Tsuchimochi, L. Vogt, O. Vydrov, T. Wang, M. A. Watson, J. Wenzel, A. White, C. F. Williams, V. Vanovschi, S. Yeganeh, S. R. Yost, Z.-Q. You, I. Y. Zhang, X. Zhang, Y. Zhou, B. R. Brooks, G. K. L. Chan, D. M. Chipman, C. J. Cramer, W. A. Goddard, III, M. S. Gordon, W. J. Hehre, A. Klamt, H. F. Schaefer, III, M. W. Schmidt, C. D. Sherrill, D. G. Truhlar, A. Warshel, X. Xu, A. Aspuru-Guzik, R. Baer, A. T. Bell, N. A. Besley, J.-D. Chai, A. Dreuw, B. D. Dunietz, T. R. Furlani, S. R. Gwaltney, C.-P. Hsu, Y. Jung, J. Kong, D. S. Lambrecht, W. Liang, C. Ochsenfeld, V. A. Rassolov, L. V. Slipchenko, J. E. Subotnik, T. Van Voorhis, J. M. Herbert, A. I. Krylov, P. M. W. Gill, and M. Head-Gordon. Advances in molecular quantum chemistry contained in the Q-Chem 4 program package. Molecular Physics, 113(2):184–215, 2015. doi:10.1080/00268976.2014.952696.
Stephen M. Goodlett, Nathaniel L. Kitzmiller, Justin M. Turney, and Henry F. Schaefer, III. MolSym: a Python package for handling symmetry in molecular quantum chemistry. The Journal of Chemical Physics, 161(2):024107, 2024. doi:10.1063/5.0216738.
Greg Landrum, Paolo Tosco, Ricardo Rodriguez, Brian Kelley, David Cosgrove, Riccardo Vianello, and others. RDKit: open-source cheminformatics. 2026. URL: https://www.rdkit.org, doi:10.5281/zenodo.22140358.
The mpmath development team. mpmath: a Python library for arbitrary-precision floating-point arithmetic (version 1.3.0). 2023. URL: https://mpmath.org/.