schur-weyl¶
Partitions, Young tableaux, symmetric-group characters and Schur–Weyl duality,
built from scratch on numpy and the standard library — no
representation-theory or combinatorics dependencies.
Schur–Weyl duality splits \((\mathbb{C}^d)^{\otimes n}\) under the commuting actions of \(S_n\) (permuting the tensor factors) and \(GL_d\) (acting diagonally) into blocks indexed by partitions \(\lambda \vdash n\) with \(\ell(\lambda) \le d\):
This package gives you both sides of that sum — the combinatorics of \(\lambda\), and the linear algebra that projects onto each block.
Install¶
Requires Python ≥ 3.9. The only runtime dependency is numpy. For local
development, install it editable with the dev extra, which adds pytest and
ruff:
Quick start¶
Partitions are plain tuples, tableaux are tuples of tuples, and permutations are 0-indexed one-line tuples. Nothing is a custom class, so everything composes with ordinary Python.
from schur_weyl import partitions, dim_specht, dim_weyl, isotypic_proj
from schur_weyl.character import character
from schur_weyl.sw_measure import schur_weyl_measure
[*partitions(4)]
# [(4,), (3, 1), (2, 2), (2, 1, 1), (1, 1, 1, 1)]
dim_specht((2, 1)) # 2 -- the standard rep of S_3
dim_weyl((2, 1), d=3) # 8
character((2, 1), (3,)) # -1 -- Murnaghan-Nakayama
schur_weyl_measure([0.7, 0.3], k=4)
# {(4,): 0.4141, (3, 1): 0.4977, (2, 2): 0.0882, ...}
P = isotypic_proj((2, 1), d=2) # np.ndarray, P @ P == P
Every function carries a docstring with worked examples, run as doctests. The test suite checks closed-form identities — \(\sum_\lambda (f^\lambda)^2 = n!\), character orthogonality, \(P_\lambda^2 = P_\lambda\) — rather than fixed outputs.
schur-weyl is developed at
AVlyx/schur-weyl, released on
PyPI, and licensed under the MIT
License.