3D Equivariant Models and Quantum Chemistry¶
To predict how a molecule folds, vibrates, or reacts at atomic resolution, we need the quantum mechanical energy landscape that pulls every atom through space. This file explores potential energy surfaces, why machine learning interatomic potentials bridge quantum accuracy and classical speed, how \(E(3)\) symmetry and automatic differentiation guarantee energy-conserving forces, and how architectures evolved from SchNet to PaiNN, NequIP, and MACE.
The Potential Energy Surface Intuition¶
-
Picture a tiny glass marble released on a rugged mountain range. Gravity immediately pulls the marble downhill into the nearest valley, where it settles into a stable resting spot. To cross from one valley into a deeper neighbouring valley, the marble needs a thermal kick strong enough to climb over the mountain pass separating them.
-
Every molecule in nature obeys this exact geometric picture on its Potential Energy Surface (PES). Under the Born-Oppenheimer approximation (because light electrons rearrange thousands of times faster than heavy atomic nuclei), the total potential energy of an \(N\)-atom system reduces to a single smooth scalar landscape over nuclear coordinates \(\mathbf{r}_1, \dots, \mathbf{r}_N \in \mathbb{R}^3\) and atomic numbers \(Z_1, \dots, Z_N\).
- Every topological feature of that high-dimensional landscape has a direct chemical meaning.
- Local minima (valleys) are stable 3D molecular conformers or crystal structures where net atomic forces vanish.
- The global minimum is the thermodynamically most stable shape or ground-state polymorph.
- Saddle points (mountain passes) are transition states, and their barrier height \(\Delta E^{\ddagger}\) controls exponentially how fast a chemical reaction proceeds.
- The steepness of the slope determines the exact force pulling each atom at every femtosecond of motion.
Quantum Accuracy Versus Classical Speed¶
-
If the Potential Energy Surface dictates all of chemistry, why not simply compute \(E(\mathbf{r}_1, \dots, \mathbf{r}_N)\) from first principles at every simulation step? The answer lies in a punishing computational wall.
-
Solving the many-body Schrödinger equation directly grows exponentially with the number of electrons. Density Functional Theory (DFT) (which earned Walter Kohn the 1998 Nobel Prize) brilliantly sidesteps the giant many-electron wavefunction by expressing ground-state energy as a functional of the 3D electron density. Even so, standard Kohn-Sham DFT scales roughly as \(O(N^3)\) with system size \(N\). Doubling the number of atoms makes each step eight times slower. In practice, quantum molecular dynamics with DFT is confined to a few hundred atoms simulated for tens of picoseconds, far too small and brief to watch a drug unbind from a protein or lithium ions diffuse through a battery cathode.
-
At the opposite corner sit classical force fields (such as AMBER, CHARMM, and OPLS). They treat chemical bonds as fixed harmonic springs, angles as stiff hinges, and non-bonded atoms as hard spheres carrying static point charges. Classical force fields scale cleanly as \(O(N)\) and simulate millions of atoms for microseconds, yet they pay a steep physical price. Because bonds are wired in as unbreakable springs and electron clouds cannot shift, classical force fields cannot simulate chemical reactions (bond breaking or formation) and struggle with metallic bonding, catalysis, and electronic polarisation.
-
Machine Learning Interatomic Potentials (MLIPs) shatter this century-old trade-off. Rather than solving quantum equations from scratch on every femtosecond step, we generate a focused training dataset of DFT snapshots (energies and forces across diverse geometries), train a symmetry-respecting neural network to approximate the PES locally inside a cutoff radius \(r_{\text{cut}}\), and decompose total energy as a sum of learnable atomic contributions.
- Because each atom interacts only with neighbours inside \(r_{\text{cut}}\) (typically \(5\) to \(6\,\text{\AA}\)), evaluation scales linearly as \(O(N)\) while retaining near-DFT accuracy across bond breaking, catalysis, and complex alloys. The speedup routinely reaches \(10^3\) to \(10^6\) times faster than raw DFT.
E(3) and SE(3) Symmetry and Energy-Conserving Forces¶
-
Imagine placing a warm mug of tea on a kitchen table, then sliding it across the room and turning it ninety degrees. The temperature of the tea (a scalar quantity) stays completely identical, while the direction the mug handle points (a 3D vector) rotates rigidly with the mug.
-
Physical space has no preferred origin and no preferred "north" direction, so any trustworthy MLIP must obey Euclidean symmetry (building directly on geometric deep learning in chapter 15). Let \(\mathbf{t} \in \mathbb{R}^3\) be any translation and \(R \in SO(3)\) be any 3D rotation (or \(R \in O(3)\) including reflections for achiral potential energies).
- Scalar invariance demands that shifting or rotating all atoms leaves the total potential energy strictly unchanged.
- Vector equivariance demands that atomic forces rotate by the exact same rotation matrix \(R\) and ignore translations completely.
-
One tempting shortcut is to train a neural network head to predict the \(3N\) force numbers directly without differentiating an energy. Why is that dangerous in molecular dynamics? An arbitrary vector field generally has nonzero curl (\(\nabla \times \mathbf{F} \neq \mathbf{0}\)), meaning a simulated molecule can travel around a closed loop and return to its starting shape with more kinetic energy than it began with, violating conservation of energy until the simulation literally explodes.
-
Instead, principled MLIPs predict the scalar potential energy \(E_\theta\) and compute forces analytically as its negative spatial gradient via reverse-mode automatic differentiation (
jax.grad, directly from chapter 03).
-
Differentiating an invariant scalar energy hands us three deep physical guarantees for free. First, by the chain rule, the gradient of an \(E(3)\)-invariant scalar is automatically \(E(3)\)-equivariant. Second, the resulting force field is mathematically curl-free, conserving total mechanical energy during long simulations. Third, translation invariance guarantees that all internal forces cancel out (\(\sum_{i=1}^N \mathbf{F}_i = \mathbf{0}\)), enforcing Newton's third law automatically!
-
Even better, every single DFT snapshot provides one scalar energy plus \(3N\) force components. Training jointly on energies and forces (force matching) multiplies the supervision signal by \(3N + 1\) per quantum calculation.
Architectural Evolution from Invariant to Higher-Order Equivariant Models¶
- Over the last decade, MLIP architectures have evolved through three clear generations, each unlocking dramatically better sample efficiency by letting richer directional geometry flow inside the hidden layers.
Generation 1, Invariant Pairwise Models (SchNet)¶
- SchNet (Schütt et al., 2017) achieves exact \(E(3)\) invariance in the simplest possible way, feeding the network only pairwise interatomic distances \(d_{ij} = \|\mathbf{r}_j - \mathbf{r}_i\|\). Each distance is expanded into smooth radial basis functions (RBFs) that modulate continuous-filter message passing (chapter 15). SchNet is compact and fast, yet because a single message-passing hop discards all bond angles and relative directions, it struggles to distinguish subtly different 3D arrangements that share similar neighbour distances.
Generation 2, Directional Vector Models (PaiNN)¶
-
PaiNN (Polarisable Atom Interaction Neural Network, Schütt et al., 2021) gives every atom a pair of internal representations, combining ordinary invariant scalar channels \(\mathbf{s}_i \in \mathbb{R}^F\) with equivariant 3D vector channels \(\mathbf{v}_i \in \mathbb{R}^{F \times 3}\). Think of equipping each atom with a bundle of tiny compass needles that spin smoothly whenever the molecule rotates.
-
During message passing, neighbour scalars scale the unit displacement vectors \(\hat{\mathbf{r}}_{ij} = (\mathbf{r}_j - \mathbf{r}_i) / d_{ij}\) to update \(\mathbf{v}_i\), while inner products \(\langle \mathbf{v}_i, \mathbf{v}_i \rangle\) feed angular information cleanly back into the scalar track without breaking rotational symmetry. PaiNN captures directional physics at near-SchNet speed and dramatically lowers force errors.
Generation 3, Higher-Order Tensor-Product Models (NequIP and MACE)¶
- Why stop at scalars (\(\ell = 0\)) and vectors (\(\ell = 1\))? Electron orbitals themselves come in \(s\) (\(\ell=0\)), \(p\) (\(\ell=1\)), \(d\) (\(\ell=2\)), and \(f\) (\(\ell=3\)) angular symmetries. Higher-order equivariant networks expand relative directions \(\hat{\mathbf{r}}_{ij}\) in spherical harmonics \(Y_\ell^m(\hat{\mathbf{r}}_{ij})\) and couple features through Clebsch-Gordan tensor products, the exact algebra quantum physicists use to combine angular momenta.
- NequIP (Batzner et al., 2022) demonstrated that stacking \(E(3)\)-equivariant tensor-product message passing layers cuts required DFT training data by up to 1,000-fold compared with invariant models, reaching quantum force accuracy from only a few hundred snapshots.
- MACE (Batatia et al., 2022) took a crucial further leap by merging equivariant message passing with the Atomic Cluster Expansion (ACE). Standard GNNs build 2-body messages per hop and rely on 5 or 6 deep layers to approximate multi-atom correlations, which expands the receptive field awkwardly and slows multi-GPU parallelisation. MACE constructs explicit high body-order (\(\nu\)-body, typically 4-body) equivariant tensor contractions inside every single layer. With rich many-body geometry resolved locally, MACE achieves state-of-the-art accuracy in just 2 layers, running far faster on large periodic materials.
Accelerating Molecular Dynamics and Materials Discovery¶
- Once trained, an MLIP plugs straight into Velocity Verlet molecular dynamics, stepping nuclear positions \(\mathbf{r}_i\) and velocities \(\mathbf{v}_i\) forward in tiny increments \(\Delta t \approx 1\text{ fs}\) using Newton's second law \(\mathbf{a}_i = \mathbf{F}_i / m_i\).
-
Because Velocity Verlet is symplectic (time-reversible and phase-space volume preserving) and our autodiff forces are strictly conservative, total energy stays rock-steady over millions of steps, letting scientists measure ionic conductivity in solid-state batteries, crack propagation in alloys, and catalytic reaction barriers at realistic temperatures.
-
Even more exciting is the rise of universal foundation MLIPs such as MACE-MP-0, CHGNet, M3GNet, and MatterSim. Pretrained across millions of inorganic crystals and trajectories spanning nearly the entire periodic table (from repositories like the Materials Project), these foundation potentials run stable reactive simulations out of the box across unfamiliar chemistries, slashing months of bespoke DFT dataset generation down to hours of lightweight fine-tuning.
Take-Home¶
- The Potential Energy Surface \(E(\mathbf{r}_1, \dots, \mathbf{r}_N)\) acts like a mountain landscape whose valleys are stable 3D shapes, whose passes are reaction barriers, and whose negative slopes are atomic forces.
- DFT offers quantum accuracy yet scales as \(O(N^3)\), while classical force fields scale as \(O(N)\) yet cannot break bonds; MLIPs bridge both regimes by learning local quantum energies at \(O(N)\) cost.
- Differentiating an \(E(3)\)-invariant scalar energy via automatic differentiation (
jax.grad) automatically yields \(E(3)\)-equivariant, energy-conserving forces that obey Newton's third law. - MLIP architectures progressed from distance-only invariant models (SchNet) to scalar-vector models (PaiNN) and spherical tensor-product many-body models (NequIP, MACE) for dramatic gains in data efficiency and speed.
- Universal foundation MLIPs trained across the periodic table now power rapid crystal relaxation, catalyst design, and nanosecond-scale reactive molecular dynamics.
Coding Tasks (use CoLab or notebook)¶
-
Build an \(E(3)\)-invariant neural pairwise potential in JAX, obtain atomic forces automatically via
jax.grad, and verify numerically under a random 3D rotation \(R \in SO(3)\) and translation \(\mathbf{t}\) that energy is strictly invariant, forces rotate equivariantly, and total net force sums to zero.import jax import jax.numpy as jnp import matplotlib.pyplot as plt def init_potential(key, n_rbf=12, hidden=16): k1, k2 = jax.random.split(key) return { "centers": jnp.linspace(0.8, 4.0, n_rbf), "W1": jax.random.normal(k1, (n_rbf, hidden)) * 0.35, "b1": jnp.zeros((hidden,)), "W2": jax.random.normal(k2, (hidden, 1)) * 0.35, } def invariant_energy(params, coords): """E(3)-invariant total potential energy summed over distinct atom pairs.""" N = coords.shape[0] diff = coords[:, None, :] - coords[None, :, :] mask = 1.0 - jnp.eye(N) dist = jnp.sqrt(jnp.sum(diff ** 2, axis=-1) + jnp.eye(N)) rbf = jnp.exp(-2.5 * (dist[..., None] - params["centers"]) ** 2) z = jnp.dot(rbf, params["W1"]) + params["b1"] h = z * jax.nn.sigmoid(z) pair_e = jnp.squeeze(jnp.dot(h, params["W2"]), axis=-1) + 0.25 / (dist ** 4) return 0.5 * jnp.sum(pair_e * mask) forces_fn = lambda params, coords: -jax.grad(invariant_energy, argnums=1)(params, coords) key = jax.random.PRNGKey(3) k_p, k_r, k_t = jax.random.split(key, 3) params = init_potential(k_p) coords = jnp.array([[0.0, 0.0, 0.0], [1.15, 0.35, -0.20], [-0.95, 0.80, 0.40], [0.20, -1.10, 0.75]]) # Sample a proper random 3D rotation R in SO(3) via QR decomposition Q, _ = jnp.linalg.qr(jax.random.normal(k_r, (3, 3))) R = Q * jnp.where(jnp.linalg.det(Q) < 0, -1.0, 1.0) t = jax.random.normal(k_t, (3,)) * 5.0 coords_rot = jnp.dot(coords, R.T) + t E_orig, E_rot = invariant_energy(params, coords), invariant_energy(params, coords_rot) F_orig, F_rot = forces_fn(params, coords), forces_fn(params, coords_rot) e_err = float(jnp.abs(E_orig - E_rot)) f_err = float(jnp.max(jnp.abs(F_rot - jnp.dot(F_orig, R.T)))) net_force = float(jnp.linalg.norm(jnp.sum(F_orig, axis=0))) print(f"Energy err: {e_err:.2e} | Force equiv err: {f_err:.2e} | Net force: {net_force:.2e}") fig, ax = plt.subplots(figsize=(7.0, 3.6)) labels = ["Energy Invariance", "Force Equivariance", "Net Force (3rd Law)"] errs = [max(e_err, 1e-8), max(f_err, 1e-8), max(net_force, 1e-8)] ax.bar(labels, errs, color=["#27ae60", "#3498db", "#9b59b6"], width=0.5) ax.set_yscale("log"); ax.set_ylim(1e-9, 1e-2) ax.set_ylabel("Absolute Symmetry Error (log scale)") ax.set_title("Exact E(3) Symmetry & Conservation via Autodiff in JAX") plt.tight_layout(); plt.show() -
Train a miniature SchNet-like MLIP on synthetic 3-atom molecular snapshots from a ground-truth anharmonic Morse potential, comparing energy-only training against joint energy + force matching to observe the dramatic gain in force accuracy when data is scarce.
import jax import jax.numpy as jnp import matplotlib.pyplot as plt # Ground-truth anharmonic Morse potential for a 3-atom molecule def true_morse_energy(coords, D_e=1.8, a=1.6, r_eq=1.35): diff = coords[:, None, :] - coords[None, :, :] dist = jnp.sqrt(jnp.sum(diff ** 2, axis=-1) + jnp.eye(3)) mask = 1.0 - jnp.eye(3) morse = D_e * (1.0 - jnp.exp(-a * (dist - r_eq))) ** 2 return 0.5 * jnp.sum(morse * mask) true_force_fn = lambda c: -jax.grad(true_morse_energy)(c) # Generate 18 training snapshots and 40 test snapshots near equilibrium triangle base = jnp.array([[0.0, 0.0, 0.0], [1.35, 0.0, 0.0], [0.675, 1.17, 0.0]]) key = jax.random.PRNGKey(42) k_tr, k_te, k_init = jax.random.split(key, 3) X_tr = base[None, :, :] + 0.16 * jax.random.normal(k_tr, (18, 3, 3)) X_te = base[None, :, :] + 0.16 * jax.random.normal(k_te, (40, 3, 3)) E_tr = jax.vmap(true_morse_energy)(X_tr) F_tr = jax.vmap(true_force_fn)(X_tr) E_te = jax.vmap(true_morse_energy)(X_te) F_te = jax.vmap(true_force_fn)(X_te) centers = jnp.linspace(0.7, 2.4, 10) gamma = 4.5 def pair_basis_energy(coords): """RBF basis sums per snapshot (shape: (10,)) for an E(3)-invariant pair potential.""" diff = coords[:, None, :] - coords[None, :, :] dist = jnp.sqrt(jnp.sum(diff ** 2, axis=-1) + jnp.eye(3)) mask = 1.0 - jnp.eye(3) rbf = jnp.exp(-gamma * (dist[..., None] - centers) ** 2) return 0.5 * jnp.sum(rbf * mask[..., None], axis=(0, 1)) def pair_basis_force(coords): """Exact analytic force basis d(-E_k)/dr (shape: (3, 3, 10)) matching -jax.grad.""" diff = coords[:, None, :] - coords[None, :, :] # r_i - r_j dist = jnp.sqrt(jnp.sum(diff ** 2, axis=-1) + jnp.eye(3)) mask = (1.0 - jnp.eye(3))[..., None] rbf = jnp.exp(-gamma * (dist[..., None] - centers) ** 2) dphi_dr = -2.0 * gamma * (dist[..., None] - centers) * rbf * mask unit = diff / dist[..., None] # F_i = -sum_{j!=i} dphi/dr_ij * (r_i - r_j)/r_ij return -jnp.sum(unit[:, :, :, None] * dphi_dr[:, :, None, :], axis=1) # Precompute design matrices for fast energy-only vs energy+force matching Phi_E_tr = jax.vmap(pair_basis_energy)(X_tr) # (18, 10) Phi_F_tr = jax.vmap(pair_basis_force)(X_tr) # (18, 3, 3, 10) Phi_F_te = jax.vmap(pair_basis_force)(X_te) # (40, 3, 3, 10) def train_mlip(force_weight, n_steps=200, lr=0.004): w = jnp.zeros((10,)) bias = jnp.array([0.0]) def loss_fn(w_, b_): e_pred = jnp.dot(Phi_E_tr, w_) + b_[0] f_pred = jnp.einsum("nijc,c->nij", Phi_F_tr, w_) le = jnp.mean((e_pred - E_tr) ** 2) lf = jnp.mean((f_pred - F_tr) ** 2) return le + force_weight * lf + 1e-4 * jnp.sum(w_ ** 2) grad_fn = jax.grad(loss_fn, argnums=(0, 1)) test_f_mae = [] for step in range(n_steps): gw, gb = grad_fn(w, bias) w, bias = w - lr * gw, bias - lr * gb if step % 20 == 0 or step == n_steps - 1: f_p = jnp.einsum("nijc,c->nij", Phi_F_te, w) test_f_mae.append(float(jnp.mean(jnp.abs(f_p - F_te)))) return test_f_mae mae_energy_only = train_mlip(force_weight=0.0) mae_force_match = train_mlip(force_weight=2.0) print(f"Final Test Force MAE (Energy-only training): {mae_energy_only[-1]:.4f}") print(f"Final Test Force MAE (Energy + Force match): {mae_force_match[-1]:.4f}") steps = list(range(0, 200, 20)) + [199] fig, ax = plt.subplots(figsize=(7.2, 4.0)) ax.plot(steps, mae_energy_only, "o--", color="#e74c3c", lw=2, label="Energy-Only Supervision") ax.plot(steps, mae_force_match, "s-", color="#27ae60", lw=2.2, label="Energy + Force Matching") ax.set_xlabel("Gradient Step") ax.set_ylabel("Test Force MAE (eV / Angstrom)") ax.set_title("Force Matching Slashes Error on 18 Small-Data DFT Snapshots") ax.legend() plt.tight_layout() plt.show() -
Implement a PaiNN-style scalar-vector equivariant interaction layer (verifying vector equivariance) and run a 200-step Velocity Verlet molecular dynamics simulation using autodiff forces from a differentiable potential to verify tight total-energy conservation.
import jax import jax.numpy as jnp import matplotlib.pyplot as plt # Part A: PaiNN-style scalar + vector equivariant message layer def painn_layer(s, v, coords, W_s, W_v): """Update scalar features s (N, F) and equivariant vectors v (N, F, 3).""" N = coords.shape[0] r_ij = coords[None, :, :] - coords[:, None, :] # (N, N, 3) dist = jnp.sqrt(jnp.sum(r_ij ** 2, axis=-1, keepdims=True) + 1e-8) mask = (1.0 - jnp.eye(N))[:, :, None] r_hat = (r_ij / dist) * mask # unit vectors decay = jnp.exp(-0.6 * dist) * mask # Scalar message + directional vector message along unit vectors r_hat zs = jnp.dot(s, W_s) zv = jnp.dot(s, W_v) phi_s = zs * jax.nn.sigmoid(zs) # (N, F) phi_v = zv * jax.nn.sigmoid(zv) # (N, F) ds = jnp.sum(decay * phi_s[None, :, :], axis=1) dv = jnp.sum(decay[:, :, :, None] * phi_v[None, :, :, None] * r_hat[:, :, None, :], axis=1) # Couple updated vectors back into scalars via invariant dot product ||v||^2 v_new = v + dv s_new = s + ds + 0.1 * jnp.sum(v_new ** 2, axis=-1) return s_new, v_new key = jax.random.PRNGKey(11) k1, k2, k3, k4 = jax.random.split(key, 4) W_s = jax.random.normal(k1, (6, 6)) * 0.3 W_v = jax.random.normal(k2, (6, 6)) * 0.3 s0 = jax.random.normal(k3, (3, 6)) v0 = jnp.zeros((3, 6, 3)) r0 = jnp.array([[0.0, 0.0, 0.0], [1.45, 0.10, 0.0], [0.60, 1.25, 0.15]]) # Check exact vector equivariance under random SO(3) rotation Q, _ = jnp.linalg.qr(jax.random.normal(k4, (3, 3))) R = Q * jnp.where(jnp.linalg.det(Q) < 0, -1.0, 1.0) s_a, v_a = painn_layer(s0, v0, r0, W_s, W_v) s_b, v_b = painn_layer(s0, jnp.einsum("ij,nfj->nfi", R, v0), jnp.dot(r0, R.T), W_s, W_v) v_rot_err = float(jnp.max(jnp.abs(v_b - jnp.einsum("ij,nfj->nfi", R, v_a)))) print(f"PaiNN vector feature equivariance error: {v_rot_err:.2e}") # Part B: Velocity Verlet MD using autodiff conservative forces def morse_pes(r): diff = r[:, None, :] - r[None, :, :] dist = jnp.sqrt(jnp.sum(diff ** 2, axis=-1) + jnp.eye(3)) mask = 1.0 - jnp.eye(3) return 0.5 * jnp.sum((1.5 * (1.0 - jnp.exp(-1.5 * (dist - 1.35))) ** 2) * mask) force_fn = lambda r: -jax.grad(morse_pes)(r) dt = 0.025 mass = 1.0 r = r0 vel = jnp.array([[0.12, -0.08, 0.02], [-0.07, 0.14, -0.05], [-0.05, -0.06, 0.03]]) acc = force_fn(r) / mass pot_hist, kin_hist, tot_hist, bond01_hist = [], [], [], [] for _ in range(200): pe = float(morse_pes(r)) ke = float(0.5 * mass * jnp.sum(vel ** 2)) pot_hist.append(pe) kin_hist.append(ke) tot_hist.append(pe + ke) bond01_hist.append(float(jnp.linalg.norm(r[1] - r[0]))) r_next = r + vel * dt + 0.5 * acc * (dt ** 2) acc_next = force_fn(r_next) / mass vel = vel + 0.5 * (acc + acc_next) * dt r, acc = r_next, acc_next drift = float(jnp.max(jnp.abs(jnp.array(tot_hist) - tot_hist[0]))) print(f"Total energy drift across 200 Verlet steps: {drift:.2e}") steps = jnp.arange(200) * dt fig, axes = plt.subplots(1, 2, figsize=(11.2, 4.0)) axes[0].plot(steps, pot_hist, color="#3498db", lw=1.8, label="Potential E") axes[0].plot(steps, kin_hist, color="#e74c3c", lw=1.8, label="Kinetic K") axes[0].plot(steps, tot_hist, color="#27ae60", lw=2.2, label="Total (E + K)") axes[0].set_xlabel("Simulation Time (a.u.)"); axes[0].set_ylabel("Energy") axes[0].set_title(f"Energy Conservation with Autodiff Forces (Drift = {drift:.1e})") axes[0].legend() axes[1].plot(steps, bond01_hist, color="#9b59b6", lw=2.0) axes[1].axhline(1.35, color="#666", ls="--", lw=1.2, label="Equilibrium Bond Length") axes[1].set_xlabel("Simulation Time (a.u.)"); axes[1].set_ylabel("Atom 0-1 Distance (Angstroms)") axes[1].set_title("Anharmonic Molecular Vibration Trajectory") axes[1].legend(); plt.tight_layout(); plt.show()