Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rabi fit failing in some instances #897

Closed
andrea-pasquale opened this issue Jun 21, 2024 · 4 comments · Fixed by #915
Closed

Rabi fit failing in some instances #897

andrea-pasquale opened this issue Jun 21, 2024 · 4 comments · Fixed by #915
Labels
bug Something isn't working calibration

Comments

@andrea-pasquale
Copy link
Contributor

While testing the emulator I saw that the rabi fit tends to fail even if the output is quite well defined.

image_2024-06-19_20-28-00

I think that the error is related to the fft guess, we need to investigate this more.

@andrea-pasquale andrea-pasquale added bug Something isn't working calibration labels Jun 21, 2024
@alecandido
Copy link
Member

Here we can see multiple oscillations, and the emulator is returning a fully imbalanced signal, since it's always positive (at the end of the day, it is always a probability, despite working as a signal).

Thus, we have to subtract from the FFT the 0th moment, i.e. the integral itself, otherwise it will dominate the transformed function, and it may lead to a guess for initial parameters that is very far from the desired global minimum.

Most likely, this was already done in a former version of Qibocal, but it got lost in the current one.

@sorewachigauyo
Copy link

sorewachigauyo commented Jun 24, 2024

On this topic, it might be nice to add tests for individual routines using the emulator (single qubit for now), since the results are deterministic, but that might increase the CI/github actions cost.

@andrea-pasquale
Copy link
Contributor Author

Thanks @sorewachigauyo, indeed we could consider doing something like this.
After discussing with @alecandido, a possible way to speed up the execution time with the emulator could be to run using AveragingMode.SEQUENTIAL. We just need to come up with a mechanism to plug this information into tests.

@alecandido
Copy link
Member

To be more precise: that's a possible way, provided that the emulator is instructed to use it properly (which I believe is not, right now).

AveragingMode.SEQUENTIAL makes the shots the innermost loop. If this information is taken into account, since the evolution is deterministic, the emulator should not re-evolve for each and every shot, just sampling the final state as many times as required.
This would make the shots almost priceless (i.e. for any reasonable amount of shots, the price should be pretty cheap, in comparison to the evolution).
But you will pay for each and every parameters' combination.

In any case, I fully support using the emulator for testing the routines in the CI, as many as possible (even when the results are not fully meaningful - but it will always be incredibly better than with dummy). But I would dedicate an issue on its own ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working calibration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants