RingsStatisticsMatter
This package provides a tool for finding primitive rings efficiently for large models of amorphous materials.
Designed for large structural models, this can handle 100,000-atoms in under 10 minutes multithreaded on a 16GB M2 Mac laptop.
This package implements an algorithm based on the work described in:
100k-atom model of a-Si with the 9-membered primitive rings highlighted
8k-atom model of a-C with the 5-, 6-, and 7-membered primitive rings highlighted
Features
Python wrappers for easy plotting and incorporation into more complex analysis frameworks.
Returns node indices for each ring in your structure
Flexible multi-element support (ignore or allow homopolar bonds, per-atom radii or element-pair cutoffs). Neighbours from vesin.
Shared-memory parallelism in both backends (rayon in Rust, native threads in Julia).
Installation
pip install rings-statistics-matter
Wheels are built for Linux, macOS and Windows. Installing from source needs a Rust toolchain.
Backends
The same algorithm is implemented twice. Tests check that both return the same rings.
backend="rust" (default): src/kernel.rs. No runtime dependencies. Threads via num_threads.
backend="julia": rings_statistics_matter/rings.jl. Install with the julia extra; juliacall installs Julia on first use. Threads via JULIA_NUM_THREADS.
Usage
from ase.io import read
from rings_statistics_matter import ring_statistics
counts, rings = ring_statistics(read("structures/aSi_500atom_test.xyz"), cutoff=2.85)
counts[n - 1] is the number of n-membered rings, rings[n - 1] an (n_rings, n) array of atom indices.
cutoff is a global bond length, per-atom radii, or a dict of element-pair bond lengths (a pair set to 0 never bonds). The default is 1.3 x the ASE natural radii.
Command line:
python run_rings.py -c 2.85 structures/aSi_500atom_test.xyz
Multi-component systems, such as phase-change Ge-Sb-Te without Ge-Ge bonds:
python examples/run_rings_GeSbTe.py --homopolar n structures/GST_5k_amorphous.xyz
Tests
uv sync && uv run pytest
Disclaimer
If you see non-integer entries in the ring statistics, or the nodes don’t seem right, this is most likely from using small unit cells.
We try to automatically create supercells to fix this, but there may be edge cases where this isn’t enough. For large enough cells, this shouldn’t be an issue.
Extra Arguments
maxlvl: search depth. Rings of up to maxlvl - 1 nodes are found.
mxpths (Julia backend): buffer for shortest paths between a source and one node. Raise it if the kernel reports more paths than mxpths.
Supported Platforms
This package has been tested on macOS and Linux.
Releasing
Bump version in pyproject.toml and Cargo.toml, then push a v* tag. The Release workflow builds the wheels and publishes them to PyPI by trusted publishing.
Contributing
Contributions are welcome! Feel free to open issues or pull requests on the GitHub repository:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for rings-statistics-matter 0.2.0
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 |
|---|---|---|---|---|
| rings_statistics_matter-0.2.0.tar.gz | 111.1 kB | With provenance | Details for rings_statistics_matter-0.2.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| rings_statistics_matter-0.2.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for rings_statistics_matter-0.2.0-cp310-abi3-win_amd64.whl |
| rings_statistics_matter-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for rings_statistics_matter-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl |
| rings_statistics_matter-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for rings_statistics_matter-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl |
| rings_statistics_matter-0.2.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for rings_statistics_matter-0.2.0-cp310-abi3-macosx_11_0_arm64.whl |
| rings_statistics_matter-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for rings_statistics_matter-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 1.7 MB
Release files / rings_statistics_matter-0.2.0.tar.gz
| Download URL | rings_statistics_matter-0.2.0.tar.gz |
|---|---|
| Size | 111.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39b7528fbe0859bc407f761521ede7caad47cc183c4ed164ab72a56c0f6d2f12
|
|
BLAKE2b-256 checksum How to use checksums |
58521b931a0c5c0299c9ec92505ec3b3a34b4502d38c27873cab7ff9d5c1c04a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 12, 2026.
Transparency logRelease files / rings_statistics_matter-0.2.0-cp310-abi3-win_amd64.whl
| Download URL | rings_statistics_matter-0.2.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 225.4 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
596cc7bf2d9cfd3a1105aaf0f31d8aa6fe87cac4a61fc578b60eb6519156b8c5
|
|
BLAKE2b-256 checksum How to use checksums |
285dddd216f24e3514f1c43a237cffda0049b6cf686dfc1dc7f917c1b0b40c58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 12, 2026.
Transparency logRelease files / rings_statistics_matter-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | rings_statistics_matter-0.2.0-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 346.3 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6a72aa0c1570f9e9af762e70e1f1adabd078403a4636338c2de671ca99a38911
|
|
BLAKE2b-256 checksum How to use checksums |
c6894fd69b8575cb7ae4b409ad7300d21fd2a8cc5633b5e5ad45f6735dac4e92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 12, 2026.
Transparency logRelease files / rings_statistics_matter-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | rings_statistics_matter-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 340.5 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
e5730a21064592921ebfb70b78d153763363547d2bd330fcb0842de78ade52e1
|
|
BLAKE2b-256 checksum How to use checksums |
69e9e39a17e8d499f0a6fbb45e5291db330aba6e5e6fbe4db0d83aa2c751799f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 12, 2026.
Transparency logRelease files / rings_statistics_matter-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | rings_statistics_matter-0.2.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 309.5 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
031e58589e02502be959657d8fe6b5a573abb151b8119720a75555c5b3f02177
|
|
BLAKE2b-256 checksum How to use checksums |
a1e25377b19a40d890dfcdd5ddcf3bc612c07cc31cb8525de502758c8d245609
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 12, 2026.
Transparency logRelease files / rings_statistics_matter-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | rings_statistics_matter-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 322.8 kB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
74295a8e4d77c7cce925524be178f66ef990b4e28beb2573fde172e0c11c7383
|
|
BLAKE2b-256 checksum How to use checksums |
ee3ed582496a4e28ecb798d2041f4e52fa1b7cd64f2692b12d03fcb3f1840374
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 12, 2026.
Transparency logSecurity for rings-statistics-matter 0.2.0
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 6 files in this release have been uploaded with provenance metadata.
Attestation for rings_statistics_matter-0.2.0.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 12, 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.