The solution of the first principle equations of quantum mechanics provides an increasingly accurate and predictive approach for solving problems involving atoms and small molecules. A general introduction to the methods used for the ab initio calculation of rotational–vibrational spectra of small molecules is presented, with a strong focus on triatomic systems. The use of multi-reference electronic structure methods to compute molecular potential-energy and dipole-moment surfaces is discussed. Issues related to the construction of such surfaces and the inclusion of corrections due to relativistic and non-Born–Oppenheimer effects are reviewed. The derivation of exact, internal-coordinate nuclear-motion-effective Hamiltonians and their solution using a discrete-variable representation are discussed. Sample results for the water molecules are used throughout the tutorial to illustrate the theoretical and numerical issues in such calculations.