Skip to main content

h4lat

tests PyPI Python versions Documentation License: GPL v3+ DOI

Clebsch-Gordan coefficients and lattice operators for the hypercubic group H(4) and the 16-cell honeycomb group W(F₄)

Lattice QCD calculations of nucleon structure (moments of parton distribution functions, form factors) need operators that transform irreducibly under the hypercubic group H(4), the symmetry group of a four-dimensional hypercubic lattice, of order 384 with 20 irreducible representations (irreps). h4lat computes the Clebsch-Gordan coefficients of H(4) and builds these operators:

  • Clebsch-Gordan coefficients of any tensor product of H(4) irreps, with the projection formula of Sakata (1974) (optionally on all CPU cores), and a bundled database of the products needed for the operators below.
  • A bundled database of 1360 H(4)-irreducible operators ψ̄ Γ D⋯D ψ, with Γ = 𝟙, γ₅, γ_μ, γ_μγ₅, σ_μν (S, P, V, A, T) and zero to three derivatives, each with a definite C-parity.
  • For every operator: its expression, its tree-level kinematic factor (in exact arithmetic, with a choice of six polarisation projectors), its C-parity, trace condition and index symmetry.
  • The operators used in published works, a PDF catalogue of the operators, linear combinations of operators and HDF5 storage.
  • The same for the 16-cell honeycomb lattice, whose symmetry group W(F₄) (order 1152, 25 irreps) contains H(4) and protects more operators from mixing (Katz and Nogradi 2026): select it with group="honeycomb".

Documentation

The documentation is in the wiki:

Getting started Installation (optional features, install from GitHub, development install)
User guide Computing Clebsch-Gordan coefficients · Building operators · Operator database (operator IDs) · Operator catalogue (PDF) · Operators from the literature · Saving and loading operators · API overview
Theory The hypercubic group · Clebsch-Gordan coefficients · Lattice operators · The 16-cell honeycomb group · References

Every function and class also has a detailed docstring (help(h4lat.cg_calc)).


Installation

pip install h4lat                   # core (numpy + sympy + tqdm only)
pip install "h4lat[full]"           # all the optional features (PDF catalogue, parallel computation, HDF5, …)

h4lat needs Python ≥ 3.11. To install a given release, or the latest code, directly from GitHub:

pip install "h4lat @ git+https://github.com/Tag-E/h4lat.git@v0.4.0"   # release 0.4.0
pip install "h4lat[full] @ git+https://github.com/Tag-E/h4lat.git"    # latest code on main

The Installation page of the wiki describes the other optional features and the development install.


Quick start

from h4lat import cg_calc, get_OperatorList, get_paper_operators, latex_print_multiplicities

# Decompose (4,1) ⊗ (4,1), the product of the vector operators with one derivative ψ̄ γ_μ D_ν ψ
print(latex_print_multiplicities((4, 1), (4, 1)))    # τ⁽¹⁾₁ ⊕ τ⁽³⁾₁ ⊕ τ⁽⁶⁾₁ ⊕ τ⁽⁶⁾₃, as a LaTeX string

# Its Clebsch-Gordan coefficients, loaded from the bundled database: one block per irrep and copy
cg = cg_calc((4, 1), (4, 1), verbose=False)

# Operators of the bundled database, selected by Dirac structure and number of derivatives ("V1")
ops = get_OperatorList(keys="V1")
op = ops[1]
print(op.id, op.irrep, op.C, op.tr, op.symm)       # ID, H(4) irrep, C-parity, trace condition, index symmetry
print(op.latex_O)                                   # the operator, as a LaTeX string
print(op.K)                                         # kinematic factor, a SymPy expression in m_N, E(p), p_1, p_2, p_3
print(op.evaluate_K(m_value=0.939, E_value=1.0, p1_value=0.0, p2_value=0.0, p3_value=0.3))

# The operators of a published work, selected by INSPIRE texkey or DOI
paper_ops = get_paper_operators("Rodekamp:2023wpe")

# The same for the 16-cell honeycomb lattice: (4,1) ⊗ (4,1) = (1,1) ⊕ (6,1) ⊕ (9,1) of W(F₄)
print(latex_print_multiplicities((4, 1), (4, 1), group="honeycomb"))
honeycomb_ops = get_OperatorList(keys="V1", group="honeycomb")
h4lat-catalogue -X V --nder 1 2      # PDF catalogue of the vector operators with 1 and 2 derivatives (needs LaTeX)

Examples

Jupyter notebooks with worked examples are provided in the examples/ folder:

Notebook Description
quickstart.ipynb Tensor-product decomposition, CG coefficients, operator construction, and the bundled database, in executable form
operator_algebra.ipynb Linear combinations of operators: addition, subtraction, scalar multiplication, and mixed-irrep behaviour
operator_catalogue.ipynb Listing of the most relevant operators of the bundled database — V, A and T with one and two derivatives (IDs 25–80 and 113–336) — organised by number of derivatives, Dirac structure, and H(4) irrep; all the operators are in the PDF catalogue
paper_operators.ipynb Operators used in published works, selected with get_paper_operators by INSPIRE texkey or DOI, and the code that builds them from the operators of the bundled database
honeycomb.ipynb The 16-cell honeycomb group W(F₄): its irreps, how they join those of H(4), its Clebsch-Gordan coefficients, and the operators that can be measured in a nucleon at rest

A Google Colab notebook with some minimal working examples can be found here.


How to cite

If you use h4lat in your research, please cite it, and give the version you used (h4lat.__version__), since operator IDs and conventions can change between versions (see the changelog):

@software{Taggi_h4lat,
  author  = {Taggi, Emilio},
  title   = {{h4lat}: {C}lebsch-{G}ordan coefficients and lattice operators for the hypercubic group {H(4)} and the 16-cell honeycomb group {W(F$_4$)}},
  year    = {2026},
  version = {0.4.0},
  doi     = {10.5281/zenodo.23598681},
  url     = {https://github.com/Tag-E/h4lat}
}

The DOI 10.5281/zenodo.23598681 covers all versions of h4lat and leads to the latest one. Each release also has its own DOI, listed on the Zenodo page. The "Cite this repository" button on the GitHub page gives the same reference in APA and BibTeX form (from CITATION.cff).


Contributing and changelog

Questions, bug reports and suggestions are welcome as GitHub issues. CONTRIBUTING.md explains how to set up a development install, run the tests and edit the wiki, and CHANGELOG.md lists the changes of each release.


Acknowledgements

h4lat is built on the following works (also listed, with the others used in the documentation, on the wiki page References):


Disclaimer

h4lat has not been peer-reviewed. Its documentation (this README, the wiki and the docstrings), and much of its code and tests, were written with agentic AI tools (Claude Code, by Anthropic) under the direction of the author: these tools are what make it possible for one person to develop, maintain and distribute a package of this size.

The group theory, the methods and the conventions of h4lat come from published papers and preprints (see the Acknowledgements above), and the test suite checks the code against them: the matrices of the group elements against the generator relations and the character tables, and the decompositions of the tensor products and the operators against the tables and expressions of those works. It also checks that the Clebsch-Gordan coefficients transform as they must under the group. Still, as with any work that has not been reviewed by the scientific community, h4lat may contain mistakes, in the explanations as well as in the code: check the results you rely on, and please report anything that looks wrong as a GitHub issue.


License

GNU General Public License v3.0 or later: see LICENSE. All derivative works must be distributed under the same open-source terms.

Metadata

Release files for h4lat 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for h4lat 0.4.0
File Size Uploaded Provenance Actions
h4lat-0.4.0.tar.gz 1.5 MB With provenance Details for h4lat-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for h4lat 0.4.0
File Interpreter ABI Platform Actions
h4lat-0.4.0-py3-none-any.whl Python 3 none any Details for h4lat-0.4.0-py3-none-any.whl

Total release size: 5.9 MB

Release files / h4lat-0.4.0.tar.gz

Download URL h4lat-0.4.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
f5f2af5889438667a6018c83ff4547d1546ed62c6532bd5d5ce6f15783371dac
BLAKE2b-256 checksum
How to use checksums
97e64fa5f822676a23bdc5c9bb988e764cde4a6a764403d40b7cec7318909f83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / h4lat-0.4.0-py3-none-any.whl

Download URL h4lat-0.4.0-py3-none-any.whl
Size 4.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
405163f367740ebff6228edcdb079f3a8fc33e5511b4c63922a5792804601b0f
BLAKE2b-256 checksum
How to use checksums
99ba40e9d48197e54eb549b2c488d59ac9a8d1d555888c19b11b88f184215f50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Security for h4lat 0.4.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for h4lat-0.4.0.tar.gz

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 Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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