Fast calculation of structural and dynamical parameters
fastatomstruct is a Python package (mostly written in Rust) that provides fast, parallelised analysis of atomistic simulation data.
Thread-based parallelisation via rayon is used throughout to fully exploit multicore processors.
Citation
If you use fastatomstruct in your research, please cite:
Documentation
What can this package do?
Structural analysis
- Atomic distances, coordination numbers, bond finding, nearest neighbours
- Lazy access to trajectories larger than memory (
fs.io.open): frames are decoded on demand and analyses process them a few at a time - Radial distribution function (RDF) and static structure factor
- Bond orientational order (Steinhardt q_l, Q_l) and bond order correlation
- Tetrahedral, octahedral, and trigonal order parameters
- Three-body correlation (TBC, ALTBC) — simple, angular-limited, and angular-resolved
- Bond angle distribution, dihedral angle distribution, bond length ratio, angular-resolved RDF
- Local environment characterisation (Cartesian and cylindrical coordinates)
- Ring size distribution (King's and Guttman's shortest-path algorithms)
- Peierls distortion analysis
- Voids, Steinhardt W_l, common neighbour analysis, Voronoi and polyhedral template matching, mobility clusters, non-affine D², percolation
Dynamical analysis
- Mean squared displacement, non-Gaussian parameter, overlap q
- Four-point correlation functions (χ₄)
- Current correlation functions, velocity autocorrelation
- Vibrational density of states, intermediate scattering functions
- Viscosity (Green–Kubo and NALD), participation ratio, phase quotient, mode-weighted quantities
Force calculators & molecular dynamics
- MACE machine-learning potentials with fastatomstruct's own engine (CPU and NVIDIA GPUs; no
mace-torchor PyTorch needed), including foundation models, committees and training - ACE/PACE potentials, CP2K DFT, built-in Lennard-Jones and EMT, and an adapter for any ASE calculator (VASP, GPAW, Quantum ESPRESSO, …)
- DFT-D2, DFT-D3 and DFT-D4 dispersion corrections
- Molecular dynamics: Velocity Verlet and Langevin integrators; Bussi, Berendsen, Andersen and Nosé-Hoover thermostats; isotropic and semi-isotropic Bussi barostats (NPT); temperature and pressure curves, constraints, checkpoint/resume, measurement hooks
- Structural and cell relaxation (BFGS, L-BFGS-B, FIRE, NAG)
- Active learning (MD, relaxation, random structure search, pool labelling) with MACE committees and a DFT queue
- Parallel computing: MPI worker for snapshot-parallel analyses and domain-decomposition MD for large systems
Phonons & electronic structure
- Finite-displacement phonons with automatic k-paths (band structures, DOS)
- Electronic band structures and DOS from CP2K, COHP/COOP bonding analysis
- Kubo–Greenwood optical spectra, electron–phonon coupling, NEGF transport
Physical units
fs.unitsholds units as objects: every dimensional parameter accepts a quantity such as2 * fs.units.fsor0.35 * fs.units.nm, checks its dimension and converts it exactly; results in units other than the internal ASE units come back tagged with their unit
Visualisation & tooling
- 3D structure/trajectory rendering (
view,view_image,view_interactive, GIF video) and publication plotting via the bundledplotmodule - Separate
fastatomstruct-uiapplication (own repository, one-line installer): 3D viewer / file browser, analysis charts, active-learning metrics panel and Avro run-log monitor in one command - MCP server for LLM agents (
fastatomstruct-mcp, separate package)
Example usage
import fastatomstruct as fs
# Lithium BCC supercell
atoms = fs.build.bulk(fs.Element.Li, "bcc", a=3.45, size=(10, 10, 10))
# All pairwise distances
dists = fs.analysis.distance.all_distances(atoms)
# Coordination numbers with a 3 Å cutoff
coordination = fs.analysis.neighbours.coordination_numbers(
atoms, fs.analysis.distance.CutoffMode.Fixed(3.0)
)
More examples are in the documentation.
Rust API
fastatomstruct can also be used directly in Rust projects.
Rust API documentation.
Installation
From PyPI
pip install fastatomstruct
Supported platforms: Windows (x86_64), Linux (x86_64, aarch64), macOS (x86_64, aarch64), Python ≥ 3.9. x86_64 builds require AVX2 support (available on most CPUs since ~2015).
Optional features:
pip install "fastatomstruct[ase]" # ASE: Atoms.to_ase(), ASE calculator workflows, active learning
pip install "fastatomstruct[plot]" # matplotlib: the fs.plot_* helpers and phonon plots
pip install "fastatomstruct[xla]" # MACE on the CPU through XLA (faster)
pip install "fastatomstruct[cuda13]" # MACE on NVIDIA GPUs (CUDA 13 runtime included)
pip install "fastatomstruct[mace-torch]" # mace-torch, for MACECalculator(backend="torch") and the default trainer
pip install "fastatomstruct[cp2k]" # the cp2k-rs package, for NEGF electron transport
pip install fastatomstruct-mcp # MCP server (Model Context Protocol), separate package
From source
Requirements: Python ≥ 3.9, Rust ≥ 1.98 (install), maturin.
The authoritative build path is the workspace Justfile — the same recipes CI
uses (bare maturin build picks the default feature set, which is not what
the release wheels contain):
pip install just maturin
just develop # release build into the current venv (maturin develop --release)
just wheel-linux-x86 # release wheel (manylinux) in target/wheels
Running tests
cargo test # Rust unit tests
pytest python/test # Python regression tests (requires pytest)
Telemetry
fastatomstruct sends anonymous performance telemetry (operation name, atom/frame count, CPU type,
thread/process count, elapsed time; never coordinates, elements or structure data). Opt out with
FASTATOMSTRUCT_NO_TELEMETRY=1 or fastatomstruct.disable_telemetry(); details in the
documentation.
Contributing
- Fork the repository on GitLab.
- Create a descriptive branch for your feature or bugfix.
- Commit with clear messages and open a merge request with a detailed description.
Reporting issues & support
Use the GitLab work items page to report bugs or ask for support.
Metadata
Release files for fastatomstruct 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| fastatomstruct-2.0.1-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details for fastatomstruct-2.0.1-cp39-abi3-win_amd64.whl |
| fastatomstruct-2.0.1-cp39-abi3-manylinux_2_27_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.27+ x86-64 | Details for fastatomstruct-2.0.1-cp39-abi3-manylinux_2_27_x86_64.whl |
| fastatomstruct-2.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details for fastatomstruct-2.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| fastatomstruct-2.0.1-cp39-abi3-macosx_13_0_x86_64.whl | CPython 3.9 | abi3 | macOS 13.0+ x86-64 | Details for fastatomstruct-2.0.1-cp39-abi3-macosx_13_0_x86_64.whl |
| fastatomstruct-2.0.1-cp39-abi3-macosx_13_0_arm64.whl | CPython 3.9 | abi3 | macOS 13.0+ ARM64 | Details for fastatomstruct-2.0.1-cp39-abi3-macosx_13_0_arm64.whl |
Total release size: 144.1 MB
Release files / fastatomstruct-2.0.1-cp39-abi3-win_amd64.whl
| Download URL | fastatomstruct-2.0.1-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 27.3 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7b4484b8ffc0ed0634e7dcf7f235373e7fbff29b3aed601c7fae678806f3aad1
|
|
BLAKE2b-256 checksum How to use checksums |
14c6f17e3713dc81d84ce2f7773f5497c7b743c213d77042c2f05974448f6fdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.13
|
Release files / fastatomstruct-2.0.1-cp39-abi3-manylinux_2_27_x86_64.whl
| Download URL | fastatomstruct-2.0.1-cp39-abi3-manylinux_2_27_x86_64.whl |
|---|---|
| Size | 43.9 MB |
| Tags | CPython 3.9 Linux glibc 2.27+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
abac5699849958b4f6e345e3313f61d38d2824396bcbbe6e6f7950ef7111bc0e
|
|
BLAKE2b-256 checksum How to use checksums |
e0dc02a076f519a7bd32222ee45481355ce356812da3da422c6a4658010c055c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.13
|
Release files / fastatomstruct-2.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | fastatomstruct-2.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 22.9 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
1d1e374394d685bc7a16c9c18a72baee66c8b0855091d199406062944a61df26
|
|
BLAKE2b-256 checksum How to use checksums |
ba7584fec2127573afa67c0ee7140d9368c5eebc780ee72f1fe191ab5b86360a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.13
|
Release files / fastatomstruct-2.0.1-cp39-abi3-macosx_13_0_x86_64.whl
| Download URL | fastatomstruct-2.0.1-cp39-abi3-macosx_13_0_x86_64.whl |
|---|---|
| Size | 26.3 MB |
| Tags | CPython 3.9 abi3 macOS 13.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
191536bcfc3c6d0de3c39f1189c608f50fa25a2838c3d364148b3f5df11b006d
|
|
BLAKE2b-256 checksum How to use checksums |
82030fb5326ecd524472fc8c5778164dcaddc7d4a821acc9c327a85a195ca2b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.13
|
Release files / fastatomstruct-2.0.1-cp39-abi3-macosx_13_0_arm64.whl
| Download URL | fastatomstruct-2.0.1-cp39-abi3-macosx_13_0_arm64.whl |
|---|---|
| Size | 23.6 MB |
| Tags | CPython 3.9 abi3 macOS 13.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
963fd18b7ed6dfd529f8a0e41db2245fbaeae662629e7333851d17eed5ca454b
|
|
BLAKE2b-256 checksum How to use checksums |
0e3dc57048d3a79e334157ce152361716ddace2b83e3e5ad2a9bf63fc17e706a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.13
|
Security for fastatomstruct 2.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.