Curve Analysis (qiskit_experiments.curve_analysis)#

Curve analysis provides the analysis base class for a variety of experiments with a single experimental parameter sweep. This analysis subclasses can override several class attributes to customize the behavior from data processing to post-processing, including providing systematic initial guess for parameters tailored to the experiment.

Base Classes#


Abstract superclass of curve analysis base classes.

CurveAnalysis([models, name])

Base class for curve analysis with single curve group.

CompositeCurveAnalysis(analyses[, name])

Composite Curve Analysis.

Data Classes#


A table-like dataset for the intermediate data used for curve fitting.

SeriesDef(*args, **kwargs)

A dataclass to describe the definition of the curve.

CurveData(*args, **kwargs)

A dataclass that manages the multiple arrays comprising the dataset for fitting.

CurveFitResult([method, model_repr, ...])

Result of Qiskit Experiment curve analysis.

ParameterRepr(name[, repr, unit])

Detailed description of fitting parameter.

FitOptions(parameters[, default_p0, ...])

Collection of fitting options.



Abstract class for the serializable Qiskit Experiments curve drawer.


Curve drawer for MatplotLib backend.

Standard Analysis Library#


A class to analyze a trajectory of the Bloch vector of a single qubit.


A class to analyze general exponential decay curve.


A class to analyze general exponential decay curve with sinusoidal oscillation.


Oscillation analysis class based on a fit of the data to a cosine function.


A class to analyze a resonance peak with a square rooted Lorentzian function.


A class to analyze a resonance, typically seen as a peak.


Error amplification analysis class based on a fit to a cosine function.

Fit Functions#

fit_function.cos(x[, amp, freq, phase, baseline])

Cosine function.

fit_function.cos_decay(x[, amp, tau, freq, ...])

Cosine function with exponential decay.

fit_function.exponential_decay(x[, amp, ...])

Exponential function

fit_function.gaussian(x[, amp, sigma, x0, ...])

Gaussian function

fit_function.sqrt_lorentzian(x[, amp, ...])

Square-root Lorentzian function for spectroscopy.

fit_function.sin(x[, amp, freq, phase, baseline])

Sine function.

fit_function.sin_decay(x[, amp, tau, freq, ...])

Sine function with exponential decay.

Initial Guess Estimators#


Get constant offset of sinusoidal signal.

guess.constant_spectral_offset(y[, ...])

Get constant offset of spectral baseline.

guess.exp_decay(x, y)

Get exponential decay parameter from monotonically increasing (decreasing) curve.

guess.rb_decay(x, y[, b])

Get base of exponential decay function which is assumed to be close to 1.

guess.full_width_half_max(x, y, peak_index)

Get full width half maximum value of the peak.

guess.frequency(x, y[, filter_window, ...])

Get frequency of oscillating signal.

guess.max_height(y[, percentile, absolute])

Get maximum value of y curve and its index.

guess.min_height(y[, percentile, absolute])

Get minimum value of y curve and its index.

guess.oscillation_exp_decay(x, y[, ...])

Get exponential decay parameter from oscillating signal.


utils.is_error_not_significant(val[, ...])

Check if the standard error of given value is not significant.


A helper function to create string representation from analysis result data object.

utils.convert_lmfit_result(result, models, ...)

A helper function to convert LMFIT MinimizerResult into CurveFitResult.

utils.eval_with_uncertainties(x, model, params)

Compute Y values with error propagation.

utils.filter_data(data, **filters)

Return the list of filtered data

utils.mean_xy_data(xdata, ydata[, sigma, ...])

Return (x, y_mean, sigma) data.

utils.multi_mean_xy_data(series, xdata, ydata)

Take mean of multi series data set.

utils.data_sort(series, xdata, ydata[, ...])

Sort data.

utils.level2_probability(data, outcome)

Return the outcome probability mean and variance.


Return probability data processor callback used by the analysis classes.