-
Notifications
You must be signed in to change notification settings - Fork 14
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
Instruments section in runcard #585
Conversation
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
Hi @stavros11, I used the private property to avoid multiple connections to the local oscillators. I think that the problem is still there, right? qibolab/src/qibolab/instruments/erasynth.py Lines 30 to 36 in f896cc2
|
Good point, thanks @rodolfocarobene. I changed the R&S and ERA drivers to return the cached values, instead of getting from the instrument every time. This is simpler and should have the same behavior if the setter is implemented properly. |
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 @stavros11 for implementing this.
I did not test it yet but it looks good to me.
I will approve as soon as I test the PR.
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 @stavros11. I tested it on hardware and it seems to work as expected.
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 like the minimal approach, and I see no problem in the implementation. Please, keep going :)
@dataclass | ||
class LocalOscillatorSettings(InstrumentSettings): | ||
power: Optional[float] = None | ||
frequency: Optional[float] = None |
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 are them really optional?
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 are them really optional?
They are needed for execution. However, we initialize them as None
so that we can instantiate the instrument without passing them in the platform create
methods and assign their values later using instrument.setup
(or the setters) after loading the runcard.
In principle we could initialize the instrument with self.settings = None
and then instantiate settings
when setup
or the setters are called, but it is almost the same and maybe slightly more complicated in terms of implementation.
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.
On the one side, I'd agree with you for the current case. But if we had many more settings, the current one is scaling bad (you need linearly more code), while your second solution does not scale at all :)
(i.e. the second solution has arguably a constant overhead, or linearly less than the other one)
Fix #576. Needed for qibocal routines that update instrument (not qubit) parameters, such as the TWPA calibration. It is also useful to dump some instrument settings (LO frequency, etc.) in the runcard so that we can keep them in record. qibolab_platforms_qrc also needs to be updated for this to work.
@rodolfocarobene can you please confirm that my change in
qibolab/src/qibolab/instruments/rfsoc/convert.py
Line 39 in f896cc2
is okay?
Checklist: