{"id":13869851,"url":"https://github.com/scikit-hep/vector","last_synced_at":"2026-02-04T13:44:48.774Z","repository":{"id":37549226,"uuid":"217698030","full_name":"scikit-hep/vector","owner":"scikit-hep","description":"Vector classes and utilities","archived":false,"fork":false,"pushed_at":"2025-05-12T19:52:17.000Z","size":1713,"stargazers_count":88,"open_issues_count":27,"forks_count":32,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-12T20:51:55.383Z","etag":null,"topics":["scikit-hep","vector"],"latest_commit_sha":null,"homepage":"https://vector.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scikit-hep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-26T11:20:23.000Z","updated_at":"2025-05-12T19:52:19.000Z","dependencies_parsed_at":"2023-02-19T15:35:35.701Z","dependency_job_id":"5e9eacb3-dda8-4455-8d47-7d6b095b51f3","html_url":"https://github.com/scikit-hep/vector","commit_stats":{"total_commits":280,"total_committers":20,"mean_commits":14.0,"dds":0.7107142857142856,"last_synced_commit":"0a855f14e6b4b621caa6a1b2de88ac7b9bd02924"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scikit-hep%2Fvector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scikit-hep%2Fvector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scikit-hep%2Fvector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scikit-hep%2Fvector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scikit-hep","download_url":"https://codeload.github.com/scikit-hep/vector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254453667,"owners_count":22073618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["scikit-hep","vector"],"created_at":"2024-08-05T20:01:19.713Z","updated_at":"2026-02-04T13:44:48.768Z","avatar_url":"https://github.com/scikit-hep.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":["Pure physics"],"readme":"\u003cimg alt=\"Vector logo\" width=\"50%\" src=\"https://raw.githubusercontent.com/scikit-hep/vector/main/docs/_images/LogoSrc.svg\"/\u003e\n\n# Vector: arrays of 2D, 3D, and Lorentz vectors\n\n[![DOI][zenodo-badge]][zenodo-link]\n[![DOI][joss-badge]][joss-link]\n[![Scikit-HEP][sk-badge]][sk-link]\n\n[![Actions Status][actions-badge]][actions-link]\n[![Documentation Status][rtd-badge]][rtd-link]\n[![pre-commit.ci status][pre-commit-badge]][pre-commit-link]\n[![codecov percentage][codecov-badge]][codecov-link]\n\n[![PyPI platforms][pypi-platforms]][pypi-link]\n[![PyPI version][pypi-version]][pypi-link]\n[![Conda latest release][conda-version]][conda-link]\n\n[![LICENSE][license-badge]][license-link]\n[![GitHub Discussion][github-discussions-badge]][github-discussions-link]\n[![Gitter][gitter-badge]][gitter-link]\n\n## Installation\n\nYou can install Vector with [pip](https://pypi.org/project/vector/) and [conda](https://anaconda.org/conda-forge/vector).\n\n```bash\npip install vector\n```\n\n## Introduction\n\nVector 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.\n\nVector is part of the [Scikit-HEP project](https://scikit-hep.org/), High Energy Physics (HEP) tools in Python.\n\n### Coordinate systems\n\nVectors may be expressed in any of these coordinate systems:\n\n- the azimuthal plane may be Cartesian `x` `y` or polar `rho` ($\\rho$) `phi` ($\\phi$)\n- the longitudinal axis may be Cartesian `z`, polar `theta` ($\\theta$), or pseudorapidity `eta` ($\\eta$)\n- the temporal component for space-time vectors may be Cartesian `t` or proper time `tau` ($\\tau$)\n\nin any combination. (That is, 4D vectors have 2×3×2 = 12 distinct coordinate systems.)\n\n\u003cimg alt=\"Diagram of coordinate systems\" width=\"100%\" src=\"https://raw.githubusercontent.com/scikit-hep/vector/main/docs/_images/coordinate-systems.svg\"/\u003e\n\n### Backends\n\nVectors may be included in any of these data types:\n\n- [vector.obj](https://vector.readthedocs.io/en/latest/src/make_object.html) objects (pure Python)\n- [NumPy structured arrays](https://numpy.org/doc/stable/user/basics.rec.html) of vectors\n- [Awkward Arrays](https://awkward-array.org/) of vectors (possibly within variable-length lists or nested record structures)\n- [SymPy expressions](https://www.sympy.org/en/index.html) for symbolic (non-numeric) manipulations\n- In [Numba-compiled functions](https://numba.pydata.org/), with [vector.obj](https://vector.readthedocs.io/en/latest/src/make_object.html) objects or Awkward Arrays\n\nEach of these \"backends\" provides the same suite of properties and methods, through a common \"compute\" library.\n\n### Integrations\n\nOptionally, the vector package provides integration with other libraries. Currently, this includes:\n\n- [PyTree integrations](https://vector.readthedocs.io/en/latest/src/pytree.html) using the [optree](https://github.com/metaopt/optree) package.\n\n### Geometric versus momentum\n\nFinally, vectors come in two flavors:\n\n- geometric: only one name for each property or method\n- 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$).\n\n### Familiar conventions\n\nNames and coordinate conventions were chosen to align with [ROOT](https://root.cern/)'s [TLorentzVector](https://root.cern.ch/doc/master/classTLorentzVector.html) and [Math::LorentzVector](https://root.cern.ch/doc/master/classROOT_1_1Math_1_1LorentzVector.html), as well as [scikit-hep/math](https://github.com/scikit-hep/scikit-hep/tree/master/skhep/math), [uproot-methods TLorentzVector](https://github.com/scikit-hep/uproot3-methods/blob/master/uproot3_methods/classes/TLorentzVector.py), [henryiii/hepvector](https://github.com/henryiii/hepvector), and [coffea.nanoevents.methods.vector](https://coffea-hep.readthedocs.io/en/latest/modules/coffea.nanoevents.methods.vector.html).\n\n## Getting help\n\n- Source code on GitHub: [scikit-hep/vector](https://github.com/scikit-hep/vector)\n- Report bugs and request features on the [GitHub Issues page](https://github.com/scikit-hep/vector/issues)\n- Ask questions on the [GitHub Discussions page](https://github.com/scikit-hep/vector/discussions)\n- Real-time chat on Gitter: [Scikit-HEP/Vector](https://gitter.im/Scikit-HEP/vector)\n\n## Contributing to Vector\n\nIf you want to contribute to Vector, [pull requests](https://github.com/scikit-hep/vector/pulls) are welcome!\n\nPlease install the latest version of the `main` branch from source or a fork:\n\n```bash\ngit clone https://github.com/scikit-hep/vector.git\ncd vector\npip install -e .\n```\n\nRefer to [CONTRIBUTING.md](https://github.com/scikit-hep/vector/blob/main/.github/CONTRIBUTING.md) for more.\n\n## Citing Vector\n\nTo cite Vector, please use [![DOI][joss-badge]][joss-link]\n\n```bib\n@article{Chopra2025,\ndoi = {10.21105/joss.07791},\nurl = {https://doi.org/10.21105/joss.07791},\nyear = {2025}, publisher = {The Open Journal},\nvolume = {10},\nnumber = {109},\npages = {7791},\nauthor = {Saransh Chopra and Henry Schreiner and Eduardo Rodrigues and Jonas Eschle and Jim Pivarski},\ntitle = {Vector: JIT-compilable mathematical manipulations of ragged Lorentz vectors},\njournal = {Journal of Open Source Software}\n}\n```\n\n## Documentation\n\n### Tutorials\n\n- [Vector objects](https://vector.readthedocs.io/en/latest/src/object.html)\n- [NumPy arrays of vectors](https://vector.readthedocs.io/en/latest/src/numpy.html)\n- [Awkward Arrays of vectors](https://vector.readthedocs.io/en/latest/src/awkward.html)\n- [Compiling functions on vectors with Numba](https://vector.readthedocs.io/en/latest/src/numba.html)\n- [Vector expressions with SymPy](https://vector.readthedocs.io/en/latest/src/sympy.html)\n\n### Vector constructors\n\n- [Making vector objects](https://vector.readthedocs.io/en/latest/src/make_object.html)\n- [Making NumPy arrays of vectors](https://vector.readthedocs.io/en/latest/src/make_numpy.html)\n- [Making Awkward Arrays of vectors](https://vector.readthedocs.io/en/latest/src/make_awkward.html)\n- [Making SymPy vector expressions](https://vector.readthedocs.io/en/latest/src/make_sympy.html)\n\n### Vector functions\n\n- [Interface for all vectors](https://vector.readthedocs.io/en/latest/src/common.html)\n- [Interface for 2D vectors](https://vector.readthedocs.io/en/latest/src/vector2d.html)\n- [Interface for 3D vectors](https://vector.readthedocs.io/en/latest/src/vector3d.html)\n- [Interface for 4D vectors](https://vector.readthedocs.io/en/latest/src/vector4d.html)\n- [Interface for 2D momentum](https://vector.readthedocs.io/en/latest/src/momentum2d.html)\n- [Interface for 3D momentum](https://vector.readthedocs.io/en/latest/src/momentum3d.html)\n- [Interface for 4D momentum](https://vector.readthedocs.io/en/latest/src/momentum4d.html)\n\n### Integrations\n\n- [PyTree integration API](https://vector.readthedocs.io/en/latest/src/pytree_api.html)\n\n### More ways to learn\n\n- [Papers and talks](https://vector.readthedocs.io/en/latest/src/talks.html)\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/jpivarski\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1852447?v=4?s=100\" width=\"100px;\" alt=\"Jim Pivarski\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJim Pivarski\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-jpivarski\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"https://github.com/scikit-hep/vector/commits?author=jpivarski\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/scikit-hep/vector/commits?author=jpivarski\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/henryiii\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/4616906?v=4?s=100\" width=\"100px;\" alt=\"Henry Schreiner\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eHenry Schreiner\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-henryiii\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"https://github.com/scikit-hep/vector/commits?author=henryiii\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/scikit-hep/vector/commits?author=henryiii\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/eduardo-rodrigues\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/5013581?v=4?s=100\" width=\"100px;\" alt=\"Eduardo Rodrigues\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eEduardo Rodrigues\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-eduardo-rodrigues\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"https://github.com/scikit-hep/vector/commits?author=eduardo-rodrigues\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/scikit-hep/vector/commits?author=eduardo-rodrigues\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://lovelybuggies.com.cn/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/29083689?v=4?s=100\" width=\"100px;\" alt=\"N!no\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eN!no\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/scikit-hep/vector/commits?author=LovelyBuggies\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/pfackeldey\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/18463582?v=4?s=100\" width=\"100px;\" alt=\"Peter Fackeldey\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ePeter Fackeldey\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/scikit-hep/vector/commits?author=pfackeldey\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/kreczko\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1213276?v=4?s=100\" width=\"100px;\" alt=\"Luke Kreczko\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLuke Kreczko\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/scikit-hep/vector/commits?author=kreczko\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/nsmith-\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/6587412?v=4?s=100\" width=\"100px;\" alt=\"Nicholas Smith\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNicholas Smith\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-nsmith-\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/mayou36\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/17454848?v=4?s=100\" width=\"100px;\" alt=\"Jonas Eschle\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJonas Eschle\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-mayou36\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://saransh-cpp.github.io/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/74055102?v=4?s=100\" width=\"100px;\" alt=\"Saransh Chopra\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSaransh Chopra\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-Saransh-cpp\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"https://github.com/scikit-hep/vector/commits?author=Saransh-cpp\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/scikit-hep/vector/commits?author=Saransh-cpp\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the\n[all-contributors](https://github.com/all-contributors/all-contributors)\nspecification. Contributions of any kind welcome! See\n[CONTRIBUTING.md](./.github/CONTRIBUTING.md) for information on setting up a\ndevelopment environment.\n\n## Acknowledgements\n\nThis library was primarily developed by Saransh Chopra, Henry Schreiner, Jim Pivarski, Eduardo Rodrigues, and Jonas Eschle.\n\nSupport for this work was provided by the National Science Foundation cooperative agreement [OAC-1836650](https://www.nsf.gov/awardsearch/showAward?AWD_ID=1836650) and [PHY-2323298](https://www.nsf.gov/awardsearch/showAward?AWD_ID=2323298) (IRIS-HEP) and [OAC-1450377](https://www.nsf.gov/awardsearch/showAward?AWD_ID=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.\n\n[actions-badge]: https://github.com/scikit-hep/vector/actions/workflows/ci.yml/badge.svg\n[actions-link]: https://github.com/scikit-hep/vector/actions\n[codecov-badge]: https://codecov.io/gh/scikit-hep/vector/branch/main/graph/badge.svg?token=YBv60ueORQ\n[codecov-link]: https://codecov.io/gh/scikit-hep/vector\n[conda-version]: https://img.shields.io/conda/vn/conda-forge/vector.svg\n[conda-link]: https://github.com/conda-forge/vector-feedstock\n[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions\u0026message=Ask\u0026color=blue\u0026logo=github\n[github-discussions-link]: https://github.com/scikit-hep/vector/discussions\n[gitter-badge]: https://badges.gitter.im/Scikit-HEP/vector.svg\n[gitter-link]: https://gitter.im/Scikit-HEP/vector?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n[joss-badge]: https://joss.theoj.org/papers/10.21105/joss.07791/status.svg\n[joss-link]: https://doi.org/10.21105/joss.07791\n[license-badge]: https://img.shields.io/badge/License-BSD_3--Clause-blue.svg\n[license-link]: https://opensource.org/licenses/BSD-3-Clause\n[pre-commit-badge]: https://results.pre-commit.ci/badge/github/scikit-hep/vector/main.svg\n[pre-commit-link]: https://results.pre-commit.ci/repo/github/scikit-hep/vector\n[pypi-link]: https://pypi.org/project/vector/\n[pypi-platforms]: https://img.shields.io/pypi/pyversions/vector\n[pypi-version]: https://badge.fury.io/py/vector.svg\n[rtd-badge]: https://readthedocs.org/projects/vector/badge/?version=latest\n[rtd-link]: https://vector.readthedocs.io/en/latest/?badge=latest\n[sk-badge]: https://scikit-hep.org/assets/images/Scikit--HEP-Project-blue.svg\n[sk-link]: https://scikit-hep.org/\n[zenodo-badge]: https://zenodo.org/badge/DOI/10.5281/zenodo.15263860.svg\n[zenodo-link]: https://zenodo.org/records/15263860\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscikit-hep%2Fvector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscikit-hep%2Fvector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscikit-hep%2Fvector/lists"}