Header Ads Widget

AI & Machine Learning for Materials Sciences

Last Posts

10/recent/ticker-posts

Post 17: Invariance vs Equivariance — Why MACE Beats SchNet for Materials

The single architectural distinction that separates 2017-era neural network potentials from today's state of the art: what happens to a network's internal features when you rotate the crystal — and why that determines force accuracy.

🔄
Invariant

Output unchanged under rotation

🧭
Equivariant

Output rotates with the input

📈
Timeline

SchNet 2017 → MACE 2022

🎯
Payoff

Far more accurate forces, fewer training structures

Post 16 established that every neural network potential sums per-atom energy contributions computed from each atom's local environment. The question this post answers is: what mathematical object does the network use to represent that local environment? The answer — scalars only (invariant) versus scalars plus vectors and tensors (equivariant) — turns out to be the single biggest factor separating SchNet-era accuracy from MACE-era accuracy.

1. Two Symmetries, One Crystal

Physically, a crystal's total energy cannot depend on how you've oriented it in space — rotate the whole structure and the energy stays exactly the same. This is rotational invariance of the energy, and it is non-negotiable: any correct potential must respect it. But the forces on each atom are vectors — they point in specific directions in 3D space. Rotate the crystal, and the force vectors must rotate by exactly the same amount. This is rotational equivariance of the forces.

🔄 The two symmetry requirements
Energy (scalar): E(RR) = E(R)       — invariant
Forces (vector): F(RR) = R · F(R)   — equivariant

R = a rotation matrix applied to all atomic positions
RR = the rotated set of positions
💡
An everyday analogy

Imagine weighing a rotating object on a scale — the weight reading (a scalar) never changes no matter which way the object is turned: that's invariance. Now imagine tracking the direction an arrow on that object points — as you rotate the object, the arrow's direction rotates with it: that's equivariance. A network that only ever computes scalars cannot represent that arrow at all.

2. SchNet: Invariant by Construction

SchNet represents each atom's environment using only interatomic distances — a quantity that is automatically rotation-invariant, since rotating the crystal doesn't change how far apart any two atoms are. Every internal feature SchNet computes is a scalar number per atom. This guarantees the predicted energy is invariant (correct), but it means SchNet must recover the directional information needed for forces entirely through differentiation of distance-based features — it never explicitly represents "which direction".

📏 SchNet's continuous-filter convolution (schematic)
hi(t+1) = hi(t) + Σj hj(t) ⊙ W(‖ri−rj‖)

Every input to the filter W is a scalar distance ‖ri−rj‖.
No directional (vector) information ever enters the network.

3. NequIP and MACE: Equivariant by Construction

NequIP (2022) and MACE (2022) instead pass spherical harmonic representations of the relative position vectors ri−rj through the network — not just their length, but their full directional content, organised by rotation order ℓ (ℓ=0 is a scalar, ℓ=1 transforms like a vector, ℓ=2 like a rank-2 tensor, and so on). Every layer is built from tensor products that combine these multi-order features while provably preserving the correct equivariance at every step.

🧭 Equivariant message passing (schematic)
hi(t+1) = hi(t) ⊕ Σj Y(r̂ij) ⊗ hj(t)

Y(r̂ij) = spherical harmonics of the unit directionij
⊗ = tensor product, combined via Clebsch-Gordan coefficients
Output features at ℓ>0 rotate correctly when the input crystal rotates
PropertySchNet (invariant)NequIP / MACE (equivariant)
Internal featuresScalars only (ℓ=0)Scalars + vectors + tensors (ℓ=0,1,2,…)
Input to the networkInteratomic distances onlyFull direction vectors ri−rj
Force accuracyGood, but indirectSubstantially better — directional info is explicit
Data efficiencyNeeds more training structuresOften 10-100× fewer structures for same accuracy
Compute cost per stepLowerHigher (tensor products are expensive)

4. Why Equivariance Helps Most for Transition Metal Compounds

🔬
Directional bonding is exactly what crystal field theory describes

The energy splitting between t₂g and eg d-orbitals depends on the direction of the ligand field relative to the d-orbital lobes — this is inherently a directional, tensor-like effect (the d-orbitals themselves transform as ℓ=2 spherical harmonics under rotation). An invariant network like SchNet can only learn this indirectly through distance patterns; an equivariant network can represent the directional structure of the ligand field much more naturally, which is part of why MACE-MP-0 performs so well on transition-metal-containing materials straight out of the box.

5. The Architecture Timeline

YearModelKey contribution
2007Behler-ParrinelloSum of per-atom NNs; hand-crafted symmetry-function descriptors
2017SchNetLearned continuous-filter convolutions replace hand-crafted descriptors; still fully invariant
2021NequIPFirst widely-adopted E(3)-equivariant message-passing potential; tensor features throughout
2022MACEHigher-order equivariant many-body messages in a single layer — fewer layers needed for the same expressivity, faster training
2023–24MACE-MP-0, CHGNetEquivariant architectures trained as foundation models on the full Materials Project trajectory database

6. What MACE Adds on Top of NequIP

Both NequIP and MACE are equivariant, but MACE's key innovation is constructing higher-order many-body features within a single message-passing step, rather than building up many-body correlations gradually over many layers as NequIP does. This makes MACE both more expressive per layer and considerably faster to train — one reason it has become the default starting point for foundation models like MACE-MP-0.

🧭
App 17 — Invariance vs Equivariance Visualiser
Rotate a small molecule interactively and watch how scalar (invariant) vs vector (equivariant) features behave differently — see exactly what SchNet throws away that MACE keeps.
Open App →

Quick Check

1. What does it mean for a property to be "rotationally equivariant" rather than "rotationally invariant"?

  • A. Equivariant means the property never changes; invariant means it changes unpredictably
  • B. An equivariant property transforms in a well-defined, matching way when the input is rotated (like a force vector rotating with the crystal); an invariant property stays exactly the same (like the total energy)
  • C. They are two names for the same mathematical concept
  • D. Equivariant properties only apply to 2D systems

2. Why can SchNet's internal features never directly represent a bond direction?

  • A. SchNet was not designed to handle crystals
  • B. SchNet's continuous-filter convolutions take only interatomic distances (scalars) as input — distance alone cannot encode which direction a neighbour lies in
  • C. SchNet uses too few layers to learn direction
  • D. SchNet only works for molecules, not solids

3. Why might an equivariant network like MACE be especially well-suited to transition-metal d-orbital physics?

  • A. MACE was specifically trained only on transition metals
  • B. Crystal field splitting depends on the directional relationship between ligands and d-orbitals — an inherently tensor-like (ℓ=2) effect that equivariant features can represent directly, unlike distance-only invariant features
  • C. Transition metals have no directional bonding character, so any architecture works equally well
  • D. Equivariant networks are simply larger and therefore always more accurate
Equivariance Invariance SchNet NequIP MACE Spherical Harmonics Crystal Field Theory Tensor Features