MLIP
MLIP evaluates machine-learned interatomic potentials on CPU and GPU, returning ASE-compatible energies (eV), analytical forces (eV/Å), and analytical periodic stress (eV/ų).
Quick usage
Section titled “Quick usage”from atomli.calculators.mlip import MLIP
atoms.calc = MLIP("nequix-mp-1") # downloads & verifies SHA-256 on first useenergy = atoms.get_potential_energy() # eVforces = atoms.get_forces() # eV/Åstress = atoms.get_stress() # eV/ų (requires 3D periodic cell)Charge- and spin-conditioned molecular/cell potential (HyFF):
atoms.calc = MLIP("hyff-presto", charge=1, unpaired=1)# or: MLIP("/models/custom.nqx", runtime="nequix", device="gpu:pci:0000:61:00.0")Runtime families
Section titled “Runtime families”| Runtime | File format | Cutoff / representation | Periodicity & stress | Charge & spin | Supported architectures / notes |
|---|---|---|---|---|---|
Nequix | .nqx | Equivariant MP (), 6.0 Å | 0D & 3D PBC + stress | Neutral | nequix-mp-1, nequix-oam-1, nequix-omat-1 |
NequIP | .nequip.zip | e3nn equivariant tensor-product MP | 0D & 3D PBC + stress | Neutral | nequip-s, nequip-l; GPU resident displacement stencil path |
Equiformer | .pt | SO(2) equivariant graph transformer | 0D & 3D PBC + stress | Neutral | equiformer, equiformer-gradient |
HyFF | .safetensors + weights.json | Cartesian MP, H–Bi, 4.5 Å | 0D & 3D PBC + stress | Explicit charge, unpaired / multiplicity | hyff-presto, hyff-vivace, hyff-moderato (andante/largo unsupported) |
See MLIP models for the full 13-model catalog and checkpoint sizes.
Constructor parameters
Section titled “Constructor parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
model | str | Path | required | Catalog ID ("nequix-mp-1", etc.) or local checkpoint file/directory |
runtime | str | "nequix" | "nequix", "nequip", "equiformer", or "hyff"; inferred automatically for catalog IDs and .zip / .pt / .safetensors paths |
device | str | Adapter | None | Auto / atomli.gpu default | "cpu", "gpu" ("wgpu" alias), "gpu:<index>", "gpu:pci:<id>", "auto", or Adapter |
adapter | Adapter | int | str | None | None | Physical GPU selector when device="gpu" |
download | bool | True | Allow fetching uncached catalog checkpoints (False requires local cache hit) |
charge | float | None | None | Integer charge override (HyFF only; other runtimes raise if provided) |
unpaired | int | None | None | Unpaired electron count (HyFF only; , multiplicity is unpaired + 1) |
multiplicity | int | None | None | Spin multiplicity (, HyFF only; conflicts if combined with a differing unpaired) |
- Element validation: Construction validates every atomic number in
atomsagainst the loaded model’s species table and raises explicitly on out-of-coverage elements.
Spatial domain tiling
Section titled “Spatial domain tiling”- Automatic spatial domain decomposition: On large supercells (10k–100k+ atoms),
MLIPpartitions atoms into spatial sub-domains with ghost/halo exchange to keep device buffers within VRAM limits and scale across multiple GPUs when configured. - No silent CPU downgrade: Explicit
device="gpu"("wgpu") raises immediately if no hardware adapter matches or the selector is invalid.
Batching: NEB, ForceSession, and batch_stats
Section titled “Batching: NEB, ForceSession, and batch_stats”atomli.mep.NEB batches interior images sharing an MLIP configuration automatically, and ForceSession evaluates finite-displacement stencils (used by method="resident_finite_difference" in Vibrations and run_resident_finite_difference() in Phonons):
from atomli.displacements import ForceSession
session = ForceSession(atoms)forces = session.evaluate_displacements([[(1, 0, -0.01)], [(1, 0, 0.01)]], batch_size=2)print(session.stats, atoms.calc.batch_stats)batch_stats field | Description |
|---|---|
native_batch_calls | Completed native multi-geometry batch invocations |
native_batch_geometries | Total geometries evaluated inside native batches |
serial_geometries | Geometries evaluated through the serial batch fallback path |
batch_failures | Failed batch attempts prior to serial evaluation |
Host output buffer requirement for ForceSession: 24 * configurations * n_atoms bytes (forces in eV/Å; input displacements in Å).
Model cache and verification
Section titled “Model cache and verification”Weights are never bundled inside Python wheels. Resolution order:
- Explicit local path or verified cache directory (
ATOMLI_MODELS_DIR, else$XDG_CACHE_HOME/atomli/models, else~/Library/Caches/atomli/modelson macOS or~/.cache/atomli/modelson Linux) https://tako.atom.li/calculation-wasm/- Backup GitHub Release
mlip-models
Every catalog download is staged to a temporary file and accepted only after matching both byte size and pinned SHA-256 digest.