Basic crystallographic algorithms in the ML language

Z. Matěj

MAX IV Laboratory, Lund University, Lund, Sweden

zdenek.matej@maxiv.lu.se

Machine learning (ML) is increasingly finding applications in crystallography and materials science, enabling data-driven discovery of structural patterns, accelerating phase identification, and predicting material properties from complex diffraction and imaging datasets. In addition to these novel applications, traditional algorithms - used in crystallography for decades - are now being reimplemented using ML-based methods or simply executed within high-performance ML frameworks to benefit from their computing capabilities.

Among the next generation of scientists it is common a crystallography problem - that would be traditionally resolved by progressive analysis, followed by application of tailored numerical methods - is tackled by data-driven ML approach. While generic, unoptimized ML solutions often require more computational resources than traditional methods, the availability of optimized ML hardware and advanced software frameworks, built on robust mathematical libraries and developed by both the research community and industrial partners, can offer efficient alternatives.

This contribution aims to provide a gentle introduction to implementing several computational algorithms commonly used in the analysis of diffraction data in materials science and crystallography. The selected examples focus on well-understood, foundational algorithms that will be reformulated as neural networks. The process of solving these problems using data-driven approaches will be illustrated, including the full workflow and a discussion of its limitations, strengths, and potential ML-based extensions. Demonstrations will include peak parameter refinement using the least squares method, electron density map calculation, and a basic iterative algorithm for phase problem solving.