skillfed

vector

Vector classes and utilities

vector v1.8.1 685.6K downloads/30d#5,353 on PyPI99
Permissive license BSD-3-Clause Active released

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 vector

uv

uv add vector

poetry

poetry add vector

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Free Threading :: 3 - StableTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: MathematicsTopic :: Scientific/Engineering :: PhysicsTyping :: Typed

Tags

2D 3D vector math arrayslorentz vector operationsspatial vector calculationshigh energy physics vectorsvectorized geometric operationscoordinate system transformationsnumpy awkward array vectorsmomentum and energy calculations
hep-physicsspatial-matharray-computing

More Scientific/Engineering packages