convert_lmfit_result(result, models, xdata, ydata)[source]#

A helper function to convert LMFIT MinimizerResult into CurveFitResult.

CurveFitResult is a dataclass that can be serialized with the experiment JSON decoder. In addition, this class converts LMFIT Parameter objects into ufloats so that extra parameter computation in the analysis post-processing can perform accurate error propagation with parameter correlation.

  • result (MinimizerResult) – Output from LMFIT minimize.

  • models (List[Model]) – Model used for the fitting. Function description is extracted.

  • xdata (ndarray) – X values used for the fitting.

  • ydata (ndarray) – Y values used for the fitting.


QiskitExperiments CurveFitResult object.

Return type: