From 93ec160d6bd4a17d2ca383b1d18156fceec54f2d Mon Sep 17 00:00:00 2001 From: Changsoo Kim <57739683+csookim@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:45:48 +0400 Subject: [PATCH] Update tests/test_backends.py Co-authored-by: Alessandro Candido --- tests/test_backends.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_backends.py b/tests/test_backends.py index da0676269..3ce064e8f 100644 --- a/tests/test_backends.py +++ b/tests/test_backends.py @@ -62,10 +62,6 @@ def test_natives(): def test_natives_no_cz_cnot(): platform = create_platform("dummy") - for p in platform.pairs: - platform.pairs[p].native_gates.CZ = None - platform.pairs[p].native_gates.CNOT = None - backend = QibolabBackend(platform) assert set(backend.natives) == { "I", @@ -75,7 +71,14 @@ def test_natives_no_cz_cnot(): "GPI2", "GPI", "M", + "CZ", + "CNOT" } + + for gate in ["CZ", "CNOT"]: + for p in platform.pairs: + setattr(platform.pairs[p].native_gates, gate, None) + assert gate not in set(backend.natives) def test_execute_circuit_initial_state():