qml.noise.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:
>>> x = np.linspace(1, 10, 5) >>> rng = np.random.default_rng(12345) >>> y = np.exp(-x) + rng.normal(scale=0.1, size=len(x)) >>> qml.noise.exponential_extrapolate(x, y) np.float64(1.015...)
code/api/pennylane.noise.exponential_extrapolate
Download Python script
Download Notebook
View on GitHub