Open alecandido opened 3 weeks ago
I wanted to keep this issue separate from #416 because that one is reporting an issue of a current fit, that could be addressed in different ways, while this one is a proposal for a different fit, that will also require a not-yet-available feature in Qibolab.
The time of flight fit currently consist in the following algorithm:
https://github.com/qiboteam/qibocal/blob/b0c0ef7de08ef35d3f5b8a0140349d3c95724b58/src/qibocal/protocols/signal_experiments/time_of_flight_readout.py#L96-L102
However, this is definitely committed to a given pulse shape, and prone to signal distortions.
A more stable alternative would be to inspect the macroscopic properties of the signal, of which we need only one: the first moment, i.e. its (horizontal) average (expected value, as in distributions).
In order to extract it, the baseline value should be subtracted (otherwise the average would be affected by the centering of the acquisition window), and in principle the carrier should be removed anyhow, to avoid oscillating about 0. This second step could be easily replaced by an absolute value, since the (horizontal) average will be asymptotically insensitive to high-frequency oscillations. In the end, the proposal will be something like:
to be compared to the mean of the signal sent on readout.
However, to work as intended, this requires the following assumptions:
While 1. is a sufficiently general and reasonable assumption, 2. is currently plainly false while using Qibolab. Indeed, the acquisition is done in sync with the readout pulse, cutting the end of the signal. This could be solved by defining the acquisition window independently of the readout pulse.