Skip to content

Commit

Permalink
feat!: Drop single sequence execution for batched one
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Jul 16, 2024
1 parent 8cc906d commit 3e86816
Showing 1 changed file with 15 additions and 35 deletions.
50 changes: 15 additions & 35 deletions src/qibolab/platform/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
):
"""
Expand Down

0 comments on commit 3e86816

Please sign in to comment.