vector
Vector classes and utilities
What it is and what it does
Vector is a Python library for working with 2D, 3D, and 4D space-time vectors, designed primarily for performing geometric and momentum calculations on arrays of vectors. It supports multiple coordinate systems (Cartesian, polar, pseudorapidity, etc.) and can work with several data backends including pure Python objects, NumPy structured arrays, Awkward Arrays, SymPy expressions, and Numba-compiled functions. Each backend provides the same interface, allowing you to write code once and run it across different data structures.
The library is part of the Scikit-HEP project and aligns with conventions from ROOT's TLorentzVector and related high-energy physics tools. It offers both geometric and momentum flavors of vectors, where momentum vectors provide physics-specific property names (like transverse momentum) alongside geometric equivalents. This makes it useful for scientific computing workflows that need to manipulate spatial data efficiently without writing explicit loops.
Use it for:
- Perform batch geometric calculations on arrays of 3D points or vectors in scientific simulations.
- Work with 4D space-time vectors and Lorentz transformations in high-energy physics analysis.
- Convert between coordinate systems (Cartesian, polar, pseudorapidity) for physics calculations.
- Integrate vector operations into Numba-compiled functions for performance-critical code paths.
- Manipulate nested or ragged vector data structures using Awkward Arrays backend.
- Perform symbolic vector algebra using SymPy for analytical physics derivations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Vector provides 2D, 3D, and 4D space-time vector operations optimized for working with arrays of vectors rather than individual vectors in loops, with support for multiple coordinate systems and data backends.
Yes. Vector is actively maintained, has no known vulnerabilities, installs with minimal friction, and is well-suited for scientific and physics applications requiring efficient array-based vector operations. The permissive BSD-3-Clause license poses no restrictions. Install it if you need to work with spatial vectors at scale or in high-energy physics contexts.
Install
vector on PyPI
pip
pip install vectoruv
uv add vectorpoetry
poetry add vectorInstalling vector
Before you install
Low friction installation with only numpy and packaging as runtime dependencies. Active maintenance with a recent release (85 days ago) and ongoing repository activity.
License in practice
BSD-3-Clause is a permissive license allowing commercial and private use with minimal restrictions, requiring only preservation of copyright and license notices.
Quickstart
pip install vector
import vector
v = vector.obj(x=1, y=2, z=3)
print(v.magnitude)
Requires Python 3.10 or later.
Verify before relying
- Whether optional backends (Awkward Arrays, SymPy, Numba) are automatically available or require separate installation.
- Performance characteristics when working with very large arrays compared to raw NumPy operations.
- Whether the optree integration for PyTree support is installed by default or as an optional dependency.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numpy, packaging |
| Maintenance | actively maintained — 85 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 685,620/month — #5,353 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: vector-1.8.1-py3-none-any.whl
Keywords: vector
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
euclid3Provides 2D and 3D vector, matrix, quaternion,…
unclear · top 15,000 on PyPI
fastjetFastJet provides Python bindings to the FastJet…
permissive · top 15,000 on PyPI
shapelyShapely provides Python tools for creating,…
permissive · top 1,000 on PyPI
uproot3-methodsAdds physics-oriented methods to ROOT file…
permissive · top 15,000 on PyPI
awkward0Manipulates complex, non-rectangular data…
permissive · top 15,000 on PyPI
opensimplexGenerates OpenSimplex noise across 2D, 3D, and…
permissive · top 15,000 on PyPI
spatial_imagespatial-image provides an N-dimensional spatial…
permissive · top 15,000 on PyPI
awkward-cppProvides compiled C++ kernels and extensions…
permissive · top 5,000 on PyPI
uproot3Reads and writes ROOT files (the data format…
permissive · top 15,000 on PyPI
mt2Computes stransverse mass (MT2) for particle…
permissive · top 15,000 on PyPI