qiboteam / qibo

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

Raise error when initial state shape is wrong #1361

Closed stavros11 closed 4 months ago

stavros11 commented 5 months ago

Implements the fix described in https://github.com/qiboteam/qibo/issues/646#issuecomment-2160875608 and closes #646.

Note that without this, the qibojit-numba backend will proceed with execution and return wrong results, sometimes with a non-normalized final state or segmentation fault.

Checklist:

codecov[bot] commented 5 months ago

Codecov Report

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

Project coverage is 99.84%. Comparing base (70901d5) to head (28da693).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1361 +/- ## ======================================= Coverage 99.84% 99.84% ======================================= Files 74 74 Lines 10760 10763 +3 ======================================= + Hits 10743 10746 +3 Misses 17 17 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibo/pull/1361/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/1361/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `99.84% <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.