Abstract
Accurate crystal structure determination is critical across all scientific disciplines involving crystalline materials. However, solving and refining inorganic crystal structures from powder X-ray diffraction (PXRD) data is traditionally a labor-intensive and time-consuming process that demands substantial expertise. In this work, we introduce PXRDGen, an end-to-end neural network that determines crystal structures by learning joint structural distributions from experimentally stable crystals and their PXRD, producing atomically accurate structures refined through PXRD data. PXRDGen integrates a pretrained XRD encoder, a diffusion/flow-based structure generator, and a Rietveld refinement module, enabling the solution of structures with unparalleled accuracy in a matter of seconds. Evaluation on MP-20 inorganic dataset reveals a remarkable matching rate of 82% (1 sample) and 96% (20 samples) for valid compounds, with Root Mean Square Error (RMSE) approaching the precision limits of Rietveld refinement. PXRDGen effectively tackles key challenges in XRD, such as the precise localization of light atoms, differentiation of neighboring elements, and resolution of overlapping peaks. Overall, PXRDGen marks a significant advancement in the automated determination of crystal structures from powder diffraction data.
Introduction
Determining the 3D arrangement of atoms in a crystal is fundamental to materials science, yet it remains a significant bottleneck. While single-crystal X-ray diffraction (SCXRD) is the gold standard, many novel materials—such as catalysts or ceramics—can only be synthesized as powders. Powder X-ray Diffraction (PXRD) produces a 1D pattern where 3D structural information is "compressed," leading to overlapping peaks and ambiguous intensities.
Traditionally, solving these structures requires Rietveld refinement, a process that is notoriously expert-dependent, time-consuming, and prone to failure if the initial structural guess is even slightly inaccurate. Furthermore, X-rays struggle to localize light atoms (like Hydrogen or Lithium) or distinguish between neighboring elements in the periodic table (like Iron and Manganese). PXRDGen addresses these challenges by automating the generation and refinement process using a generative framework.
The PXRDGen Framework
PXRDGen consists of three integrated modules designed to move from a 1D diffraction pattern to a refined 3D structure:
- Pre-trained XRD Encoder (PXE): This module uses contrastive learning to align PXRD patterns with known crystal structures in a shared latent space. While Transformers are effective at retrieval, Convolutional Neural Networks (CNNs) were found to be superior encoders for the subsequent generation phase.
- Crystal Structure Generation (CSG): This core module utilizes Riemannian Flow Matching to generate candidate structures. This flow-based approach converges 20 times faster than traditional diffusion models, reaching high accuracy in approximately one second.
- Rietveld Refinement (RR) Module: Candidate structures are automatically passed to a refinement engine (GSAS-II) to polish atomic coordinates against the experimental diffraction data, ensuring physical and experimental consistency.
Additionally, the system incorporates CellNet, a sub-network designed to predict lattice parameters directly from the diffraction pattern, providing a robust alternative when traditional indexing software fails.
Experimental Setup and Results
The model was trained and evaluated on the MP-20 dataset, comprising 45,229 experimentally stable inorganic structures from the Materials Project. PXRD patterns were simulated using standard Cu Kα radiation parameters to provide a consistent ground truth.
PXRDGen achieved unprecedented accuracy on the MP-20 test set, with an 82% match rate for a single sample and 96% when allowed 20 candidate samples. The Root Mean Square Error (RMSE) for generated structures was typically below 0.01, nearing the theoretical precision limits of the Rietveld method.
Beyond speed and accuracy, the model demonstrates a form of "generative intuition." It can accurately place light atoms (e.g., H in $Zr_2Ni_2H_6$) and distinguish between elements with nearly identical atomic numbers (e.g., Mn vs. Fe) by learning the underlying distribution of stable crystals—tasks that are traditionally considered extremely difficult or impossible for standard PXRD.
Conclusion and Future Work
PXRDGen represents a major step toward fully automated crystal structure determination. By reducing the time required from weeks of expert labor to seconds of computation, it opens new doors for high-throughput materials discovery. Future work will focus on scaling the model to more complex structures (beyond 20 atoms per cell), improving robustness against real-world experimental noise such as preferred orientation, and more tightly integrating AI directly into the Rietveld refinement loop.
Summary updated