qiboteam / qibo

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

Fix Shor example #1439

Closed stavros11 closed 2 weeks ago

stavros11 commented 2 weeks ago

Fix Shor example, which is outdated since #1039, as reported in #1432.

The measurement in the end is needed because it is no longer possible to execute circuits that contain only collapse measurements using state vectors.

Specifying nshots=1 is needed because a default nshots=1000 was introduced in #1039 compared to the None being used before. This was also causing the performance issue reported in #1432, because during the repeated execution it was executing the circuit 1000 times instead of one that we need.

Checklist:

codecov[bot] commented 2 weeks ago

Codecov Report

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

Project coverage is 97.10%. Comparing base (e93ec84) to head (c645237). Report is 2 commits behind head on master.

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