Skip to main content

A library to chain the atomic models with applications

Project description

atomchain

AtomChain provides CLI tools and Python APIs for atomic structure manipulation and ML potential calculations.

CLI Tools

AtomChain includes several command-line tools for common atomistic workflows:

  • mlrelax - Relax atomic structures using ML potentials
  • mlphonon - Calculate phonon properties and band structures
  • mlgap - Predict band gap using ML potentials
  • mlsinglepoint - Single point energy/forces/stress calculations
  • mlsupercell - Generate supercells with various transformation matrices
  • mlrattle - Generate rattled structure datasets for training
  • mlbatch - Batch process trajectories with ML potentials
  • mlcompare - Compare calculated properties between two trajectories
  • mlneb - Nudged elastic band calculations for reaction pathways

Installation

pip install -e .

Quick Start

Single Point Calculation

mlsinglepoint input.vasp --calculator chgnet --output results.yaml

Generate Supercell

mlsupercell input.vasp --size 2 --output supercell.vasp

Generate Training Dataset

mlrattle input.vasp --stdev 0.05 --count 100 --output structures.traj

Batch Process Trajectory

mlbatch structures.traj --calculator chgnet --output results.traj

Compare Trajectories

mlcompare dft.traj ml.traj --labels "DFT" "CHGNet" --output comparison.png

Relax Structure

mlrelax input.vasp --calculator chgnet --output relaxed.vasp

Calculate Phonons

mlphonon input.vasp --calculator chgnet --supercell 2,2,2

Documentation

Detailed documentation for each tool is available in the docs/ directory:

Python API

All CLI tools have corresponding Python APIs for programmatic use:

from ase.io import read
from atomchain import (
    relax_with_ml,
    phonon_with_ml,
    init_calc,
    calculate_single_point,
    make_supercell_structure,
    generate_rattle_dataset,
    calculate_trajectory_batch,
    compare_trajectories,
    calculate_neb,
    predict_gap,
)

atoms = read("structure.vasp")

# Relax structure
relaxed_atoms = relax_with_ml(atoms, calculator="chgnet")

# Calculate phonons
phonon_with_ml(atoms, calculator="chgnet", supercell_matrix=[[2,0,0],[0,2,0],[0,0,2]])

# Predict band gap
gap = predict_gap(atoms, xc="PBE")

# Single point calculation
results = calculate_single_point(atoms, calculator="chgnet")

# Generate supercell
supercell = make_supercell_structure(atoms, size=2)

# Generate dataset
generate_rattle_dataset(
    atoms,
    stdev=0.05,
    count=100,
    output="dataset.traj"
)

# Batch process trajectory
results = calculate_trajectory_batch(
    "dataset.traj",
    calculator="chgnet",
    output="results.traj"
)

# Compare trajectories
compare_trajectories("dft.traj", "ml.traj", labels=["DFT", "CHGNet"])

# NEB calculation
images = [read(f"image{i}.vasp") for i in range(5)]
calculate_neb(images, calculator="chgnet")

Requirements

  • Python 3.9+
  • ASE (Atomic Simulation Environment)
  • Optional: CHGNet, M3GNet, MACE for ML potentials
  • Optional: Phonopy for phonon analysis

License

[Your license here]

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

atomchain-0.1.5.tar.gz (816.7 kB view details)

Uploaded Source

Built Distribution

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

atomchain-0.1.5-py3-none-any.whl (54.1 kB view details)

Uploaded Python 3

File details

Details for the file atomchain-0.1.5.tar.gz.

File metadata

  • Download URL: atomchain-0.1.5.tar.gz
  • Upload date:
  • Size: 816.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for atomchain-0.1.5.tar.gz
Algorithm Hash digest
SHA256 387b4c1e07a88cf2a2bb369f06bc773aae06da8c57def900a17f8917311566bb
MD5 225977c5e30d7b66ea635b79784a718c
BLAKE2b-256 a4ed9c4f1a8daec933ab19e863db51d9883b5eae51fb5b401cf6913e3f83c983

See more details on using hashes here.

File details

Details for the file atomchain-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: atomchain-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 54.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for atomchain-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 298f003c97ab4fe12b1464db3d8445a31100e9a0af39984df2ee367a7bfb696c
MD5 b77f7e97ac85623226b0655181497d04
BLAKE2b-256 6de22bc75fdbcaf12e2a46f9796cbf511ddd32a27a2211fe5178ce10bf7db7ef

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