qml.noise.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() with order = 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

Example:

>>> x = np.linspace(1, 10, 5)
>>> rng = np.random.default_rng(12345)
>>> y = x**2 + x + 1 + 0.3 * rng.random(len(x))
>>> qml.noise.richardson_extrapolate(x, y)
np.float64(1.26...)