minimage
Minimum-image convention for a periodic parallelepiped.
linkcell walks k-nearest neighbours. vesin builds cutoff pair lists.
Both need the same wrap: fold through H, pick one image, never the
self image. This crate is that wrap. Cell holds the 3x3 lattice and
a dump-cell origin. Constructors accept LAMMPS bounds plus xy, xz, yz tilts, a CON lattice or length-angle box, an ASE-style 3x3 cell,
and a vesin box.
It is a LODE library. The Rust crate is the implementation. The C ABI
(mi_*) is the hourglass waist, the same shape as
linkcell and
readcon-core. C++ is a
RAII header over that ABI.
Docs (orgmode first, HTML export): lode-org.github.io/minimage. Org catalog: lode-org.github.io.
Install
Rust:
cargo add minimage
C and C++ consumers take the staticlib (--features capi, on by
default) plus include/minimage.h or include/minimage.hpp. Meson,
CMake, and pkg-config all install that archive and those headers.
pip install minimage
Python 3.10 or newer. Each release has one abi3 wheel per platform, for Linux x86_64 and aarch64 (manylinux_2_28), macOS arm64 and Windows x86_64, which covers every CPython from 3.10 on. Elsewhere pip builds the sdist, which needs a Rust toolchain.
import minimage
cell = minimage.Cell.ortho(10.0, 10.0, 10.0)
assert abs(cell.dist2([0.2, 0.0, 0.0], [9.4, 0.0, 0.0]) - 0.64) < 1e-12
Meson
meson setup build
meson compile -C build
meson install -C build
As a wrap, Meson exposes minimage_dep:
[wrap-git]
url = https://github.com/lode-org/minimage.git
revision = v0.2.1
depth = 1
[provide]
minimage = minimage_dep
minimage_dep = dependency('minimage', fallback: ['minimage', 'minimage_dep'])
CMake
cmake -B build -DCMAKE_INSTALL_PREFIX=$PREFIX
cmake --build build
cmake --install build
find_package(minimage 0.2 REQUIRED)
target_link_libraries(app PRIVATE minimage::minimage)
pkg-config
pkg-config --cflags --libs minimage
Rust
use minimage::{dist2_many, reduce_pairs, Cell};
let sim = Cell::ortho(10.0, 10.0, 10.0)?;
let sheared = Cell::from_lammps_bounds(
15.0, 8.660254037844386, 10.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0,
)?;
let left = [0.2, 0.0, 0.0];
let right = [9.4, 0.0, 0.0];
assert!((sim.dist2(left, right) - 0.64).abs() < 1e-12);
let qs = [[9.4, 0.0, 0.0], [1.0, 0.0, 0.0]];
let mut out = [0.0; 2];
dist2_many(&sim, left, &qs, &mut out)?;
let pairs = [[0, 1], [0, 0], [0, 1]];
let mut kept = Vec::new();
reduce_pairs(&pairs, &mut kept)?;
assert_eq!(kept, vec![[0, 1]]);
Cell::from_ase, Cell::from_con, Cell::from_con_box, and
Cell::from_vesin take the same row-major 3x3 lattice. Displacement
is the wrapped vector from p to q.
Batch kernels select AVX-512, AVX2, AVX, NEON, or scalar at run time.
MINIMAGE_SIMD overrides that choice. simd_path() returns the name.
License
MIT. See LICENSE.
Metadata
Release files for minimage 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| minimage-0.2.1.tar.gz | 167.2 kB | With provenance | Details for minimage-0.2.1.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| minimage-0.2.1-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for minimage-0.2.1-cp310-abi3-win_amd64.whl |
| minimage-0.2.1-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for minimage-0.2.1-cp310-abi3-manylinux_2_28_x86_64.whl |
| minimage-0.2.1-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for minimage-0.2.1-cp310-abi3-manylinux_2_28_aarch64.whl |
| minimage-0.2.1-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for minimage-0.2.1-cp310-abi3-macosx_11_0_arm64.whl |
Total release size: 1.6 MB
Release files / minimage-0.2.1.tar.gz
| Download URL | minimage-0.2.1.tar.gz |
|---|---|
| Size | 167.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
794e7958e7fe8d5869cd94b0c7d4b768067890575153b0b66e8d76f829eba7da
|
|
BLAKE2b-256 checksum How to use checksums |
346ae61270796e9a1fd8b4a2f5cf423b0ca601c73c77a828d41de8bb0cc79801
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / minimage-0.2.1-cp310-abi3-win_amd64.whl
| Download URL | minimage-0.2.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 317.4 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
33ff653bf912fd073496f51db22d5befb171d776f2ba03c5ad31d4c93d6ebf03
|
|
BLAKE2b-256 checksum How to use checksums |
1e55ec6fa01075b08c7f6ee8b12abfd5bd81716fad8daed99712802608e0d761
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / minimage-0.2.1-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | minimage-0.2.1-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 407.0 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
87804c9a2f04051ddad2a5897861db805a718290eec8194bcc647cb522250271
|
|
BLAKE2b-256 checksum How to use checksums |
6009da9b4231c4ef77894238eb40d068f11c4a10f4b13a3a8f3a340c5535d577
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / minimage-0.2.1-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | minimage-0.2.1-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 360.0 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
54f1441ac9f9f2d7eae36aeeb5fa508035803c2186657f8e0aeb317d5fc23673
|
|
BLAKE2b-256 checksum How to use checksums |
8f2cc0f44ac9b3fa320099f97485253639d42294a5545567e2b753ed600ea02e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / minimage-0.2.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | minimage-0.2.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 337.3 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
60b11cd98e6856431e28d6f819bfbdfff6b8f29258776a82ed57e5170b1da9c3
|
|
BLAKE2b-256 checksum How to use checksums |
37b90cf9404ce4db3c070053d8566007c2d16030056e68e1f9d687e38d8c540f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for minimage 0.2.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.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for minimage-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA 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.