qsolve-sdk
The bridge between a Qiskit workflow and the Qsolve platform. Qsolve is a platform where researchers find, benchmark and run quantum and hybrid workflows, judged against the best classical method. Documentation.
You write a workflow in plain Qiskit: your circuits, your algorithm, your error mitigation, your
classical references. This SDK runs it on Qsolve's backends (CPU, GPU, QPU), records every circuit it
sends and every count it gets back, runs every method you declare, re-evaluates the answers, measures
the quantum run and validates the lot. If a workflow passes qsolve check on your laptop, it passes
validation on the platform, because the platform runs the same three stages (validate, lint, test)
with this same code in its sandbox. (The sandbox
has no network and a fixed set of importable modules; qsolve lint tells you what it will refuse,
and the contract lists the platform rules.)
The SDK contains no quantum algorithm. Qsolve does not compete with Qiskit: use Qiskit (and its ecosystem) for the quantum part.
Install
pip install qsolve-sdk
pip install "qsolve-sdk[ibm]" # + the IBM runtime: device noise models and IBM hardware
Python 3.12 or newer (the version the Qsolve sandbox runs, so what passes here runs there), Qiskit
2.x. Install the ibm extra even if you never touch hardware: the
fake:<device> noise-model targets, and the noise-model case in the scaffold's benchmarks, need it.
Running on a real IBM device additionally needs your own token in the QSOLVE_IBM_TOKEN
environment variable (optional QSOLVE_IBM_INSTANCE). qsolve --version prints the installed
version.
Five-minute tour
qsolve init my-problem --summary "Pick the best depots" # a complete Qiskit workflow to start from
cd my-problem
qsolve validate . # manifest, schemas, example inputs
qsolve lint . # secrets and imports the sandbox would reject
qsolve run . -i examples/qubo_5.json # run on the CPU simulator
qsolve estimate . -i examples/qubo_5.json # circuits and shots to expect, no execution
qsolve test . # the validation gates and benchmark cases
qsolve check . # validate + lint + test: the full pre-submission check
qsolve test does not run lint, and the platform does, so use qsolve check . before you submit: it
runs the three stages in the platform's order and stops at the first failure. Every command exits
non-zero on failure. The scaffold is a working QAOA workflow that passes every gate; change it step
by step and re-run qsolve check . after each step.
src/workflow.py is the whole workflow:
from qsolve import Context, Outcome, Workflow
class Qubo(Workflow):
def __init__(self, input, params): ... # parse the input; raise WorkflowError for mistakes
def size(self) -> int: ... # qubits or variables
def quantum(self, ctx: Context) -> Outcome: # plain Qiskit: build circuits, run them via ctx
counts = ctx.sampler.run([(circuit, params, shots)]).result()[0].data.meas.get_counts()
...
def reference(self, ctx) -> Outcome: ... # the classical answer you are judged against
def classical_annealing(self, ctx) -> Outcome: ... # any other classical method you declare
def evaluate(
self, solution
) -> float: ... # the objective of a solution: Qsolve re-checks every method with it
def answer(self, outcome) -> dict: ... # the domain answer people read
qsolve.yaml declares the methods and says in plain words what each one is. Qsolve shows that text
and measures every number itself.
Targets
| Target | Runs on |
|---|---|
sim-cpu |
Qiskit Aer on the CPU (the default) |
sim-gpu |
Qiskit Aer on a GPU; needs qiskit-aer-gpu |
fake:<device>[@scale] |
Aer with an IBM device's published noise model, optionally with every error rate multiplied by scale, from 1 to 10 (for example fake:fez@1.6); free; needs the ibm extra |
ibm:<device> |
IBM Quantum hardware, with your own token in QSOLVE_IBM_TOKEN (needs the ibm extra); spends your own IBM quota |
What Qsolve measures, and what it does not
All workflow code is untrusted. Qsolve guarantees: provenance (what ran, reproducibly, in a sandbox);
boundary measurement (circuits, shots, depth, two-qubit gates and raw fidelity, computed from what
actually crossed the backend); re-evaluation (each method's objective recomputed with your
evaluate; a contradiction fails validation); that the quantum method really sent circuits; and honest
cost (your estimate() is compared with what was sent). It cannot prove that your classical baseline
is the best classical method, or that your error mitigation is legitimate: mitigated figures are
labelled reported, next to the measured raw figures.
Public API
Everything a workflow imports is exported from qsolve: Workflow, Outcome, Context,
WorkflowError, InvalidSolution, MethodUnavailable, QuantumNotAllowed, Estimate, Result,
Provenance, Quality, Mitigation, Uncertainty, MethodResult, Metrics, CircuitStats,
RunOutput, Manifest, load_workflow, run_workflow, estimate_run, MAX_SHOTS_PER_CIRCUIT
(the most shots the platform runs per circuit, 100000) and __version__.
Compatibility. The SDK follows semantic versioning. Names in qsolve.__all__, the qsolve
commands and the lint codes are public and stable: they change incompatibly only in a new major
version, after a deprecating minor release, and every change is listed in CHANGELOG.md. Other
modules (qsolve.backends, qsolve.metering, qsolve.benchmark, qsolve.lint, ...) are
documented and importable but may change in a minor version. The executor protocol
(qsolve.backends.remote), qsolve.sandbox_entry and every underscore-prefixed name are internal
and may change in any release. Every public name,
with signatures, parameters and examples, is in the SDK reference of the
Qsolve documentation (Build a workflow, "SDK
reference"), and every qsolve command and flag is in "The qsolve command line" there.
Documentation
- The Qsolve documentation, section "Build a workflow": the guided tutorial, the SDK reference and the CLI reference
- llms.txt: every documentation page as plain markdown, for coding agents and tools that read documentation
- Writing a workflow
- The contract
- Design: the SDK as the bridge
- Changelog and contributing
Development
uv sync && uv run pytest && uv run ruff check src tests && uv run mypy src
Metadata
Release files for qsolve-sdk 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qsolve_sdk-1.1.0.tar.gz | 101.0 kB | With provenance | Details for qsolve_sdk-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qsolve_sdk-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for qsolve_sdk-1.1.0-py3-none-any.whl |
Total release size: 188.5 kB
Release files / qsolve_sdk-1.1.0.tar.gz
| Download URL | qsolve_sdk-1.1.0.tar.gz |
|---|---|
| Size | 101.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
027d9210fb945f1a9acab2ccf141f8374f29f3c8bc1586b69256bc24250e09ec
|
|
BLAKE2b-256 checksum How to use checksums |
8972dfe6e90a96d828ea04a734cdf7074128ce881f10344940c728bb37033554
|
| 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 20, 2026.
Transparency logRelease files / qsolve_sdk-1.1.0-py3-none-any.whl
| Download URL | qsolve_sdk-1.1.0-py3-none-any.whl |
|---|---|
| Size | 87.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dfe65db45f0fa7c4937b0781012c551f764cf707816ac87726f6ace0a3c4ee4a
|
|
BLAKE2b-256 checksum How to use checksums |
02539f3c1ce5e9c2560b13bebe61d5a48302d5f67d392c660b33d311be955045
|
| 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 20, 2026.
Transparency logSecurity for qsolve-sdk 1.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
Both files in this release have been uploaded with provenance metadata.
Attestation for qsolve_sdk-1.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 20, 2026.
Transparency logA 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.