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

From PyPI (Python ≥ 3.12; prebuilt abi3 wheels for linux-x86_64 and macos-arm64):

pip install racah-py

Or from a checkout (needs a Rust stable toolchain):

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; py-v* tags/releases publish them to PyPI. 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.1.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.1-cp312-abi3-win_amd64.whl (15.0 MB view details)

Uploaded CPython 3.12+Windows x86-64

racah_py-0.1.1-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.1-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.1-cp312-abi3-macosx_11_0_arm64.whl (12.7 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

racah_py-0.1.1-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.1.tar.gz.

File metadata

  • Download URL: racah_py-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 9cc444f4c0ff4d0cb8ca1b30e353177438b565fd96ce5b2bf3e1cb1810fd2736
MD5 469e3764b3519f8037779b1d5c7fa6e2
BLAKE2b-256 20c119ec9b309bb0a58385c2871d0ac82a31925ddb653676f1b943ca7eb02376

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.1.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.1-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: racah_py-0.1.1-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.1-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0048e0eed3eac2ab56de7dc4b8f0f95b65f3485cb954e03cbf12cc8225e73daa
MD5 92ee19af9c91d3297f3d8afa883cfd44
BLAKE2b-256 4364d13f932f203412af68b3062e8e12f9da4132a27665fa2fc0982781b150ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.1-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.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for racah_py-0.1.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 42159742da2f9b98128fb4dc7b94fa89d31af14482e21da2adc98ac5e1c1fd10
MD5 f1ea545a0f7b54070a2b0452d5f9191b
BLAKE2b-256 f89645fb04405bfd3943e60e18bc693ee82499bdd52e860579b27172b49830bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.1-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.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for racah_py-0.1.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 abb44fb8a7b93580d5e55c3182d4c4cfa9e04ba67f2afd7974ecd9c5a6bd41ee
MD5 7b2aa3c96208352ac5d6f460196ee555
BLAKE2b-256 731fdbe8a959bfd2f0761541d6f33f18c0eca69b3b8ffd63eadc430faf586b57

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.1-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.1-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for racah_py-0.1.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e50d8924eeca08208bf99d8129d106760fdd0c4847a6448c15a1f0f9fe88ecbb
MD5 f723721a05948a6c34fe4d612c23f591
BLAKE2b-256 ce316cf40cd28b3dd55015029f89c85b35d92d4c025e39dec55bbffe24e6376f

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.1-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.1-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for racah_py-0.1.1-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bd0f406dc55626d0dcdf5a6a18e5c743492ef08a1dd8e5d377ed9e49ef20a745
MD5 76bbde36bffaebc58ee7c9d5f3fd9f6e
BLAKE2b-256 b6e962fb163ae5c23ceac079d8a3ab4fe232bc98349deb9e3bcb673781587bec

See more details on using hashes here.

Provenance

The following attestation bundles were made for racah_py-0.1.1-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

This release

0.1.1 This release

6 files

0.1.0

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