Skip to content

🎨 Miscellaneous Fixes #509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 15, 2025
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies = [
"numpy>=1.26; python_version >= '3.12'",
"numpy>=1.24; python_version >= '3.11'",
"numpy>=1.22",
"scikit-learn>=1.5.2",
]


Expand Down
6 changes: 0 additions & 6 deletions src/mqt/bench/benchmarks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,3 @@
"""

from __future__ import annotations

from mqt.bench.benchmarks.qiskit_application_ml import qnn

__all__ = [
"qnn",
]
4 changes: 2 additions & 2 deletions src/mqt/bench/tket_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from pytket.qasm import circuit_to_qasm_str
from qiskit import QuantumCircuit, transpile

from .utils import convert_cmap_to_tuple_list, get_openqasm_gates, save_as_qasm
from .utils import get_openqasm_gates, save_as_qasm

if TYPE_CHECKING: # pragma: no cover
from pytket._tket.passes import BasePass
Expand Down Expand Up @@ -279,7 +279,7 @@ def get_mapped_level(
return False

cmap = device.coupling_map
cmap_converted = convert_cmap_to_tuple_list(cmap)
cmap_converted = [(c[0], c[1]) for c in cmap]
arch = Architecture(cmap_converted)

# add blank wires to the circuit such that afterwards the number of qubits is equal to the number of qubits of the architecture
Expand Down
7 changes: 0 additions & 7 deletions src/mqt/bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,4 @@ def calc_supermarq_features(

def get_module_for_benchmark(benchmark_name: str) -> ModuleType:
"""Returns the module for a specific benchmark."""
if benchmark_name == "qnn":
return import_module("mqt.bench.benchmarks.qiskit_application_ml.qnn")
return import_module("mqt.bench.benchmarks." + benchmark_name)


def convert_cmap_to_tuple_list(c_map: list[list[int]]) -> list[tuple[int, int]]:
"""Converts a coupling map to a list of tuples."""
return [(c[0], c[1]) for c in c_map]
2 changes: 1 addition & 1 deletion tests/test_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def test_unidirectional_coupling_map() -> None:
device_name="oqc_lucy",
)
# check that all gates in the circuit are in the coupling map
cmap = utils.convert_cmap_to_tuple_list(OQCProvider.get_device("oqc_lucy").coupling_map)
cmap = [(c[0], c[1]) for c in OQCProvider.get_device("oqc_lucy").coupling_map]
assert qc.valid_connectivity(arch=pytket.architecture.Architecture(cmap), directed=True)


Expand Down
49 changes: 49 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading