Rigid Body Flows for Sampling Molecular Crystal Structures

Jonas Köhler, Michele Invernizzi, Pim De Haan, Frank Noe

Introduction

Sampling the equilibrium configurations of molecular crystals is a fundamental task in drug discovery, materials science, and chemistry. Understanding how molecules pack into crystalline lattices allows researchers to predict thermodynamic properties and stability. Traditionally, these systems are explored using Molecular Dynamics (MD) or Markov Chain Monte Carlo (MCMC) simulations. However, these methods often suffer from "metastability," where the simulation becomes trapped in local energy minima, requiring prohibitive amounts of computational time to transition between different crystal phases or explore the full configuration space.

Normalizing Flows (NFs) have emerged as a promising alternative. By learning a differentiable, invertible mapping between a simple base distribution (such as a Gaussian) and a complex target distribution (the crystal's energy landscape), NFs can generate independent samples efficiently. However, applying NFs to molecular crystals introduces a significant geometric challenge: modeling the rotation of molecules in 3D space ($SO(3)$).

The Challenge of Rotational Manifolds

Modeling rotations is notoriously difficult for standard neural network architectures. Common representations like Euler angles are plagued by "gimbal lock" and non-smoothness, which can lead to artificial discontinuities in the learned density. While rotation matrices avoid these issues, they are difficult to constrain during training.

In physical systems, smoothness is paramount because the forces acting on molecules are the gradients of the energy. A generative model that produces a "jagged" or non-smooth density cannot faithfully represent the underlying physical force fields. This paper introduces a novel flow architecture designed to be smooth, expressive, and physically principled for systems of interacting rigid bodies.

Methodology

The researchers propose a framework that treats molecules as rigid bodies defined by a position ($x_0$), a rotation ($R$), and fixed internal degrees of freedom ($\Psi$). The core innovations of this approach include:

1. The $S^3$ Double Cover

To model rotations, the authors leverage the relationship between the rotation group $SO(3)$ and the unit quaternion sphere $S^3$. Because quaternions $q$ and $-q$ represent the same physical rotation, the authors utilize a "double cover" approach. They employ a sign-flip equivariant coupling flow and stochastically select signs during the transformation process. This ensures that the resulting probability density on the rotation group is mathematically consistent and globally smooth.

2. Projective Convex Gradient Maps (PCGM)

A major contribution of this work is the Projective Convex Gradient Map (PCGM), a new type of flow for the $S^3$ manifold. By taking the gradient of a strictly convex function and projecting it back onto the sphere, the model creates a highly expressive transformation. Unlike standard "affine" quaternion flows—which are often limited to representing a single mode—PCGM can "shred" a distribution into multiple peaks. This is essential for crystals, where molecules typically have several preferred orientations.

3. Symmetrized Moebius Transforms

For applications requiring higher speed, the authors also introduce Symmetrized Moebius Transforms. These provide an analytically invertible alternative to PCGM, though they are generally less expressive for highly complex, multi-modal distributions.

Experimental Results

Toy Model: Tetrahedron in an External Field

To test the expressivity of the flows, the authors designed a "stress test" involving a tetrahedron in an external field. This setup creates a highly multi-modal rotational density. The PCGM architecture successfully captured the complex density with many distinct peaks, whereas simpler affine and Moebius flows failed to resolve the underlying structure.

Real-World Application: Ice XI

The method was evaluated on Ice XI (using the TIP4P water model), a real-world molecular crystal system. Testing on systems of 16 and 128 water molecules at temperatures of 50K and 100K, the flows achieved near-perfect overlap with the energy distributions and radial distribution functions (the structural "fingerprints" of the crystal) produced by traditional, computationally expensive MD simulations.

Thermodynamic Efficiency

One of the most significant outcomes is the implementation of Learned Free Energy Perturbation (LFEP). By training the flow to map a "base" temperature to a "target" temperature, the researchers could estimate the free energy difference ($\Delta F$) between states. While the standard MBAR (Multistate Bennett Acceptance Ratio) method required 5 to 10 separate MD simulations at intermediate temperatures to achieve accuracy, the NF approach required only one base simulation and a training step. This represents a substantial leap in computational efficiency for thermodynamic property calculation.

Limitations and Future Work

While the current model excels at modeling stable crystal structures, several challenges remain:

  • Phase Transitions: The model is currently optimized for crystalline states; extending it to handle transitions between solid, liquid, and gas phases is an ongoing area of research.
  • Symmetry Exploitation: Future iterations could better exploit $SE(3)$ symmetries (global translations and rotations) and the internal symmetries of specific molecules (such as the mirror symmetry of a water molecule).
  • Scaling: To move from 128 molecules to "bulk" systems with thousands of atoms, these flows will likely need to be integrated with advanced graph neural network architectures like EGNN or MACE.

Conclusion

By combining the geometric rigor of the $S^3$ double cover with the expressivity of Projective Convex Gradient Maps, this work provides a powerful new tool for the molecular sciences. The ability to sample complex, multi-modal rotational distributions not only improves our ability to model crystals but also offers a significantly faster path to calculating the thermodynamic properties essential for material and drug design.

Summary updated

BibTeX
@inproceedings{kohler2023rigid,
  author = {Jonas Köhler and Michele Invernizzi and Pim De Haan and Frank Noe},
  title = {{Rigid Body Flows for Sampling Molecular Crystal Structures}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=GAfus0XZCD},
}
Figure