Skip to content
Projects

Bin-Cao/PyWPEM has 228 GitHub stars and 83 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-23 17:19 UTC. Last push 2026-09-23.

How these counts are measured

What you can do

  • XRD SimulationAccurate diffraction pattern generation from crystallographic information.
  • Peak Decomposition & Quantitative AnalysisWPEM-based decomposition and volume fraction determination.
  • Bragg Law Optimization (EM Framework)Expectation-Maximization-based parameter solving.
  • Extinction & Wyckoff HandlingSymmetry-aware preprocessing and structural filtering.

Measured star growth

in 24h
0
in 7 days
0
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

About

[WPEM / PyWPEM] AI-Driven Structure Refinement of X-ray Diffraction

Developer Tools

README.md

Original

PyWPEM

[!TIP] Explore the PyWPEM product homepage: https://bin-cao.github.io/PyWPEM/

A next-generation whole-pattern refinement framework for complex crystal structure analysis.

English | 简体中文 | 日本語 | 한국어 | Español | Français | Deutsch

Homepage Documentation arXiv Paper Supplementary Materials Download Stats

GitHub Stars GitHub Forks Open Issues Closed Issues License Last Commit

[!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.

I am developing a user interface to support all functionalities of PyXplore (see the UI repository). Through the UI, users only need to input their data and parameters, and the corresponding execution code is generated automatically. Please stay tuned for updates.

We welcome contributions from the community. 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.



Overview

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


Installation

Install from PyPI and install the dependencies:

pip install PyXplore

Upgrade to the latest version:

pip install --upgrade PyXplore

Key Features

  • 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.


Architecture Overview

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.


Tables & Figures

PyWPEM table

PyWPEM figure


Scientific Reference

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}
}

License

This project is released under the MIT License.

Explore related projects

Loading…