  Symmetry provides a powerful machinery to classify, interpret, and understand
quantum-mechanical theories and results. However, most contemporary quantum
chemistry packages lack the ability to handle degeneracy and symmetry breaking
effects, especially in non-Abelian groups, nor are they able to characterize
symmetry in the presence of external magnetic or electric fields. In this
article, a program written in Rust entitled QSym$^2$ that makes use of group
and representation theories to provide symmetry analysis for a wide range of
quantum-chemical calculations is introduced. With its ability to generate
character tables symbolically on-the-fly, and by making use of a generic
symmetry-orbit-based representation analysis method formulated in this work,
QSym$^2$ is able to address all of these shortcomings. To illustrate these
capabilities of QSym$^2$, four sets of case studies are examined in detail in
this article: (i) high-symmetry $\textrm{C}_{84}\textrm{H}_{64}$,
$\textrm{C}_{60}$, and $\textrm{B}_9^-$ to demonstrate the analysis of
degenerate molecular orbitals (MOs); (ii) octahedral $\textrm{Fe(CN)}_6^{3-}$
to demonstrate the analysis of symmetry-broken determinants and MOs; (iii)
linear hydrogen fluoride in a magnetic field to demonstrate the analysis of
magnetic symmetry; and (iv) equilateral $\textrm{H}_3^+$ to demonstrate the
analysis of density symmetries.
