Non-intrusive diagnostic framework for evaluating scientific claims in quantum machine learning
Project description
HilbertBench
Diagnose quantum ML experiments without changing a line of algorithm code.
HilbertBench is a non-intrusive diagnostic framework for quantum machine learning. You wrap one object — an Estimator, Sampler, or PennyLane device — and every circuit execution is silently recorded into an append-only, cryptographically sealed trace. Nothing else in your code changes.
After the run you call built-in analyzers to diagnose trainability, shot noise, optimization convergence, circuit structure, expressibility, and hardware noise — all from the evidence already in the trace.
Install
# Default: runs the Qiskit workflow out of the box
# (trace core + Qiskit integration + Parquet storage)
pip install hilbertbench
# Add the PennyLane integration
pip install hilbertbench[pennylane]
# Everything (Qiskit + PennyLane + storage)
pip install hilbertbench[full]
The default install covers the documented Qiskit path. PennyLane is the one optional integration; if you use it without installing it, the error tells you exactly which extra to add.
The one-line change
from hilbertbench.integrations.qiskit import HilbertEstimatorProxy
from hilbertbench.recorder.tape import HilbertTape
from hilbertbench.analysis import detect_barren_plateau
from hilbertbench import HilbertTrace
# Wrap the estimator — everything else stays the same
with HilbertTape("runs/my_vqe", tags={"algorithm": "vqe"}) as tape:
estimator = HilbertEstimatorProxy(tape) # ← the only change
# ... your existing optimizer loop, completely unchanged ...
# Analyze the sealed trace
trace = HilbertTrace(tape.dir_path)
print(detect_barren_plateau(trace))
# {'status': 'Trainable', 'variance': 0.215, 'variance_ci': [0.098, 0.371], ...}
Built-in analyzers
| Function | What it answers |
|---|---|
detect_barren_plateau |
Is the cost-landscape variance exponentially suppressed? |
shot_noise_ratio |
Is the optimizer chasing signal or shot noise? |
optimization_convergence |
Is the parameter trajectory still moving? |
circuit_structure |
How deep, how many qubits, what gate composition? |
kl_expressibility |
How uniformly does the ansatz cover Hilbert space? |
noise_profile |
What hardware noise levels did the run experience? |
from hilbertbench.analysis import summary
report = summary(trace) # runs all analyzers, returns one dict
Integrations
| Framework | Proxy class | Install extra |
|---|---|---|
| Qiskit V2 Estimator | HilbertEstimatorProxy |
hilbertbench[qiskit] |
| Qiskit V2 Sampler | HilbertSamplerProxy |
hilbertbench[qiskit] |
| IBM Quantum hardware | HilbertEstimatorProxy with EstimatorV2(mode=backend) |
hilbertbench[qiskit] |
| PennyLane | HilbertPennyLaneDeviceProxy |
hilbertbench[pennylane] |
Tutorials
Four end-to-end tutorials, each diagnosing a real quantum ML failure mode:
| # | Tutorial | Concepts |
|---|---|---|
| 01 | Why Isn't My VQE Converging? | Barren plateau, cost-landscape variance |
| 02 | Am I Using Enough Shots? | Shot noise floor, SNR, shot budget |
| 03 | Expressibility vs Trainability | Active Mode, KL expressibility, Holmes 2022 |
| 04 | How Hardware Noise Degrades Your Results | Circuit fidelity, gate error, noise profile |
Documentation
| Resource | Contents |
|---|---|
| End-to-End Guide | The whole tool in one document — top-down, layered, no quantum background assumed |
| mamuncseru.github.io/hilbertbench | Learning site: getting started, tutorials, concept guides |
| hilbertbench.readthedocs.io | Reference site: analyzer internals, trace format, architecture, and the test catalog — all 319 tests explained |
The learning site builds from mkdocs.yml, the reference site from
mkdocs-rtd.yml. After adding tests, refresh the catalog with
python tools/gen_test_catalog.py.
Design guarantees
- Non-intrusive — the proxy never re-executes circuits, modifies shot counts, or alters your algorithm (INV-001)
- Immutable traces — every trace is append-only and sealed with a SHA-256 hash on close (INV-002)
- Evidence, not verdicts — raw execution data is stored; diagnostic conclusions are computed at read time and never written back (INV-006)
- No silent failures — every initiated span ends with a
COMPLETEDorERRORevent (INV-007)
Those INV-NNN codes appear throughout the source comments and docstrings.
Each is a numbered, non-negotiable guarantee; the complete, canonical list
(INV-001 … INV-008) lives in
docs/reference/invariants.md (rendered on
the reference site). When you see an
INV-NNN tag in the code, that is where it is defined.
Acknowledgments
HilbertBench was developed by Md. Abdullah Al Mamun in the Neural Engineering Data Consortium (NEDC), lab at Temple University, under the advisorship of Prof. Joseph Picone (Department of Electrical and Computer Engineering). The author is grateful to Dr. Picone for his guidance and for the research environment in which this work was carried out.
Citing HilbertBench
If you use HilbertBench in your research, please cite it using the
metadata in CITATION.cff. On the GitHub project page,
that file makes a "Cite this repository" button appear automatically
in the right-hand sidebar (it is a GitHub feature, not a README badge,
and only shows once the repository is on GitHub). A DOI badge will be
added here once the first release is archived on Zenodo.
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hilbertbench-1.0.0.tar.gz.
File metadata
- Download URL: hilbertbench-1.0.0.tar.gz
- Upload date:
- Size: 60.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
150fa18354d1d7bffff18f74b7c95d0572effb279e4cd5d4d5fdd797db9c7036
|
|
| MD5 |
a330f5c82f70d3e8c1434488b0ce8d7f
|
|
| BLAKE2b-256 |
72526057c9ed4ab04f345e1fa493acd0d641ee625e1fbc7842f11cbfaa2dc487
|
File details
Details for the file hilbertbench-1.0.0-py3-none-any.whl.
File metadata
- Download URL: hilbertbench-1.0.0-py3-none-any.whl
- Upload date:
- Size: 72.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c31bcd59420cec86c91a297f59f3d58cd408108c81044385cd502cfca5e06c72
|
|
| MD5 |
ba3380a26f7a74dd27667a4ec407d101
|
|
| BLAKE2b-256 |
1d3e1be2aebdb4b17693bd4328e17969e0399a82c5ae2a84ef5dfadb897cd4e5
|