A next-generation whole-pattern refinement framework for complex crystal structure analysis.
Language: English | 简体中文 | 日本語
Note
WPEM introduces a fundamentally new paradigm for XRD refinement beyond conventional Rietveld methods.
Instead of fitting diffraction peaks through traditional least-squares profile matching, WPEM formulates the entire diffraction pattern as a physics-constrained probabilistic mixture distribution and performs whole-pattern decomposition through an expectation-maximization framework. By explicitly embedding Bragg consistency into the optimization process, PyWPEM enables stable phase-resolved refinement under severe peak overlap, mixed phases, amorphous backgrounds, and complex experimental conditions. This work represents one of the first attempts to unify AI-driven structure analysis with physically admissible diffraction refinement, potentially redefining the next generation of automated XRD refinement workflows.
We have released the tutorial videos in Chinese on BiliBili:Link
Other tools include XQueryer for initial structure inference and PRDNet for crystal property prediction.
We welcome contributions from the community. The contributors will be acknowledged in the current paper. Substantial contributions to key functionalities may lead to co-authorship in future publications for the next version of WPEM
PyXplore is a modular Python framework for X-ray diffraction (XRD) simulation, decomposition, quantitative analysis, and AI-assisted structure refinement.
It integrates:
- Physics-based diffraction modeling
- EM-based Bragg optimization
- Structure graph construction
- Extinction and Wyckoff analysis
- Amorphous phase quantification
- AI-driven structural refinement
The toolkit is designed for reproducible scientific workflows in materials characterization and AI for Science research.
Install from PyPI and Install the dependencies:
pip install PyXploreUpgrade to the latest version:
pip install --upgrade PyXplore-
XRD Simulation Accurate diffraction pattern generation from crystallographic information.
-
Peak Decomposition & Quantitative Analysis WPEM-based decomposition and volume fraction determination.
-
Bragg Law Optimization (EM Framework) Expectation-Maximization-based parameter solving.
-
Extinction & Wyckoff Handling Symmetry-aware preprocessing and structural filtering.
-
Graph-Based Structure Representation Crystal graph construction for downstream machine learning tasks.
-
Amorphous Structure Analysis RDF-based quantitative evaluation.
-
Multi-modal Extension Integrated modules for XAS and XPS analysis.
PyWPEM/
├── WPEM.py
├── XRDSimulation/
├── EMBraggOpt/
├── Refinement/
├── StructureOpt/
├── GraphStructure/
├── Extinction/
├── Amorphous/
├── Background/
├── Plot/
├── DecomposePlot/
├── WPEMXAS/
├── WPEMXPS/
└── refs/
The design follows a physics-consistent, modular architecture, enabling independent or pipeline-based execution.
If you use PyWPEM in your research, please cite:
@article{cao2026wpem,
title={AI-Driven Structure Refinement of X-ray Diffraction},
author={Bin Cao, Qian Zhang, Zhenjie Feng, Taolue Zhang, Jiaqiang Huang, Lu-Tao Weng, Tong-Yi Zhang},
journal={arXiv preprint},
year={2026},
url={https://arxiv.org/abs/2602.16372v1}
}We welcome contributions from the community.
- Report bugs via Issues
- Propose features
- Submit pull requests
- Contact for academic collaboration
Please ensure code readability, documentation clarity, and scientific correctness before submission.
This project is released under the MIT License.
Free for academic and commercial use. Please cite related publications when used in scientific research.
PyWPEM Desktop, developed by @Zhou Xuan-Yu.

