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 and 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 from source

Version 0.1.0 targets CPython 3.12, Windows x64 and Linux x86_64. A C/C++ compiler and CMake are required for source installation. Portable wheels and clean installed tests are prepared by the release workflow; public package publication remains a separate gate.

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.

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.1.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.1.0
File Size Uploaded Provenance Actions
softqp-0.1.0.tar.gz 364.7 kB With provenance Details for softqp-0.1.0.tar.gz

Built distributions (wheels)

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

Total release size: 1.1 MB

Release files / softqp-0.1.0.tar.gz

Download URL softqp-0.1.0.tar.gz
Size 364.7 kB
Tags Source
SHA-256 checksum
How to use checksums
49ebbcc91ada6a539a684551b44e3f4ca6b549731118a9d7330c28a5c0f657e1
BLAKE2b-256 checksum
How to use checksums
f129df13ceb1c9ed2c4be4fb51d73bef29dd10b48884bafcdcf5921cc12ec1df
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.1.0-cp312-cp312-win_amd64.whl

Download URL softqp-0.1.0-cp312-cp312-win_amd64.whl
Size 423.0 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
19b05f3fd993bcc5290b31107908dafb227522865f23b490ca845708c1061879
BLAKE2b-256 checksum
How to use checksums
90b13bb2bd0ebbc888a8ddbc86de09f376c20d92526f83e9b36315ef5efc9fbd
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.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL softqp-0.1.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 271.6 kB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d0d5a0a6a6b9cce4a086261e1a6ba21dbb24ab706c1bf404c825b544fb58d07a
BLAKE2b-256 checksum
How to use checksums
97a4e66e95a63fe206937ff6269d600d388ee56dd8f1d282a599e75a7d4dcbe0
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.1.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.1.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