Usage

Usage via the Webpage

Use the web interface to generate and download a benchmark interactively, or use Python or the CLI to automate generation.

When you use the web interface to generate and download circuits, also cite the 2026 paper (see References).

Usage via the mqt-bench Python package

After Installation, pass a name from the benchmark catalogue, a level, and a size to get_benchmark(). This call returns a five-qubit Deutsch–Jozsa circuit at the algorithmic level:

1from mqt.bench import BenchmarkLevel, get_benchmark
2
3qc = get_benchmark("dj", BenchmarkLevel.ALG, 5)
4print(qc.draw(output="text"))
     ┌───┐     ┌─────────┐┌───┐ ░ ┌─┐         
q_0: ┤ H ├─────┤0        ├┤ H ├─░─┤M├─────────
     ├───┤     │         │├───┤ ░ └╥┘┌─┐      
q_1: ┤ H ├─────┤1        ├┤ H ├─░──╫─┤M├──────
     ├───┤     │         │├───┤ ░  ║ └╥┘┌─┐   
q_2: ┤ H ├─────┤2 Oracle ├┤ H ├─░──╫──╫─┤M├───
     ├───┤     │         │├───┤ ░  ║  ║ └╥┘┌─┐
q_3: ┤ H ├─────┤3        ├┤ H ├─░──╫──╫──╫─┤M├
     ├───┤┌───┐│         │└───┘ ░  ║  ║  ║ └╥┘
q_4: ┤ X ├┤ H ├┤4        ├──────░──╫──╫──╫──╫─
     └───┘└───┘└─────────┘      ░  ║  ║  ║  ║ 
c: 4/══════════════════════════════╩══╩══╩══╩═
                                   0  1  2  3 

Further examples can be found in the Quickstart guide.

Usage via the Command Line Interface (CLI)

Installing MQT Bench provides the mqt-bench command. To try it in an isolated environment with uv, run uvx mqt-bench --help.

CLI Options

List the available options with mqt-bench --help:

usage: mqt-bench [-h] [--level {alg,indep,nativegates,mapped}]
                 [--algorithm {ae,bell,bmw_quark_cardinality,bmw_quark_copula,bv,cdkm_ripple_carry_adder,dj,draper_qft_adder,dynamic_qft,full_adder,ghz,ghz_dynamic,graphstate,grover,half_adder,hhl,hrs_cumulative_multiplier,iqpe,mlqae,modular_adder,multiplier,qaoa,qft,qftentangled,qnn,qpeexact,qpeinexact,quantum_metropolis,qwalk,randomcircuit,rg_qft_multiplier,seven_qubit_steane_code,shor,shors_nine_qubit_code,simon,superdense_coding,teleportation,vbe_ripple_carry_adder,vqe_real_amp,vqe_su2,vqe_two_local,wstate}]
                 [--num-qubits NUM_QUBITS] [--compiler {qiskit,mqt}]
                 [--compiler-seed COMPILER_SEED]
                 [--mapping-trials MAPPING_TRIALS]
                 [--optimization-level {0,1,2,3}] [--target TARGET]
                 [--random-parameters | --no-random-parameters]
                 [--output-format {qasm2,qasm3,qpy,qir,qir-bitcode}]
                 [--qir-profile {base,adaptive}]
                 [--target-directory TARGET_DIRECTORY] [--save] [--mirror]
                 [--list-benchmarks | --list-targets] [--seed SEED]
                 [--benchmark-options JSON]

Generate a single benchmark

options:
  -h, --help            show this help message and exit
  --level {alg,indep,nativegates,mapped}
                        Level to generate benchmarks for ("alg", "indep",
                        "nativegates" or "mapped").
  --algorithm {ae,bell,bmw_quark_cardinality,bmw_quark_copula,bv,cdkm_ripple_carry_adder,dj,draper_qft_adder,dynamic_qft,full_adder,ghz,ghz_dynamic,graphstate,grover,half_adder,hhl,hrs_cumulative_multiplier,iqpe,mlqae,modular_adder,multiplier,qaoa,qft,qftentangled,qnn,qpeexact,qpeinexact,quantum_metropolis,qwalk,randomcircuit,rg_qft_multiplier,seven_qubit_steane_code,shor,shors_nine_qubit_code,simon,superdense_coding,teleportation,vbe_ripple_carry_adder,vqe_real_amp,vqe_su2,vqe_two_local,wstate}
                        Name of the benchmark (e.g., 'grover', 'shor').
  --num-qubits NUM_QUBITS
                        Benchmark size. For most algorithms, this is the
                        number of qubits.
  --compiler {qiskit,mqt}
                        Compiler to use (default: qiskit).
  --compiler-seed COMPILER_SEED
                        MQT Core compilation seed (default: 10).
  --mapping-trials MAPPING_TRIALS
                        Number of MQT Core mapping trials (default: 8).
  --optimization-level {0,1,2,3}
                        Qiskit optimization level (0-3, default: 2). Ignored
                        by the MQT compiler.
  --target TARGET       Gate set name for nativegates (e.g., 'ibm_heron') or
                        device name for mapped (e.g., 'ibm_heron_156').
  --random-parameters, --no-random-parameters
                        Whether to assign random parameters to parametric
                        circuits (default: True). Use --no-random-parameters
                        to disable.
  --output-format {qasm2,qasm3,qpy,qir,qir-bitcode}
                        Output format. Possible values: ['qasm2', 'qasm3',
                        'qpy', 'qir', 'qir-bitcode'].
  --qir-profile {base,adaptive}
                        Profile for QIR output (default: base). Use adaptive
                        for measurement feedback.
  --target-directory TARGET_DIRECTORY
                        Directory to save the output file (used for binary
                        formats or if --save is specified).
  --save                Save text output to a file. Binary formats always
                        write a file.
  --mirror              If set, generate the mirror version of the benchmark
                        (circuit @ circuit.inverse()).
  --list-benchmarks     List benchmarks and descriptions.
  --list-targets        List native gate sets and mapped devices.
  --seed SEED           Seed for benchmark construction and random parameter
                        values.
  --benchmark-options JSON
                        Benchmark-specific options as a JSON object, e.g.
                        {"depth": 5, "for_loop": true}.

MQT Bench version: 2.4.1.dev7+g951b59e48
Qiskit version: 2.6.2

Example Usage

List benchmark names and descriptions, or available gate sets and devices:

mqt-bench --list-benchmarks
mqt-bench --list-targets

Use --seed to reproduce random parameters and the choices of factories that accept a seed. Pass factory options through --benchmark-options as a JSON object:

mqt-bench --level alg --algorithm graphstate --num-qubits 6 --seed 42
mqt-bench --level alg --algorithm qwalk --num-qubits 3 --benchmark-options '{"depth": 5, "for_loop": true}'

The Python API accepts the same options as keyword arguments. With random_parameters=True, seed also controls the numeric values assigned to symbolic parameters. Omitting seed preserves each factory’s default.

OpenQASM is printed to stdout by default. For example, generate a five-qubit Deutsch–Jozsa circuit in OpenQASM 3:

mqt-bench --level alg --algorithm dj --num-qubits 5 --output-format qasm3
// Benchmark created by MQT Bench on 2026-11-16
// SPDX-License-Identifier: MIT
// For more info: https://mqt-bench.app/
// MQT Bench version: 2.4.1.dev7+g951b59e48
// Qiskit version: 2.6.2
// Output format: qasm3
// Level: alg
// Generation options: {"benchmark": "dj", "circuit_size": 5, "encoding": null, "level": "alg", "mirror": false, "opt_level": null, "options": {}, "random_parameters": true, "target": null}

OPENQASM 3.0;
include "stdgates.inc";
gate Oracle _gate_q_0, _gate_q_1, _gate_q_2, _gate_q_3, _gate_q_4 {
  x _gate_q_0;
  x _gate_q_1;
  cx _gate_q_0, _gate_q_4;
  cx _gate_q_1, _gate_q_4;
  cx _gate_q_2, _gate_q_4;
  cx _gate_q_3, _gate_q_4;
  x _gate_q_0;
  x _gate_q_1;
}
bit[4] c;
qubit[5] q;
x q[4];
h q[4];
h q[0];
h q[1];
h q[2];
h q[3];
Oracle q[0], q[1], q[2], q[3], q[4];
h q[0];
h q[1];
h q[2];
h q[3];
barrier q[0], q[1], q[2], q[3], q[4];
c[0] = measure q[0];
c[1] = measure q[1];
c[2] = measure q[2];
c[3] = measure q[3];

Pass --save to write OpenQASM to a file. QPY and QIR bitcode always write a file. --target-directory selects the output directory. The CLI prints the saved path. This command maps the circuit to the IBM Heron device model:

mqt-bench --level mapped --algorithm dj --num-qubits 5 --optimization-level 3 --target ibm_heron_156 --output-format qasm3 --save
dj_mapped_ibm_heron_156_opt3_5.qasm

For the Python equivalents of the CLI options, see the Parameter Space guide.

Docker

From a Git clone, build the image and run the CLI:

docker build -t mqt-bench .
docker run --rm mqt-bench --algorithm ghz --num-qubits 3 --level alg

Use docker run --rm -t mqt-bench --help for colored CLI help.