From 3e86816fffe2e6f240eb9d083d6131d5f6c7477b Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Sun, 31 Mar 2024 15:26:06 +0200 Subject: [PATCH] feat!: Drop single sequence execution for batched one --- src/qibolab/platform/platform.py | 50 ++++++++++---------------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/src/qibolab/platform/platform.py b/src/qibolab/platform/platform.py index d19d7f928..3e141e3cf 100644 --- a/src/qibolab/platform/platform.py +++ b/src/qibolab/platform/platform.py @@ -214,40 +214,6 @@ def disconnect(self): instrument.disconnect() self.is_connected = False - def _execute(self, sequence, options, **kwargs): - """Executes sequence on the controllers.""" - result = {} - - for instrument in self.instruments.values(): - if isinstance(instrument, Controller): - new_result = instrument.play( - self.qubits, self.couplers, sequence, options - ) - if isinstance(new_result, dict): - result.update(new_result) - - return result - - def execute_pulse_sequence( - self, sequence: PulseSequence, options: ExecutionParameters, **kwargs - ): - """ - Args: - sequence (:class:`qibolab.pulses.PulseSequence`): Pulse sequences to execute. - options (:class:`qibolab.platforms.platform.ExecutionParameters`): Object holding the execution options. - **kwargs: May need them for something - Returns: - Readout results acquired by after execution. - """ - options = self.settings.fill(options) - - time = ( - (sequence.duration + options.relaxation_time) * options.nshots * NS_TO_SEC - ) - log.info(f"Minimal execution time (sequence): {time}") - - return self._execute(sequence, options, **kwargs) - @property def _controller(self): """Controller instrument used for splitting the unrolled sequences to @@ -264,7 +230,21 @@ def _controller(self): assert len(controllers) == 1 return controllers[0] - def execute_pulse_sequences( + def _execute(self, sequence, options, **kwargs): + """Executes sequence on the controllers.""" + result = {} + + for instrument in self.instruments.values(): + if isinstance(instrument, Controller): + new_result = instrument.play( + self.qubits, self.couplers, sequence, options + ) + if isinstance(new_result, dict): + result.update(new_result) + + return result + + def execute( self, sequences: List[PulseSequence], options: ExecutionParameters, **kwargs ): """