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
From a Release (recommended)
# 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/*.pyatomli/_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.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| atomli-0.1.5-cp310-abi3-win_arm64.whl | CPython 3.10 | abi3 | Windows ARM64 | Details |
| atomli-0.1.5-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| atomli-0.1.5-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.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| atomli-0.1.5-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 149.6 MB
Release files / atomli-0.1.5-cp310-abi3-win_arm64.whl
| Download URL | atomli-0.1.5-cp310-abi3-win_arm64.whl |
|---|---|
| Size | 29.1 MB |
| Tags | CPython 3.10 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
e01fb75302e755881bc65d78415eaf020e5b5e6fb9441cdacf608db6d44d17bd
|
|
BLAKE2b-256 checksum How to use checksums |
94643ecfafe2604546c807d75fd2845ac3c5b675c86ccbb7cd74846e01c4cd5c
|
| 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.5-cp310-abi3-win_amd64.whl
| Download URL | atomli-0.1.5-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 31.1 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5b5f28cd11ba29cd5ffe0f34493a036b07f8ca4e6f23162b29507c23b0e026f3
|
|
BLAKE2b-256 checksum How to use checksums |
82f0840404035c2b097f407a921b0ca00c0b3611ea302f2065534cb85dabad8b
|
| 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.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | atomli-0.1.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 31.3 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
13f8672d590daad6781093f2756478cc6b8c0fcaa732c301c64541d2d0bf9056
|
|
BLAKE2b-256 checksum How to use checksums |
7fd92903a6fccdc73fb9699e9321d51615f54565b426c79b4baa0c83d0fdc892
|
| 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.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | atomli-0.1.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 29.5 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
1fca4bd8e502bf1f335e2ef6ed1fc6d396d8652e7ea9016ccf42c1dc5dc097f4
|
|
BLAKE2b-256 checksum How to use checksums |
0fb9261e1c8275eff7509f2b8c9531b2b53a02e213f3901cf0a78e2ad862f9a4
|
| 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.5-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | atomli-0.1.5-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 |
6081a546bf92fc6f49f22bf9878914a50935d57a5b2700517c4c6778fc2591f4
|
|
BLAKE2b-256 checksum How to use checksums |
ff8c444249b49046ca3a137064a34228fe8c54464d008c00f823f6c66692e3c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|