Vector

Vector: JIT-compilable mathematical manipulations of ragged Lorentz vectors - Published in JOSS (2025)

https://github.com/scikit-hep/vector

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 8 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
    4 of 25 committers (16.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

scikit-hep vector

Keywords from Contributors

hep asymptotic-formulas closember cls frequentist-statistics hep-ex high-energy-physics histfactory jax statistical-inference
Last synced: 4 months ago · JSON representation ·

Repository

Vector classes and utilities

Basic Info
  • Host: GitHub
  • Owner: scikit-hep
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Homepage: https://vector.readthedocs.io
  • Size: 1.81 MB
Statistics
  • Stars: 93
  • Watchers: 10
  • Forks: 31
  • Open Issues: 27
  • Releases: 27
Topics
scikit-hep vector
Created about 6 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing License Citation

README.md

Vector logo

Vector: arrays of 2D, 3D, and Lorentz vectors

DOI DOI Scikit-HEP

Actions Status Documentation Status pre-commit.ci status codecov percentage

PyPI platforms PyPI version Conda latest release

LICENSE GitHub Discussion Gitter

Installation

You can install Vector with pip and conda.

bash pip install vector

Introduction

Vector is a Python library for 2D and 3D spatial vectors, as well as 4D space-time vectors. It is especially intended for performing geometric calculations on arrays of vectors, rather than one vector at a time in a Python for loop.

Vector is part of the Scikit-HEP project, High Energy Physics (HEP) tools in Python.

Coordinate systems

Vectors may be expressed in any of these coordinate systems:

  • the azimuthal plane may be Cartesian x y or polar rho ($\rho$) phi ($\phi$)
  • the longitudinal axis may be Cartesian z, polar theta ($\theta$), or pseudorapidity eta ($\eta$)
  • the temporal component for space-time vectors may be Cartesian t or proper time tau ($\tau$)

in any combination. (That is, 4D vectors have 2×3×2 = 12 distinct coordinate systems.)

Diagram of coordinate systems

Backends

Vectors may be included in any of these data types:

Each of these "backends" provides the same suite of properties and methods, through a common "compute" library.

Geometric versus momentum

Finally, vectors come in two flavors:

  • geometric: only one name for each property or method
  • momentum: same property or method can be accessed with several synonyms, such as pt ($p_T$, transverse momentum) for the azimuthal magnitude rho ($\rho$) and energy and mass for the Cartesian time t and proper time tau ($\tau$).

Familiar conventions

Names and coordinate conventions were chosen to align with ROOT's TLorentzVector and Math::LorentzVector, as well as scikit-hep/math, uproot-methods TLorentzVector, henryiii/hepvector, and coffea.nanoevents.methods.vector.

Getting help

Contributing to Vector

If you want to contribute to Vector, pull requests are welcome!

Please install the latest version of the main branch from source or a fork:

bash git clone https://github.com/scikit-hep/vector.git cd vector pip install -e .

Refer to CONTRIBUTING.md for more.

Citing Vector

To cite Vector, please use DOI

bib @article{Chopra2025, doi = {10.21105/joss.07791}, url = {https://doi.org/10.21105/joss.07791}, year = {2025}, publisher = {The Open Journal}, volume = {10}, number = {109}, pages = {7791}, author = {Saransh Chopra and Henry Schreiner and Eduardo Rodrigues and Jonas Eschle and Jim Pivarski}, title = {Vector: JIT-compilable mathematical manipulations of ragged Lorentz vectors}, journal = {Journal of Open Source Software} }

Documentation

Tutorials

Vector constructors

Vector functions

More ways to learn

Contributors

Thanks goes to these wonderful people (emoji key):

Jim Pivarski
Jim Pivarski

🚧 💻 📖
Henry Schreiner
Henry Schreiner

🚧 💻 📖
Eduardo Rodrigues
Eduardo Rodrigues

🚧 💻 📖
N!no
N!no

📖
Peter Fackeldey
Peter Fackeldey

📖
Luke Kreczko
Luke Kreczko

💻
Nicholas Smith
Nicholas Smith

🤔
Jonas Eschle
Jonas Eschle

🤔
Saransh Chopra
Saransh Chopra

🚧 💻 📖

This project follows the all-contributors specification. Contributions of any kind welcome! See CONTRIBUTING.md for information on setting up a development environment.

Acknowledgements

This library was primarily developed by Saransh Chopra, Henry Schreiner, Jim Pivarski, Eduardo Rodrigues, and Jonas Eschle.

Support for this work was provided by the National Science Foundation cooperative agreement OAC-1836650 and PHY-2323298 (IRIS-HEP) and OAC-1450377 (DIANA/HEP). Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.

Owner

  • Name: Scikit-HEP Project
  • Login: scikit-hep
  • Kind: organization
  • Email: scikit-hep-forum@googlegroups.com

A community project for High Energy Physics data analysis in Python

JOSS Publication

Vector: JIT-compilable mathematical manipulations of ragged Lorentz vectors
Published
May 23, 2025
Volume 10, Issue 109, Page 7791
Authors
Saransh Chopra ORCID
University College London, Princeton University
Henry Schreiner ORCID
Princeton University
Eduardo Rodrigues ORCID
University of Liverpool
Jonas Eschle ORCID
Syracuse University
Jim Pivarski ORCID
Princeton University
Editor
Axel Donath ORCID
Tags
vector algebra high energy physics

Citation (CITATION.cff)

cff-version: "1.2.0"
authors:
- family-names: Chopra
  given-names: Saransh
  orcid: "https://orcid.org/0000-0003-3046-7675"
- family-names: Schreiner
  given-names: Henry
  orcid: "https://orcid.org/0000-0002-7833-783X"
- family-names: Rodrigues
  given-names: Eduardo
  orcid: "https://orcid.org/0000-0003-2846-7625"
- family-names: Eschle
  given-names: Jonas
  orcid: "https://orcid.org/0000-0002-7312-3699"
- family-names: Pivarski
  given-names: Jim
  orcid: "https://orcid.org/0000-0002-6649-343X"
contact:
- family-names: Pivarski
  given-names: Jim
  orcid: "https://orcid.org/0000-0002-6649-343X"
doi: 10.5281/zenodo.15263860
message: If you use this software, please cite our article in the
  Journal of Open Source Software.
preferred-citation:
  authors:
  - family-names: Chopra
    given-names: Saransh
    orcid: "https://orcid.org/0000-0003-3046-7675"
  - family-names: Schreiner
    given-names: Henry
    orcid: "https://orcid.org/0000-0002-7833-783X"
  - family-names: Rodrigues
    given-names: Eduardo
    orcid: "https://orcid.org/0000-0003-2846-7625"
  - family-names: Eschle
    given-names: Jonas
    orcid: "https://orcid.org/0000-0002-7312-3699"
  - family-names: Pivarski
    given-names: Jim
    orcid: "https://orcid.org/0000-0002-6649-343X"
  date-published: 2025-05-23
  doi: 10.21105/joss.07791
  issn: 2475-9066
  issue: 109
  journal: Journal of Open Source Software
  publisher:
    name: Open Journals
  start: 7791
  title: "Vector: JIT-compilable mathematical manipulations of ragged
    Lorentz vectors"
  type: article
  url: "https://joss.theoj.org/papers/10.21105/joss.07791"
  volume: 10
title: "Vector: JIT-compilable mathematical manipulations of ragged
  Lorentz vectors"

Papers & Mentions

Total mentions: 2

Elevated Heart Rate is Associated with Cardiac Denervation in Patients with Heart Failure: A 123-Iodine-MIBG Myocardial Scintigraphy Study
Last synced: 2 months ago
Genome-wide comparative analysis of DNA methylation between soybean cytoplasmic male-sterile line NJCMS5A and its maintainer NJCMS5B
Last synced: 2 months ago

GitHub Events

Total
  • Create event: 60
  • Release event: 3
  • Issues event: 33
  • Watch event: 13
  • Delete event: 62
  • Member event: 1
  • Issue comment event: 93
  • Push event: 153
  • Pull request review event: 97
  • Pull request review comment event: 44
  • Pull request event: 152
  • Fork event: 6
Last Year
  • Create event: 60
  • Release event: 3
  • Issues event: 33
  • Watch event: 13
  • Delete event: 62
  • Member event: 1
  • Issue comment event: 93
  • Push event: 153
  • Pull request review event: 97
  • Pull request review comment event: 44
  • Pull request event: 152
  • Fork event: 6

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 484
  • Total Committers: 25
  • Avg Commits per committer: 19.36
  • Development Distribution Score (DDS): 0.638
Past Year
  • Commits: 100
  • Committers: 12
  • Avg Commits per committer: 8.333
  • Development Distribution Score (DDS): 0.53
Top Committers
Name Email Commits
pre-commit-ci[bot] 6****] 175
Saransh Chopra s****1@g****m 98
Henry Schreiner h****r@c****h 80
dependabot[bot] 4****] 58
Jim Pivarski j****i 38
eduardo-rodrigues e****s@c****h 6
Peter Fackeldey f****r@g****m 4
Aditi Juneja 9****a 3
Matthew Feickert m****t@c****h 3
Naman Priyadarshi 7****i 3
Florian Bruggisser f****n@b****h 2
Angus Hollands g****5@g****m 1
Ankush Chudiwal 1****8 1
Benjamin Fischer b****s@c****h 1
David Pérez-Suárez d****o@g****m 1
Frantic Rabbit 1****t 1
HP (Hetav) 6****5 1
Luke Kreczko l****o@g****m 1
Michael Eliachevitch m****h@p****e 1
N!no n****l@g****m 1
Raymond Ehlers r****s@g****m 1
Sinclert Pérez S****t@h****m 1
The Gitter Badger b****r@g****m 1
Yogendra Sharma E****a@g****m 1
p-mishra1 8****1 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 65
  • Total pull requests: 422
  • Average time to close issues: 5 months
  • Average time to close pull requests: 5 days
  • Total issue authors: 26
  • Total pull request authors: 21
  • Average comments per issue: 1.91
  • Average comments per pull request: 1.05
  • Merged pull requests: 375
  • Bot issues: 2
  • Bot pull requests: 237
Past Year
  • Issues: 22
  • Pull requests: 144
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 4 days
  • Issue authors: 14
  • Pull request authors: 13
  • Average comments per issue: 1.55
  • Average comments per pull request: 0.52
  • Merged pull requests: 123
  • Bot issues: 1
  • Bot pull requests: 90
Top Authors
Issue Authors
  • Saransh-cpp (28)
  • jpivarski (6)
  • simonthor (3)
  • agoose77 (2)
  • ikrommyd (2)
  • acampove (2)
  • masonproffitt (2)
  • pre-commit-ci[bot] (1)
  • veprbl (1)
  • matthewfeickert (1)
  • jpata (1)
  • lgray (1)
  • denehoffman (1)
  • Superharz (1)
  • nhartman94 (1)
Pull Request Authors
  • pre-commit-ci[bot] (182)
  • Saransh-cpp (143)
  • dependabot[bot] (82)
  • Schefflera-Arboricola (10)
  • henryiii (10)
  • pfackeldey (8)
  • jpivarski (6)
  • Ankush1oo8 (4)
  • matthewfeickert (3)
  • kyleniemeyer (2)
  • allcontributors[bot] (2)
  • pandyah5 (2)
  • Yogendra0Sharma (2)
  • Naman-Priyadarshi (2)
  • meliache (1)
Top Labels
Issue Labels
bug (unverified) (17) feature (11) good first issue (11) bug (11) docs (9) hacktoberfest (6) tests (5) cleanup (2) help wanted (2) dependencies (1) wontfix (1)
Pull Request Labels
dependencies (88) docs (17) github_actions (13) bug (7) feature (4) tests (1) cleanup (1)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 588,877 last-month
  • Total docker downloads: 386
  • Total dependent packages: 19
    (may contain duplicates)
  • Total dependent repositories: 55
    (may contain duplicates)
  • Total versions: 50
  • Total maintainers: 4
pypi.org: vector

Vector classes and utilities

  • Versions: 28
  • Dependent Packages: 17
  • Dependent Repositories: 50
  • Downloads: 588,877 Last month
  • Docker Downloads: 386
Rankings
Dependent packages count: 0.8%
Downloads: 1.3%
Dependent repos count: 2.1%
Docker downloads count: 3.1%
Average: 3.9%
Forks count: 8.0%
Stargazers count: 8.3%
Last synced: 4 months ago
spack.io: py-vector

Vector classes and utilities

  • Versions: 15
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Forks count: 20.5%
Stargazers count: 20.9%
Average: 24.7%
Dependent packages count: 57.3%
Maintainers (1)
Last synced: 4 months ago
conda-forge.org: vector
  • Versions: 7
  • Dependent Packages: 2
  • Dependent Repositories: 5
Rankings
Dependent repos count: 14.8%
Dependent packages count: 19.6%
Average: 27.8%
Forks count: 37.5%
Stargazers count: 39.5%
Last synced: 5 months ago

Dependencies

pyproject.toml pypi
  • importlib-metadata >=0.22; python_version < "3.8"
  • numpy >=1.13.3
  • packaging >=19
  • typing-extensions python_version < "3.8"
.github/workflows/cd.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/upload-artifact v3 composite
  • pypa/gh-action-pypi-publish v1.6.4 composite
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v3.1.1 composite
  • pre-commit/action v3.0.0 composite
.github/workflows/notebooks.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
environment.yml conda
  • jupyterlab >=1.2
  • nb_conda_kernels
  • numba >=0.50
  • numpy >=1.13.3
  • pip >=18
  • pytest >=6
  • root >=6.18.04