-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
Conversation
|
||
|
||
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**). |
There was a problem hiding this comment.
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**). |
There was a problem hiding this comment.
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
There was a problem hiding this 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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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}}") |
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
faring -> fairing
There was a problem hiding this comment.
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}}") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks. Good catch!
Replaced by #2535 |
#2535 only adds the intro and use case docs. We can still use this PR for part 3 and 4. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
I think it'a better to start with a new branch instead of resolving all the conflicts. |
Description
Fixes #2371
License
Before opening the PR, please ensure you have completed the following where appropriate.