-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for exponential extrapolation (#953)
**Context:** The last PR ([first](#806), [second](PennyLaneAI/pennylane#5972)) to add exponential extrapolation capabilities to catalyst. **Description of the Change:** This PR ensures that `pennylane.transforms.exponential_extrapolate` works inside catalyst's `mitigate_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 `sign`) of the exponential. If the slope is positive, the data is flipped to fit something that looks like $A\mathrm{e}^{-Bx} + C$ where $B\in\mathbb{R}_{> 0}$. An example of this happening can be seen here. ```py >>> exponential_extrapolate([1,2,3], [0.3894, 0.3894183, 0.38941]) -1.0000000000000059e-06 >>> richardson_extrapolate([1,2,3], [0.3894, 0.3894183, 0.38941]) 0.3893551000000072 ``` 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
- Loading branch information
1 parent
4f2b9f1
commit 0055f9e
Showing
2 changed files
with
80 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters