qiboteam / qibo

A full-stack framework for quantum computing.
https://qibo.science
Apache License 2.0
294 stars 60 forks source link

Expectation values as native backend arrays #1382

Closed BrunoLiegiBastonLiegi closed 1 month ago

BrunoLiegiBastonLiegi commented 4 months ago

This updates the expectation values calculation, that are now computed and returned as native arrays of the backend used. This, in turns, begs for updating some of the error mitigation methods accordingly. In particular, as torch was having problems with the scipy.curve_fit I had to implement a custom _curve_fit based on the torch.optim.LBFGS optimizer.

Checklist:

codecov[bot] commented 4 months ago

Codecov Report

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

Please upload report for BASE (master@325190e). Learn more about missing BASE report. Report is 18 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1382 +/- ## ========================================= Coverage ? 97.11% ========================================= Files ? 81 Lines ? 11699 Branches ? 0 ========================================= Hits ? 11362 Misses ? 337 Partials ? 0 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibo/pull/1382/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/qibo/pull/1382/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `97.11% <100.00%> (?)` | | 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.