Skip to main content

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 test on your laptop, it passes validation on the platform, because the platform runs 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

Every command exits non-zero on failure, so qsolve validate . && qsolve lint . && qsolve test . is a complete pre-submission check. The scaffold is a working QAOA workflow that passes every gate; change it step by step and re-run qsolve test . 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

Development

uv sync && uv run pytest && uv run ruff check src tests && uv run mypy src

Metadata

Release files for qsolve-sdk 1.0.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 qsolve-sdk 1.0.0
File Size Uploaded Provenance Actions
qsolve_sdk-1.0.0.tar.gz 99.9 kB With provenance Details for qsolve_sdk-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qsolve-sdk 1.0.0
File Interpreter ABI Platform Actions
qsolve_sdk-1.0.0-py3-none-any.whl Python 3 none any Details for qsolve_sdk-1.0.0-py3-none-any.whl

Total release size: 186.7 kB

Release files / qsolve_sdk-1.0.0.tar.gz

Download URL qsolve_sdk-1.0.0.tar.gz
Size 99.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4b5d1e472dc87f2dbf7afbb777f11af093e55a1e2c9b5531e4501caf829dd002
BLAKE2b-256 checksum
How to use checksums
1bb969c0626b1d717a3fbcf2c1cfda629655e5ed414eb5cb975d577b0f0b8329
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 log

Release files / qsolve_sdk-1.0.0-py3-none-any.whl

Download URL qsolve_sdk-1.0.0-py3-none-any.whl
Size 86.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c8c16d9ca6a4325fe9b49d37a553187b6c86faf684c4f194f000aafdb94a111
BLAKE2b-256 checksum
How to use checksums
22567897ff602334acccb223ac06efca12391c4109bab97063cce6028adc1d91
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 log

Security for qsolve-sdk 1.0.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.

Select from 2 files

Attestation for qsolve_sdk-1.0.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 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