qml.transforms.richardson_extrapolate¶
-
richardson_extrapolate
(x, y)[source]¶ Polynomial fit where the degree of the polynomial is fixed to being equal to the length of
x
.In a nutshell, this function is calling
poly_extrapolate()
withorder = len(x)-1
. This function is compatible with all interfaces supported by pennylane.- Parameters
x (Array) – Data in x
y (Array) – Data in y = f(x)
- Returns
Extrapolated value at f(0).
- Return type
float
See also
Example:
>>> x = np.linspace(1, 10, 5) >>> y = x**2 + x + 1 + 0.3 * np.random.rand(len(x)) >>> qml.transforms.richardson_extrapolate(x, y) tensor(1.15105156, requires_grad=True)
code/api/pennylane.transforms.richardson_extrapolate
Download Python script
Download Notebook
View on GitHub