Skip to content

combin · ConnectedComponents

4 accepted declarations. Python and Rust forms, contracts, evidence, failure boundaries, and checked usages are kept together below.

Worked example

The complete checked program Enumerate and certify rational points on a finite-field hyperbola uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Enumerate and certify rational points on a finite-field hyperbola."""

from noether.commalg import AffineSpace
from noether.numthy import FiniteField


def main() -> None:
    field = FiniteField.prime(5)
    plane = AffineSpace(field, 2, names=["x", "y"])
    x, y = plane.coordinate_ring.generators()
    hyperbola = plane.closed_subscheme(plane.coordinate_ring.ideal([x * y - 1]))
    count, certificate = hyperbola.point_count(shards=3)
    certificate.verify(hyperbola)
    assert count == 4
    assert len(list(hyperbola.rational_points())) == count
    print(f"xy=1 over F_5 has {count} rational points")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/18_finite_field_schemes.py.

combin.ConnectedComponents

The result of Graph.connected_components — per-vertex labels and the component count.

Detailed contract

The result of Graph.connected_components — per-vertex labels and the component count.

Labels 0..count are assigned in ascending order of each component's smallest-id vertex — a canonical, traversal-order- independent labelling.

class ConnectedComponents

noether::combin::ConnectedComponents · Direct Rust declaration

pub struct ConnectedComponents { pub label: Vec<usize>, pub count: usize, }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: validation/unit/combin/test_graph_facade.py:33 · validation/unit/combin/test_graph_facade.py:8

combin.ConnectedComponents.count

The number of components.

Detailed contract

The number of components. 0 for the empty graph.

(self) -> int

noether::combin::ConnectedComponents · Python projection

Python projection convenience over this Rust mathematical type
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: examples/18_finite_field_schemes.py:14 · examples/18_finite_field_schemes.py:16 · examples/18_finite_field_schemes.py:17 · examples/18_finite_field_schemes.py:18 · validation/unit/combin/test_graph_facade.py:34 · validation/unit/combinatorics/test_poset.py:142

combin.ConnectedComponents.label

Per-vertex component labels — list[int] of length graph.order.

Detailed contract

Per-vertex component labels — list[int] of length graph.order.

(self) -> list[int]

noether::combin::ConnectedComponents · Python projection

Python projection convenience over this Rust mathematical type
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: examples/21_graph_symmetry.py:3 · validation/unit/combin/test_graph_facade.py:84 · validation/unit/combin/test_graph_facade.py:87 · validation/unit/combin/test_graph_facade.py:88 · validation/unit/combin/test_graph_facade.py:89 · validation/unit/combin/test_graph_facade.py:90

combin.ConnectedComponents.members

The vertices of component c, in ascending id order, as list[int].

Detailed contract

The vertices of component c, in ascending id order, as list[int]. Returns the empty list if c >= count.

The vertices of component c, in ascending id order, or an empty Vec if c >= count.

(self, component: int) -> list[VertexId]

noether::combin::ConnectedComponents::members · Direct Rust declaration

pub fn members(&self, c: usize) -> Vec<u32>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded

Executable usage: validation/unit/combin/test_graph_facade.py:35 · validation/unit/combin/test_graph_facade.py:36 · validation/harness/parity.py:293 · validation/harness/parity.py:295