--- id: qpsolvers version: "4.13.0" license: unclear license_treatment: copyleft maintenance: active --- # qpsolvers — Quadratic programming solvers in Python with a unified API. License: copyleft · Maintenance: active · Downloads: 831.7K/mo ## What it is and what it does qpsolvers is a wrapper library that provides a single `solve_qp` function to solve convex quadratic programs with multiple backend solvers. It abstracts away the differences between solvers like OSQP, ProxQP, Clarabel, and others, allowing you to write solver-agnostic code and switch backends by changing a keyword argument. The library accepts problem matrices as NumPy arrays (for dense solvers) or SciPy CSC sparse matrices (for sparse solvers), and returns the optimal solution vector or None if the problem is infeasible. The package also offers a `solve_problem` function that returns not just the primal solution but also dual multipliers and other solver-computed quantities. It supports standard QP form with linear inequality constraints (Gx ≤ h), equality constraints (Ax = b), and variable bounds (lb ≤ x ≤ ub). The library automatically detects which solvers are available on your system and lists them in `qpsolvers.available_solvers`, letting you choose based on your problem structure and performance needs. Use it for: - Solve constrained least-squares problems by converting them to QP form with appropriate P and q matrices. - Implement model predictive control or trajectory optimization in robotics by solving QPs at each time step. - Benchmark multiple QP solvers on the same problem to find the fastest or most accurate for your use case. - Add penalty terms (ridge regression, LASSO-like regularization) by incorporating them into the QP objective. - Extract dual multipliers and sensitivity information for post-solution analysis or warm-starting. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a unified Python interface to solve convex quadratic programs using a choice of backend solvers, returning either the primal solution or primal and dual results. Yes. The package is actively maintained, has low install friction, no known vulnerabilities, and solves a well-defined numerical problem with a clean API. The copyleft license requires attention if you plan to distribute derivative works, but the library itself and its optional backends cover both open-source and commercial use cases. Install it if you need to solve convex quadratic programs or want to experiment with multiple QP solvers. ## Install pip install qpsolvers uv add qpsolvers poetry add qpsolvers ## Installing qpsolvers Before you install: Low friction install with only numpy and scipy as runtime dependencies. Active maintenance with a recent release (26 days old) and steady repository activity. License in practice: Licensed under LGPLv3 (copyleft). Derivative works must be distributed under compatible terms; proprietary use requires careful review or use of optional commercial solver backends. Quickstart: import numpy as np from qpsolvers import solve_qp P = np.array([[4.0, 1.0], [1.0, 3.0]]) q = np.array([1.0, 1.0]) G = np.array([[1.0, 1.0], [1.0, -1.0]]) h = np.array([1.0, 1.0]) x = solve_qp(P, q, G, h, solver="proxqp") print(x) Requires Python 3.10 or later. Matrix P must be positive semi-definite (convex); some solvers require positive definite (strictly convex). Verify before relying: - Whether all backend solvers are automatically installed or require separate installation steps - Performance characteristics and solver selection guidance for specific problem classes - Support for non-convex quadratic programs or workarounds ## Package facts - License: not declared (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 831.7K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags quadratic programming solver, convex QP solver, numerical optimization, solve_qp function, QP backend abstraction, linear constraints optimization, matrix optimization, optimization, numerical-computing, solver-abstraction [View on SkillFed](https://skillfed.io/packages/qpsolvers) · [View on PyPI](https://pypi.org/project/qpsolvers/)