Metadata-Version: 2.4
Name: XMFlib
Version: 0.1.4
Summary: A library for pair probability prediction using machine learning.
Author-email: Minhui Li <23210220016@m.fudan.edu.cn>
License: MIT License
        
        Copyright (c) 2025 aFui233
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/aFui233/XMFlib
Project-URL: Repository, https://github.com/aFui233/XMFlib
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENCE
Requires-Dist: torch>=1.10
Requires-Dist: numpy>=1.20
Dynamic: license-file

# XMFlib

**XMFlib** 是一个基于机器学习的位点对概率预测库，适用于表面科学和材料模拟领域。它通过预训练的神经网络模型，能够根据输入的相互作用能、温度和覆盖度，快速预测不同类型的配对概率。

---

## 特性

- 支持多种表面类型（如 100, 111 晶面）
- 内置多层感知机（MLP）模型，推理高效
- 简单易用的 API，便于集成到科研和工程项目
- 兼容 PyTorch，易于扩展和自定义模型

---

## 安装

```bash
pip install XMFlib
```

---

## 使用示例

```python
from XMFlib.PairProbML import PairProbPredictor

predictor = PairProbPredictor()
result = predictor.predict(
    facet=100,                  # 晶面类型，可选 '100' 或 '111'
    interaction_energy=0.2,    # 相互作用能 (eV)
    temperature=400,            # 温度 (K)
    main_coverage=0.5           # 主组分覆盖度 (0~1)
)
print(result)
# 输出示例: {'vacancy_pair': 0.12, 'species_pair': 0.34, 'species_vacancy_pair': 0.54}
```

