From 8dca5144357eeee8acc1556419e211be4c6b79f0 Mon Sep 17 00:00:00 2001 From: Nils Quetschlich Date: Fri, 19 Apr 2024 16:21:05 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20removed=20ECR=20gate=20postproce?= =?UTF-8?q?ssing=20that=20is=20not=20needed=20anymore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mqt/bench/utils.py | 15 --------------- tests/test_bench.py | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/mqt/bench/utils.py b/src/mqt/bench/utils.py index 509f9d626..c36576019 100644 --- a/src/mqt/bench/utils.py +++ b/src/mqt/bench/utils.py @@ -19,8 +19,6 @@ from qiskit.converters import circuit_to_dag from qiskit_optimization.applications import Maxcut -from mqt.bench.devices import OQCProvider - if TYPE_CHECKING or sys.version_info >= (3, 10, 0): # pragma: no cover from importlib import metadata, resources else: @@ -210,22 +208,9 @@ def save_as_qasm( f.write(qc_str) f.close() - if gate_set == OQCProvider.get_native_gates(): - postprocess_single_oqc_file(str(file)) return True -def postprocess_single_oqc_file(filename: str) -> None: - with Path(filename).open() as f: - lines = f.readlines() - with Path(filename).open("w") as f: - for line in lines: - if not ("gate rzx" in line.strip("\n") or "gate ecr" in line.strip("\n")): - f.write(line) - if 'include "qelib1.inc"' in line.strip("\n"): - f.write("opaque ecr q0,q1;\n") - - def create_zip_file(zip_path: str | None = None, qasm_path: str | None = None) -> int: if zip_path is None: zip_path = get_zip_file_path() diff --git a/tests/test_bench.py b/tests/test_bench.py index 60b865077..108fecfdf 100644 --- a/tests/test_bench.py +++ b/tests/test_bench.py @@ -942,7 +942,7 @@ def test_saving_qasm_to_alternative_location_with_alternative_filename( path.unlink() -def test_oqc_postprocessing() -> None: +def test_oqc_benchmarks() -> None: qc = get_benchmark("ghz", 1, 5) directory = "." filename = "ghz_oqc"