openmaterials.ai / codes / DiffCSP

DiffCSP: crystal structure prediction by joint equivariant diffusion

Given a composition, a diffusion model denoises the lattice and the fractional coordinates together under periodic E(3) invariance and returns candidate structures in seconds.

What it is and how it works

Lattice and coordinates together

The lattice follows a denoising diffusion with a Gaussian prior and an O(3)-equivariant score. Fractional coordinates follow score matching with a wrapped normal, which builds periodicity into the model.

Fractional coordinates

Positions live in [0,1)^3 and enter the network through a Fourier transform of relative fractional vectors, invariant to periodic translation with no multi-graph edges.

Denoising network

EGNN-style message passing on the fully connected graph, with L^T L for O(3) invariance. Six layers, 512 hidden states, 256 Fourier features on MP-20 (Jiao 2023).

Sampling

1,000 diffusion steps, an ancestral predictor with a Langevin corrector for the coordinates, and k candidates per composition, k = 1 or 20 in the benchmarks (Jiao 2023).

Ab initio generation

A discrete diffusion on atom types lets the same model generate compositions too, with 100% structural validity on Perov-5, Carbon-24 and MP-20 (Jiao 2023).

What people do with it

  • 77.93%match rate on MP-20 with 20 samplesJiao 2023
  • 10 sfor 20 candidates per compound, USPEX 12.5 hJiao 2023
  • 0.0492normalised RMSE of matched MP-20 structuresJiao 2023

Kagome and Lieb lattice quantum materials

SCIGEN steered DiffCSP to 10 million Archimedean and Lieb lattice compounds. Of 26,000 relaxed with DFT, 53% were structurally stable, and two predicted materials were synthesised. Okabe 2025

Superconductors by guided diffusion

A DiffCSP model pretrained on Alexandria and fine-tuned on 7183 superconductors gave 34,027 unique candidates from 200,000 samples, 773 with a DFT Tc above 5 K. Prakash 2026

Fifteen compounds against USPEX

In the DiffCSP paper, it matched 73.33% of 15 MP-20 compounds with 20 candidates in about 10 s each, against 53.33% for the USPEX evolutionary search at 12.5 h. Jiao 2023

How it is used

  1. Give a composition

    The atom types of one unit cell, as one-hot vectors, fix the conditional p(L, F | A).

  2. Sample candidates

    Draw the lattice from N(0, I) and coordinates from U(0, 1), then denoise for 1,000 steps.

  3. Match or relax

    Compare with pymatgen StructureMatcher (stol 0.5, angle_tol 10, ltol 0.3) or relax.

  4. Evaluate

    Rank the k candidates by energy with DFT or a potential and keep the best structure.