Skip to content

combin · CanonicalLabel

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

Worked example

The complete checked program Canonically label a cycle and compute its automorphism group uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Canonically label a cycle and compute its automorphism group."""

from noether.combin import Graph


def main() -> None:
    cycle = Graph.from_unweighted(
        5,
        [(0, 1), (1, 2), (2, 3), (3, 4), (4, 0)],
        directed=False,
    )
    canonical = cycle.canonical_label()
    assert canonical.verify(cycle)
    assert canonical.automorphism_group.order == 10
    assert cycle.laplacian()[0] == [2, -1, 0, 0, -1]
    print(f"Aut(C5) has order {canonical.automorphism_group.order}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/21_graph_symmetry.py.

combin.CanonicalLabel

An exact graph canonical labeling and its checked symmetry data.

class CanonicalLabel

noether::combin::CanonicalLabel · Direct Rust declaration

pub struct CanonicalLabel { /* private fields */ }
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:7 · validation/unit/combin/test_graph_facade.py:87

combin.CanonicalLabel.automorphism_group

The exact automorphism group on the original graph's vertex ids.

Detailed contract

The exact automorphism group acting on the original vertex ids.

(self) -> PermutationGroup

noether::combin::CanonicalLabel::automorphism_group · Direct Rust declaration

pub fn automorphism_group(&self) -> &PermutationGroup
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:16 · examples/21_graph_symmetry.py:18 · examples/29_integral_line_configurations.py:10 · validation/unit/category/test_category.py:55 · validation/unit/combin/test_acceptance_workload.py:31 · validation/unit/combin/test_graph_facade.py:91

combin.CanonicalLabel.graph

The canonically relabeled graph.

(self) -> Graph

noether::combin::CanonicalLabel::graph · Direct Rust declaration

pub fn graph(&self) -> &Graph
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:19 · validation/unit/combin/test_graph_facade.py:21 · validation/unit/combin/test_graph_facade.py:22 · validation/unit/combin/test_graph_facade.py:23 · validation/unit/combin/test_graph_facade.py:24 · validation/unit/combin/test_graph_facade.py:25

combin.CanonicalLabel.labeling

The permutation mapping original vertex ids to canonical vertex ids.

(self) -> Permutation

noether::combin::CanonicalLabel::labeling · Direct Rust declaration

pub fn labeling(&self) -> &Permutation
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_acceptance_workload.py:100 · validation/unit/combin/test_acceptance_workload.py:101 · validation/unit/combin/test_acceptance_workload.py:98 · validation/unit/combin/test_acceptance_workload.py:99 · validation/unit/combin/test_graph_facade.py:58 · validation/unit/combin/test_graph_facade.py:60

combin.CanonicalLabel.verify

Verify that the labeling reconstructs the stored canonical graph.

(self, original: Graph) -> bool

noether::combin::CanonicalLabel::verify · Direct Rust declaration

pub fn verify(&self, original: &Graph) -> bool
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/01_bezout_certificates.py:10 · examples/01_bezout_certificates.py:3 · examples/03_exact_linear_systems.py:13 · examples/03_exact_linear_systems.py:3 · examples/04_smith_normal_form.py:12 · examples/06_shortest_lattice_vectors.py:12