Registry / ai-ml / daqp
library0.8.7pypypiunverified

DAQP is a dual active-set solver designed for convex quadratic programs (QPs), including mixed-integer QPs (MIQPs) and hierarchical QPs (HQPs). Written in C and library-free, it provides high-performance interfaces for Python, Julia, and MATLAB. It excels at solving small to medium-scale, dense QP and LP problems, particularly those arising in real-time Model Predictive Control (MPC) applications. The current version is 0.8.5, with frequent releases addressing improvements and bug fixes.

pip install daqp
INSTALL
IMPORT
SIG · DAQP
D
daqp
ai-mlpythonv0.8.7
Install
1.7s avg
Import
Disk
19MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.7s · import 0.000s · 21MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

daqp
import daqp
from daqp import solve
The primary interface is typically accessed via the top-level 'daqp' module, with functions like 'daqp.solve'.
solve
daqp.solve(H, f, A, bl, bu)
The main QP solver function is 'solve' within the 'daqp' module.

This example demonstrates how to define and solve a basic quadratic programming problem using the `daqp.solve` function. It minimizes `0.5*x'*H*x + f'*x` subject to `bl <= A*x <= bu` and optional box constraints on `x`. The solution `x` and objective value `fval` are extracted from the result object.

import numpy as np import daqp # Define a simple QP: min 0.5*x'*H*x + f'*x s.t. bl <= A*x <= bu, l <= x <= u H = np.array([[2.0, 0.0], [0.0, 2.0]]) # Hessian (positive definite) f = np.array([-2.0, -2.0]) # Linear term A = np.array([[1.0, 0.0], [0.0, 1.0], [1.0, 1.0]]) # Constraint matrix bl = np.array([0.0, 0.0, 0.0]) # Lower bound for A*x bu = np.array([10.0, 10.0, 1.0]) # Upper bound for A*x # No explicit bounds on x (l, u can be omitted or set to -inf, +inf) x_min = np.full(H.shape[0], -np.inf) # Lower bound for x x_max = np.full(H.shape[0], np.inf) # Upper bound for x # Solve the QP problem # Note: H, f, A, bl, bu are the minimum required arguments. l and u can be passed if needed. result = daqp.solve(H, f, A, bl, bu) if result.exitflag == 1: # exitflag 1 means optimal solution found print(f"Optimal solution x: {result.x}") print(f"Optimal objective value: {result.fval}") print(f"Number of iterations: {result.iter}") else: print(f"Solver failed with exitflag: {result.exitflag}") print(f"Result details: {result}")
Debug
Known issues
breakingThe Python interface was re-implemented in Cython in v0.5.0, potentially breaking existing code that relied on the previous Python bindings. Additionally, the detection of binary constraints from the 'sense' parameter was introduced.
fix
Review your code for any direct C API calls from Python or explicit binary constraint definitions and update to use the new Cython-based API and 'sense' flags for binary constraints if applicable.
affects: <=0.4.x
gotchaDAQP is highly optimized for small to medium-scale, dense quadratic programs. Its performance and suitability for large-scale or sparse problems may be significantly limited. For sparse problems, consider other solvers like OSQP.
fix
Assess the scale and sparsity of your QP problems. For large-scale or sparse problems, evaluate alternative QP solvers designed to exploit sparsity.
affects: All versions
breakingStarting from v0.8.3, the Hessian matrix `H` is explicitly symmetrized in-place (as `0.5 * (H + H.T)`) during the solver setup. If your application relies on an asymmetric `H` being passed and processed in a specific non-symmetrized manner, this behavior change might impact results.
fix
Ensure that your input Hessian `H` is already symmetric, or that the symmetrization `0.5 * (H + H.T)` is acceptable for your problem formulation. If not, consider explicitly symmetrizing `H` before passing it to DAQP to maintain control over the matrix used by the solver.
affects: >=0.8.3
deprecatedFeatures such as warm-starting with primal/dual iterates and setting a `time_limit` were introduced in v0.8.1. These functionalities are not available in earlier versions of the library.
fix
Upgrade to DAQP v0.8.1 or later to utilize warm-starting capabilities (by providing initial primal/dual iterates) and to enforce a wall-clock time limit for the solver.
affects: <0.8.1
Upgrade
Version history
0.8.7latest on PyPI · released May 19, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources
daqp — pip install daqp · libregistry