From 08b69346174f4011260c882161292501ab2cf01b Mon Sep 17 00:00:00 2001 From: Alec Edgington Date: Fri, 26 Jan 2024 08:41:48 +0000 Subject: [PATCH] Use QTM_DEFAULT_GATESET instead of tk_gateset. --- tests/e2e_test.py | 5 ++--- tests/test_placement.py | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/e2e_test.py b/tests/e2e_test.py index b61cfad..dcbf03b 100644 --- a/tests/e2e_test.py +++ b/tests/e2e_test.py @@ -9,17 +9,16 @@ from phir.model import PHIRModel from rich import print -from pytket.circuit import OpType from pytket.phir.machine import Machine, MachineTimings from pytket.phir.phirgen import genphir from pytket.phir.place_and_route import place_and_route from pytket.phir.placement import placement_check -from pytket.phir.qtm_machine import QTM_MACHINES_MAP, QtmMachine +from pytket.phir.qtm_machine import QTM_DEFAULT_GATESET, QTM_MACHINES_MAP, QtmMachine from pytket.phir.sharding.sharder import Sharder from tests.test_utils import QasmFile, get_qasm_as_circuit if __name__ == "__main__": - machine = Machine(3, {OpType.TK1, OpType.TK2}, {1}, MachineTimings(3.0, 1.0, 2.0)) + machine = Machine(3, QTM_DEFAULT_GATESET, {1}, MachineTimings(3.0, 1.0, 2.0)) # force machine options for this test # machines normally don't like odd numbers of qubits machine.sq_options = {0, 1, 2} diff --git a/tests/test_placement.py b/tests/test_placement.py index 95a3ad9..b742851 100644 --- a/tests/test_placement.py +++ b/tests/test_placement.py @@ -10,7 +10,6 @@ import pytest -from pytket.circuit import OpType from pytket.phir.machine import Machine, MachineTimings from pytket.phir.placement import ( GateOpportunitiesError, @@ -18,12 +17,11 @@ place, placement_check, ) +from pytket.phir.qtm_machine import QTM_DEFAULT_GATESET -tk_gateset = {OpType.TK1, OpType.TK2} - -m = Machine(4, tk_gateset, {1}, MachineTimings(10, 2, 2)) -m2 = Machine(6, tk_gateset, {1, 3}, MachineTimings(10, 2, 2)) -m3 = Machine(8, tk_gateset, {0, 6}, MachineTimings(10, 2, 2)) +m = Machine(4, QTM_DEFAULT_GATESET, {1}, MachineTimings(10, 2, 2)) +m2 = Machine(6, QTM_DEFAULT_GATESET, {1, 3}, MachineTimings(10, 2, 2)) +m3 = Machine(8, QTM_DEFAULT_GATESET, {0, 6}, MachineTimings(10, 2, 2)) def test_placement_check() -> None: