Skip to main content

qversus

CI PyPI License

Canonical quantum-computing problems, solved by the real frameworks next to the classical baseline that is usually still more practical, with every run recorded as a replayable, seeded trace.

qversus separates what to compute from how. A Problem is a formulation (Grover search, MaxCut, the H2 ground state, a surface-code memory, ...) with a set of parameter regimes (Instances). A Solver is a thin adapter that attacks a problem with one real framework (Qiskit + Aer, PennyLane, Cirq, Stim + PyMatching) or with a classical method, and returns the same SolverResult shape whatever the framework. A registry pairs them, so running a quantum method and the classical baseline side by side is one loop, not one script per framework.

Circuit-model solvers also return a Trace: the state after every gate (amplitudes, per-qubit Bloch vectors, probabilities), the circuit as a flat op list, and a seeded shot histogram. A run is a pure function of (params, seed): with the same framework versions, the same inputs give the same bytes.

The package makes no claim of quantum advantage. Every problem ships a classical baseline, and on these textbook-scale instances the classical method wins on wall time; what the quantum methods show are real phenomena (interference, entanglement, query separations, error-correction thresholds) at a scale a laptop simulates exactly.

Install

pip install qversus                 # core: NumPy only (formulations, registry, trace schema, RNG)
pip install "qversus[all]"          # every simulator-based adapter
Extra Brings Enables
qiskit qiskit>=2.4,<3, qiskit-aer>=0.17 the circuit adapters (16 problems), the step tracer, the Aer noise model
pennylane pennylane>=0.45, networkx QAOA cross-check, VQE on H2, the quantum-kernel classifier, the H2 Hamiltonian for the exact baseline
cirq cirq-core>=1.6 the third QAOA implementation
stim stim>=1.16, pymatching>=2.0 repetition and surface-code memories decoded by minimum-weight matching
learn scikit-learn>=1.5 the classical RBF-SVM baseline and the precomputed-kernel SVM
hardware qiskit-ibm-runtime>=0.30 the opt-in IBM Quantum adapter (real QPU, needs a token)
all every extra except hardware

A missing framework disables only its own adapters (a warning names it); the rest of the registry works.

Quick start

from qversus.registry import get_problem, solvers_for

problem = get_problem("maxcut")
instance = problem.instance("square")            # the 4-cycle; optimum cut = 4

for solver in solvers_for(problem):              # QAOA on Qiskit, PennyLane and Cirq + two classical methods
    result = solver.run(problem, instance, seed=42, shots=2048)
    print(f"{result.paradigm:12} {result.solver:18} cut={result.value['cut']}  cost={result.cost}")
from qversus.registry import get_problem, solvers_for

problem = get_problem("grover")
instance = problem.instance("grover-4-10")       # N = 16 items, item 10 marked
qiskit = next(s for s in solvers_for(problem) if s.framework == "qiskit")
result = qiskit.run(problem, instance, seed=42, shots=2048)

trace = result.trace.to_dict()                   # JSON-ready: steps, circuit_ops, measurements, provenance
print(result.value, trace["measurements"]["counts"])

More: quick start guide.

The catalogue

Twenty problems in six families, 119 instances. Each has at least one quantum method and one classical baseline.

Problem Family Quantum solvers Classical baseline
single-qubit, qrng, interference fundamentals Qiskit Bloch/bit model, PRNG, wave optics
state-prep, chsh, teleportation, superdense entanglement Qiskit the amplitudes written down directly, local hidden variables, measure-and-resend, one bit per carrier
deutsch-jozsa, bernstein-vazirani, simon oracle algorithms Qiskit query-counting classical algorithms
grover, qft, qpe, shor flagship algorithms Qiskit linear scan, FFT, exact phase, trial division
maxcut, vqe, qml variational Qiskit, PennyLane, Cirq brute force + greedy, exact diagonalisation, RBF-SVM
noise, qec-repetition, qec-surface noise and QEC Qiskit-Aer, Stim + PyMatching the exact answer, the unprotected qubit

Per-problem parameters, result fields and the closed-form checks the tests enforce: docs/problems.

Contracts

  • Problem / Instance: identity (id, bilingual EN/ES title and concept, category, metric, references), the instances, and a live_capable hint (small and noise-free enough to re-simulate interactively).
  • Solver / SolverResult: run(problem, instance, seed, shots) -> SolverResult with value, cost, bilingual notes, an optional trace, optimal (an exact classical baseline) and extra (landscapes, curves, kernel matrices). Paradigm is one of quantum-sim, quantum-hardware, classical.
  • Trace (schema qversus-trace/1): JSON-first and free of framework types, so a reader needs neither Python nor a quantum SDK.
  • Bit order: amplitude and probability arrays use Qiskit's little-endian index (qubit 0 is the least significant bit); count keys are that index in binary, highest qubit leftmost.

Details: docs/architecture.

Real hardware (opt-in)

The ibm-hardware adapter submits small circuits to IBM Quantum (Open Plan, free tier) and returns the counts with the backend named in the provenance. It is never part of the default solver set: it is offered only when named explicitly and QISKIT_IBM_TOKEN is set. See docs/solvers/06_ibm-hardware.md.

Development

python -m venv .venv && .venv/Scripts/python -m pip install -e ".[dev]"   # bash: .venv/bin/python
python -m pytest                     # core, registry and physics tests
python -m ruff check qversus tests
python scripts/check_content_standards.py

CI runs lint, the tests, a core-only install check, and the repository guards on develop and main. Releases are tagged vX.XX.XXX and published to PyPI by trusted publishing (docs/guides/04_releasing.md).

Used by

  • QLab (qlab.fasl-work.com): a public, didactic quantum-computing lab whose committed traces are produced by this engine.

License

MIT. See LICENSE.

Metadata

Release files for qversus 0.1.1

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

Source distribution (sdist)

Source distribution for qversus 0.1.1
File Size Uploaded Provenance Actions
qversus-0.1.1.tar.gz 75.7 kB With provenance Details for qversus-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qversus 0.1.1
File Interpreter ABI Platform Actions
qversus-0.1.1-py3-none-any.whl Python 3 none any Details for qversus-0.1.1-py3-none-any.whl

Total release size: 161.0 kB

Release files / qversus-0.1.1.tar.gz

Download URL qversus-0.1.1.tar.gz
Size 75.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fc8bc47f0623dd836ba6891678ba33551579bf8baf489b3612bafbc3aec74b0a
BLAKE2b-256 checksum
How to use checksums
e89ec0e2c2f727f5c2803eeae4b19becf3161e2a386219163282390fe038f045
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 8, 2026.

Transparency log

Release files / qversus-0.1.1-py3-none-any.whl

Download URL qversus-0.1.1-py3-none-any.whl
Size 85.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4703530cfaddcdcc15567e29a45e9c932cb046e0403cfef6409335fde759f161
BLAKE2b-256 checksum
How to use checksums
8cb77b8bee41e6940de61e3db12c8a314686a010b6a67bdbcb91947e47b9672c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 8, 2026.

Transparency log

Security for qversus 0.1.1

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 qversus-0.1.1.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 Oct 8, 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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