Install with pip
The dense routines need only NumPy:
pip install peigentuxThe sparse routines (peigen.sparse, sparse Cholesky, iterative solvers) also need SciPy. The sparse extra installs it:
pip install "peigentux[sparse]"To pin it in a project, add peigentux>=2.1 to your requirements or to dependencies in pyproject.toml. With uv: uv add "peigentux[sparse]".
Supported platforms
Every wheel is built and tested in CI, and the tests fail if BLAS/LAPACK wasn't linked, so a slow fallback build can't ship by accident.
| Operating system | Architectures | BLAS / LAPACK | Python |
|---|---|---|---|
| Linux (glibc 2.28+, manylinux_2_28) | x86_64, aarch64 | OpenBLAS, bundled in the wheel | CPython 3.10–3.15 |
| macOS | arm64 (Apple silicon), x86_64 (Intel) | Apple Accelerate | CPython 3.10–3.15 |
Not yet available as wheels:
- Windows. Not built or tested yet.
- Alpine and other musl-based Linux. pip falls back to the source distribution (see below).
- Free-threaded Python (
python3.14t,python3.15t). The extension doesn't declare support for running without the GIL yet.
Check your install
Print what was compiled into the extension you installed:
python -c "import peigen; peigen.show_build_config()"pEigen build configuration -------------------------- version: 2.1.0 eigen_version: 5.0.1-dev+master build_type: Release blas_enabled: True blas_backend: accelerate lapack_enabled: True lapack_backend: accelerate openmp_enabled: False vectorization_enabled: True eigen_mpl2_only: True
If lapack_enabled is False, everything still works, but dense solves, SVD and eigh use Eigen's own kernels, which are slower for large matrices. In code, peigen.build_config() returns the same information as a dict.
Build from source
On platforms without a wheel, pip builds the source distribution automatically. That needs:
- a C++17 compiler and CMake 3.18 or newer
- BLAS/LAPACK development files: optional, but recommended. On Linux, install OpenBLAS (for example
sudo apt-get install libopenblas-dev) and point CMake at it:
CMAKE_ARGS="-DBLA_VENDOR=OpenBLAS" pip install --no-binary peigentux peigentuxTo work on pEigen itself, clone the repository with its Eigen submodule and install in editable mode:
git clone --recurse-submodules https://github.com/TtheBC01/pEigen.git
cd pEigen
python -m pip install -e ".[test,sparse]"
pytestSee DEV.md for tests, benchmarks and release steps.
Why two names?
The name peigen on PyPI belongs to an unrelated project, so this one is distributed as peigentux (after eigen.tuxfamily.org). The import name is unchanged:
import peigen
from peigen import linalg, sparse, decomppip install peigen installs that other project, not this one.
Coming from pEigen 1.0 (the Boost.Python libpeigen module)? 2.0 was a rewrite; the changelog has a migration table.