irrepx
Install
pip install irrepx # Light mode: representation algebra only
pip install irrepx[jax] # Full mode: JAX (any platform, pre-installed)
One-step install with the right JAX backend:
pip install irrepx[jax-cpu] # CPU
pip install irrepx[jax-cuda12] # CUDA 12
pip install irrepx[jax-cuda13] # CUDA 13
pip install irrepx[jax-tpu] # TPU
Quick Start
from irrepx import Irrep, Irreps
# Structural algebra (no JAX needed)
irreps = Irreps("32x0e + 16x1o + 8x2e")
assert irreps.dim == 32 + 48 + 40
assert Irrep("2e") in Irrep("1o") * Irrep("1o")
With JAX installed:
import jax.numpy as jnp
from irrepx import IrrepsArray, spherical_harmonics
x = IrrepsArray("1o", jnp.array([[1.0, 0.0, 0.0]]))
sh = spherical_harmonics([0, 1, 2], x, normalize=True)
print(sh.irreps) # 1x0e+1x1o+1x2e
Wigner D from direction
Compute Wigner D matrices from edge direction vectors (Gram-Schmidt → Euler angles → JD-seed formula). Available in both numpy (light) and JAX (full) modes.
import numpy as np
from irrepx import wigner_D_from_direction
edge = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]) # (E, 3) unit vectors
D = wigner_D_from_direction(edge, l_range=[0, 1, 2])
# D[l] is (E, 2l+1, 2l+1)
With JAX, the same call is JIT-compatible and operates on jnp.ndarray.
Pre-computed constants
irrepx ships pre-computed Clebsch-Gordan coefficients, JD seed matrices, and spherical Bessel roots as npz files. These are loaded lazily on first access. The loaders take no arguments and return the full shipped table; callers slice or filter the subset they need.
from irrepx import load_cg, load_jd, load_sb_roots
cg = load_cg() # dict keyed by "l1=N,l2=M", shipped lmax=7 (+SOC rows)
jd = load_jd() # list of (2l+1, 2l+1) matrices, shipped lmax=13
sb = load_sb_roots() # list of 1-D root arrays, shipped lmax=13
Inspect the shipped capacity with irrepx constants status. If your work
needs larger tables than shipped, rebuild them with the CLI:
irrepx constants status
irrepx constants update --cg-lmax 10 --jd-lmax 15 --sb-lmax 20
For per-triplet CG access (used internally by spherical_harmonics and
tensor_product), use the computational function:
from irrepx import clebsch_gordan
cg = clebsch_gordan(1, 1, 2) # returns dense (3, 3, 5) array
License
GPL-3.0-or-later
Metadata
Release files for irrepx 0.5.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| irrepx-0.5.6.tar.gz | 417.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| irrepx-0.5.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 823.3 kB
Release files / irrepx-0.5.6.tar.gz
| Download URL | irrepx-0.5.6.tar.gz |
|---|---|
| Size | 417.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bddfa360595106c16fbc4ed18f599b841633b7588da4ac68d81a2380e188e57d
|
|
BLAKE2b-256 checksum How to use checksums |
9782d4b5106208bdeadd7e9e3f4a996cb90f85036af67e8d4c2c3ff5d4490d90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / irrepx-0.5.6-py3-none-any.whl
| Download URL | irrepx-0.5.6-py3-none-any.whl |
|---|---|
| Size | 406.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70255a4cb502a0b9d9f851549c4568627a8f8bb60dd25d670d9d97279ef1b801
|
|
BLAKE2b-256 checksum How to use checksums |
bdb475fe91675d3cd48c343289cd82c1a934267dca59d6b91f7de19351c644ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency log