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.3.tar.gz (1.3 MB 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.3-py3-none-any.whl (45.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: atomchain-0.1.3.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for atomchain-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6c215beeaf56e4d5fce7507bd789976756c0dca11571541862c8fc1eb2af9c2c
MD5 dceb1fd6d8033d093ba09ddcf19ad95b
BLAKE2b-256 3349420f1901f6ba8fa12d2d7124f2282c7647bd4bb75f8da499bd28d6661234

See more details on using hashes here.

File details

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

File metadata

  • Download URL: atomchain-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 45.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for atomchain-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 33b5bfff1c3f9415ec6baa6d7ad4cc07f3c33f78169c46d860c1e1372009fa7e
MD5 39e4ed6e2b5c3b9591e0403f764748ed
BLAKE2b-256 30cf7af69c5bfcfba98d52a1394f6f744acb80abe619720900a5fbead0ab65cc

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