qiboteam / qibocal

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

Rabi with frequency detuning #857

Closed rodolfocarobene closed 4 months ago

rodolfocarobene commented 4 months ago

I'm trying to close #608. I've currently tested it with dummy only, obtaining fairly reasonable results (I changed the fake values generator):

immagine

It should be tested with real hardware. I'm not sure, in particular, of the fit procedure so at the moment I have not add any update mechanism.

I have also a question regarding "duplication": I have now written the "rabi amplitude frequency signal" routine, I was thinking to write also the one with length. Should I do something regarding the probability routines or the sequences routines?

Checklist:

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 98.55072% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 97.35%. Comparing base (3ee8864) to head (017a620). Report is 50 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/qiboteam/qibocal/pull/857/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/857?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) ```diff @@ Coverage Diff @@ ## main #857 +/- ## ========================================== + Coverage 97.25% 97.35% +0.09% ========================================== Files 109 113 +4 Lines 8044 8459 +415 ========================================== + Hits 7823 8235 +412 - Misses 221 224 +3 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibocal/pull/857/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/857/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `97.35% <98.55%> (+0.09%)` | :arrow_up: | 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](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | Coverage Δ | | |---|---|---| | [src/qibocal/protocols/\_\_init\_\_.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | | | [src/qibocal/protocols/rabi/amplitude.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Frabi%2Famplitude.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3JhYmkvYW1wbGl0dWRlLnB5) | `96.87% <100.00%> (-0.75%)` | :arrow_down: | | [src/qibocal/protocols/rabi/amplitude\_signal.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Frabi%2Famplitude_signal.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3JhYmkvYW1wbGl0dWRlX3NpZ25hbC5weQ==) | `97.40% <100.00%> (-0.54%)` | :arrow_down: | | [src/qibocal/protocols/rabi/ef.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Frabi%2Fef.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3JhYmkvZWYucHk=) | `100.00% <100.00%> (ø)` | | | [src/qibocal/protocols/rabi/length.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Frabi%2Flength.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3JhYmkvbGVuZ3RoLnB5) | `97.26% <100.00%> (-0.62%)` | :arrow_down: | | [src/qibocal/protocols/rabi/length\_sequences.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Frabi%2Flength_sequences.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3JhYmkvbGVuZ3RoX3NlcXVlbmNlcy5weQ==) | `100.00% <100.00%> (ø)` | | | [src/qibocal/protocols/rabi/length\_signal.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Frabi%2Flength_signal.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3JhYmkvbGVuZ3RoX3NpZ25hbC5weQ==) | `100.00% <100.00%> (+2.06%)` | :arrow_up: | | [src/qibocal/protocols/rabi/utils.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Frabi%2Futils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3JhYmkvdXRpbHMucHk=) | `100.00% <100.00%> (ø)` | | | [src/qibocal/protocols/rabi/amplitude\_frequency.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Frabi%2Famplitude_frequency.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3JhYmkvYW1wbGl0dWRlX2ZyZXF1ZW5jeS5weQ==) | `97.95% <97.95%> (ø)` | | | [...bocal/protocols/rabi/amplitude\_frequency\_signal.py](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree&filepath=src%2Fqibocal%2Fprotocols%2Frabi%2Famplitude_frequency_signal.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#diff-c3JjL3FpYm9jYWwvcHJvdG9jb2xzL3JhYmkvYW1wbGl0dWRlX2ZyZXF1ZW5jeV9zaWduYWwucHk=) | `98.36% <98.36%> (ø)` | | | ... and [2 more](https://app.codecov.io/gh/qiboteam/qibocal/pull/857?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/qiboteam/qibocal/pull/857/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam)
andrea-pasquale commented 4 months ago

I have also a question regarding "duplication": I have now written the "rabi amplitude frequency signal" routine, I was thinking to write also the one with length. Should I do something regarding the probability routines or the sequences routines?

Thanks @rodolfocarobene for opening the PR. Having also a probability version of this protocols will be useful I think. Only the acquisition part should be different between the two versions. There are plans to also drop this "duplication" by introducing a flag like we did for the spectroscopies experiment #832. Considering a sequence version I would say that we don't need it unless we receive an explicit request by our lab.

rodolfocarobene commented 4 months ago

This should now be complete! There are four routines:

I tested them just with dummy, if there are cold qubit at TII that would be nice, otherwise I should be able to test these in June. I'm a bit unsure just of the fittings, but other than that they should be ok (they are clearly extremely similar to other already existing experiments)

rodolfocarobene commented 4 months ago

For now I have conducted hardware tests only of rabi_amplitude_frequency_signal (for simplicity), but it seems to be working fine: immagine Here for example it finds the correct frequency and a pi-pulse duration very similar to the optimal one.

I will soon test the other routines as well (sorry if I'm occupying the QPU). With dummy everything works, except maybe the fit with rabi_amplitude_frequency that could maybe have some problem

rodolfocarobene commented 4 months ago

Rabi frequency length (with probability): immagine

Rabi frequency amplitude (with signal) (amplitude is half of the optimal one because I doubled the duration): immagine

Rabi frequency amplitude (with probability): immagine

rodolfocarobene commented 4 months ago

Ok @andrea-pasquale, this should be now really ready to review. I've added the update functions and tried to reduce duplication a bit.

rodolfocarobene commented 4 months ago

Hi guys, could we maybe review it before Wednesday? The code should be fairly fine