qiboteam / qibo

A framework for quantum computing
https://qibo.science
Apache License 2.0
287 stars 58 forks source link

Migrate ML backends to Qiboml #1365

Open MatteoRobbiati opened 3 months ago

MatteoRobbiati commented 3 months ago

Checklist:

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 99.82%. Comparing base (ad50a20) to head (750a510).

:exclamation: Current head 750a510 differs from pull request most recent head 72eea4b

Please upload reports for the commit 72eea4b to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1365 +/- ## ========================================== - Coverage 99.84% 99.82% -0.02% ========================================== Files 74 72 -2 Lines 10806 10507 -299 ========================================== - Hits 10789 10489 -300 - Misses 17 18 +1 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibo/pull/1365/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/1365/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `99.82% <100.00%> (-0.02%)` | :arrow_down: | 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.

MatteoRobbiati commented 3 months ago

@BrunoLiegiBastonLiegi @Edoardo-Pedicillo now tests are passing.

alecandido commented 3 months ago

@BrunoLiegiBastonLiegi I'd just go for the uniform scheme, no need to make Qiboml different from the other providers.

We should keep a single instruction, just for "tensorflow", that will check explicitly for it, and, in case, replace the backend with "qiboml", and the platform with "tensorflow". This should be just a transition device, until we decide to break for good (thus, we'll open an issue about, and schedule for removal).

Moreover, I'd even drop all the QIBO_NON_NATIVE_BACKENDS specification, just rely on the package name (as we're already doing). If the package is not available, we could catch the error and re-raise, hinting that is not installed, or misspelled (that could even be non-existing). This will allow future backend providers to avoid at all the need of editing qibo source.