Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

qiskit.ignis.characterization.T1Fitter

class T1Fitter(backend_result, xdata, qubits, fit_p0, fit_bounds, time_unit='micro-seconds')

GitHub

Estimate T1, based on experiments outcomes,

The experiments were created by t1_circuits, and executed on the device.

The probabilities of measuring 1 is assumed to be of the form

f(t)=Aet/T1+B,f(t) = A\mathrm{e}^{-t/T_1}+B,

for unknown parameters A, B, and T1.

Parameters

  • backend_result (Result) – result of execution of t1_circuits on the backend.
  • xdata (Union[List[float], array]) – delay times of the T1 circuits.
  • qubits (List[int]) – indices of the qubits whose T1‘s are to be measured.
  • fit_p0 (List[float]) – initial values to the fit parameters, where the order is (A,T1,B)(A, T_1, B).
  • fit_bounds (Tuple[List[float], List[float]]) – bounds on the parameters to fit. The first tuple is the lower bounds, in the order (A,T1,B)(A, T_1, B). The second tuple is the upper bounds.
  • time_unit (str) – unit of delay times in xdata.

__init__

__init__(backend_result, xdata, qubits, fit_p0, fit_bounds, time_unit='micro-seconds')

Initialize self. See help(type(self)) for accurate signature.


Methods

__init__(backend_result, xdata, qubits, …)Initialize self.
add_data(results[, recalc, refit])Add new execution results to previous execution results
fit_data([qid, p0, bounds, series])Fit the curve.
plot(qind[, series, ax, show_plot])Plot coherence data.
time([qid, series])Return the characteristic time for the given qubit and series
time_err([qid, series])Return the error of characteristic time for the given qubit and series

Attributes

backend_resultReturn the execution results
descriptionReturn the fitter’s purpose, e.g.
fit_funReturn the function used in the fit, e.g.
measured_qubitsReturn the indices of the qubits to be characterized
paramsReturn the fit function parameters that were calculated by curve_fit
params_errReturn the error of the fit function parameters
seriesReturn the list of series for the data
xdataReturn the data points on the x-axis, the independenet parameter which is fit against
ydataReturn the data points on the y-axis

add_data

add_data(results, recalc=True, refit=True)

Add new execution results to previous execution results

Parameters

  • results (Union[Result, List[Result]]) – new execution results
  • recalc (bool) – whether tp recalculate the data
  • refit (bool) – whether to refit the data

backend_result

Return the execution results

Return type

Union[Result, List[Result]]

description

Return the fitter’s purpose, e.g. ‘T1’

Return type

str

fit_data

fit_data(qid=- 1, p0=None, bounds=None, series=None)

Fit the curve.

Compute self._params and self._params_err

Parameters

  • qid (int) – qubit for fitting. If -1 fit for all the qubits
  • p0 (Optional[List[float]]) – initial guess, equivalent to p0 in scipy.optimize
  • bounds (Optional[Tuple[List[float], List[float]]]) – bounds, equivalent to bounds in scipy.optimize
  • series (Optional[str]) – series to fit (if None fit all)

fit_fun

Return the function used in the fit, e.g. BaseFitter._exp_fit_fun

Return type

Callable

measured_qubits

Return the indices of the qubits to be characterized

Return type

List[int]

params

Return the fit function parameters that were calculated by curve_fit

Return type

List[float]

params_err

Return the error of the fit function parameters

Return type

List[float]

plot

plot(qind, series='0', ax=None, show_plot=False)

Plot coherence data.

Parameters

  • qind – qubit index to plot
  • series – which series to plot (if list then plot multiple)
  • ax – plot axes
  • show_plot – whether to call plt.show()

Returns

The axes object

Return type

Axes

Raises

ImportError – if matplotlib is not installed

series

Return the list of series for the data

Return type

Optional[List[str]]

time

time(qid=- 1, series='0')

Return the characteristic time for the given qubit and series

Parameters

  • qid (int) – the qubit index (or all qubits if -1)
  • series (str) – the series to get

Return type

Union[float, List[float]]

Returns

The characteristic time of the qubit, or all qubits

time_err

time_err(qid=- 1, series='0')

Return the error of characteristic time for the given qubit and series

Parameters

  • qid (int) – the qubit index (or all qubits if -1)
  • series (str) – the series to get

Return type

Union[float, List[float]]

Returns

The error of the characteristic time of the qubit, or all qubits

xdata

Return the data points on the x-axis, the independenet parameter which is fit against

Return type

Union[List[float], array]

ydata

Return the data points on the y-axis

The data points are returning in the form of a list of dictionaries:

  • ydata[i][‘mean’] is a list, where item

    no. j is the probability of success of qubit i for a circuit that lasts xdata[j].

  • ydata[i][‘std’] is a list, where ydata[‘std’][j] is the

    standard deviation of the success of qubit i.

Return type

List[Dict]

Was this page helpful?
Report a bug or request content on GitHub.