-
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
Add fit to Chevron #520
Add fit to Chevron #520
Conversation
Codecov Report
@@ Coverage Diff @@
## main #520 +/- ##
==========================================
+ Coverage 96.42% 96.47% +0.04%
==========================================
Files 66 66
Lines 4789 4846 +57
==========================================
+ Hits 4618 4675 +57
Misses 171 171
Flags with carried forward coverage won't be shown. Click here to find out more. |
That is a good choice for fitting. More usage might expose where it fails, but for that we might want it merged. |
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.
Of course, the critical part is the fit (as for the name of the PR), and we might need to iterate a bit.
All the other modifications are fine :)
src/qibocal/protocols/characterization/two_qubit_interaction/cz_virtualz.py
Outdated
Show resolved
Hide resolved
src/qibocal/protocols/characterization/two_qubit_interaction/cz_virtualz.py
Show resolved
Hide resolved
src/qibocal/protocols/characterization/two_qubit_interaction/chevron.py
Outdated
Show resolved
Hide resolved
src/qibocal/protocols/characterization/two_qubit_interaction/chevron.py
Outdated
Show resolved
Hide resolved
def fit_flux_amplitude(matrix, amps, times): | ||
"""Estimate amplitude of Chevron plot by computing | ||
FFT for each amplitude and chooses the amplitude | ||
which lowers the 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.
I know it's annoying, but the algorithm is definitely not trivial: it would be nice to have a complete description in English (rather than Python) of the whole algorithm.
Maybe we could discuss it before going through the process. Or you can use me as a guinea pig to test the description.
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.
Feel free to have a look now.
src/qibocal/protocols/characterization/two_qubit_interaction/utils.py
Outdated
Show resolved
Hide resolved
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 for implementing this. As a test I tried it on the chevron we got with QM on qw5q_gold last February (one of the first in TII) and it gave: amplitude=0.998, duration=28.7 which is acceptable. Here is the final curve fit in the amplitude slice (done quickly in a notebook):
We should address @alecandido's comments related to code, such as the redundant qubit
variables, before merging, but I agree with @igres26 that in order to evaluate how good the fitting is we need to try it in practice. So I would not block this PR for this, particularly because now we don't have any QPUs to check. We can always improve the fitting later, as we did with other routines.
src/qibocal/protocols/characterization/two_qubit_interaction/chevron.py
Outdated
Show resolved
Hide resolved
src/qibocal/protocols/characterization/two_qubit_interaction/chevron.py
Outdated
Show resolved
Hide resolved
src/qibocal/protocols/characterization/two_qubit_interaction/chevron.py
Outdated
Show resolved
Hide resolved
@alecandido I addressed all your comments but the improvements on the median for which I opened #535. |
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.
Ok, since we postponed the fit
improvements, the rest is pretty much innocuous, and the implementation is fine.
Let's merge :)
I saw that you approved the comment above so I merged... |
This PR implements a post-processing operation for the chevron protocol in order to find the best point for the CZ.
The post-processing works as follows:
This is the result on hardware
TODO:
Checklist:
master
main
main