A library for pair probability prediction using machine learning.
Project description
XMFlib
XMFlib is a machine learning-based library for predicting pair-site probabilities, designed for surface science and materials simulation. Leveraging pre-trained neural network models, it can quickly predict various types of pair probabilities based on input interaction energy, temperature, and coverage.
Features
- Supports multiple surface types (e.g., 100, 111 facets)
- Supports first-nearest neighbor (1NN) and second-nearest neighbor (2NN) interaction predictions
- Built-in multi-layer perceptron (MLP) models for efficient inference
- Simple and user-friendly API, easy to integrate into research and engineering projects
- Compatible with PyTorch, making it easy to extend and customize models
Installation
pip install XMFlib
Virtual Environment Setup (Recommended)
conda create --name <env_name> python=3.9
conda activate <env_name>
pip install XMFlib
Usage Example
Basic Model Prediction (1NN interactions only)
from XMFlib.PairProbML import PairProbPredictor
predictor = PairProbPredictor()
result = predictor.predict(
facet=100, # Facet type, options: '100' or '111'
interaction_energy=0.3, # Interaction energy (eV)
temperature=400, # Temperature (K)
main_coverage=0.7 # Main species coverage (0~1)
)
print("Predicted probabilities:", result)
Example output:
Predicted probabilities: [0.002484329044818878, 0.38522598147392273, 0.5955939292907715]
2NN Model Prediction (considering 1NN and 2NN interactions)
from XMFlib.PairProbML import PairProbPredictor
predictor = PairProbPredictor()
result_2nn = predictor.predict_2nn(
facet=111, # Facet type, options: '100' or '111'
interaction_energy_1nn=0.16, # 1NN interaction energy (eV)
interaction_energy_2nn=0.04, # 2NN interaction energy (eV)
temperature=525, # Temperature (K)
main_coverage=0.7 # Main species coverage (0~1)
)
print("Predicted 2NN probabilities:", result_2nn)
Example output:
Predicted 2NN probabilities: [0.012345678901234, 0.45678901234567, 0.53086530825309]
The list corresponds to:
- Pee: probability of a vacancy-vacancy pair (empty-empty site)
- Paa: probability of a specie-specie pair (specie-specie)
- Pae: probability of a specie-vacancy pair (specie-empty site)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xmflib-0.1.8.tar.gz.
File metadata
- Download URL: xmflib-0.1.8.tar.gz
- Upload date:
- Size: 155.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e919f7d163b098535f1a38befe157a8c6d43d54cdcea291157167e98676461b2
|
|
| MD5 |
d23d1fb6e7acee979cc175ca30c55cc5
|
|
| BLAKE2b-256 |
36ed283982ee5b6685a1463a323c9b706b9798ba28c91d3514c95d5eb4c253c2
|
File details
Details for the file xmflib-0.1.8-py3-none-any.whl.
File metadata
- Download URL: xmflib-0.1.8-py3-none-any.whl
- Upload date:
- Size: 154.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8342a06d7a214fc900dae57d7daf5d90eac1f97073ca6f9b4d2b66afb73c8b9a
|
|
| MD5 |
e029527633644f5f1d9214d1910bacbe
|
|
| BLAKE2b-256 |
0470eaecec9c06e6d407e1b9649a865d599bb451763dd97c7d308125ad7da7e0
|