diff --git a/src/qibolab/backends.py b/src/qibolab/backends.py index 53f2bcaa9..ea80aebff 100644 --- a/src/qibolab/backends.py +++ b/src/qibolab/backends.py @@ -125,6 +125,18 @@ def execute_circuit(self, circuit, initial_state=None, nshots=1000): "Hardware backend only supports circuits as initial states.", ) + if not all(q in circuit.wire_names for q in self.platform.qubits): + # This should be done in qibo side + # raise_error( + # ValueError, + # "Circuit qubits do not match the platform qubits.", + # ) + + # Temporary fix: overwrite the wire names + circuit._wire_names = self.qubits + + self.platform.wire_names = circuit.wire_names + sequence, measurement_map = self.compiler.compile(circuit, self.platform) if not self.platform.is_connected: diff --git a/tests/test_backends.py b/tests/test_backends.py index bf5065723..232106764 100644 --- a/tests/test_backends.py +++ b/tests/test_backends.py @@ -63,6 +63,10 @@ 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", @@ -72,15 +76,8 @@ 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(): backend = QibolabBackend("dummy")