Skip to main content

Lorentz-Equivariant Geometric Algebra Transformer for High-Energy Physics

Project description

Lorentz-Equivariant Geometric Algebra Transformer

Tests codecov PyPI version pytorch black

LGATr-CS LGATr-HEP

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:

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 our example notebooks for how to use LGATr and ConditionalLGATr.

Features

  • L-GATr encoder and decoder as LGATr and ConditionalLGATr
  • Additional attention backends, installation via pip install lgatr[xformers_attention] and pip install lgatr[flex_attention]. You might have to run python -m pip install --upgrade pip setuptools wheel because extra imports require modern versions of pip, 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, MLPConfig and LGATRConfig objects

Examples

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 the following 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


Download files

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

Source Distribution

lgatr-1.2.0.tar.gz (35.0 kB view details)

Uploaded Source

Built Distribution

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

lgatr-1.2.0-py3-none-any.whl (51.0 kB view details)

Uploaded Python 3

File details

Details for the file lgatr-1.2.0.tar.gz.

File metadata

  • Download URL: lgatr-1.2.0.tar.gz
  • Upload date:
  • Size: 35.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lgatr-1.2.0.tar.gz
Algorithm Hash digest
SHA256 4bd83eb332fabbadb8a83446f864a97197867327028ca3d145a1e42832b53f48
MD5 4ecca46115d57c86c14b5fb426df51a9
BLAKE2b-256 e096ec50224da2636422fd5b6faf8bc958389c0cdb19fb020c62351c10c62fbb

See more details on using hashes here.

Provenance

The following attestation bundles were made for lgatr-1.2.0.tar.gz:

Publisher: release.yaml on heidelberg-hepml/lgatr

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

File details

Details for the file lgatr-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: lgatr-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 51.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lgatr-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4d57630eb9525f460882730f8ea81a8a5adae295f4e4a034c1a2af224ffece4
MD5 4c8661a78a5d7081719e3f627f52a56b
BLAKE2b-256 affa291af38638fa0cb0e7daa235faaa7b2e1a3f23113ae3a6f47c8f956e608d

See more details on using hashes here.

Provenance

The following attestation bundles were made for lgatr-1.2.0-py3-none-any.whl:

Publisher: release.yaml on heidelberg-hepml/lgatr

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