qiboteam / qibolab

Quantum hardware module and drivers for Qibo.
https://qibo.science
Apache License 2.0
40 stars 10 forks source link

reduce the max number of bins #857

Closed hay-k closed 3 months ago

hay-k commented 3 months ago

Fixes https://github.com/qiboteam/qibolab/issues/850

Checklist:

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 66.66%. Comparing base (48d0352) to head (fb2d46f).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #857 +/- ## ======================================= Coverage 66.66% 66.66% ======================================= Files 55 55 Lines 5900 5901 +1 ======================================= + Hits 3933 3934 +1 Misses 1967 1967 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibolab/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/qibolab/pull/857/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `66.66% <100.00%> (+<0.01%)` | :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.

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

hay-k commented 3 months ago

irrespective of how long the acquisition is

What do you mean? If averaging is not done on hardware (i.e. we are executing in singleshot mode), each acquisition operation results into a number that needs to be stored in a separate bin. This is basically when we hit these limits, because we usually need too many bins for such execution. If averaging is done, then multiple acquisitions need only one bin that contains the averaged value. So in that sense you can have more acquisitions (this is basically a for loop in q1asm), than bins, if this is what you meant. The way qblox handles this is that every time you have a new acquisition you just write it into the dedicated bin - this results into averaging instead of overwriting.

alecandido commented 3 months ago

What you are talking about is the "averaging mode": https://github.com/qiboteam/qibolab/blob/48d03523dcfb7f9a5dc721019ec36f29f7715883/src/qibolab/execution_parameters.py#L29-L37 while I was mentioning the "acquisition type": https://github.com/qiboteam/qibolab/blob/48d03523dcfb7f9a5dc721019ec36f29f7715883/src/qibolab/execution_parameters.py#L15-L24 (Qibolab lingo).

My take is that this limit should depend on how much storage you need according to your acquisition type (discrimination could be a single bit, integration a couple of floats, and raw two entire arrays of samples). Isn't it the case?

hay-k commented 3 months ago

A ok. My understanding so far is that in qblox terminology a bin can store one (in general complex) number, and bins are used only in INTEGRATION or DISCRIMINATION mode. In RAW mode things are done a bit differently and it looks like the bin memory is not used for that at all, but I still need to confirm this.