Minimal first version#1
Conversation
Fix versions and up notebook example
This commit introduces a reverse dependency on the [`graphix-mqtbench` plugin](https://github.com/TeamGraphix/graphix-mqtbench) and lists it in the README. Current reverse dependency points to the branch `minimal` in my fork to ensure that the CI passes, but upon merging TeamGraphix/graphix-mqtbench#1, we can edit the nox file to point to the `main` branch in the base TeamGraphix repository. This new plugin offers an API to interface with the MQT Bench suite which is useful for benchmarking Graphix with relevant circuits (both the simulator backends and the optimization workflow). Since we still don't have a robust pipeline to benchmark execution times and the pattern optimization passes, the glue code to perform the benchmarks is presented in the plugin's README instead of being part of the plugin's codebase.
The contents of `_benchmark_names.py` depend on the exact version of **`mqt‑bench`** that was used to generate it. When a different version is installed, the module contains incorrect benchmark names, causing test failures. In the CI for Graphix (a reverse dependency), this problem manifested because the file had been generated with `mqt-bench==2.1.0`, while `pyproject.toml` only required `mqt‑bench>=2.1.0`. Consequently, CI installed the newer release **2.2.2**, leading to a mismatch. For instance, see https://github.com/TeamGraphix/graphix/actions/runs/28994040306/job/86039809250?pr=558 **Fixes introduced in this commit:** - Pin the `mqt-bench` dependency to version **2.2.2**. - Enable Dependabot to keep this pin up‑to‑date when necessary. - Add a generator script that can recreate `_benchmark_names.py` for any future `mqt-bench` version. - Run the generator with the new pinned version and commit the updated `_benchmark_names.py`. These changes ensure that the benchmark names stay in sync with the installed `mqt-bench` version, preventing CI failures.
thierry-martinez
left a comment
There was a problem hiding this comment.
Could you explain the reasons for using the src/graphix_mqtbench/ directory structure instead of the flatter layout graphix_mqtbench/ (i.e., only one level of subdirectory)? It feels a bit odd to have a dedicated src/ folder that contains just this single package. Are there plans to add other packages to the repository in the future?
Having benchmark names hard‑coded in _benchmark_names.py makes the code break every time the list of names is updated on the MQTBench side. I propose a fix that pins the MQTBench version: matulni#2
| qc_clean.remove_final_measurements() | ||
| qiskit_data = Statevector_qiskit(qc_clean).data # numpy array of complex amplitudes | ||
|
|
||
| qiskit_data_msb = qiskit_data.reshape((2,) * bench.nqubits).transpose(range(bench.nqubits - 1, -1, -1)).reshape(-1) |
There was a problem hiding this comment.
| qiskit_data_msb = qiskit_data.reshape((2,) * bench.nqubits).transpose(range(bench.nqubits - 1, -1, -1)).reshape(-1) | |
| qiskit_data_msb = qiskit_data.reshape((2,) * bench.nqubits).transpose(reverse(range(bench.nqubits))).reshape(-1) |
Pin `mqt-bench==2.2.2` and Update `_benchmark_names.py` + Generator
It's the default structure when you initialize a project with Here there's a related discussion: https://stackoverflow.com/questions/79794657/how-to-build-a-single-file-namespace-library-with-uv Adding to the I noticed that in Graphix we don't have this issue, maybe because we use the To answer your question, there are no plans to add additional packages to the repository. I hope that one day we can deploy some proper benchmarking of Graphix, but I expect it to be a different repo that has
Thanks a lot for this suggestion! |
This commit introduces a minimal functioning version of the graphix-mqtbench plugin, compatible with Graphix' master branch.