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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for atomchain-0.1.6.tar.gz
Algorithm Hash digest
SHA256 acb14564a1f418922cb515c0ffd85958096623740df08c537510fb6f234b6dce
MD5 cae1bfffd0414016e5b60d737bda1366
BLAKE2b-256 7ac991b184f5d7b4451ea9b5b939faf52a37d6cbedb3804a2d28a658b4b73241

See more details on using hashes here.

File details

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

File metadata

  • Download URL: atomchain-0.1.6-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.11.11

File hashes

Hashes for atomchain-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 70a595a2a485bbfb45289a815bda2de98e2d75e528f002ce3d9922b186d3fb88
MD5 8a5ec274ba7c0793b093fa8eaa1c52fd
BLAKE2b-256 a6ada27a1fda041e2e570f5e5c4a5337058b2f0963206c75acd0a64001887151

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