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

Version 0.1.0 is published on PyPI. Portable wheels support CPython 3.12 on Windows x64 and Linux x86_64.

python -m pip install "softqp==0.1.0"
python -m pip install "softqp[comparisons]==0.1.0"  # optional DAQP and ElastiQP adapters

The GitHub release contains the same source archive and wheels, with SHA-256 checksums. Every public file was matched to the tagged workflow output, and a fresh public-index Windows install passed all 94 native tests and the installed-license checks. Linux and Windows wheels pass isolated installed tests in the release workflow.

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 development)

The source development 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 currently published 0.1.0 wheel does not contain 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.2.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.2.0
File Size Uploaded Provenance Actions
softqp-0.2.0.tar.gz 384.7 kB With provenance Details for softqp-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for softqp 0.2.0
File Interpreter ABI Platform Actions
softqp-0.2.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for softqp-0.2.0-cp312-cp312-win_amd64.whl
softqp-0.2.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.2.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Total release size: 1.1 MB

Release files / softqp-0.2.0.tar.gz

Download URL softqp-0.2.0.tar.gz
Size 384.7 kB
Tags Source
SHA-256 checksum
How to use checksums
de5a33d90b10235d421bcca4ebb2405f65b58e2f529ab168968c6e3f20c80263
BLAKE2b-256 checksum
How to use checksums
de2b96264bcedfdb869f6b59c7f05c3ca76f04517dd78a43ff04e7390ed04ce6
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 1, 2026.

Transparency log

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

Download URL softqp-0.2.0-cp312-cp312-win_amd64.whl
Size 440.8 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
0ddc107729ac6590806a65ef96be27ea3500f8a07f38ffb63ec262484398231f
BLAKE2b-256 checksum
How to use checksums
fa0ace4fe39af8f275f67d86da3ba579db4865484ee00be1c6cf18dd9566ef25
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 1, 2026.

Transparency log

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

Download URL softqp-0.2.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 291.4 kB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
84a868c4d449d5242632fdba28b5aa628ae9ab6d7551fc54d965f98eb4eb6f59
BLAKE2b-256 checksum
How to use checksums
f793ac3b4d09fced92d7e27b4375267650aa6f21caba82408038b22a038f692f
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 1, 2026.

Transparency log

Security for softqp 0.2.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.2.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 1, 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