Skip to main content

irrepx

CI PyPI Version Python Versions License GitHub Issues GitHub Stars

Minimal O(3) irreducible representations with optional JAX support.

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

irrepx-0.5.4.tar.gz (409.1 kB view details)

Uploaded Source

Built Distribution

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

irrepx-0.5.4-py3-none-any.whl (399.1 kB view details)

Uploaded Python 3

File details

Details for the file irrepx-0.5.4.tar.gz.

File metadata

  • Download URL: irrepx-0.5.4.tar.gz
  • Upload date:
  • Size: 409.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for irrepx-0.5.4.tar.gz
Algorithm Hash digest
SHA256 d0aa73fa048f00c6474d89611c12874ee4ed84409211d9226eb725231f891d61
MD5 19868b94db82ba7ef1751f13ce05a77a
BLAKE2b-256 2299d24e0d4df48568c2a2451fff1482d64bc5982131b9f559391d71d5f47356

See more details on using hashes here.

Provenance

The following attestation bundles were made for irrepx-0.5.4.tar.gz:

Publisher: publish.yaml on kYangLi/irrepx

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

File details

Details for the file irrepx-0.5.4-py3-none-any.whl.

File metadata

  • Download URL: irrepx-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 399.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for irrepx-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8718c3aafb6c62587bdb1f2465025b651d8a461adf2fccce0a76aea2119d580e
MD5 f195c65d8f5d5f5fc6a5802938f148b8
BLAKE2b-256 442acebd01317494f834826b0f86ff4f85275fc3c6a6162716246711d19110b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for irrepx-0.5.4-py3-none-any.whl:

Publisher: publish.yaml on kYangLi/irrepx

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

Release history Release notifications | RSS feed

This release

0.5.4 This release

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

1 file

0.5.0

1 file

0.4.2

1 file

0.4.1

1 file

0.4.0

1 file

0.0.0

1 file

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