Skip to main content

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:

Yuan, X. & Cormack, A. N.
Computational Materials Science, vol. 24, pp. 343-360, 2002.

9-membered primitive rings in a 100k-atom model of a-Si Ring statistics of a 1M-atom model

100k-atom model of a-Si with the 9-membered primitive rings highlighted

5-, 6- and 7-membered primitive rings in an 8k-atom model of a-C

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.

Graphs without coordinates, such as the net of a framework, go in as edges. For a periodic graph images holds the lattice offset of each edge’s second node:

from rings_statistics_matter import ring_statistics_graph

# primitive cubic net: one node bonded to its images along each axis
counts, rings = ring_statistics_graph(
    edges=[[0, 0], [0, 0], [0, 0]], images=[[1, 0, 0], [0, 1, 0], [0, 0, 1]]
)

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:

https://github.com/MorrowChem/RingsStatisticsMatter

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for rings-statistics-matter 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rings-statistics-matter 0.3.0
File Size Uploaded Provenance Actions
rings_statistics_matter-0.3.0.tar.gz 113.3 kB With provenance Details for rings_statistics_matter-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rings-statistics-matter 0.3.0
File Actions
rings_statistics_matter-0.3.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for rings_statistics_matter-0.3.0-cp310-abi3-win_amd64.whl
rings_statistics_matter-0.3.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.3.0-cp310-abi3-manylinux_2_28_x86_64.whl
rings_statistics_matter-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for rings_statistics_matter-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl
rings_statistics_matter-0.3.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for rings_statistics_matter-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
rings_statistics_matter-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for rings_statistics_matter-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 1.7 MB

Release files / rings_statistics_matter-0.3.0.tar.gz

Download URL rings_statistics_matter-0.3.0.tar.gz
Size 113.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9cea13c145b1386b51e26e18916446b2b2e9c43f4f07405ad328bf3222dd7eab
BLAKE2b-256 checksum
How to use checksums
6bb94c56634a216ba9d817805322df5405c29564e957ffdc37ecb1042db93e6b
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 log

Release files / rings_statistics_matter-0.3.0-cp310-abi3-win_amd64.whl

Download URL rings_statistics_matter-0.3.0-cp310-abi3-win_amd64.whl
Size 227.2 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3794da537f1a76dac8e2efda96e2c4d53b95d70df82a34b6bf27b9162bc18004
BLAKE2b-256 checksum
How to use checksums
28d8fd41ae5f1a1fa6759082a0254e1489433b7583bb45c67edf4346bfaf9058
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 log

Release files / rings_statistics_matter-0.3.0-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL rings_statistics_matter-0.3.0-cp310-abi3-manylinux_2_28_x86_64.whl
Size 347.9 kB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
53cea69380604f50efaf04cdb068719eebe02dbcdff6b5b5f3c76d3376c17331
BLAKE2b-256 checksum
How to use checksums
f6c043dd8b7deada5883e3783f872e07624a2391682b55cf56cb1195cc98508f
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 log

Release files / rings_statistics_matter-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL rings_statistics_matter-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl
Size 342.1 kB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
51388a7de22918114376af869ad44e4b09c3eb84aad110328d63efce1849cdab
BLAKE2b-256 checksum
How to use checksums
b6d58939ff6582cb3cf6aff37888de943edac9f0110f7928fabad59196c81a44
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 log

Release files / rings_statistics_matter-0.3.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL rings_statistics_matter-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Size 311.3 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
66b8c3639f4e843da180d3b2a9fa5ffd1921f8df7686495d301aa730a3da3729
BLAKE2b-256 checksum
How to use checksums
ff1fd3592a4e469aad3fb5ec7ef7fd4a261643e84b95a0df50260d5023f64675
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 log

Release files / rings_statistics_matter-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL rings_statistics_matter-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 324.3 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ed842ddfdbb38013569a1d02a28d5cf8b3fcf45c2b6cccc84d7c45746c66254d
BLAKE2b-256 checksum
How to use checksums
248e0e1aed7c7e1137e90f0c674d5805f91f08507eebe8410884de73baa35c7a
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 log

Security for rings-statistics-matter 0.3.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.

Select from 6 files

Attestation for rings_statistics_matter-0.3.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 log

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.

Release history Release notifications | RSS feed

This release

0.3.0 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page