-
Notifications
You must be signed in to change notification settings - Fork 6
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
Coherence Flux #954
Coherence Flux #954
Conversation
To be more explicit as an example and template
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #954 +/- ##
==========================================
- Coverage 97.55% 97.46% -0.10%
==========================================
Files 118 118
Lines 9056 9067 +11
==========================================
+ Hits 8835 8837 +2
- Misses 221 230 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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 @Jacfomg for sharing this!
You can find a few suggestions down below.
@dataclass | ||
class CoherenceFluxSignalData(Data): | ||
"""Coherence acquisition outputs.""" | ||
|
||
data: dict[QubitId, npt.NDArray] = field(default_factory=dict) | ||
"""Raw data acquired.""" |
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 would just define a dictionary instead of defining a dataclass
.
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 agree it would do the job but I like keeping similarities between protocols and sacripts it makes things simpler IMO
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.
My vote goes for skipping the 1-parameter class (there is not even any method associated, so it is truly a wrapper, not even used for the type...)
runcards/coherence_flux.py
Outdated
|
||
# D2 | ||
params_qubit = { | ||
"w_max": 5.552552628640306 * 1e9, # FIXME: this is not the qubit frequency |
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.
True, but at the same time what we usually have in the runcard is the maximum frequency, right?
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.
What we usually have in the runcard is something wrong then 🤷♂️
I think that the correct of way of using it would be for you to define an executor for each flux point. for bias in biases:
with Executor.open(
"myexec",
path="test_rx_calibration",
platform="dummy",
targets=[target],
update=True,
force=True,
) as e:
.... Would this work for you? |
That would save the protocol outputs but then I would like to save the data used on the final plotting on another folder |
Ok then you could pass through CLI the folder for the final plot (for example). |
Indeed:
So, you have two options:
Intermediate options are available as well, since you can batch them the way you prefer. Which one is the most convenient depends on the use case. For a limited range of values, which will be used altogether (e.g. comparing them), I'd go for option 2.. If instead you have many values, I'd organize them according to some hierarchy (which in principle could be done even with 2., but you should filter them manually during reports' generation, which is not available in a user-friendly way). |
I will go with the 1st with the small fix of defining a first unused executed to get some qubit parameters from the platform instead of defining them at every executor |
You can also instantiate the platform without an executor :) |
And, in that case, you will receive a platform with all targets, so you can just query those you want, without instantiating over and over for each target (btw, this is also true for the executor: it executes the routines for a specific target, but its platform always contains all possible targets). |
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.
Quick look at the first script
@dataclass | ||
class CoherenceFluxSignalData(Data): | ||
"""Coherence acquisition outputs.""" | ||
|
||
data: dict[QubitId, npt.NDArray] = field(default_factory=dict) | ||
"""Raw data acquired.""" |
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.
My vote goes for skipping the 1-parameter class (there is not even any method associated, so it is truly a wrapper, not even used for the type...)
Regarding the |
09ac57a
to
5683fe4
Compare
5683fe4
to
40153aa
Compare
40153aa
to
970776b
Compare
because of #981 I can close it. |
Using #949 as it is does not allow me to create several path during the for loop for the bias an have all the report separate. They will be overwritten as far as I understand. Can you take a look @alecandido or @andrea-pasquale
Checklist:
master
main
main