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.7.tar.gz (1.1 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.7-py3-none-any.whl (58.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for atomchain-0.1.7.tar.gz
Algorithm Hash digest
SHA256 49c6fd373443475709bb7edd5ba29a7bfaad84fe570d4a6f02fe5471e7d7924c
MD5 3675f555feb4f72f48f023f2f54876af
BLAKE2b-256 4427fdb9aacc7d31a8081498bf853e53d05692e3b4d85cf7bdc92337860ec627

See more details on using hashes here.

File details

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

File metadata

  • Download URL: atomchain-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 58.5 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e50efbdfdde0a7b76bf41896996e54a46ba015ed6b47959038481153205a15f9
MD5 3eb580ae1f60070c0e8879e3608d90ca
BLAKE2b-256 23e79d26f99d33e2bfb8fae8210c530834d938e73f69ec7f0e39e57a0ac9d8c2

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