Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remaining pages of LRE user guide #2532

Closed
wants to merge 1 commit into from
Closed

Conversation

purva-thakre
Copy link
Contributor

Description

Fixes #2371


License

  • I license this contribution under the terms of the GNU GPL, version 3 and grant Unitary Fund the right to provide additional permissions as described in section 7 of the GNU GPL, version 3.

Before opening the PR, please ensure you have completed the following where appropriate.



Based on the choice of input parameters, a sample matrix created using {func}`.sample_matrix` is used to find the
coefficients of linear combination required for multivariate Richardson extrapolation (**link theory section here**).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To do: after #2522 is merged

## Disadvantages


When using a large circuit, the number of noise scaled circuits grows polynomially such that the execution time rises because we require the sample matrix to be a square matrix (**link theory page here**).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To do: after #2522 is merged

Copy link
Contributor

@vprusso vprusso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a WIP, but peppering in a few comments. Feel free to ping me again if additional comments would be useful!

# How do I use LRE?


LRE works in two steps: generate noise-scaled circuits and apply inference to results from executed circuits.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without additional comments on the layerwise aspect, this description could just as well apply to ZNE. While this description is not incorrect, it may be misleading as it could be applied to ZNE or LRE without further discussion on how the noise-scaling on different layers comes into the picture.

## Apply LRE directly


With the circuit, and executor defined, we just need to choose the polynomial extrapolation degree as well as the fold multiplier.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the first ,:

With the circuit and executor defined,

)


print(f"Error with mitigation (ZNE): {abs(ideal_value - mitigated_result):.{3}}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This print statement refers to ZNE but it should be LRE

If one aims to reduce the sampling cost by using a larger fold multiplier, the bias for polynomial extrapolation increases as one moves farther away from the zero-noise limit.


Chunking a large circuit with a lower number of chunks to reduce the sampling cost can reduce the performance of LRE. In ZNE parlance, this is equivalent to local folding faring better than global folding in LRE when we use a higher number of chunks in [LRE](lre-3-options.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

faring -> fairing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the phrase is supposed to be fare better not fair better.

https://dictionary.cambridge.org/us/dictionary/english/faring



calculated_mitigated_result = np.dot(noise_scaled_exp_values, coeffs_of_linear_comb)
print(f"Error with mitigation (ZNE): {abs(ideal_value - calculated_mitigated_result):.{3}}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think ZNE should be LRE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks. Good catch!

@purva-thakre
Copy link
Contributor Author

Replaced by #2535

@natestemen
Copy link
Member

#2535 only adds the intro and use case docs. We can still use this PR for part 3 and 4.

@purva-thakre purva-thakre reopened this Oct 11, 2024
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.72%. Comparing base (b7fe9d7) to head (50a4da1).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2532   +/-   ##
=======================================
  Coverage   98.72%   98.72%           
=======================================
  Files          90       90           
  Lines        4156     4158    +2     
=======================================
+ Hits         4103     4105    +2     
  Misses         53       53           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@purva-thakre
Copy link
Contributor Author

I think it'a better to start with a new branch instead of resolving all the conflicts.

@purva-thakre purva-thakre deleted the lre_user_guide branch October 11, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User's Guide for LRE
3 participants