linalg · World¶
7 accepted declarations. Python and Rust forms, contracts, evidence, failure boundaries, and checked usages are kept together below.
Worked example¶
The complete checked program Compute all conjugacy classes of A5 and verify orbit-stabilizer uses this API directly.
# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Compute all conjugacy classes of A5 and verify orbit-stabilizer."""
from noether.groups import Permutation, PermutationGroup
def main() -> None:
group = PermutationGroup.from_generators(
5,
[Permutation.from_images([1, 2, 0, 3, 4]), Permutation.from_images([1, 2, 3, 4, 0])],
)
classes = group.conjugacy_classes()
for conjugacy_class in classes:
conjugacy_class.verify()
assert conjugacy_class.centralizer().order * conjugacy_class.size == group.order
assert sorted(conjugacy_class.size for conjugacy_class in classes) == [1, 12, 12, 15, 20]
print(f"A5 conjugacy-class sizes: {[value.size for value in classes]}")
if __name__ == "__main__":
main()
Run it with .venv/bin/python examples/20_conjugacy_classes.py.
linalg.World¶
Explicit owner of one initialized MPI world.
noether::linalg::World · Python projection
| Contract | Value |
|---|---|
| Guarantee | checked deterministic result |
| Determinism | deterministic |
| Availability | MPI-enabled build (distributed feature) |
| Domain implementation crates | noether, flint-core, m4rst, m4rst-distributed, m4rste, mzs, pwvla, spar-core, sparla, sparb, lattice-enum |
| GIL | attached / bounded |
Executable usage: examples/distributed/f2_linear_algebra.py:11 · examples/distributed/f2_linear_algebra.py:6
linalg.World.initialize¶
Initialize MPI exactly once for this process.
noether::linalg::World · Python projection
| Contract | Value |
|---|---|
| Guarantee | checked deterministic result |
| Determinism | deterministic |
| Availability | MPI-enabled build (distributed feature) |
| Dispatch / backing | m4rst-distributed, m4rst |
| GIL | released |
Executable usage: examples/distributed/f2_linear_algebra.py:11
Example
from noether import capabilities
installed = capabilities()
if "distributed" in installed.compiled_features:
from noether.linalg import DistributedMatrix, World
from noether.numthy import FiniteField
world = World.initialize()
matrix = DistributedMatrix.identity(world, FiniteField.prime(2), 3)
assert matrix.rank() == 3
else:
assert installed.mpi_runtime is None
linalg.World.is_root¶
Whether this process is rank zero.
noether::linalg::World · Python projection
| Contract | Value |
|---|---|
| Guarantee | checked deterministic result |
| Determinism | deterministic |
| Availability | MPI-enabled build (distributed feature) |
| Domain implementation crates | noether, flint-core, m4rst, m4rst-distributed, m4rste, mzs, pwvla, spar-core, sparla, sparb, lattice-enum |
| GIL | attached / bounded |
Executable usage: examples/distributed/f2_linear_algebra.py:20 · examples/distributed/f2_linear_algebra.py:41 · examples/distributed/f2_linear_algebra.py:58
linalg.World.library_version¶
MPI implementation/version string.
noether::linalg::World · Python projection
| Contract | Value |
|---|---|
| Guarantee | checked deterministic result |
| Determinism | deterministic |
| Availability | MPI-enabled build (distributed feature) |
| Domain implementation crates | noether, flint-core, m4rst, m4rst-distributed, m4rste, mzs, pwvla, spar-core, sparla, sparb, lattice-enum |
| GIL | attached / bounded |
Executable usage: examples/distributed/f2_linear_algebra.py:60
linalg.World.mpi_rank¶
This process's MPI rank.
noether::linalg::World · Python projection
| Contract | Value |
|---|---|
| Guarantee | checked deterministic result |
| Determinism | deterministic |
| Availability | MPI-enabled build (distributed feature) |
| Domain implementation crates | noether, flint-core, m4rst, m4rst-distributed, m4rste, mzs, pwvla, spar-core, sparla, sparb, lattice-enum |
| GIL | attached / bounded |
Executable usage: examples/distributed/f2_linear_algebra.py:15 · validation/unit/infra/test_mpi_scale_report.py:109 · validation/unit/infra/test_mpi_scale_report.py:126 · validation/unit/infra/test_mpi_scale_report.py:443
linalg.World.size¶
Number of processes in the MPI world.
noether::linalg::World · Python projection
| Contract | Value |
|---|---|
| Guarantee | checked deterministic result |
| Determinism | deterministic |
| Availability | MPI-enabled build (distributed feature) |
| Domain implementation crates | noether, flint-core, m4rst, m4rst-distributed, m4rste, mzs, pwvla, spar-core, sparla, sparb, lattice-enum |
| GIL | attached / bounded |
Executable usage: examples/20_conjugacy_classes.py:16 · examples/20_conjugacy_classes.py:17 · examples/20_conjugacy_classes.py:18 · examples/distributed/f2_linear_algebra.py:14 · examples/distributed/f2_linear_algebra.py:60 · validation/unit/combinatorics/test_partition_composition.py:15
linalg.World.thread_support¶
Thread support supplied by MPI.
noether::linalg::World · Python projection
| Contract | Value |
|---|---|
| Guarantee | checked deterministic result |
| Determinism | deterministic |
| Availability | MPI-enabled build (distributed feature) |
| Domain implementation crates | noether, flint-core, m4rst, m4rst-distributed, m4rste, mzs, pwvla, spar-core, sparla, sparb, lattice-enum |
| GIL | attached / bounded |