Skip to main content

LVec

CI PyPI License: GPL v3

Lorentz and spatial vectors for physics analysis, built on NumPy with optional Awkward Array support. LVec provides event kinematics, angular matching, reference-frame transformations, event reductions, and decay angles.

Installation

NumPy is required; Awkward support is optional. Supported Python and dependency versions are declared in pyproject.toml.

pip install lvec
pip install "lvec[awkward]"  # optional jagged arrays and records

Quick start

import numpy as np
from lvec import LVec, Frame

tracks = LVec.from_ptepm(
    pt=np.array([2., 3.]), eta=np.array([.2, -.3]),
    phi=np.array([.4, -.5]), m=.13957,
)
pair = tracks[0] + tracks[1]
print(pair.mass, pair.pt, tracks[0].delta_r(tracks[1]))

cm = Frame.from_lvec(pair)
pair_in_cm = pair.to_frame(cm)
np.testing.assert_allclose(pair_in_cm.to_p4()[:3], 0., atol=1e-14)

Use consistent momentum, energy, and mass units with c=1 and metric (+,-,-,-). Components are owned, read-only float64 arrays. Physical-particle validation is optional, and numerically risky calculations receive selective precision recovery.

Documentation

The user guide covers the full API, NumPy and Awkward workflows, physics conventions, cache controls, numerical accuracy, examples, and benchmarks.

For development, install a checkout with pip install -e ".[dev]" and run python -m pytest -W error::RuntimeWarning.

License

LVec is distributed under the GNU General Public License v3. See the citation when using LVec in research.

Metadata

Release files for lvec 0.2.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 lvec 0.2.0
File Size Uploaded Provenance Actions
lvec-0.2.0.tar.gz 172.3 kB With provenance Details for lvec-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 261.0 kB

Release files / lvec-0.2.0.tar.gz

Download URL lvec-0.2.0.tar.gz
Size 172.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4273195ae4cb6b0f6d986a2f697153de093365ed39a9fbde9dd7db647a763620
BLAKE2b-256 checksum
How to use checksums
2853f548ea22955ba9bb6e629c9dc811187b5d8eba0537e384e91f2e367d5739
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 1, 2026.

Transparency log

Release files / lvec-0.2.0-py3-none-any.whl

Download URL lvec-0.2.0-py3-none-any.whl
Size 88.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96fc20fef690441eaf0639d09dc98412a072b73e25a6149696227312ca449938
BLAKE2b-256 checksum
How to use checksums
186ed94097227cfa53dc2150fa97c307306a5f0cc38424fa17b20afc51bf318a
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 1, 2026.

Transparency log

Security for lvec 0.2.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 lvec-0.2.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 1, 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