-
Notifications
You must be signed in to change notification settings - Fork 17
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
Unify execution interface #861
Conversation
Currently, it is at the stage of just an interface proposal, but it would require to propagate the |
8d74b7f
to
6f4c84b
Compare
741f85a
to
ef4863f
Compare
ef4863f
to
793a9cb
Compare
793a9cb
to
cf8991a
Compare
Bounds are now always read from the instrument
Removing mentions of no longer existing objects
@stavros11 @hay-k the biggest change is (of course) in Everything else is just a matter of propagating these changes and fixing the tests. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 0.2 #861 +/- ##
==========================================
- Coverage 45.17% 44.93% -0.25%
==========================================
Files 70 70
Lines 6255 6224 -31
==========================================
- Hits 2826 2797 -29
+ Misses 3429 3427 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alecandido. Looks good to me and I think the faster we merge this, the better for other ongoing developers (drivers).
options: ExecutionParameters, | ||
*sweepers: Sweeper, | ||
) -> dict[Any, list]: | ||
"""Execute a pulse sequences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in this docstring, most likely in the Returns:
part (but I cannot comment directly there), we could add a more detailed sentence about what exactly is returned. For example a dict
from readout pulse id
s to ExecuteResult
objects.
That reminds me that at some point we need to finalize the output of this function for 0.2, since this is also user facing. Certainly not for this PR, but currently, I am not sure about the following:
- Should we keep the
dict
and with what keys? Currently we are usingserial
(replaced byid
) and also qubit name. Personally, I think we should keep thedict
but only withid
s, not qubits. - Should we keep separate objects for different averaging/acquisition modes, or just replace everything with array?
- Unrolling: I think
id
is still sufficient and we don't need lists, if all readouts in the givensequences
have distinctid
s. - Sweepers: I think here the same
id
is associated to multiple measurements so maybe we need multi-dimensional arrays (as we have now), however I could think some complicated cases (eg. we are sweeping something on the readout pulse).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep the
dict
and with what keys? Currently we are usingserial
(replaced byid
) and also qubit name. Personally, I think we should keep thedict
but only withid
s, not qubits.
Agreed
Should we keep separate objects for different averaging/acquisition modes, or just replace everything with array?
Replace with arrays. #809 #899 are both listed for 0.2
Unrolling: I think
id
is still sufficient and we don't need lists, if all readouts in the givensequences
have distinctid
s.
That is fine by me. It would keep the return object flat (less nested)
Sweepers: I think here the same
id
is associated to multiple measurements so maybe we need multi-dimensional arrays (as we have now), however I could think some complicated cases (eg. we are sweeping something on the readout pulse).
Sweepers are for loops, by definition. We should collect them within multidimensional arrays, since each iteration is homogeneous with the others.
Possibly, we should identify results with just the id of the original pulse, if newer readout pulses are introduced in the process. But this should be fully internal to the drivers, despite non-trivial
assert pulse.id and pulse.qubit in results | ||
shape = results[pulse.qubit].magnitude.shape | ||
shape = results[pulse.qubit][0].magnitude.shape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following the above comment, why do we need to index using [0]
here? This is probably a patch for tests to pass, however do we actually want the results to be a dict
with list
values now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stavros11 thanks for your comments: I would avoid implementing both, even the docstring, because the current result is not here to stay. Current patches are there because it's useful to have tests passing, even for a work-in-progress 0.2 version, but they will also change as a consequence of new developments concerning the results. I would close this as it is, unless you or @hay-k have any other comments. |
No comments from my side, I agree with the plan and merging this as it is. I also agree with the summary in the issues.
Sure, when you define the interface I will propagate it to QM. |
As previously announced, I'm merging this, and keep going with #809 and #899. Thanks @stavros11 for your review. I will keep into account in those issues (I'm going to directly cite it in there) |
Close #755
Controller.play()
Controller.sweep()