quri_parts.algo.utils package#

exp_fitting(x_data, y_data, order, point)#

Curve fitting with an exponential ansatz f(x) = a + b exp(p(x)), where p(x) is a polynomial of a given order.

Parameters:
  • x_data (Iterable[float]) – x-coordinates for fitting.

  • y_data (Iterable[float]) – y-coordinates for fitting.

  • order (int) – Order of the polynomial on the exponential used for fitting.

  • point (float) – A point at which the fitted function to be evaluated.

Returns:

The fitted parameters (can be accessed with parameters) and a value at the input point of the fitted function (can be accessed with value).

Return type:

FittedResult

exp_fitting_with_const(x_data, y_data, order, constant, point)#

Curve fitting with an exponential ansatz f(x) = constant + b exp(p(x)), where p(x) is a polynomial of a given order and constant is a known parameter (obtained as the infinite limit f(x->inf) when f(x) converges to a finite asymptotic value).

Parameters:
  • x_data (Iterable[float]) – x-coordinates for fitting.

  • y_data (Iterable[float]) – y-coordinates for fitting.

  • order (int) – Order of the polynomial on the exponential used for fitting.

  • constant (float) – A constant deduced from asymptotic behavior f(x->inf).

  • point (float) – A point at which the fitted function to be evaluated.

Returns:

The fitted parameters (can be accessed with parameters) and a value at the input point of the fitted function (can be accessed with value).

Return type:

FittedResult

exp_fitting_with_const_log(x_data, y_data, order, constant, point)#

Log fitting with an exponential ansatz f(x) = constant + b exp(p(x)), where p(x) is a polynomial of a given order and constant is a known parameter (obtained as the infinite limit f(x->inf) when f(x) converges to a finite asymptotic value).

Parameters:
  • x_data (Iterable[float]) – x-coordinates for fitting.

  • y_data (Iterable[float]) – y-coordinates for fitting.

  • order (int) – Order of the polynomial on the exponential used for fitting.

  • constant (float) – A constant deduced from asymptotic behavior f(x->inf).

  • point (float) – A point at which the fitted function to be evaluated.

Returns:

The fitted parameters (can be accessed with parameters) and a value at the input point of the fitted function (can be accessed with value).

Return type:

FittedResult

polynomial_fitting(x_data, y_data, order, point)#

Polynomial fitting with an polynomial of a given order.

Parameters:
  • x_data (Iterable[float]) – x-coordinates for fitting.

  • y_data (Iterable[float]) – y-coordinates for fitting.

  • order (int) – Order of the polynomial used for fitting.

  • point (float) – A point at which the fitted function to be evaluated.

Returns:

The fitted parameters (can be accessed with parameters) and a value at the input point of the fitted function (can be accessed with value).

Return type:

FittedResult

Submodules#