Skip to main content

Lorentz Local Canonicalization

Project description

Lorentz Local Canonicalization

Tests codecov PyPI version pytorch ruff

LLoCa-CS LLoCa-HEP

This repository contains a standalone implementation of Lorentz Local Canonicalization (LLoCa) by Jonas Spinner, Luigi Favaro, Peter Lippmann, Sebastian Pitz, Gerrit Gerhartz, Huilin Qu, Tilman Plehn, and Fred A. Hamprecht. LLoCa uses equivariantly predicted local reference frames and geometric message passing between these frames to make any architecture Lorentz-equivariant. You can read more about LLoCa in the following two papers and in the LLoCa documentation:

Installation

You can either install the latest release using pip

pip install lloca

or clone the repository and install the package in dev mode

git clone https://github.com/heidelberg-hepml/lloca.git
cd lloca
pip install -e ".[dev]"
pre-commit install

How to use LLoCa

Please have a look at the LLoCa documentation (WIP) and our example notebook for the LLoCa-Transformer.

Features

  • Backbone architectures in lloca/backbone: Transformer, ParticleTransformer, ParticleNet, GraphNet, MLP
  • The Transformer backbone supports several attention kernels that can be installed optionally with e.g. pip install lloca[varlen-attention], pip install lloca[xformers-attention], pip install lloca[flex-attention], pip install lloca[flash-attention].
  • LLoCaMessagePassing as blueprint for generic LLoCa graph network backbones
  • Equivariant vector predictors in lloca/equivectors: MLPVectors, LGATrVectors, PELICANVectors
  • Local frames for equivariant architectures on several symmetry groups: SO(1,3) (LearnedPDFrames, LearnedSO13Frames, LearnedRestFrames), SO(3) (LearnedSO3Frames), SO(1,1)xSO(2) (LearnedZFrames) and SO(2) (LearnedSO2Frames); as well as the corresponding random global frames for data augmentation
  • Support for arbitrary higher-order representations with the TensorReps class

Coming soon:

  • Parity-odd representations
  • Support for cross-attention
  • More backbone architectures

Examples

Let us know if you use lloca, so we can add your repo to the list!

Citation

If you find this code useful in your research, please cite our papers

@article{Favaro:2025pgz,
    author = "Favaro, Luigi and Gerhartz, Gerrit and Hamprecht, Fred A. and Lippmann, Peter and Pitz, Sebastian and Plehn, Tilman and Qu, Huilin and Spinner, Jonas",
    title = "{Lorentz-Equivariance without Limitations}",
    eprint = "2508.14898",
    archivePrefix = "arXiv",
    primaryClass = "hep-ph",
    month = "8",
    year = "2025"
}
@article{Spinner:2025prg,
    author = "Spinner, Jonas and Favaro, Luigi and Lippmann, Peter and Pitz, Sebastian and Gerhartz, Gerrit and Plehn, Tilman and Hamprecht, Fred A.",
    title = "{Lorentz Local Canonicalization: How to Make Any Network Lorentz-Equivariant}",
    eprint = "2505.20280",
    archivePrefix = "arXiv",
    primaryClass = "stat.ML",
    month = "5",
    year = "2025"
}

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

lloca-1.3.5.tar.gz (252.1 kB view details)

Uploaded Source

Built Distribution

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

lloca-1.3.5-py3-none-any.whl (67.0 kB view details)

Uploaded Python 3

File details

Details for the file lloca-1.3.5.tar.gz.

File metadata

  • Download URL: lloca-1.3.5.tar.gz
  • Upload date:
  • Size: 252.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lloca-1.3.5.tar.gz
Algorithm Hash digest
SHA256 b8e7b22053b570bdcf2e9a18cf36a96dc8abb67896a8a4b5dae8480d92b41261
MD5 a0dc5fc161942483cea16c01beb5dc93
BLAKE2b-256 175cf903afab2e7a36399b4662973cc97ad6f595bb1d36e4389500dc1615963f

See more details on using hashes here.

Provenance

The following attestation bundles were made for lloca-1.3.5.tar.gz:

Publisher: release.yaml on heidelberg-hepml/lloca

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

File details

Details for the file lloca-1.3.5-py3-none-any.whl.

File metadata

  • Download URL: lloca-1.3.5-py3-none-any.whl
  • Upload date:
  • Size: 67.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lloca-1.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6b2064dfa2542e7cac8182e57cfac3e6b10b750cae8ab78429c03e7fc0fe5d63
MD5 1f6c35846f08a8afd95b6ffd9ab91805
BLAKE2b-256 e02eadb9bc91f62abb8ed78133590d6b71f5e6c70a044a2f85d513916ca4ea2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for lloca-1.3.5-py3-none-any.whl:

Publisher: release.yaml on heidelberg-hepml/lloca

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