Lorentz-Equivariant Geometric Algebra Transformer for High-Energy Physics
Project description
This repository contains a standalone implementation of the Lorentz-Equivariant Geometric Algebra Transformer (L-GATr) by Jonas Spinner, Víctor Bresó, Pim de Haan, Tilman Plehn, Huilin Qu, Jesse Thaler, and Johann Brehmer. L-GATr uses spacetime geometric algebra representations to construct Lorentz-equivariant layers and combines them into a transformer architecture. You can read more about L-GATr in the following two papers and in the L-GATr documentation:
- Lorentz-Equivariant Geometric Algebra Transformers for High-Energy Physics (ML audience)
- A Lorentz-Equivariant Transformer for All of the LHC (HEP audience)
Installation
You can either install the latest release using pip
pip install lgatr
or clone the repository and install the package in dev mode
git clone https://github.com/heidelberg-hepml/lgatr.git
cd lgatr
pip install -e .
How to use L-GATr
Please have a look at the L-GATr documentation and our example notebooks for LGATr and ConditionalLGATr.
Features
- L-GATr encoder and decoder as
LGATrandConditionalLGATr - Additional attention backends, installation via
pip install lgatr[xformers_attention]andpip install lgatr[flex_attention]. You might have to runpython -m pip install --upgrade pip setuptools wheelbecause extra imports require modern versions ofpip, setuptools, wheel. - Support for torch's automatic mixed precision; critical operations are performed in
float32 - Interface to the geometric algebra: Embedding and extracting multivectors; spurions for symmetry breaking at the input level
- Many hyperparameters to play with, organized via the
SelfAttentionConfig,CrossAttentionConfig,MLPConfigandLGATRConfigobjects
Examples
- https://github.com/spinjo/weaver-core/blob/lgatr/weaver/nn/model/LGATr.py: L-GATr in the CMS boosted object tagging library
weaver. Includes examples for how to use L-GATr without thexformerspackage. - https://github.com/heidelberg-hepml/lorentz-frames: Code for the LLoCa project, including L-GATr as a baseline. The main results from https://github.com/heidelberg-hepml/lorentz-gatr can be reproduced here using the
lgatrpackage. - https://github.com/heidelberg-hepml/high-dim-unfolding: Generative jet substructure unfolding with L-GATr, uses the
ConditionalLGATr. - https://github.com/heidelberg-hepml/lorentz-gatr: Original
LGATrimplementation used for the papers. This repo doesn't import thelgatrpackage, but has its own (outdated)lgatr/folder.
Let us know if you use lgatr, so we can add your repo to the list!
Citation
If you find this code useful in your research, please cite our papers
@article{Brehmer:2024yqw,
author = "Brehmer, Johann and Bres\'o, V\'\i{}ctor and de Haan, Pim and Plehn, Tilman and Qu, Huilin and Spinner, Jonas and Thaler, Jesse",
title = "{A Lorentz-Equivariant Transformer for All of the LHC}",
eprint = "2411.00446",
archivePrefix = "arXiv",
primaryClass = "hep-ph",
reportNumber = "MIT-CTP/5802",
month = "11",
year = "2024"
}
@inproceedings{spinner2025lorentz,
title={Lorentz-Equivariant Geometric Algebra Transformers for High-Energy Physics},
author={Spinner, Jonas and Bres{\'o}, Victor and De Haan, Pim and Plehn, Tilman and Thaler, Jesse and Brehmer, Johann},
booktitle={Advances in Neural Information Processing Systems},
year={2024},
volume={37},
eprint = {2405.14806},
url = {https://arxiv.org/abs/2405.14806}
}
@inproceedings{brehmer2023geometric,
title = {Geometric Algebra Transformer},
author = {Brehmer, Johann and de Haan, Pim and Behrends, S{\"o}nke and Cohen, Taco},
booktitle = {Advances in Neural Information Processing Systems},
year = {2023},
volume = {36},
eprint = {2305.18415},
url = {https://arxiv.org/abs/2305.18415},
}
Project details
Release history Release notifications | RSS feed
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 lgatr-1.3.1.tar.gz.
File metadata
- Download URL: lgatr-1.3.1.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92148666690fa002a1691aa1b8294e6ecfedefbf581825c0c944527bac45bbb9
|
|
| MD5 |
120f196b311aa00b02e98bcaae5d6865
|
|
| BLAKE2b-256 |
ca68fc1a0b4bf066be34b54fda4842ea2de28a93eba9e3860c53ed11cc3c24af
|
Provenance
The following attestation bundles were made for lgatr-1.3.1.tar.gz:
Publisher:
release.yaml on heidelberg-hepml/lgatr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lgatr-1.3.1.tar.gz -
Subject digest:
92148666690fa002a1691aa1b8294e6ecfedefbf581825c0c944527bac45bbb9 - Sigstore transparency entry: 614085957
- Sigstore integration time:
-
Permalink:
heidelberg-hepml/lgatr@99b9f4746fbb37dff092e9a75087381b198f47ca -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/heidelberg-hepml
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@99b9f4746fbb37dff092e9a75087381b198f47ca -
Trigger Event:
push
-
Statement type:
File details
Details for the file lgatr-1.3.1-py3-none-any.whl.
File metadata
- Download URL: lgatr-1.3.1-py3-none-any.whl
- Upload date:
- Size: 50.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1a29b3b40ea104fb14741c992f4fffbb136235cb51b07fe06f699aeaa835698
|
|
| MD5 |
ca98e6dad4591e3613defbdd9ebfb3cc
|
|
| BLAKE2b-256 |
2a9629b68ac8fd9772c94467201770733a7454fc24a3fcf5d59c3e122f14797f
|
Provenance
The following attestation bundles were made for lgatr-1.3.1-py3-none-any.whl:
Publisher:
release.yaml on heidelberg-hepml/lgatr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lgatr-1.3.1-py3-none-any.whl -
Subject digest:
c1a29b3b40ea104fb14741c992f4fffbb136235cb51b07fe06f699aeaa835698 - Sigstore transparency entry: 614085962
- Sigstore integration time:
-
Permalink:
heidelberg-hepml/lgatr@99b9f4746fbb37dff092e9a75087381b198f47ca -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/heidelberg-hepml
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@99b9f4746fbb37dff092e9a75087381b198f47ca -
Trigger Event:
push
-
Statement type: