Skip to main content

pqblocks-qubo-bench

Standardized benchmarking harness, instance loaders, and metric evaluators for quantum-inspired optimization algorithms and classical baseline solvers.

CI License Python 3.11+



Overview

pqblocks-qubo-bench is an evaluation harness and benchmark suite designed to compare quantum-inspired heuristic solvers (such as Simulated Bifurcation, Simulated Annealing, and Quantum Annealing) against established classical solvers (such as Google OR-Tools CP-SAT, MQLib, and D-Wave Neal).

It provides:

  • Time-to-Solution (TTS) Engine: Statistically rigorous computation of Time-to-Solution at arbitrary target success probabilities (e.g. 99% confidence), accounting for run failure distributions and runtime variance.
  • Reference Optimality Gap: Standardized percentage gap calculation between heuristic solutions and known ground-truth or reference bounds ($E_{\text{found}} - E_{\text{ref}}) / |E_{\text{ref}}|$.
  • Standard Benchmark Loaders: Native loaders for standard benchmark suites including Stanford G-set, BiqMac, QPLIB, TSPLIB, OR-Library, and planted-solution instances.
  • Unified Solver Wrappers: Baseline wrappers conforming to the dimod BinaryQuadraticModel interface for CP-SAT, OpenJij, D-Wave Neal, and MQLib.

Installation

pip install pqblocks-qubo-bench

Dependencies

Requires Python 3.11+, dimod, numpy, PyYAML, and jsonschema. Optional solver baselines:

  • ortools (Google CP-SAT solver)
  • dwave-neal (Classical simulated annealing baseline)
  • openjij (Simulated quantum annealing baseline)
  • MQLib (External C++ Max-Cut heuristic solver, optional)

Quickstart

from pqblocks_qubo_bench.tts_engine import calculate_tts

# Timing data: list of (runtime_seconds, success_boolean) tuples
runs = [(0.012, True), (0.015, False), (0.011, True), (0.014, True)]

# Calculate Time-To-Solution for 99% target confidence
tts = calculate_tts(runs, target_prob=0.99)
print(f"Calculated TTS (99% target): {tts:.4f}s")

Benchmark Instance Loading

Load standard problem instances directly into dimod.BinaryQuadraticModel:

from pqblocks_qubo_bench.loaders import load_instance

# Load a benchmark problem (G-set, BiqMac, QPLIB, etc.)
bqm, meta = load_instance("gset", "G1")
print(f"Loaded {meta['instance_id']} from {meta['suite_name']} with {len(bqm.variables)} variables")

Architecture and Subpackages

  • pqblocks_qubo_bench.tts_engine: Core statistical engine for calculating Time-to-Solution and success probabilities.
  • pqblocks_qubo_bench.gap: Relative and absolute reference gap calculations with zero-energy handling.
  • pqblocks_qubo_bench.loaders: Standard benchmark loaders (gset_loader, biqmac_loader, qplib_loader, tsplib_loader, orlib_loader, planted_loader).
  • pqblocks_qubo_bench.cpsat_wrapper: CP-SAT exact/heuristic baseline integration.
  • pqblocks_qubo_bench.mqlib_wrapper: MQLib heuristic solver integration.
  • pqblocks_qubo_bench.sqa_wrapper: Simulated Quantum Annealing benchmark wrapper.
  • pqblocks_qubo_bench.batch: Batch benchmark execution and orchestration.

Fair Benchmarking Disclaimer

When comparing heuristic solvers (such as Simulated Bifurcation or Simulated Annealing) against baseline solvers:

  • Solvers must be compared under equal computational work (e.g., sample counts, read counts, and iteration budgets must be explicitly stated).
  • Heuristic point solutions must report both mean energy, best energy, and Time-to-Solution (TTS).
  • External baselines (MQLib, CP-SAT) must specify timeout and thread allocations.

Verification & Testing

Every commit and release is verified across Python 3.11, 3.12, 3.13, and 3.14.

pytest

License

Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.

Metadata

Release files for pqblocks-qubo-bench 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 pqblocks-qubo-bench 0.1.0
File Size Uploaded Provenance Actions
pqblocks_qubo_bench-0.1.0.tar.gz 42.4 kB Without provenance Details for pqblocks_qubo_bench-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pqblocks-qubo-bench 0.1.0
File Interpreter ABI Platform Actions
pqblocks_qubo_bench-0.1.0-py3-none-any.whl Python 3 none any Details for pqblocks_qubo_bench-0.1.0-py3-none-any.whl

Total release size: 83.7 kB

Release files / pqblocks_qubo_bench-0.1.0.tar.gz

Download URL pqblocks_qubo_bench-0.1.0.tar.gz
Size 42.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3bddfc195b7c262227f750f68ccc2826e8c8f99be9e52985662f07dac8cae27d
BLAKE2b-256 checksum
How to use checksums
eb0d899c1dfe0afd1b0714f68c9e5ba05d6435f6d78171ef3ec2d84b298bbc49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pqblocks_qubo_bench-0.1.0-py3-none-any.whl

Download URL pqblocks_qubo_bench-0.1.0-py3-none-any.whl
Size 41.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
432c64b649dc47fe1bc72bc987c1fb5a7815c9c0dac1a1e42c52dbb2e4dc28eb
BLAKE2b-256 checksum
How to use checksums
c169a6787fc31cb6cd47b465d0dfdd70ac371830b4211a07cdd03af21acd4163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for pqblocks-qubo-bench 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.0 This release

2 release files No 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