Related Experiment Video
Updated: Aug 7, 2026

X-ray Powder Diffraction in Conservation Science: Towards Routine Crystal Structure Determination of Corrosion Products on Heritage Art Objects
Published on: June 8, 2016
Rust-accelerated powder X-ray diffraction simulation for high-throughput and machine-learning-driven materials
Miroslav Lebeda1,2,3, Jan Drahokoupil1,3, Petr Veřtát3
1Faculty of Mechanical Engineering Czech Technical University in Prague Technická 4 16607Prague 6 Czechia.
Abstract:
High-throughput powder X-ray diffraction (XRD) simulations are a key prerequisite for generating large datasets used in the development of machine-learning models for XRD-based materials analysis. However, the widely used pymatgen powder XRD calculator, implemented entirely in Python, can be computationally inefficient for large-scale workloads, limiting throughput. We present XRD-Rust, a Rust-accelerated implementation of the pymatgen powder XRD calculator that maintains compatibility with the existing Python-based workflows. The method retains pymatgen for crystal structure handling, while reimplementing the computationally intensive parts of the XRD calculation in the Rust language, with optional further acceleration via single instruction, multiple data (SIMD) vectorization and multi-threaded execution across reflections using the Rayon library. Performance benchmarking on two large crystallographic datasets, the Materials Cloud Three-Dimensional Structure Database (MC3D, 33142 structures) and the Crystallography Open Database (COD, 515181 structures), demonstrates substantial speedups. For the MC3D, XRD-Rust achieves a median serial SIMD speedup of 10.8× [median absolute deviation (MAD) of 1.8×], increasing to 15.1× (MAD 3.8×) with eight-thread parallel execution, with a maximum runtime reduction from 40.5 s to 0.9 s. For the COD, the median serial SIMD acceleration reaches 10.7× (MAD 4.2×), while eight-thread parallel execution yields 19.5× (MAD 10.0×), with a maximum reduction from 1437 to 1 min. SIMD vectorization alone provides additional performance gains ranging from a few percent to several tens of percent, depending on the workload and execution mode. Overall, these benchmarks demonstrate that XRD-Rust significantly accelerates powder XRD simulations compared with the original pymatgen implementation, enabling efficient high-throughput dataset generation and improving performance in interactive diffraction analysis applications.
Related Concept Videos
X-ray Diffraction of Biological Samples
According to Bragg's law, when X-rays strike the sample positioned on a stage, the rays are scattered by the electron clouds around the sample atoms. The X-ray diffraction or scattering is caused by constructive interference of the X-ray waves that reflect off the internal crystal...
Determination of Crystal Structures
X-ray Crystallography
Diffraction
Diffraction is the change in the direction of travel experienced by an electromagnetic wave when it encounters a physical barrier whose dimensions are comparable to those of the wavelength of the light. X-rays are electromagnetic radiation with wavelengths about as long as the distance between neighboring...

