Skip to content

MLIP

MLIP evaluates machine-learned interatomic potentials on CPU and GPU, returning ASE-compatible energies (eV), analytical forces (eV/Å), and analytical periodic stress (eV/ų).

from atomli.calculators.mlip import MLIP
atoms.calc = MLIP("nequix-mp-1") # downloads & verifies SHA-256 on first use
energy = atoms.get_potential_energy() # eV
forces = 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")
RuntimeFile formatCutoff / representationPeriodicity & stressCharge & spinSupported architectures / notes
Nequix.nqxEquivariant MP (Lmax⁡=3L_{\max} = 3), 6.0 Å0D & 3D PBC + stressNeutralnequix-mp-1, nequix-oam-1, nequix-omat-1
NequIP.nequip.zipe3nn equivariant tensor-product MP0D & 3D PBC + stressNeutralnequip-s, nequip-l; GPU resident displacement stencil path
Equiformer.ptSO(2) equivariant graph transformer0D & 3D PBC + stressNeutralequiformer, equiformer-gradient
HyFF.safetensors + weights.jsonCartesian MP, H–Bi, 4.5 Å0D & 3D PBC + stressExplicit charge, unpaired / multiplicityhyff-presto, hyff-vivace, hyff-moderato (andante/largo unsupported)

See MLIP models for the full 13-model catalog and checkpoint sizes.

ParameterTypeDefaultDescription
modelstr | PathrequiredCatalog ID ("nequix-mp-1", etc.) or local checkpoint file/directory
runtimestr"nequix""nequix", "nequip", "equiformer", or "hyff"; inferred automatically for catalog IDs and .zip / .pt / .safetensors paths
devicestr | Adapter | NoneAuto / atomli.gpu default"cpu", "gpu" ("wgpu" alias), "gpu:<index>", "gpu:pci:<id>", "auto", or Adapter
adapterAdapter | int | str | NoneNonePhysical GPU selector when device="gpu"
downloadboolTrueAllow fetching uncached catalog checkpoints (False requires local cache hit)
chargefloat | NoneNoneInteger charge override (HyFF only; other runtimes raise if provided)
unpairedint | NoneNoneUnpaired electron count (HyFF only; 2S2S, multiplicity is unpaired + 1)
multiplicityint | NoneNoneSpin multiplicity (≥1\ge 1, HyFF only; conflicts if combined with a differing unpaired)
  • Element validation: Construction validates every atomic number in atoms against the loaded model’s species table and raises explicitly on out-of-coverage elements.
  • Automatic spatial domain decomposition: On large supercells (10k–100k+ atoms), MLIP partitions 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 fieldDescription
native_batch_callsCompleted native multi-geometry batch invocations
native_batch_geometriesTotal geometries evaluated inside native batches
serial_geometriesGeometries evaluated through the serial batch fallback path
batch_failuresFailed batch attempts prior to serial evaluation

Host output buffer requirement for ForceSession: 24 * configurations * n_atoms bytes (forces in eV/Å; input displacements in Å).

Weights are never bundled inside Python wheels. Resolution order:

  1. Explicit local path or verified cache directory (ATOMLI_MODELS_DIR, else $XDG_CACHE_HOME/atomli/models, else ~/Library/Caches/atomli/models on macOS or ~/.cache/atomli/models on Linux)
  2. https://tako.atom.li/calculation-wasm/
  3. 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.