Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General execution interface #755

Closed
alecandido opened this issue Jan 15, 2024 · 1 comment · Fixed by #861
Closed

General execution interface #755

alecandido opened this issue Jan 15, 2024 · 1 comment · Fixed by #861
Milestone

Comments

@alecandido
Copy link
Member

The present situation is fragmented, both at the Platform level (frontend) and Instrument level (backend), because of the historical way the hardware optimization landed in Qibolab.

Platform

The Platform implements the support for sequence unrolling, by differentiating:

def execute_pulse_sequence(
self, sequence: PulseSequence, options: ExecutionParameters, **kwargs
):

def execute_pulse_sequences(
self, sequences: List[PulseSequence], options: ExecutionParameters, **kwargs
):

even if they are reconvened later on in Platform._execute(). Moreover, sweepers require the usage of a separate method:
def sweep(
self, sequence: PulseSequence, options: ExecutionParameters, *sweepers: Sweeper
):

(also notice how **kwargs enter the first two, and not the latter - but they are always unused, so we could well drop them).

We could reconcile the frontend by having a single Platform.execute(), doing both sweeps and unrolling, possibly at the same time.
The interface would be simply:

 def execute( 
     self, sequences: list[PulseSequence], options: ExecutionParameters, *sweepers: Sweeper 
 ): 

and the current three alternatives are obtained by passing a 1-element list for sequences, or no sweepers object, or both (I also wonder whether, for symmetry, we should have a list[Sweeper] - but that's a detail).

This will require some logic for the missing case of simultaneous sweep and unrolling. In particular, if a sequence containing sweepers is to be unrolled, we should definitely give the user the option to tell that is the same sweeper in all sequences, otherwise a nested loop will be attempted, as nested as the number of swept pulses fitting in the batch.
To make it possible, #692 will be needed.

For the time being, if multiple sequences will be passed, the potential sweepers should be unrolled (generating even more lists), which is simpler to implement, and does not require any change in the user code (on the contrary, the mark for sweepers identity will have to be explicitly inserted by the user).

Controller

At the backend level, we have the Controller.play() and Controller.sweep() methods. But they are already collapsed somewhere, e.g.

def play(self, qubits, couplers, sequence, options):
return self.sweep(qubits, couplers, sequence, options)

a suitable implementation of sweepers (with a proper recursion) for the other drivers will remove the necessity for the separation. At that point, we will just keep the Controller.play() with the strictly more general .sweep() interface.

This was referenced Jan 23, 2024
@alecandido alecandido linked a pull request Apr 23, 2024 that will close this issue
3 tasks
@alecandido alecandido added this to the Qibolab 0.2.0 milestone Apr 23, 2024
@alecandido
Copy link
Member Author

Completed in #861

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant