-
Notifications
You must be signed in to change notification settings - Fork 7
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
Example scripts #951
Example scripts #951
Conversation
And to use flake-parts
for more information, see https://pre-commit.ci
Thanks for experimenting with the scripts. with Executor.open(...) as e:
e.flipping(...) Keep this PR draft for a moment. We will work on the context manager, to add plots on the fly, and to put together some (proto-)official recommendations about how to use the scripts API. Then we will come back and simplify this code :) |
Great, once #949 is finished I could take a look to update this. |
Also @stavros11 @andrea-pasquale @alecandido I found that for an RB experiment they want for the qibocal paper could we write the RB part with QUA and the rest of the protocols with a qibocal script? If not each RB scans takes half an hour and they would like to do 10 at least in the whole experiment |
Yes, we could. I believe @stavros11 has a protocol working for the RB protocol. It should be relatively easy to do it. |
@stavros11 will confirm, but I understood the QUA RB is a Qibocal protocol. So, it could be included in a Qibocal script as the ordinary RB, together with everything else (and even in the unlikely case in which it isn't, and @stavros11 manually generated his report, we could make it a protocol) Scripts are alternative to runcards, not to protocols. |
Yes, the RB protocol in QUA is now a Qibocal protocol defined in a branch called Here is an example runcard for running this: platform: qw11q
targets: ["D1"]
actions:
- id: rb_qua
operation: rb_ondevice
parameters:
num_of_sequences: 10000
max_circuit_depth: 500
delta_clifford: 10
n_avg: 1
save_sequences: True
apply_inverse: True # if `False` it will apply "filtered" post-processing
state_discrimination: True and here some example reports: qiboteam/qibolab_platforms_qrc#154. Note that this is different than our existing RB protocol because the sequences are generated in the device and are correlated. I was not planning to open a PR for this for the following reasons:
This routine also has a small enhancement over the original qua example as it allows to download the sequences from the device, since these are needed for the filtered and restless post-processing. |
Thanks @stavros11, although it is true that your qua protocol goes against qibolab-qibocal philosophy, I was thinking that we could try to sell this an additional feature in order to somewhat detach qibocal from qibolab. It is not necessarily a bad idea to have some protocols which are instrument-specific as long they are very few I would say :) |
Regarding this point, I just noticed that even the sweetspots are hard-coded to the previous values, instead of loaded from the runcard, and therefore don't work anymore, other than qubit D4 for which the sweetspot did not change much. I will try to fix this so that it loads the configuration from the qibolab platform. |
Well, what means "very few" is rather arbitrary, and that's the dangerous part. However, I'm also aware that something like this has to be taken into account, but in general, I would follow a different strategy that does not affect the Qibolab-Qibocal split. In particular, the long-term strategy has been outlined in qiboteam/qibolab#854 and qiboteam/qibolab#917, and it will be at the heart of Qibolab 0.3 (in case you didn't know, I'm already getting ready for the next breaking changes :P). The general idea is to expose more features through Qibolab. Even features that are not available for all drivers. I know the proposal looks pretty weird at first glance, but I invite you to go through the rationale, and only consider the practical step as the consequence. |
I will just push draft stuff here also from the qua protocol before getting proper scripts like the ones in #954 |
@@ -181,7 +181,7 @@ def load_data(path: Path, filename: str): | |||
"""Load data stored in a npz file.""" | |||
file = path / f"{filename}.npz" | |||
if file.is_file(): | |||
raw_data_dict = dict(np.load(file)) | |||
raw_data_dict = dict(np.load(file, allow_pickle=True)) |
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.
It definitely sounds bad...
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.
I think both of these changes come from @stavros11 pr
I'm closing this since all scripts for the qibocal paper have been moved to https://github.com/qiboteam/qibocal-paper-data |
I agree this should not be like that, but I feel simpler just to reuse the protocols plotting, dataclasses and results objects. Just for now to get some results for the qibocal paper. After we just need to copy paste the acquisition part and that would be the script.
Checklist:
master
main
main