Skip to main content

SoftQP

SoftQP exposes a pinned native OSQP solver with generalized soft-constraint penalties. It preserves the authors' C implementation and Python binding, with a separate import namespace, portable wheels and a reproducible local-source build.

The implementation supports the published generalized projection method and a candidate asymmetric separable elastic extension. Native asymmetric solutions are checked against independently lifted QPs; no novelty or performance improvement is claimed.

Install

Release version 0.3.0. Portable wheels support CPython 3.12 on Windows x64 and Linux x86_64.

python -m pip install "softqp==0.3.0"
python -m pip install "softqp[comparisons]==0.3.0"

The optional comparisons include DAQP, ElastiQP, Clarabel, ProxQP and PIQP. The release procedure describes display and distribution versioning, wheel checks and source provenance.

The CPU learning profile supplies the exact optional CPU PyTorch and PyG dependencies for the learned initializer primitives. The default SDK and comparisons extra do not install PyTorch. This release provides solver and learning primitives. Trained checkpoints, held-out results and performance claims require a separately registered product campaign.

Install from source

A C/C++ compiler and CMake are required for source installation. The source and wheel procedure is documented in releasing.

python -m pip install .
python -m pytest

Penalties

Call softqp.OSQP().setup(...) with the usual QP matrices and bounds, then setup_penalty(...) with per-row types, linear and quadratic weights. Hard constraints use PenaltyType.OSQP_PENALTY_NONE. Quadratic, L1, elastic-net, Huber and grouped norms follow the pinned upstream implementation. See the upstream tutorial.

Provenance

The native source is the A2R-Lab OSQP fork at 2500405a1bc63387721feec64f0c050fa99223dd; the binding is d6df7f987ba40e75bfac338ab19a97b2c92f7334. Both are Apache-2.0. Original attribution is preserved in NOTICE and native/.

The mathematical reference is Schwan, Lew and Plancher (2026). No paper timing is a measurement of this distribution.

Original-space API

softqp.problem.Problem declares a symmetric PSD Hessian, sparse constraint matrix, interval bounds and Penalty arrays. softqp.solvers.solve(problem, method) accepts lifted, generalized (symmetric weights) asymmetric (side-specific elastic weights), or daqp with the comparisons extra (a dense active-set reference). It reports original-space objective components, physical violations, hard-row error, stationarity, dimensions and solver work. Failed solves carry no purported solution.

The asymmetric update supports the CPU builtin backend. Its derivation, sign conventions and limitations are in penalty semantics. softqp.reference preserves the authors' lifting helpers for Huber and grouped penalties, with their MIT notice.

The DAQP adapter preserves original-scale side costs, exports backend settings, and refuses unsupported objectives. See DAQP comparison for its positive-definite and quadratic-side restrictions.

Symmetric penalties use the authors' compact signed/shared-slack lifting helper. Asymmetric penalties use explicit nonnegative lower and upper slacks. Performance comparisons must include the compact symmetric baseline rather than forcing an unnecessarily large general formulation.

Directional coupled peaks (0.2.0)

The published 0.2.0 API adds PeakGroup, PeakProblem, PreparedPeakSolver and solve_peak for disjoint directional peak penalties, native original-row updates and exact compact/row-split/DAQP comparisons. The immutable 0.1.0 wheel predates this API. See directional peak semantics and restrictions. No priority or runtime advantage is established.

Repeated vector updates

from softqp.sessions import PreparedSolver
workspace = PreparedSolver(problem, method="asymmetric")
first = workspace.solve()
workspace.update(q=next_q, lower=next_lower, upper=next_upper)
next_result = workspace.solve()

The workspace owns a copy of the input problem. Matrices, hard/soft row policy, side coefficients and finite-side pattern remain fixed. Invalid updates are rejected before the native workspace changes. problem returns a copy for inspection, and reset() zeros warm iterates while keeping the factorization. Generalized and compact lifted workspaces are also available; lifted workspaces default to the same native backend, with reference_backend="stock" for independent checking.

setup_wall_seconds includes initial validation and assembly; update_wall_seconds includes validation and vector construction. The returned native setup/solve timers keep their backend meaning. A session's elapsed_seconds measures that solve call including original-space evaluation, whereas cold solve() retains its documented timing scope. A benchmark must time its full declared operation explicitly and never sum repeated initial setup fields as if every stream step created a solver. Warm-state reuse does not guarantee a runtime gain.

DaqpWorkspace in softqp.sessions uses DAQP 0.10.3's documented vector update API without resending sense flags, preserving its active state. It retains original-scale side weights, hard-row policy, finite-side pattern and hard equality classification. Random mixed-row streams match independent cold lifting. It provides the same setup/update wall timers as the native workspace, so a comparison need not handicap DAQP by rebuilding it at every frame.

Metadata

Release files for softqp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for softqp 0.3.0
File Size Uploaded Provenance Actions
softqp-0.3.0.tar.gz 490.7 kB With provenance Details for softqp-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for softqp 0.3.0
File Interpreter ABI Platform Actions
softqp-0.3.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for softqp-0.3.0-cp312-cp312-win_amd64.whl
softqp-0.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details for softqp-0.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Total release size: 1.3 MB

Release files / softqp-0.3.0.tar.gz

Download URL softqp-0.3.0.tar.gz
Size 490.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8f605f9541ff890df7f06d2133ae5792cc57b9585aba8264275d0bfc750c6ae4
BLAKE2b-256 checksum
How to use checksums
4a6c6f3150d1c55a0779950448082f4488b2589c2befdbb87f4a38e1de4a4c8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / softqp-0.3.0-cp312-cp312-win_amd64.whl

Download URL softqp-0.3.0-cp312-cp312-win_amd64.whl
Size 478.2 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
6b930ca688e629ee11b7e816c2b160135c817de382082e3876c8504d40da1c89
BLAKE2b-256 checksum
How to use checksums
fd983b4861570a8bc3470166e60291dcf7a69102fdd77dfdc90c02929e460a4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / softqp-0.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL softqp-0.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 326.5 kB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
86c3e68f170f1b8ebf3c23acf1073732956c0bc9308d4ea7101289e05504dda1
BLAKE2b-256 checksum
How to use checksums
3b1be23bf51d2fc12f0f90d96756d5b258824e64ad6d220f5d77602f2fa17ebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for softqp 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for softqp-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page