Skip to main content

Minimal O(3) irreducible representations with optional JAX support. A lightweight, pure-Python replacement for the core of e3nn-jax.

Project description

irrepx

GitHub Actions 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

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.

from irrepx import load_cg, load_jd, load_sb_roots

cg = load_cg()         # loads from cg.npz, lmax=7 by default
cg = load_cg(lmax=5)   # subset up to lmax=5
jd = load_jd()         # loads from jd.npz, lmax=13 by default
sb = load_sb_roots()   # loads from sb_root.npz, lmax=13 by default

If the requested lmax exceeds the shipped tables, 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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

irrepx-0.4.2-py3-none-any.whl (346.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: irrepx-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 346.5 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.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 71a308d0e731069f7c2914386b052d20ee9c051eec7ba4ccce16cb3eae1b436c
MD5 e353ab0182d2acec51a2fb53dea04bff
BLAKE2b-256 408e870ea0187fa902f7d22110838f687778e4f3b4ed45f45357aeadbafea361

See more details on using hashes here.

Provenance

The following attestation bundles were made for irrepx-0.4.2-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page