Repository: qiboteam/qibolab

Issue:
Different signature of `execute_circuits`
The signature of `execute_circuits` 
https://github.com/qiboteam/qibolab/blob/483c5a541f5d8f67f2e561958544aff314a425c6/src/qibolab/backends.py#L112
is different from the abstract method in Qibo (see initial_state).
https://github.com/qiboteam/qibo/blob/703af36f06afff6dbc4a629a66b17671a8d8bd92/src/qibo/backends/abstract.py#L198-L200

Discussion:

Patch:
diff --git a/src/qibolab/backends.py b/src/qibolab/backends.py
index 160b9d50..20c87eb0 100644
--- a/src/qibolab/backends.py
+++ b/src/qibolab/backends.py
@@ -109,7 +109,7 @@ class QibolabBackend(NumpyBackend):
         self.assign_measurements(measurement_map, readout)
         return result
 
-    def execute_circuits(self, circuits, initial_state=None, nshots=1000):
+    def execute_circuits(self, circuits, initial_states=None, nshots=1000):
         """Executes multiple quantum circuits with a single communication with
         the control electronics.
 
@@ -117,19 +117,19 @@ class QibolabBackend(NumpyBackend):
 
         Args:
             circuits (list): List of circuits to execute.
-            initial_state (:class:`qibo.models.circuit.Circuit`): Circuit to prepare the initial state.
+            initial_states (:class:`qibo.models.circuit.Circuit`): Circuit to prepare the initial state.
                 If ``None`` the default ``|00...0>`` state is used.
             nshots (int): Number of shots to sample from the experiment.
 
         Returns:
             List of ``MeasurementOutcomes`` objects containing the results acquired from the execution of each circuit.
         """
-        if isinstance(initial_state, Circuit):
+        if isinstance(initial_states, Circuit):
             return self.execute_circuits(
-                circuit=[initial_state + circuit for circuit in circuits],
+                circuits=[initial_states + circuit for circuit in circuits],
                 nshots=nshots,
             )
-        if initial_state is not None:
+        if initial_states is not None:
             raise_error(
                 ValueError,
                 "Hardware backend only supports circuits as initial states.",


Test patch:
diff --git a/tests/test_backends.py b/tests/test_backends.py
index 5c4586d0..99c46d9f 100644
--- a/tests/test_backends.py
+++ b/tests/test_backends.py
@@ -70,11 +70,15 @@ def test_measurement_samples():
 
 def test_execute_circuits():
     backend = QibolabBackend("dummy")
+    initial_state_circuit = Circuit(3)
+    initial_state_circuit.add(gates.GPI(0, phi=np.pi / 2))
     circuit = Circuit(3)
     circuit.add(gates.GPI2(i, phi=np.pi / 2) for i in range(3))
     circuit.add(gates.M(0, 1, 2))
 
-    results = backend.execute_circuits(5 * [circuit], nshots=100)
+    results = backend.execute_circuits(
+        5 * [circuit], initial_states=initial_state_circuit, nshots=100
+    )
     assert len(results) == 5
     for result in results:
         assert result.samples().shape == (100, 3)