Skip to main content

atomli

ASE-shaped Python API for atomistic simulation.

import atomli as ase
from atomli import Atoms
from atomli.optimize import BFGS, FIRE2
from atomli.md.verlet import VelocityVerlet
from atomli.calculators.lj import LennardJones
from atomli.build import molecule
from atomli.io import read, write

Calculators

Class Backend
LennardJones classical LJ
DFTD3 DFT-D3 dispersion
XTB tight-binding (GFN2-xTB, g-xTB)
MLIP nequix / NequIP — catalog id or .nqx path
QC molecular and 3D-periodic DFT (PBE, r2SCAN, …), including stress

QC electronic state and native GPU packages

QC exposes retained spin/k-point orbitals, occupations, overlap/density matrices, ASE spectral getters, DOS/PDOS, molecular/PBC HDF5 export and molecular Molden/WFN. kernel(dm0=...), transactional set(scf=...) and independent with_settings(...) provide finer control alongside ordinary ASE energy/force calls. See the QC API and native-delivery guide for shapes, units, IO limits and hardware-specific zero-JIT GPU packages.

Global device selection

Atomli has one optional process-global compute-device override. With no override, MLIP uses a real GPU when Atomli's production WGPU backend discovers one, and QC uses GPU only when a stricter QC readiness probe can open that adapter with the packaged GPU runtime. Both fall back to native CPU without error. g-xTB remains CPU-first and prints one informational hint per process when usable hardware is visible: "Try out running on GPU! It could be faster!" "gpu" explicitly chooses a hardware GPU; explicit adapters can pin a particular hardware card:

import atomli
from atomli.calculators import MLIP, QC, XTB

atomli.gpu.set_default_device("gpu")

xtb = XTB(method="gxtb")
mlip = MLIP("nequix-mp-1")
qc = QC(xc="PBE")

A physical GPU can be selected once for the whole process. Adapter discovery is also global, and PCI identity is preferred when available:

from atomli import gpu

for adapter in gpu.adapters():
    print(adapter.index, adapter.name, adapter.kind, adapter.backend, adapter.pci_bus_id)

# Pin a particular hardware card.
gpu.set_default_device(gpu.adapters()[0])
# Equivalent hardware selector forms include "gpu:0" and "gpu:pci:0000:61:00.0".

gpu.adapters() returns hardware adapters only. CPU-backed Vulkan implementations such as llvmpipe are deliberately filtered out and are not a supported release backend. "gpu" is the canonical public spelling and "wgpu" remains an accepted alias. An explicit calculator device= overrides the process default, so a single calculation can still be forced to CPU. GFN2-xTB stays on CPU because that method has no GPU execution route. atomli.gpu.set_default_device(None) clears the process override and restores automatic per-calculator selection. An explicit global or calculator device="cpu" always disables auto-GPU. Set ATOMLI_GPU_HINT=0 to suppress the one-time g-xTB hint in batch jobs or other quiet environments.

On macOS, discovery uses the system Metal backend, so Apple Silicon needs no Vulkan installation. On Linux, discovery uses Vulkan: a working loader plus the GPU vendor's Vulkan driver/ICD must be present for hardware to be selected. If that stack is missing or only a CPU software adapter such as llvmpipe is visible, Atomli simply keeps the calculation on CPU. Windows currently uses Atomli's Vulkan backend as well; a future DX12 product path can remove that optional Vulkan dependency for MLIP without changing this fallback policy.

MLIP models (runtime download + cache)

Weights are not on PyPI and not inside the wheel. pip install atomli only installs the library; the first MLIP("nequix-mp-1") downloads the file into a local cache and reuses it later.

Order Source
0 Local cache (see the cache table below)
1 default tako.atom.li/calculation-wasm/
2 backup GitHub Release mlip-models

Cache directory, first match wins:

Setting Directory
ATOMLI_MODELS_DIR set that path, verbatim
else XDG_CACHE_HOME set $XDG_CACHE_HOME/atomli/models
else macOS ~/Library/Caches/atomli/models
else Linux and other platforms ~/.cache/atomli/models

default_models_dir() returns the resolved path.

Catalog (runtime download + cache):

Id Runtime
nequix-mp-1, nequix-mp-1-pft, nequix-mp-1-pft-nocotrain nequix
nequix-oam-1, nequix-oam-1-pft, nequix-omat-1 nequix
nequip-s, nequip-l nequip
equiformer, equiformer-gradient equiformer
from atomli.calculators import MLIP
from atomli.models import list_models, ensure_model, default_models_dir

print(list_models())                 # all ids
print(list_models(runtime="nequip")) # filter
print(default_models_dir())          # cache dir
atoms.calc = MLIP("nequix-mp-1")
atoms.calc = MLIP("nequip-s")
atoms.calc = MLIP("equiformer")
# optional prefetch into the same cache MLIP() uses
./scripts/download-mlip-models.sh
# maintainers: publish weights to the GitHub Release (not to PyPI)
./scripts/upload-mlip-models.sh

Native atomli calculators attach directly to ASE Atoms; ASE calculators are adapted automatically when assigned to atomli Atoms:

# atomli calculators on ASE-built structures and ASE drivers
from ase.build import molecule
from ase.optimize import BFGS
from atomli.calculators import XTB

atoms = molecule("H2O")
atoms.calc = XTB(method="gfn2")
print(atoms.get_potential_energy())
print(atoms.get_forces())
BFGS(atoms).run(fmax=0.05)

# ASE calculators on atomli Atoms (auto-wrapped)
from atomli import Atoms as AtomliAtoms
from ase.calculators.lj import LennardJones

a = AtomliAtoms("Ar2", positions=[[0, 0, 0], [3.8, 0, 0]])
a.calc = LennardJones(epsilon=0.0103, sigma=3.4)
print(a.get_potential_energy())

Periodic QC is enabled explicitly through settings. By default, Rust derives the FFT mesh from a 100 Ha cutoff and each Monkhorst-Pack dimension from kpt_i * cell_length_i >= 15 with lengths in Å:

from ase.build import bulk
from atomli.calculators import QC

atoms = bulk("C", "diamond", a=3.57)
atoms.calc = QC(settings={"periodic": True})
print(atoms.get_stress())  # ASE Voigt order, eV / ų

Explicit mesh=[nx, ny, nz] and kpoints=[kx, ky, kz] entries in the same mapping override the derived grids. Stress is defined only for three-dimensionally periodic QC; requesting it from molecular QC raises the normal ASE property error.

Rust calculators implement ASE's normal retained-calculator workflow, including ase.optimize, ASE molecular dynamics, ASE constraints, mixed periodic-axis masks, and repeated property calls. Electronic state is read from explicit charge / unpaired calculator options, then atoms.info, then ASE initial charge and magnetic-moment arrays.

Install (binary wheels)

Large artifacts (wheels / native _core) are published as GitHub Release assets only.

  • Not stored in git
  • Not Git LFS
  • Not built or uploaded by GitHub Actions
# list releases
gh release list --repo atomag/atomli-assets

# download + install the wheel that matches this machine
./scripts/download-wheel.sh --install
# or pin a tag:
./scripts/download-wheel.sh v0.1.2 --install

Direct pip from a release asset URL:

pip install "https://github.com/atomag/atomli-assets/releases/download/v0.1.2/atomli-0.1.2-….whl"

From PyPI (when published)

pip install atomli

Same rule: PyPI gets wheels only (py + compiled extension). No sdist that needs the private Rust tree.

What this repository is

Public package surface:

In git On GitHub Releases
pure Python packaging (atomli/*.py) platform wheels (.whl)
tests, docs, packaging metadata compiled atomli._core inside those wheels

No Rust simulation backend here. Backend sources stay private in the monorepo.

Path Role
this repo (atomli) Python package + release wheels
atom.li Frontend landing page only — not this package

Docs: https://atom.li/docs/ · Releases: https://github.com/atomag/atomli-assets

Documentation

The static Astro documentation site lives in docs-site/. It follows ASE's Python-oriented topic structure and can refresh its API reference from an installed upstream extension.

cd docs-site
bun install
bun run dev --host 0.0.0.0

See docs-site/README.md for the static build and API generation commands.

Layout

atomli/                 # importable package (py in git; binary only in wheels)
tests/
scripts/download-wheel.sh
pyproject.toml          # setuptools metadata; no maturin/Rust

Maintainers: cut a release

Build on a machine that has the private monorepo, then attach wheels to a GitHub Release with the gh CLI (not Actions, not LFS):

code/
  ase.rs/     # private: crates/atomli-py + engine
  atomli/     # this repo
# from ase.rs — builds wheel(s) and uploads them as release assets
./scripts/release-atomli.sh v0.1.0

# rebuild / add more platform wheels later
./scripts/release-atomli.sh v0.1.0   # --clobber re-uploads

Wheels contain only:

  • atomli/*.py
  • atomli/_core*.so (or platform equivalent)
  • atomli/compatibility/ase-3.29.toml

No .rs, no Cargo.toml, no backend tree.

Optional PyPI mirror of the same wheels:

twine upload dist/atomli-*.whl   # wheels only, never sdist

Development install (sibling monorepo)

cd ../ase.rs
./scripts/develop-atomli.sh
pytest ../atomli/tests -q

Version

atomli.__version__ comes from the extension when present.

Metadata

Release files for atomli 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for atomli 0.1.6
File
atomli-0.1.6-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details
atomli-0.1.6-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
atomli-0.1.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
atomli-0.1.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
atomli-0.1.6-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 150.0 MB

Release files / atomli-0.1.6-cp310-abi3-win_arm64.whl

Download URL atomli-0.1.6-cp310-abi3-win_arm64.whl
Size 29.2 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
b7c78649a4461845e6208da0321e059421d6ffc3a40defe9d05bbed2f22eab8e
BLAKE2b-256 checksum
How to use checksums
e8a1e138ccadc0d5b78acf93699810e227b4f843c4cd84bfe4d9f6fed5f2adf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / atomli-0.1.6-cp310-abi3-win_amd64.whl

Download URL atomli-0.1.6-cp310-abi3-win_amd64.whl
Size 31.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f4f63ffd725fe1622833fbf6ca5672e9bdb11bf51dab5ee99cfebf00e83e0792
BLAKE2b-256 checksum
How to use checksums
5866a098ccb3c9585824c3f1b6b1840b7dd57fda8ee03c9456d7a3bf29169b53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / atomli-0.1.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL atomli-0.1.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 31.4 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a62debd73c2a463034123cde09a4155e5cd2fe9515e8a819e0a954c7ba22b138
BLAKE2b-256 checksum
How to use checksums
928b65c9533bb04f09128e60797f8d91d951f8d82236107e2cceea914dc12f1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / atomli-0.1.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL atomli-0.1.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 29.6 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2c5f82eb3cd55c9b6c32b4442c560e84a2ac2d7527f135ff9bcf520c03cad82d
BLAKE2b-256 checksum
How to use checksums
93b9bba26d6c8f8742375ff14e67c8ec81f9b44d21b5574b8a0de4dd7c4395ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / atomli-0.1.6-cp310-abi3-macosx_11_0_arm64.whl

Download URL atomli-0.1.6-cp310-abi3-macosx_11_0_arm64.whl
Size 28.6 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ab8f7667ab3a35bd282e6840c8eaeb86d3e60caac8dea4eac578db024deb6004
BLAKE2b-256 checksum
How to use checksums
54f9b6567beec9a99e89473b3cd908b638b0dc0cf3c5588682fcfbff0fecac18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.1.6 This release

5 release files

0.1.5

5 release files

0.1.4

5 release files

0.1.3

3 release files

0.1.2

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page