qilimanjaro-tech / qililab

Qililab is a generic and scalable quantum control library used for fast characterization and calibration of quantum chips. Qililab also offers the ability to execute high-level quantum algorithms with your quantum hardware.
Apache License 2.0
29 stars 2 forks source link

[BUG] hotfix to prevent the bug, now the duration is considered while defining the hashtag of the waveform #713

Closed jordivallsq closed 3 months ago

jordivallsq commented 4 months ago

This is a temporal Hotfix with the bugfix, some feedback is required from Hardware to see if this is the real solution

Bug reference: https://github.com/qilimanjaro-tech/qililab/issues/709

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.24%. Comparing base (6514884) to head (75225b6). Report is 36 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #713 +/- ## ======================================= Coverage 96.24% 96.24% ======================================= Files 275 275 Lines 9088 9088 ======================================= Hits 8747 8747 Misses 341 341 ``` | [Flag](https://app.codecov.io/gh/qilimanjaro-tech/qililab/pull/713/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qilimanjaro-tech) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/qilimanjaro-tech/qililab/pull/713/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qilimanjaro-tech) | `96.24% <ø> (ø)` | | 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=qilimanjaro-tech#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jordivallsq commented 4 months ago

After further investigation of the bug the conclusions are these:

QM has a configuration dictionary (https://docs.quantum-machines.co/1.1.6/qm-qua-sdk/docs/Introduction/config/) including all the information of pulses, waveforms, weights...

The bug originated from a conflict between the information contained in pulses and waveforms for non-Square pulses, in pulses the duration is saved as an integer, and in waveforms the full pulse is saved as an array (with the requirement that the shape of the array must be the same as the duration).

The machine saves internally this configuration using a system of labels and to do so we create hashes based on the characteristics of the pulse (i.e. Gaussian(amplitude: 0.1,duration: 1008,num_sigmas: 4.0)) but the code ignored the duration (Gaussian(amplitude: 0.1,num_sigmas: 4.0)) presumably because it is not needed (even detrimental because is irrelevant information) for Square waveforms. But for non-Square waveforms, it creates a conflict where duration sizes do not match between waveforms and pulses.

The solution implemented solves the problem on non-Square waveforms leaving Square waveforms with the same functionality.

jordivallsq commented 3 months ago

By hardware the test has been test with rabi experiments where the size of the pulse changed in every iteration. The experiment run smoothly without crashes (unlike prior to the fix).

This image is for a drive of 100 ns: image

and for 400 ns: image

we can see how we are able to increase the size of a waveform (through software loops) without any crash

This experiment has been done in collaboration with Oscar

jordivallsq commented 3 months ago

I am adding @fedonman as a reviewer because Juanjo is not available this week