qml.transforms.exponential_extrapolate¶
- exponential_extrapolate(x, y, asymptote=None, eps=1e-06)[source]¶
Extrapolate to the zero-noise limit using an exponential model (\(Ae^{Bx} + C\)). This is done by linearizing the data using a logarithm, whereupon a linear fit is performed. Once the model parameters are found, they are transformed back to exponential parameters.
- Parameters
x (Array) – Data in x axis.
y (Array) – Data in y axis such that \(y = f(x)\).
asymptote (float) – Infinite noise limit expected for your circuit of interest (\(C\) in the equation above). Defaults to 0 in the case an asymptote is not supplied.
eps (float) – Epsilon to regularize \(\log(y - C)\) when the argument is to close to zero or negative.
- Returns
Extrapolated value at f(0).
- Return type
float
See also
Example:
>>> np.random.seed(0) >>> x = np.linspace(1, 10, 5) >>> y = np.exp(-x) + np.random.normal(scale=0.1, size=len(x)) >>> qml.transforms.exponential_extrapolate(x, y) 0.23365009000522544
code/api/pennylane.transforms.exponential_extrapolate
Download Python script
Download Notebook
View on GitHub