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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file irrepx-0.5.3.tar.gz.
File metadata
- Download URL: irrepx-0.5.3.tar.gz
- Upload date:
- Size: 364.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96df1a424757d08a17a8d7f037b22b4c0ada49e37dd50a5a33c0190b29e39a8d
|
|
| MD5 |
a342b29e81c77ee28f201c64ff0c48ff
|
|
| BLAKE2b-256 |
6e9a67488b2f8660e1f0a93bdfde99899f159381b4b0fb5a75df68af837b2b68
|
Provenance
The following attestation bundles were made for irrepx-0.5.3.tar.gz:
Publisher:
publish.yaml on kYangLi/irrepx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
irrepx-0.5.3.tar.gz -
Subject digest:
96df1a424757d08a17a8d7f037b22b4c0ada49e37dd50a5a33c0190b29e39a8d - Sigstore transparency entry: 1920501843
- Sigstore integration time:
-
Permalink:
kYangLi/irrepx@3e0d13f9345d2fb6c72012987214576f8d2f61b5 -
Branch / Tag:
refs/tags/v0.5.3 - Owner: https://github.com/kYangLi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@3e0d13f9345d2fb6c72012987214576f8d2f61b5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file irrepx-0.5.3-py3-none-any.whl.
File metadata
- Download URL: irrepx-0.5.3-py3-none-any.whl
- Upload date:
- Size: 354.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8760f852b07208141a0daad1d0517c981e19d29055e0f66f6bda23f5b64eb5b
|
|
| MD5 |
d25d6737ec435b1b839713595b70c344
|
|
| BLAKE2b-256 |
20548317dd0aae765ef7dc1a593f9606197149d09641f612fbddf42401c728ed
|
Provenance
The following attestation bundles were made for irrepx-0.5.3-py3-none-any.whl:
Publisher:
publish.yaml on kYangLi/irrepx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
irrepx-0.5.3-py3-none-any.whl -
Subject digest:
c8760f852b07208141a0daad1d0517c981e19d29055e0f66f6bda23f5b64eb5b - Sigstore transparency entry: 1920501980
- Sigstore integration time:
-
Permalink:
kYangLi/irrepx@3e0d13f9345d2fb6c72012987214576f8d2f61b5 -
Branch / Tag:
refs/tags/v0.5.3 - Owner: https://github.com/kYangLi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@3e0d13f9345d2fb6c72012987214576f8d2f61b5 -
Trigger Event:
release
-
Statement type: