Skip to content

groups · WeightLatticeMap

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

Worked example

The complete checked program Apply and multiply canonical sparse exact operators uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Apply and multiply canonical sparse exact operators."""

from noether import Z
from noether.linalg import SparseMatrix, Vector


def main() -> None:
    operator = SparseMatrix.from_triplets(
        Z,
        (3, 3),
        [(0, 0, 2), (0, 2, -1), (1, 1, 3), (2, 0, 4)],
    )
    vector = Vector.from_values(Z, [5, 7, 11])
    image = operator.apply(vector)
    assert image.to_values() == [-1, 21, 20]
    assert (operator @ operator).nnz == 4
    print(f"A v = {image.to_values()}; nnz(A^2) = {(operator @ operator).nnz}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/05_sparse_exact_operators.py.

groups.WeightLatticeMap

A homomorphism between two explicit weight lattices.

class WeightLatticeMap

noether::groups::WeightLatticeMap · Direct Rust declaration

pub struct WeightLatticeMap { /* private fields */ }
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, perm-core
GIL attached / bounded
Semantic ID noether/groups/WeightLatticeMap@1

Executable usage: validation/unit/groups/test_weight_characters.py:10 · validation/unit/groups/test_weight_characters.py:38 · validation/unit/groups/test_weight_characters.py:41

groups.WeightLatticeMap.__eq__

Test mathematical equality with another value.

(self, other: object) -> bool

noether::groups::WeightLatticeMap · 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, perm-core
GIL attached / bounded
Semantic ID noether/groups/WeightLatticeMap@1

groups.WeightLatticeMap.apply

Apply this WeightLatticeMap to the supplied value.

Detailed contract

Apply the map to one source-coordinate weight.

(self, weight: Weight) -> tuple[int, ...]

noether::groups::WeightLatticeMap::apply · Direct Rust declaration

pub fn apply( &self, weight: &[Integer], ) -> Result<Vec<Integer>, RepresentationError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, perm-core
GIL attached / bounded
Semantic ID noether/groups/WeightLatticeMap@1

Executable usage: examples/05_sparse_exact_operators.py:16 · validation/unit/commalg/test_local_algebra.py:94 · validation/unit/commalg/test_local_algebra.py:97 · validation/unit/commalg/test_polynomial_facade.py:199 · validation/unit/commalg/test_quotient_facade.py:186 · validation/unit/groups/test_weight_characters.py:39

groups.WeightLatticeMap.basis_images

Return the basis images recorded by this WeightLatticeMap.

Detailed contract

Images of source basis vectors in target coordinates.

(self) -> tuple[tuple[int, ...], ...]

noether::groups::WeightLatticeMap::basis_images · Direct Rust declaration

pub fn basis_images(&self) -> &[Vec<Integer>]
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, perm-core
GIL attached / bounded
Semantic ID noether/groups/WeightLatticeMap@1

groups.WeightLatticeMap.from_json

Deserialize and revalidate a WeightLatticeMap from typed JSON.

Detailed contract

Deserialize and revalidate source, target, and integral matrix.

(value: str) -> WeightLatticeMap

noether::groups::WeightLatticeMap::from_json · Direct Rust declaration

pub fn from_json(value: &str) -> Result<Self, NoetherError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, perm-core
GIL attached / bounded
Semantic ID noether/groups/WeightLatticeMap@1

Executable usage: validation/unit/category/test_category.py:14 · validation/unit/combin/test_acceptance_workload.py:65 · validation/unit/combin/test_acceptance_workload.py:86 · validation/unit/combin/test_graph_facade.py:106 · validation/unit/combin/test_graph_facade.py:25 · validation/unit/combinatorics/test_kashiwara_crystal.py:32

groups.WeightLatticeMap.source

Return the source recorded by this WeightLatticeMap.

Detailed contract

Source lattice.

(self) -> WeightLattice

noether::groups::WeightLatticeMap::source · Direct Rust declaration

pub const fn source(&self) -> &WeightLattice
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, perm-core
GIL attached / bounded
Semantic ID noether/groups/WeightLatticeMap@1

Executable usage: examples/09_finite_field_isomorphisms.py:11 · examples/09_finite_field_isomorphisms.py:13 · examples/09_finite_field_isomorphisms.py:9 · examples/30_modules_and_resolutions.py:34 · examples/30_modules_and_resolutions.py:37 · validation/unit/category/test_acceptance_workload.py:25

groups.WeightLatticeMap.target

Return the target recorded by this WeightLatticeMap.

Detailed contract

Target lattice.

(self) -> WeightLattice

noether::groups::WeightLatticeMap::target · Direct Rust declaration

pub const fn target(&self) -> &WeightLattice
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, perm-core
GIL attached / bounded
Semantic ID noether/groups/WeightLatticeMap@1

Executable usage: examples/09_finite_field_isomorphisms.py:10 · examples/09_finite_field_isomorphisms.py:11 · examples/30_modules_and_resolutions.py:33 · examples/30_modules_and_resolutions.py:38 · examples/31_local_fields_and_precision.py:27 · examples/36_affine_normalization.py:16

groups.WeightLatticeMap.then

Compute then for this WeightLatticeMap.

Detailed contract

Compose this map with next, returning next o self.

(self, next: WeightLatticeMap) -> WeightLatticeMap

noether::groups::WeightLatticeMap::then · Direct Rust declaration

pub fn then(&self, next: &Self) -> Result<Self, RepresentationError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, perm-core
GIL attached / bounded
Semantic ID noether/groups/WeightLatticeMap@1

Executable usage: validation/unit/groups/test_weight_characters.py:40 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:134 · validation/unit/infra/test_macaulay2_benchmark_protocol.py:135 · validation/unit/infra/test_slurm_handoff.py:638 · validation/parity/groups/test_finite_group_cohomology_hap_parity.py:44 · validation/parity/groups/test_finite_group_cohomology_hap_parity.py:45

groups.WeightLatticeMap.to_json

Serialize this WeightLatticeMap to its canonical typed JSON representation.

Detailed contract

Serialize source, target, and integral matrix.

(self) -> str

noether::groups::WeightLatticeMap::to_json · Direct Rust declaration

pub fn to_json(&self) -> Result<String, NoetherError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, perm-core
GIL attached / bounded
Semantic ID noether/groups/WeightLatticeMap@1

Executable usage: validation/unit/category/test_category.py:14 · validation/unit/category/test_category.py:15 · validation/unit/combin/test_acceptance_workload.py:30 · validation/unit/combin/test_acceptance_workload.py:65 · validation/unit/combin/test_acceptance_workload.py:86 · validation/unit/combin/test_graph_facade.py:106