Repository Usage

There are three ways how to use this benchmark suite:

  1. Via the webpage hosted at https://www.cda.cit.tum.de/mqtbench/

  2. Via the pip package mqt.bench

  3. Directly via this repository

Since the first way is rather self-explanatory, the other two ways are explained in more detail in the following.

Usage via pip package

MQT Bench is available via PyPI

(venv) $ pip install mqt.bench

To generate a benchmark circuit, use the get_benchmark method:

Module for the benchmark generation and benchmark retrieval.

get_benchmark(benchmark_name, level, circuit_size=None, benchmark_instance_name=None, compiler='qiskit', compiler_settings=None, provider_name='ibm', device_name='ibm_washington', **kwargs)[source]

Returns one benchmark as a qiskit.QuantumCircuit Object or a pytket.Circuit object.

Parameters:
  • benchmark_name (str) – name of the to be generated benchmark

  • level (str | int) – Choice of level, either as a string (“alg”, “indep”, “nativegates” or “mapped”) or as a number between 0-3 where 0 corresponds to “alg” level and 3 to “mapped” level

  • circuit_size (int | None) – Input for the benchmark creation, in most cases this is equal to the qubit number

  • benchmark_instance_name (str | None) – Input selection for some benchmarks, namely “groundstate” and “shor”

  • compiler (str) – “qiskit” or “tket”

  • compiler_settings (CompilerSettings | None) – Data class containing the respective compiler settings for the specified compiler (e.g., optimization level for Qiskit or placement for TKET)

  • provider_name (str) – “ibm”, “rigetti”, “ionq”, “oqc”, or “quantinuum” (required for “nativegates” level)

  • device_name (str) – “ibm_washington”, “ibm_montreal”, “rigetti_aspen_m3”, “ionq_harmony”, “ionq_aria1”, “oqc_lucy”, “quantinuum_h2” (required for “mapped” level)

  • kwargs (str) – Additional arguments for the benchmark generation

Returns:

QuantumCircuit | Circuit – Quantum Circuit Object representing the benchmark with the selected options, either as Qiskit::QuantumCircuit or Pytket::Circuit object (depending on the chosen compiler—while the algorithm level is always provided using Qiskit)

The available parameters are described on the parameter space description page and the algorithms are described on the algorithm page. For example, in order to obtain the 5-qubit Deutsch-Josza benchmark on algorithm level, use the following:

from mqt.bench import get_benchmark

qc = get_benchmark("dj", "alg", 5)

Examples can be found in the docs/Quickstart.ipynb jupyter notebook.

Locally hosting the MQT Bench Viewer

Additionally, this python package includes the same webserver used for the hosting of the MQT Bench webpage.

After the mqt.bench Python package is installed via

(venv) $ pip install mqt.bench

the MQT Bench Viewer can be started from the terminal via

(venv) $ mqt.bench

This first searches for the most recent version of the benchmark files on GitHub and offers to download them. Afterwards, the webserver is started locally.

Usage directly via this repository

For that, the repository must be cloned and installed:

git clone https://github.com/cda-tum/MQTBench.git
cd MQTBench
pip install .

Afterwards, the package can be used as described above.