Skip to main content

A library for pair probability prediction using machine learning.

Project description

XMFlib

English | 中文

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: [1.9832839222709777e-05, 0.38549050273994284, 0.6144896644208344]

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmflib-0.3.1.tar.gz (168.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xmflib-0.3.1-py3-none-any.whl (168.0 kB view details)

Uploaded Python 3

File details

Details for the file xmflib-0.3.1.tar.gz.

File metadata

  • Download URL: xmflib-0.3.1.tar.gz
  • Upload date:
  • Size: 168.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for xmflib-0.3.1.tar.gz
Algorithm Hash digest
SHA256 813dc88a80bc823d8b17f2dace1f5501827bc675744beb955527230da0d8fce0
MD5 44b667173b298c2e4408ea31083b6678
BLAKE2b-256 1c4b8fe0feb8960832ec95cbe89c5a649abc9c03bcfdf08c537260a42d7d685f

See more details on using hashes here.

File details

Details for the file xmflib-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: xmflib-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 168.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for xmflib-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ef977a29b89875eb6a7cfa4c5b993a6a7a172eb33eecd826a12c50c1d48f740
MD5 90afd236eaf8b0c42ea63b3e5dbd49b0
BLAKE2b-256 b995ac76e4cc2eabb8993ca7df180751c8e552f50ea5e3199c30ab3f35a725e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page