Skip to main content

racah-py

AI-generated, for agentic coding. This document was written by an AI agent as reference material for AI agents (and humans) working on this repository. It may contain errors — check it against the code and tests rather than trusting it blindly.

Python bindings (PyO3 + maturin) for the racah crate's SU(N) surface: irreps from Dynkin labels, fusion with outer multiplicities, dense m-basis Clebsch–Gordan tensors, F/R symbols with their multiplicity axes, the verification gates, and the gauge fingerprint. racah is the coefficient authority behind TeNeT-py's SU(N) symmetry provider; this package is how that consumer (and any other Python code) reaches it.

Import name is racah; the distribution is racah-py. Wheels are always built with the crate's cgc-gen feature on, so the generated coefficients are available out of the box. CGC/F/R arrays come back as NumPy float64 arrays.

Installation

Not on PyPI. Until a release is published there, install from a checkout (needs a Rust stable toolchain and Python ≥ 3.12):

git clone https://github.com/Ryo-wtnb11/racah
cd racah/racah-py
python -m venv .venv && . .venv/bin/activate
pip install maturin
maturin develop --release          # builds the extension into the active venv

or build a wheel and install it anywhere:

maturin build --release --manifest-path racah-py/Cargo.toml --out dist
pip install --no-index --find-links dist racah-py

CI (wheels.yml) builds abi3-py312 wheels for linux-x86_64 and macos-arm64 on every tag and on manual dispatch; they are uploaded as workflow artifacts, not published. One wheel per platform covers CPython ≥ 3.12.

Quick start

Verified against the built extension; every call below is the actual API (see racah.pyi for the full typed surface).

import racah

three = racah.Irrep([1, 0])            # SU(3) fundamental, from its Dynkin label
assert three.dim() == 3                # exact integer, arbitrary precision
eight = racah.Irrep([1, 1])            # the adjoint

# Fusion: 3 x 3bar = 1 + 8, and the adjoint appears twice in 8 x 8.
assert racah.fusion(three, three.dual()) == [
    (racah.Irrep([0, 0]), 1),
    (eight, 1),
]
assert racah.fusion_multiplicity(eight, eight, eight) == 2  # N^8_88

# m-basis Clebsch-Gordan tensor: [dim(s1), dim(s2), dim(s3), N^{s3}_{s1 s2}].
cgc = racah.clebsch_gordan(three, three.dual(), eight)
assert cgc.shape == (3, 3, 8, 1)

# F-symbol block over the four multiplicity indices [mu, nu, kappa, lambda].
f = racah.f_symbol(eight, eight, eight, eight, eight, eight)
assert f.shape == (2, 2, 2, 2)

# R-symbol multiplicity matrix, N^c_ab x N^c_ba.
r = racah.r_symbol(three, three.dual(), eight)
assert r.shape == (1, 1)

# The verification gates raise RuntimeError on violation.
racah.check_pentagon(three, three.dual(), three, three.dual())

# The gauge fingerprint a consumer pins next to persisted coefficients.
print(racah.sun_authority_fingerprint())

The rest of the surface: Irrep.from_weight / Irrep.trivial constructors, the dynkin / weight / rank properties, check_f_unitarity and check_hexagon alongside check_pentagon, and su2_frobenius_schur(two_j).

Ill-posed input (bad label, mixed rank, empty fusion vertex) raises ValueError; a tripped numerical gate (orthonormality, F-unitarity, pentagon, hexagon, factorization failure) raises RuntimeError.

Versioning and the gauge fingerprint

F/R/CGC values depend on the CGC gauge; racah publishes them in one frozen canonical gauge. racah.sun_authority_fingerprint() returns the opaque authority string identifying that convention, generation pipeline, and tolerance policy — TeNeT-py pins it next to persisted coefficients and refuses a mismatch on load. Compare it by equality only; a breaking coefficient change bumps the fingerprint epoch and is recorded in the CHANGELOG. Same fingerprint means same convention and value agreement within the oracle tolerance, not cross-process bit-identity (docs.rs: sun_authority_fingerprint).

Documentation

The semantics are the crate's; the bindings add nothing:

  • User Guide — task-oriented chapters; shapes and axis conventions match the arrays returned here.
  • docs/theory.pdf — the mathematics behind the objects.
  • docs/gauge.md — the frozen SU(N) gauge specification the fingerprint names.
  • docs.rs/racah — exact per-item semantics and errors.
  • docs/README.md — the full documentation index.

Development

uv venv && uv pip install maturin pytest numpy
cd racah-py && maturin develop --release
pytest tests

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

racah_py-0.1.0.tar.gz (3.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

racah_py-0.1.0-cp312-abi3-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.12+Windows x86-64

racah_py-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.3 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

racah_py-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (12.1 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

racah_py-0.1.0-cp312-abi3-macosx_11_0_arm64.whl (12.7 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

racah_py-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl (14.5 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

Details for the file racah_py-0.1.0.tar.gz.

File metadata

  • Download URL: racah_py-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for racah_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5dbbb9132ccd5815b227b1cb08accef802159ad202b2e41e139ff56af6cf7fc9
MD5 526f7de91daba09469823b435fec5f64
BLAKE2b-256 9180006fd7ad0e6ccfef2b10b8adf0d6d2bf2861a4802622d00aad9cd6788ee8

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.0.tar.gz:

Publisher: wheels.yml on Ryo-wtnb11/racah

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file racah_py-0.1.0-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: racah_py-0.1.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 15.0 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for racah_py-0.1.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d4b9d11c02a34da728baa5682030dd5bba96ed0147fc43649581501198959da7
MD5 cbce300c5ea0c066988ffa4645d666f3
BLAKE2b-256 b9b3f35d200f68227dd6d842ca9011eab71a5c4328e1ddc01176b92cad1b7c81

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.0-cp312-abi3-win_amd64.whl:

Publisher: wheels.yml on Ryo-wtnb11/racah

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file racah_py-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for racah_py-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d0a74dd623bcb06c7454eb1714950bec65a5eb70ffe08a57020edb6cb600ddc1
MD5 36b182b09c5b0eeb45ab4e84c23d0c71
BLAKE2b-256 d0d589dd615d4e5bb83d07df64eda541bb7c0fff134112f723b282e0357e598d

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on Ryo-wtnb11/racah

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file racah_py-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for racah_py-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f15c68ef82d6b44edc5cfac1f1a60a29150c693a459c1f656866b4594683f833
MD5 148a5426a253c89e2617ec16cd44449f
BLAKE2b-256 d7873d2556bd5598440a43c216e7448fa3e27cbe11e8147dcac7f48d0028e646

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: wheels.yml on Ryo-wtnb11/racah

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file racah_py-0.1.0-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for racah_py-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b79f9eb6741075c9621d330384daa68fb583285a676e6cd813bcba93df60fd05
MD5 e612273a3ab04d78bb05f37f96df4359
BLAKE2b-256 4bf1d5e8164e8dd97134adeb46eada3f5f1bdd602595c0962d354947027ab1cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.0-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: wheels.yml on Ryo-wtnb11/racah

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file racah_py-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for racah_py-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 db5c334192e9b0c8e8465f756998536d5b27ddf208ab2f657b17a57ab368b38c
MD5 1737ca5840abcb48b73def33e8fdcc92
BLAKE2b-256 af2117810aa6dfe2163b850bd6abacc8576f7bbcf8b9c2ff3d0f2758e4fd439c

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl:

Publisher: wheels.yml on Ryo-wtnb11/racah

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.2

6 files

0.1.1

6 files

This release

0.1.0 This release

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page