Abstract
The concept of chemical bonding can ultimately be seen as a rationalization of the recurring structural patterns observed in molecules and solids. Chemical intuition is nothing but the ability to recognize and predict such patterns, and how they transform into one another. Here, we discuss how to use a computer to identify atomic patterns automatically, so as to provide an algorithmic definition of a bond based solely on structural information. We concentrate in particular on hydrogen bonding—a central concept to our understanding of the physical chemistry of water, biological systems, and many technologically important materials. Since the hydrogen bond is a somewhat fuzzy entity that covers a broad range of energies and distances, many different criteria have been proposed and used over the years, based either on sophisticated electronic structure calculations followed by an energy decomposition analysis, or on somewhat arbitrary choices of a range of structural parameters that is deemed to correspond to a hydrogen-bonded configuration. We introduce here a definition that is univocal, unbiased, and adaptive, based on our machine-learning analysis of an atomistic simulation. The strategy we propose could be easily adapted to similar scenarios, where one has to recognize or classify structural patterns in a material or chemical compound.
Introduction
In chemistry, the hydrogen bond is a fundamental but notoriously slippery concept. It occupies a gray area between weak Van der Waals forces and strong covalent bonds. Because hydrogen bonds vary significantly in strength and geometry depending on the context—whether in liquid water, a protein, or a crystal—scientists have struggled to create a universal definition. Traditionally, researchers have relied on "hard cutoffs" (e.g., specific distance and angle thresholds). These are often arbitrary and fail to capture the smooth transition as a bond forms or breaks. Alternatively, expensive quantum mechanical energy calculations can be used, but these are computationally heavy and do not always align with structural intuition. There is a clear need for a definition that is mathematically rigorous, data-driven, and capable of handling the inherent "fuzziness" of molecular interactions.
The PAMM Framework
To address this, we introduce Probabilistic Analysis of Molecular Motifs (PAMM). This machine-learning framework defines chemical bonds based on structural data rather than arbitrary rules. The workflow consists of three main stages:
- Pattern Recognition via Manifold Learning: The algorithm processes snapshots from an atomistic simulation, describing groups of atoms using high-dimensional descriptors such as inter-atomic distances.
- Mode Seeking (Quick-Shift): Instead of assuming the number of bond types, PAMM uses a non-parametric clustering technique to identify peaks (modes) in the probability distribution of atomic coordinates. Each peak represents a stable, recurring structural motif.
- Gaussian Mixture Modeling (GMM): Once clusters are identified, the algorithm fits a Gaussian to each one, creating a probabilistic map. Instead of a binary "yes/no" classification, PAMM provides a value between 0 and 1, representing the "degree of confidence" that a specific configuration constitutes a bond.
Results and Discussion
PAMM was validated across several diverse molecular systems, including alanine dipeptide in water, liquid water, ice Ih, and ab initio simulations of water and ammonia. A key insight is treating a chemical bond as a local maximum in the probability density of atomic arrangements. If atoms frequently return to a specific geometry, that geometry is defined as a "bond."
In the case of alanine dipeptide, PAMM identified three distinct types of hydrogen bonds, including a weak Cα–H···O interaction often missed by traditional definitions. By providing a continuous probability, PAMM naturally describes transition states, making it an ideal candidate for a collective variable in enhanced sampling simulations.
Furthermore, when applied to ab initio simulations including nuclear quantum effects, the algorithm demonstrated that quantum fluctuations make the hydrogen bond "fuzzier" but do not destroy the underlying structural motif. In ice simulations, the method successfully isolated rare Bjerrum defects, distinguishing between perfect bonding and localized structural errors.
Conclusion
PAMM provides a univocal, unbiased, and adaptive definition of the hydrogen bond that adjusts to different chemical environments. While higher dimensionality in complex motifs presents a challenge for convergence, future work will focus on using PAMM as a machine-learned collective variable to drive simulations toward rare events, such as protein conformational changes. This approach paves the way for integrating structural definitions with electronic property data for a holistic, machine-learned understanding of chemistry.
Summary updated