openmaterials.ai / codes / DiffCSP
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.
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.
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.
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).
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).
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).
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
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
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
The atom types of one unit cell, as one-hot vectors, fix the conditional p(L, F | A).
Draw the lattice from N(0, I) and coordinates from U(0, 1), then denoise for 1,000 steps.
Compare with pymatgen StructureMatcher (stol 0.5, angle_tol 10, ltol 0.3) or relax.
Rank the k candidates by energy with DFT or a potential and keep the best structure.