-
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
kernels #582
kernels #582
Conversation
for more information, see https://pre-commit.ci
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 implementing this.
I still need to run the protocol.
The modifications in the API look good to me.
src/qibocal/auto/operation.py
Outdated
if "data" not in self.__dict__: | ||
self.data: Optional[ | ||
dict[Union[tuple[QubitId, int], QubitId], npt.NDArray] | ||
] = 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.
Can we move this directly in the __init__
?
With default value 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.
No, because then it was complaning that I was giving after other non default arguments. I mean, we should do something else if we want it to get it out of there.
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.
If possible, try to implement the same approach of the Parameters class, to be consistent with the rest of the code.
qibocal/src/qibocal/auto/operation.py
Lines 76 to 98 in 6d3de62
@classmethod | |
def load(cls, input_parameters): | |
"""Load parameters from runcard. | |
Possibly looking into previous steps outputs. | |
Parameters defined in Parameters class are removed from `parameters` | |
before `cls` is created. | |
Then `nshots` and `relaxation_time` are assigned to cls. | |
.. todo:: | |
move the implementation to History, since it is required to resolve | |
the linked outputs | |
""" | |
default_parent_parameters = deepcopy(DEFAULT_PARENT_PARAMETERS) | |
parameters = deepcopy(input_parameters) | |
for parameter, value in default_parent_parameters.items(): | |
default_parent_parameters[parameter] = parameters.pop(parameter, value) | |
instantiated_class = cls(**parameters) | |
for parameter, value in default_parent_parameters.items(): | |
setattr(instantiated_class, parameter, value) | |
return instantiated_class |
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.
Is this what @GabrielePalazzo did some time ago ? It was not very clear to me what it was doing could you lend me a hand ?
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.
You can also try something easier like
qibocal/src/qibocal/auto/operation.py
Lines 79 to 82 in eca6567
nboot = parameters.pop("nboot", 0) | |
par = cls(**parameters) | |
par.nboot = nboot | |
return par |
src/qibocal/protocols/characterization/signal_experiments/calibrate_state_discrimination.py
Outdated
Show resolved
Hide resolved
src/qibocal/protocols/characterization/signal_experiments/calibrate_state_discrimination.py
Outdated
Show resolved
Hide resolved
src/qibocal/protocols/characterization/signal_experiments/calibrate_state_discrimination.py
Outdated
Show resolved
Hide resolved
Is this PR in draft or under review? |
Well, it was draft because the results were not the expected, I'm waiting for comments from Zurich. But the changes to the API can be reviewed and maybe put them on another PR so they get merged faster. |
src/qibocal/protocols/characterization/signal_experiments/calibrate_state_discrimination.py
Show resolved
Hide resolved
src/qibocal/protocols/characterization/signal_experiments/calibrate_state_discrimination.py
Outdated
Show resolved
Hide resolved
src/qibocal/protocols/characterization/signal_experiments/calibrate_state_discrimination.py
Outdated
Show resolved
Hide resolved
src/qibocal/auto/operation.py
Outdated
if "data" not in self.__dict__: | ||
self.data: Optional[ | ||
dict[Union[tuple[QubitId, int], QubitId], npt.NDArray] | ||
] = 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.
If possible, try to implement the same approach of the Parameters class, to be consistent with the rest of the code.
qibocal/src/qibocal/auto/operation.py
Lines 76 to 98 in 6d3de62
@classmethod | |
def load(cls, input_parameters): | |
"""Load parameters from runcard. | |
Possibly looking into previous steps outputs. | |
Parameters defined in Parameters class are removed from `parameters` | |
before `cls` is created. | |
Then `nshots` and `relaxation_time` are assigned to cls. | |
.. todo:: | |
move the implementation to History, since it is required to resolve | |
the linked outputs | |
""" | |
default_parent_parameters = deepcopy(DEFAULT_PARENT_PARAMETERS) | |
parameters = deepcopy(input_parameters) | |
for parameter, value in default_parent_parameters.items(): | |
default_parent_parameters[parameter] = parameters.pop(parameter, value) | |
instantiated_class = cls(**parameters) | |
for parameter, value in default_parent_parameters.items(): | |
setattr(instantiated_class, parameter, value) | |
return instantiated_class |
…brate_state_discrimination.py Co-authored-by: Edoardo Pedicillo <[email protected]>
The calculation of the kernel calculation was moved https://docs.zhinst.com/labone_q_user_manual/release_notes/ |
It needs laboneq 2.20.0 version that will get merged soon. And testing on hardware. |
src/qibocal/protocols/characterization/signal_experiments/calibrate_state_discrimination.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Alessandro Candido <[email protected]>
src/qibocal/protocols/characterization/signal_experiments/calibrate_state_discrimination.py
Outdated
Show resolved
Hide resolved
Thanks @GabrielePalazzo for the review. Your comments have been addressed. |
Prototype routine to test the kernel computation for integration using zhinst functions.
Also, results.npz and result.json will be generated, which I didn't do correctly and all routines crash.
Tests will fail until we merge qiboteam/qibolab#752 to get kernels in the dummy.
Checklist:
master
main
main