Skip to content

combin · KashiwaraCrystal

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

Worked example

The complete checked program Decompose the tensor square of the type-A2 letter crystal uses this API directly.

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Benjamin Antieau and Deven Manam
"""Decompose the tensor square of the type-A2 letter crystal."""

from noether.combin import KashiwaraCrystal


def main() -> None:
    letters = KashiwaraCrystal.type_a_letters(2)
    tensor_square = letters.tensor(letters)
    highest_weights = sorted(
        tensor_square.weight(vertex) for vertex in tensor_square.highest_weight_vertices()
    )
    assert tensor_square.vertex_count == 9
    assert highest_weights == [(0, 1), (2, 0)]
    print(f"B(omega_1)^2 has highest weights {highest_weights}")


if __name__ == "__main__":
    main()

Run it with .venv/bin/python examples/23_kashiwara_crystals.py.

combin.KashiwaraCrystal

A thin Python handle around Noether's validated finite type-A crystal.

class KashiwaraCrystal

noether::combin::KashiwaraCrystal · Direct Rust declaration

pub struct KashiwaraCrystal { /* 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
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: examples/23_kashiwara_crystals.py:5 · examples/23_kashiwara_crystals.py:9 · validation/unit/combin/test_acceptance_workload.py:12 · validation/unit/combin/test_acceptance_workload.py:57 · validation/unit/combin/test_acceptance_workload.py:65 · validation/unit/combinatorics/test_kashiwara_crystal.py:11

combin.KashiwaraCrystal.__eq__

Test mathematical equality with another value.

(self, other: object) -> bool

noether::combin::KashiwaraCrystal · 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
Semantic ID noether/combin/KashiwaraCrystal@1

combin.KashiwaraCrystal.cartan_matrix

Defining type-A Cartan matrix.

Detailed contract

Defining Cartan matrix for the crystal context.

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

noether::combin::KashiwaraCrystal::cartan_matrix · Direct Rust declaration

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

Executable usage: validation/unit/combin/test_acceptance_workload.py:60 · validation/unit/combinatorics/test_kashiwara_crystal.py:20

combin.KashiwaraCrystal.character

Weight-multiplicity character in deterministic weight order.

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

noether::combin::KashiwaraCrystal::character · Direct Rust declaration

pub fn character(&self) -> BTreeMap<Vec<i64>, u64>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: examples/27_weight_characters.py:24 · examples/27_weight_characters.py:25 · examples/27_weight_characters.py:26 · validation/unit/combin/test_acceptance_workload.py:64 · validation/unit/combinatorics/test_kashiwara_crystal.py:31 · validation/unit/groups/test_weight_characters.py:43

combin.KashiwaraCrystal.e

Apply the Kashiwara raising operator e_index.

Detailed contract

Apply the Kashiwara raising operator e_index.

(self, index: int, vertex: VertexId) -> VertexId | None

noether::combin::KashiwaraCrystal::e · Direct Rust declaration

pub fn e( &self, index: usize, vertex: VertexId, ) -> Result<Option<VertexId>, CombinError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: validation/unit/combinatorics/test_kashiwara_crystal.py:23 · validation/unit/infra/test_release_candidate.py:316 · validation/unit/infra/test_repr_protocol.py:123 · validation/parity/combinatorics/test_matroid_parity.py:66 · validation/parity/combinatorics/test_matroid_parity.py:68 · validation/parity/combinatorics/test_matroid_parity.py:69

combin.KashiwaraCrystal.epsilon_phi

Return the upward and downward distances along one colored string.

Detailed contract

Return (epsilon_index(vertex), phi_index(vertex)), the upward and downward distances along one colored string.

(self, index: int, vertex: VertexId) -> tuple[int, int]

noether::combin::KashiwaraCrystal::epsilon_phi · Direct Rust declaration

pub fn epsilon_phi( &self, index: usize, vertex: VertexId, ) -> Result<(usize, usize), CombinError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: validation/unit/combinatorics/test_kashiwara_crystal.py:35 · validation/parity/combinatorics/test_crystals_parity.py:94

combin.KashiwaraCrystal.f

Apply the Kashiwara lowering operator f_index.

Detailed contract

Apply the Kashiwara lowering operator f_index.

(self, index: int, vertex: VertexId) -> VertexId | None

noether::combin::KashiwaraCrystal::f · Direct Rust declaration

pub fn f( &self, index: usize, vertex: VertexId, ) -> Result<Option<VertexId>, CombinError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: examples/02_ball_arithmetic.py:19 · examples/03_exact_linear_systems.py:16 · examples/04_smith_normal_form.py:17 · examples/05_sparse_exact_operators.py:19 · examples/06_shortest_lattice_vectors.py:15 · examples/07_integer_factorization.py:15

combin.KashiwaraCrystal.from_json

Deserialize and revalidate every colored-string and weight invariant.

(value: str) -> KashiwaraCrystal

noether::combin::KashiwaraCrystal · 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
Semantic ID noether/combin/KashiwaraCrystal@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

combin.KashiwaraCrystal.highest_weight_vertices

Vertices killed by every raising operator.

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

noether::combin::KashiwaraCrystal::highest_weight_vertices · Direct Rust declaration

pub fn highest_weight_vertices(&self) -> Vec<VertexId> ⓘ
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: examples/23_kashiwara_crystals.py:12 · validation/unit/combin/test_acceptance_workload.py:63 · validation/unit/combinatorics/test_kashiwara_crystal.py:24 · validation/unit/combinatorics/test_kashiwara_crystal.py:42 · validation/parity/combinatorics/test_crystals_parity.py:101

combin.KashiwaraCrystal.rank

Cartan rank, equal to the number of Kashiwara colors.

(self) -> int

noether::combin::KashiwaraCrystal::rank · Direct Rust declaration

pub fn rank(&self) -> usize
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: examples/38_exact_linear_systems.py:78 · examples/distributed/f2_linear_algebra.py:34 · examples/distributed/f2_linear_algebra.py:54 · examples/distributed/f2_linear_algebra.py:55 · examples/distributed/f2_linear_algebra.py:60 · validation/unit/combin/test_acceptance_workload.py:74

combin.KashiwaraCrystal.tensor

Form the right-to-left Kashiwara tensor product.

Detailed contract

Form the right-to-left Kashiwara tensor product. Vertex (left, right) has identifier left * rhs.vertex_count() + right. The Cartan matrices must agree exactly, and the complete allocation is checked before materialization.

(self, rhs: KashiwaraCrystal) -> KashiwaraCrystal

noether::combin::KashiwaraCrystal::tensor · Direct Rust declaration

pub fn tensor(&self, rhs: &Self) -> Result<Self, CombinError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: examples/23_kashiwara_crystals.py:10 · examples/23_kashiwara_crystals.py:3 · validation/unit/combin/test_acceptance_workload.py:58 · validation/unit/combinatorics/test_kashiwara_crystal.py:41 · validation/unit/combinatorics/test_kashiwara_crystal.py:42 · validation/unit/combinatorics/test_kashiwara_crystal.py:44

combin.KashiwaraCrystal.to_json

Serialize the Cartan matrix, weights, and lowering table.

(self) -> str

noether::combin::KashiwaraCrystal · 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
Semantic ID noether/combin/KashiwaraCrystal@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

combin.KashiwaraCrystal.type_a_letters

Construct the standard letter crystal B(Lambda_1) of type A_rank.

Detailed contract

Construct the standard letter crystal B(Lambda_1) of type A_rank.

(rank: int) -> KashiwaraCrystal

noether::combin::KashiwaraCrystal::type_a_letters · Direct Rust declaration

pub fn type_a_letters(rank: usize) -> Result<Self, CombinError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: examples/23_kashiwara_crystals.py:9 · validation/unit/combin/test_acceptance_workload.py:57 · validation/unit/combinatorics/test_kashiwara_crystal.py:15 · validation/unit/combinatorics/test_kashiwara_crystal.py:40 · validation/unit/combinatorics/test_kashiwara_crystal.py:50 · validation/unit/combinatorics/test_kashiwara_crystal.py:52

combin.KashiwaraCrystal.type_a_tableaux

Construct the semistandard-tableau crystal B(shape) of type A_rank.

Detailed contract

Construct the semistandard-tableau crystal B(shape) of type A_rank. The alphabet is 1..=rank+1, rows are weakly increasing, and columns are strictly increasing. The shape and exact representation-size bounds are checked before the tableaux are materialized.

(rank: int, shape: Partition | Sequence[int]) -> KashiwaraCrystal

noether::combin::KashiwaraCrystal::type_a_tableaux · Direct Rust declaration

pub fn type_a_tableaux( rank: usize, shape: &Partition, ) -> Result<Self, CombinError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: validation/unit/combinatorics/test_kashiwara_crystal.py:28 · validation/parity/combinatorics/test_crystals_parity.py:129 · validation/parity/combinatorics/test_crystals_parity.py:141 · validation/parity/combinatorics/test_crystals_parity.py:142 · validation/parity/combinatorics/test_crystals_parity.py:153

combin.KashiwaraCrystal.vertex_count

Number of vertices in the explicit colored graph.

(self) -> int

noether::combin::KashiwaraCrystal::vertex_count · Direct Rust declaration

pub fn vertex_count(&self) -> usize
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: examples/23_kashiwara_crystals.py:14 · validation/unit/combin/test_acceptance_workload.py:61 · validation/unit/combin/test_acceptance_workload.py:62 · validation/unit/combinatorics/test_kashiwara_crystal.py:19 · validation/unit/combinatorics/test_kashiwara_crystal.py:30 · validation/unit/combinatorics/test_kashiwara_crystal.py:33

combin.KashiwaraCrystal.weight

Weight in fundamental-weight coordinates.

Detailed contract

Weight of a vertex in fundamental-weight coordinates.

(self, vertex: VertexId) -> tuple[int, ...]

noether::combin::KashiwaraCrystal::weight · Direct Rust declaration

pub fn weight(&self, vertex: VertexId) -> Result<&[i64], CombinError>
Contract Value
Guarantee checked deterministic result
Determinism deterministic
Availability default CPU build
Domain implementation crates noether, graph-core, perm-core
GIL attached / bounded
Semantic ID noether/combin/KashiwaraCrystal@1

Executable usage: examples/23_kashiwara_crystals.py:12 · examples/28_steiner_categories.py:26 · validation/unit/combinatorics/test_kashiwara_crystal.py:21 · validation/unit/combinatorics/test_kashiwara_crystal.py:36 · validation/unit/combinatorics/test_kashiwara_crystal.py:42 · validation/parity/combinatorics/test_crystals_parity.py:101