mqt.bench.benchmarks

Initialization of the benchmark module.

Submodules

Package Contents

register_benchmark(benchmark_name: str, description: str = '') Callable[[_BenchmarkFactory], _BenchmarkFactory][source]

Decorator to register a benchmark factory under a unique benchmark_name.

Parameters:
  • benchmark_name – unique identifier for the benchmark (e.g., "ae").

  • description – One-line description.

Returns:

The original factory function, unmodified.

Raises:

ValueError – if the chosen name is already present in the registry.

get_available_benchmark_names() list[str][source]

Return a list of available benchmark names.

get_benchmark_description(benchmark_name: str) str[source]

Return the benchmark description given a benchmark name.

get_benchmark_catalog() Mapping[str, str][source]

Return the benchmark catalog given a benchmark name.

create_circuit(benchmark_name: str, circuit_size: int, /, *args: Any, **kwargs: Any) QuantumCircuit[source]

Creates and returns a quantum circuit based on the specified benchmark name and additional arguments.

The function retrieves the associated factory for the given benchmark name and uses it to construct the quantum circuit. If the benchmark name is not found, a ValueError is raised with the list of available benchmarks.

Parameters:
  • benchmark_name – The name of the benchmark to create the circuit for.

  • circuit_size – The size of the quantum circuit to create.

  • *args – Positional arguments to be passed to the benchmark’s factory method.

  • **kwargs – Keyword arguments to be passed to the benchmark’s factory method.

Returns:

QuantumCircuit – A quantum circuit generated by the factory associated with the given benchmark name.

Raises:
  • ValueError – If the specified benchmark name is not in the list of available

  • benchmarks.