SkillAgentSearch skills...

PyWPEM

[https://bin-cao.github.io/PyWPEM] AI-Driven Structure Refinement of X-ray Diffraction

Install / Use

/learn @Bin-Cao/PyWPEM
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<p align="center"> <!-- ===== Links ===== --> <a href="https://bin-cao.github.io/PyWPEM/"> <img src="https://img.shields.io/badge/Homepage-Project-black?style=for-the-badge" /> </a> <a href="https://pyxplore.netlify.app/"> <img src="https://img.shields.io/badge/Docs-Documentation-grey?style=for-the-badge" /> </a> <a href="https://arxiv.org/abs/2602.16372"> <img src="https://img.shields.io/badge/arXiv-Paper-b31b1b?style=for-the-badge&logo=arxiv&logoColor=white" /> </a> <a href="https://www.researchgate.net/publication/400962382"> <img src="https://img.shields.io/badge/Supplementary-Materials-teal?style=for-the-badge" /> </a> <a href="https://www.pepy.tech/projects/PyXplore"> <img src="https://img.shields.io/badge/Downloads-Stats-4CAF50?style=for-the-badge" /> </a> </p> <p align="center"> <!-- ===== GitHub Stats ===== --> <a href="https://github.com/Bin-Cao/PyWPEM"> <img src="https://img.shields.io/github/stars/Bin-Cao/PyWPEM?style=for-the-badge&logo=github" /> </a> <a href="https://github.com/Bin-Cao/PyWPEM/forks"> <img src="https://img.shields.io/github/forks/Bin-Cao/PyWPEM?style=for-the-badge&logo=github" /> </a> <a href="https://github.com/Bin-Cao/PyWPEM/issues"> <img src="https://img.shields.io/github/issues/Bin-Cao/PyWPEM?style=for-the-badge&logo=github" /> </a> <a href="https://github.com/Bin-Cao/PyWPEM/issues?q=is%3Aissue+is%3Aclosed"> <img src="https://img.shields.io/github/issues-closed/Bin-Cao/PyWPEM?style=for-the-badge&logo=github" /> </a> <a href="https://github.com/Bin-Cao/PyWPEM/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/Bin-Cao/PyWPEM?style=for-the-badge" /> </a> <a href="https://github.com/Bin-Cao/PyWPEM/commits/main"> <img src="https://img.shields.io/github/last-commit/Bin-Cao/PyWPEM?style=for-the-badge" /> </a> </p> <p align="center"> <img src="https://github.com/Bin-Cao/TCGPR/assets/86995074/28f69830-4ece-43b3-a887-e78fdb25bcab" width="140" alt="PyWPEM Logo"/> </p> <p align="center"> <strong>Python Toolkit for X-ray Diffraction Simulation, Analysis, and AI-driven Structure Refinement</strong> </p> <p align="center"> <img width="600" src="https://github.com/user-attachments/assets/e37ee8c4-8bdd-4de0-b27e-2ce7270a8a07" /> </p>

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


<p align="center"> <a href="https://star-history.com/#Bin-Cao/PyWPEM&Date"> <img src="https://api.star-history.com/svg?repos=Bin-Cao/PyWPEM&type=Date" width="650" style="border: 1px solid #d0d7de; border-radius: 12px; padding: 8px; background: #ffffff;" /> </a> </p>

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.

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

<p align="center"> <img width="450" src="https://github.com/user-attachments/assets/da5bd320-3651-4223-b862-06fb5ce1f96a" /> </p> <p align="center"> <img width="700" src="https://github.com/user-attachments/assets/50b1aacc-6a4f-4b58-95fb-a4094da60055" /> </p>

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

Contributing

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.


License

This project is released under the MIT License.

Free for academic and commercial use. Please cite related publications when used in scientific research.


<table> <tr> <td width="160" align="center" valign="top"> <img src="https://github.com/user-attachments/assets/7e77bd5a-42d6-45db-b8e6-2c82cac81b9d" width="140" style="border-radius: 50%;"/> </td> <td valign="top"> <b>For any inquiries or assistance, feel free to contact Mr. CAO Bin at:</b><br> 📧 Email: <a href="mailto:bcao686@connect.hkust-gz.edu.cn">bcao686@connect.hkust-gz.edu.cn</a><br><br> Cao Bin is a PhD candidate at the <b>Hong Kong University of Science and Technology (Guangzhou)</b>, under the supervision of Professor <a href="https://gbaaa.org.hk/en-us/article/67">Zhang Tong-Yi</a>. His research focuses on <b>AI for science</b>, especially intelligent crystal-structure analysis and discovery. Learn more about his work on his <a href="https://bin-cao.github.io/">homepage</a>. </td> </tr> </table>

Related Skills

View on GitHub
GitHub Stars105
CategoryDevelopment
Updated5h ago
Forks38

Languages

Jupyter Notebook

Security Score

95/100

Audited on Apr 2, 2026

No findings