qiboteam / qibocal

Quantum calibration, characterization and validation module for Qibo.
https://qibo.science
Apache License 2.0
31 stars 7 forks source link

added flux pulse to the sequence #839

Closed DavidSarlle closed 3 weeks ago

DavidSarlle commented 4 months ago

This PR allows the user to add a flux pulse into the qubit spectroscopy sequence (optional) in order to adjust/check the shift produced in the drive frequency when applying a flux pulse to the qubit.

Checklist:

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 97.21%. Comparing base (aad9f40) to head (24cc606). Report is 752 commits behind head on main.

Files with missing lines Patch % Lines
...l/protocols/characterization/qubit_spectroscopy.py 60.00% 4 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/qiboteam/qibocal/pull/839/graphs/tree.svg?width=650&height=150&src=pr&token=3EA9ZUNKUY&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam)](https://app.codecov.io/gh/qiboteam/qibocal/pull/839?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) ```diff @@ Coverage Diff @@ ## main #839 +/- ## ========================================== - Coverage 97.26% 97.21% -0.05% ========================================== Files 106 106 Lines 7855 7865 +10 ========================================== + Hits 7640 7646 +6 - Misses 215 219 +4 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibocal/pull/839/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/qiboteam/qibocal/pull/839/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `97.21% <60.00%> (-0.05%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/qiboteam/qibocal/pull/839?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | Coverage Δ | | |---|---|---| | [...l/protocols/characterization/qubit\_spectroscopy.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/839?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Fcharacterization%2Fqubit_spectroscopy.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL2NoYXJhY3Rlcml6YXRpb24vcXViaXRfc3BlY3Ryb3Njb3B5LnB5) | `95.23% <60.00%> (-4.77%)` | :arrow_down: |
hay-k commented 4 months ago

@DavidSarlle can you please explain in a bit more detail the rationale behind this proposal? What is the problem that this change is attempting to address?

DavidSarlle commented 4 months ago

@hay-k there is not a problem behind. This is an optional feature that allows the users to add a flux pulse to a qubit spectroscopy, showing how a qubit shifts the drive frequency if a flux pulse is applied. Introducing it here, we can check if the guess parameter obtained from a qubit flux dependence that shifts a qubit to the frequency needed for other operations like CZs is correct. Also, this routine is faster and gives the user more precision to fine tune the flux amplitude needed for the shift.

andrea-pasquale commented 4 months ago

I'm also confused because this change is basically injecting what we were doing before in the flux dependence here, since we are playing with a long flux pulse, which we are planning to drop #841. In order to address the frequency detuning induced by short flux pulses a proper experiment should be implemented.

DavidSarlle commented 4 months ago

Sorry @andrea-pasquale @hay-k, I think the latest code was not uploaded to github for some reason. Check the latest version. Here the user have the possibility of defining the duration and amplitude of the flux pulse applied

andrea-pasquale commented 4 months ago

Sorry @andrea-pasquale @hay-k, I think the latest code was not uploaded to github for some reason. Check the latest version. Here the user have the possibility of defining the duration and amplitude of the flux pulse applied

Thanks for the update @DavidSarlle. I still don't think that those changes should be included in the qubit spectroscopy experiment. We should look in the literature how to measure the detuning generated by short flux pulses.

DavidSarlle commented 4 months ago

@andrea-pasquale ok. No worries. I will keep this routine with me, because it has been very useful chracterizing the CZs. No problem

hay-k commented 4 months ago

there is not a problem behind. This is an optional feature that allows the users to add a flux pulse to a qubit spectroscopy

Well, I didn't mean "what is the problem with the qubit spectroscopy routine that you are trying to fix". What I mean is "what is the use case; what is the problem/situation that you are trying to handle that is not handled by any existing routine". Are you trying to calibrate something with this? Or are you trying to validate calibration that you did by other means? (If yes, what is the metric of validation?)

From the perspective of autocalibration, we want to have strictly defined small routines that are responsible for calibrating a specific thing, or validating specific aspect of calibration. We need to understand your problem better and come up with an optimal solution that is along the lines of this idea. Perhaps a separate dedicated experiment? But what exactly should that experiment do/calibrate/validate?

Also, this routine is faster and gives the user more precision to fine tune the flux amplitude needed for the shift.

Are you using this experiment to manually sweep the flux pulse amplitude to find a suitable value?

we can check if the guess parameter obtained from a qubit flux dependence that shifts a qubit to the frequency needed for other operations like CZs is correct.

This seems to be the problem that you are trying to solve, but can you please still elaborate a bit more? This PR uses a very long qubit flux pulse that spans the entire experiment. For CZ gates one does not need such pulses, but rather short pulses that are applied during the CZ gate only. How are these two related? At what stage of CZ calibration is this experiment useful? How do you intend to calibrate the actual short pulses that are needed for CZ gate?

DavidSarlle commented 4 months ago

@hay-k as I said, when we are calibrating the flux pulse needed for shiting high freq qubits into the low freq qubit, we need to determine the am;kitude and duration of that pulse. For that, we use the qubit flux dependence, that gives use the possibilty to obtain these values. But qubit flux dependence routine is slower and less precise method (3D measurement) than a qubit spec + flux pulse (2D experiment). So, with that we can confirm and play easily with the amplitude and duration, andsee how it sets the high energy qubit at the desired freq. Also, we can automatize the iteration over a range of amps and durations to obtain the best value to shift the high energy qubit. These values must be very accurate in order to caracterize the couplers or the CZ gate in any chip.

But, again, I have been using this method to characterize the couplers and the CZs in iqm an it is very useful, at lest for me. You can see how I use it in my notion reports: https://www.notion.so/qcomp/e0c0346bf4d449c2b0c1e0785067e533?v=c5c2aa2c3fa1497faf893043b12cf3f4&p=9a44e3ae18924710905a1407330e1d14&pm=s

But again, is not a problem if you do not consider that should be the way to do it or that it is not useful.

alecandido commented 3 weeks ago

Replaced by #982