qiskit.ignis.characterization.RabiFitter
class RabiFitter(backend_result, xdata, qubits, fit_p0, fit_bounds=None)
Rabi Experiment fitter
See BaseCalibrationFitter __init__
fit_po is [amp, freq, phase, offset]
__init__
__init__(backend_result, xdata, qubits, fit_p0, fit_bounds=None)
See BaseCalibrationFitter __init__
fit_po is [amp, freq, phase, offset]
Methods
__init__ (backend_result, xdata, qubits, fit_p0) | See BaseCalibrationFitter __init__ |
add_data (results[, recalc, refit]) | Add new execution results to previous execution results |
fit_data ([qid, p0, bounds, series]) | Fit the curve. |
guess_params ([qind]) | Guess fit parameters for rabi oscillation data |
pi2_amplitude ([qind]) | Return the pi/2 amplitude from the fit |
pi_amplitude ([qind]) | Return the pi amplitude from the fit |
plot (qind[, series, ax, show_plot]) | Plot the data and fit |
Attributes
backend_result | Return the execution results |
description | Return the fitter’s purpose, e.g. |
fit_fun | Return the function used in the fit, e.g. |
measured_qubits | Return the indices of the qubits to be characterized |
params | Return the fit function parameters that were calculated by curve_fit |
params_err | Return the error of the fit function parameters |
series | Return the list of series for the data |
xdata | Return the data points on the x-axis, the independenet parameter which is fit against |
ydata | Return 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
guess_params
guess_params(qind=0)
Guess fit parameters for rabi oscillation data
Parameters
qind (int) – qubit index to guess fit parameters for
Returns
List of fit guess parameters
[amp, freq, phase, offset]
Return type
list
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
]
pi2_amplitude
pi2_amplitude(qind=- 1)
Return the pi/2 amplitude from the fit
Parameters
qind (int) – qubit index
Returns
amp
Return type
float
pi_amplitude
pi_amplitude(qind=- 1)
Return the pi amplitude from the fit
Parameters
qind (int) – qubit index
Returns
amp
Return type
float
plot
plot(qind, series='0', ax=None, show_plot=False)
Plot the data and fit
Parameters
- qind (int) – qubit index
- series (str) – data series to plot (for rabi data always ‘0’)
- ax (Axes) – matploblib axes (if none created)
- show_plot (bool) – do plot.show
Returns
Plot axes
Return type
Axes
series
Return the list of series for the data
Return type
Optional
[List
[str
]]
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
]