-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add tests for exponential extrapolation #953
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #953 +/- ##
=======================================
Coverage 97.93% 97.93%
=======================================
Files 73 73
Lines 10338 10338
Branches 1170 1170
=======================================
Hits 10125 10125
Misses 170 170
Partials 43 43 ☔ View full report in Codecov by Sentry. |
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.
Lgtm
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.
@natestemen could keep all the values but add a skip in the test directly for those values only for exponential? With the skip add a comment about exponential not being stable.
Closes #754 |
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.
Thanks 💯
@rmoyard just added a snippet to the changelog, and added a missing docstring to satisfy CI. Feel free to take another look, or merge! |
Context: The last PR (first, second) to add exponential extrapolation capabilities to catalyst.
Description of the Change: This PR ensures that
pennylane.transforms.exponential_extrapolate
works inside catalyst'smitigate_with_zne
function.Benefits: ZNE has increased functionality.
Possible Drawbacks: As part of the testing, I've removed 0.1 and 0.2 from the list of values being used to create different circuits. This is because exponential extrapolation is not necessarily as stable as polynomial fitting. For example, when extrapolating near constant values exponential extrapolation can struggle due to the fact that a linear fit is first performed to understand the "direction" (or$A\mathrm{e}^{-Bx} + C$ where $B\in\mathbb{R}_{> 0}$ .
sign
) of the exponential. If the slope is positive, the data is flipped to fit something that looks likeAn example of this happening can be seen here.
If we want to ensure to continue testing values 0.1 and 0.2 for polynomial extrapolation, we can create separate tests. Let me know what would be best.
Related GitHub Issues:
fixes #754