passagemath-lrslib
raw JSON → 10.8.4 verified Sat May 09 auth: no python
passagemath-lrslib provides a Python interface to lrslib for vertex enumeration and convex hull computation using the reverse search algorithm. Version 10.8.4 supports Python 3.11-3.14. Release cadence follows passagemath releases.
pip install passagemath-lrslib Common errors
error ModuleNotFoundError: No module named 'passagemath.lrslib' ↓
cause Library not installed or installed in wrong environment.
fix
Run
pip install passagemath-lrslib in your active Python environment (3.11-3.14). error ImportError: cannot import name 'polyhedra' from 'passagemath.lrslib' ↓
cause Outdated version of passagemath-lrslib that doesn't export `polyhedra`.
fix
Upgrade to latest version:
pip install --upgrade passagemath-lrslib Warnings
breaking passagemath-lrslib is a replacement for SageMath's lrslib interface. Old imports like `from sage.geometry.polyhedron import Polyhedron` will not work. ↓
fix Use `from passagemath.lrslib import polyhedra` instead.
gotcha The `polyhedra` class expects points as a list of lists (rows=points, columns=coordinates). Transposing the matrix leads to incorrect results. ↓
fix Ensure your input matrix has shape (n_points, n_dimensions).
Imports
- polyhedra wrong
from sage.geometry.polyhedron import Polyhedroncorrectfrom passagemath.lrslib import polyhedra - Lrs
from passagemath.lrslib import Lrs
Quickstart
from passagemath.lrslib import polyhedra
# Define points (rows=points, columns=coordinates)
points = [[0, 0], [1, 0], [0, 1], [1, 1]]
# Compute convex hull vertices
vertices = polyhedra.convex_hull(points)
print(vertices)
# Use environment variable for optional authentication if needed
import os
api_key = os.environ.get('PASSAGEMATH_API_KEY', '')
# Not used in this example; included as placeholder.