unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
359 stars 157 forks source link

RFC: Layerwise Richardson Extrapolation #2329

Closed purva-thakre closed 4 months ago

purva-thakre commented 5 months ago

Layerwise Richardson Extrapolation RFC

Fixes #2224

codecov[bot] commented 5 months ago

Codecov Report

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

Project coverage is 98.19%. Comparing base (ccb9ff6) to head (bee9d7a). Report is 62 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2329 +/- ## ======================================= Coverage 98.19% 98.19% ======================================= Files 87 87 Lines 4052 4052 ======================================= Hits 3979 3979 Misses 73 73 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

purva-thakre commented 5 months ago

I'll be late to the Community call today due to another appointment right before.

Apologies for the delay in adding this RFC! We can discuss the proposed changes async through the Google doc comments if there's not enough time during the community call.

natestemen commented 5 months ago

The plan is to leave this PR unmerged until the RFC is accepted. Anyone who would like to give comments on the RFC is welcome to during the next two (say?) weeks.

cc @unitaryfund/engineering

purva-thakre commented 5 months ago

Andrea left a comment on the RFC that we should keep the LRE and ZNE inference methods separate. Initially, I thought it would be better to move mitiq.zne.inference to mitiq.inference in order to avoid defining another module for the multivariate extrapolation methods.

The refactor to the Factory class in mitiq would have comprised of : current functions work for single variable extrapolation and there would be another option for the multivariate extrapolation. Based on Andrea's comments, this refactor would be a major breaking change.

https://docs.google.com/document/d/1oFRl4wMGMtn57V0c_1egaHh0WUUAbtgW-U_QxNL9_kY/edit?disco=AAABMa8k_iI

FWIW I do agree with Andrea that this would be a major breaking change. I thought of proposing this breaking change to make it possible for us to extend multivariate extrapolation beyond Richardson extrapolation (in the near future).

I would appreciate comments from others on the two comments in the Backward Compatibility section. I can work on making changes to the RFC afterward.

Edit: Maybe, I am missing something here. I'll try to understand why a Factory refactor might not work for multivariate extrapolation and update the details in the RFC soon.

jordandsullivan commented 5 months ago

Andrea left a comment on the RFC that we should keep the LRE and ZNE inference methods separate. Initially, I thought it would be better to move mitiq.zne.inference to mitiq.inference in order to avoid defining another module for the multivariate extrapolation methods.

I agree that it would make sense to move all the inference methods into their own module as you describe @purva-thakre .

purva-thakre commented 4 months ago

Current version of the RFC (without the linked Jupyter notebook) was accepted during this week's community call.