Installation
Atomli requires CPython 3.10 or later. Install the package and its calculator engines:
python -m pip install "atomli[all]"Verify a calculation
Section titled “Verify a calculation”Run a water single point on the CPU to check both the package and tight-binding engine:
from atomli.build import moleculefrom atomli.calculators import XTB
water = molecule("H2O")water.calc = XTB(method="gxtb", device="cpu")print("Energy (eV):", water.get_potential_energy())Continue to the quick start for optimization, periodic slabs, vibrations, and constrained adsorption with visualizations.
Install only what you need
Section titled “Install only what you need”atomli[all] is the easiest starting point. For a smaller installation, choose an
extra based on the calculator you will use:
| Install | Calculator engines |
|---|---|
python -m pip install "atomli[all]" | All engines below |
python -m pip install "atomli[dft]" | QC: DFT and molecular electronic-structure calculations |
python -m pip install "atomli[tb]" | XTB: g-xTB and GFN2-xTB |
python -m pip install "atomli[mlip]" | MLIP: machine-learned interatomic potentials |
python -m pip install atomli | Core runtime, DFTD3, DFTD4, and LennardJones |
The quick start uses the tight-binding and DFT engines. See Calculators for method and boundary-condition support.
Optional setup
Section titled “Optional setup”GPU acceleration
Section titled “GPU acceleration”The examples start on the CPU. To inspect WebGPU adapters (Metal, Vulkan, or DX12) and select a process-wide device:
import atomli
print(atomli.gpu.adapters())atomli.gpu.set_default_device("gpu") # or "cpu"An explicit calculator setting such as device="cpu" selects that device for
the calculation.
ASE interoperability
Section titled “ASE interoperability”Install ASE if you want to use its calculators or work with ase.Atoms:
python -m pip install aseSee ASE compatibility for examples.
MLIP model weights
Section titled “MLIP model weights”MLIP downloads weights on first use and caches them separately from the Python package. See the model catalog for cache locations and offline setup.