qiboteam / qibo

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

Added global unitary folding for get_noisy_circuits #1327

Closed mho291 closed 2 months ago

mho291 commented 6 months ago

Checklist:

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 99.94%. Comparing base (37e1010) to head (4455a70). Report is 66 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1327 +/- ## ======================================= Coverage 99.94% 99.94% ======================================= Files 78 78 Lines 11236 11248 +12 ======================================= + Hits 11230 11242 +12 Misses 6 6 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibo/pull/1327/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/1327/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `99.94% <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.

AlejandroSopena commented 3 months ago

global_unitary_folding is missing in the docstrings of ZNE().

mho291 commented 3 months ago

global_unitary_folding is missing in the docstrings of ZNE().

Thanks @AlejandroSopena for reviewing the code. I will amend according to your suggestions but will take some time as I am now away. Nonetheless I'd like to share some results using global unitary folding on IQM!

We used ZNE to extrapolate and estimate the ideal value of the approximation ratio, which is the cut_size/max_cut using QAOA for a fairly large graph of 10 nodes (hence 10 qubits). The QAOA only had one layer and the circuit was at a depth of 21. We used global unitary folding.

3reg_graph_ZNE_approxratio

I was pretty impressed at the ZNE's use of Richardson extrapolation! It does seem like we cannot push the ZNE any further beyond maybe 6 or 7 global unitary foldings because the plateau is imminent, so you're right that we might need to use a different fit for the data if the circuit depth is too large.

mho291 commented 2 months ago

Hi @MatteoRobbiati and @AlejandroSopena. Sorry for the late reply, I just returned to work after mandatory national service. Just wondering if we can expedite the merging of this PR. We're in the midst of writing up an AWS blogpost for our Qibo-AWS work where we have results based on global unitary folding. Unfortunately our team cannot release the blogpost to the public unless this PR merged and we have a deadline to meet. Thanks so much!

AlejandroSopena commented 2 months ago

global_unitary_folding is missing in the docstrings of ZNE().

Thanks @AlejandroSopena for reviewing the code. I will amend according to your suggestions but will take some time as I am now away. Nonetheless I'd like to share some results using global unitary folding on IQM!

We used ZNE to extrapolate and estimate the ideal value of the approximation ratio, which is the cut_size/max_cut using QAOA for a fairly large graph of 10 nodes (hence 10 qubits). The QAOA only had one layer and the circuit was at a depth of 21. We used global unitary folding.

3reg_graph_ZNE_approxratio

I was pretty impressed at the ZNE's use of Richardson extrapolation! It does seem like we cannot push the ZNE any further beyond maybe 6 or 7 global unitary foldings because the plateau is imminent, so you're right that we might need to use a different fit for the data if the circuit depth is too large.

These results are very good! This is a good example where global unitary folding works with Richardson extrapolation because the initial circuit is shallow, so there is still room to increase the noise. Even so, an exponential decay would also work with fewer noise levels.