qiskit.ignis.verification.RBFitter¶

class
RBFitter
(backend_result, cliff_lengths, rb_pattern=None)[source]¶ Class for fitters for randomized benchmarking.
 Parameters
backend_result (Result) – list of results (qiskit.Result).
cliff_lengths (list) – the Clifford lengths, 2D list i x j where i is the number of patterns, j is the number of cliffords lengths.
rb_pattern (list) – the pattern for the RB sequences.

__init__
(backend_result, cliff_lengths, rb_pattern=None)[source]¶  Parameters
backend_result (Result) – list of results (qiskit.Result).
cliff_lengths (list) – the Clifford lengths, 2D list i x j where i is the number of patterns, j is the number of cliffords lengths.
rb_pattern (list) – the pattern for the RB sequences.
Methods
__init__
(backend_result, cliff_lengths[, …]) param backend_result
list of results (qiskit.Result).
add_data
(new_backend_result[, rerun_fit])Add a new result.
Retrieve probabilities of success from execution results.
Extract averages and std dev from the raw data (self._raw_data).
fit_data
()Fit the RB results to an exponential curve.
fit_data_pattern
(patt_ind, fit_guess)Fit the RB results of a particular pattern to an exponential curve.
plot_rb_data
([pattern_index, ax, add_label, …])Plot randomized benchmarking data of a single pattern.
Attributes
Return clifford lengths.
Return fit.
Return raw data.
Return the fit function rb_fit_fun.
Return all the results.
Return the number of loaded seeds.
Return ydata (means and std devs).

add_data
(new_backend_result, rerun_fit=True)[source]¶ Add a new result. Re calculate the raw data, means and fit.
 Parameters
new_backend_result (list) – list of RB results.
rerun_fit (bool) – re calculate the means and fit the result.
 Additional information:
Assumes that the executed ‘result’ is the output of circuits generated by randomized_benchmarking_seq.

calc_data
()[source]¶ Retrieve probabilities of success from execution results.
Outputs results into an internal variable _raw_data which is a 3dimensional list, where item (i,j,k) is the probability to measure the ground state for the set of qubits in pattern “i” for seed no. j and vector length self._cliff_lengths[i][k].
 Additional information:
Assumes that the executed ‘result’ is the output of circuits generated by randomized_benchmarking_seq.

calc_statistics
()[source]¶ Extract averages and std dev from the raw data (self._raw_data).
Assumes that self._calc_data has been run. Output into internal _ydata variable. ydata is a list of dictionaries (length number of patterns). Dictionary ydata[i]:
ydata[i][‘mean’] is a numpy_array of length n; entry j of this array contains the mean probability of success over seeds, for vector length self._cliff_lengths[i][j].
ydata[i][‘std’] is a numpy_array of length n; entry j of this array contains the std of the probability of success over seeds, for vector length self._cliff_lengths[i][j].

property
cliff_lengths
¶ Return clifford lengths.

property
fit
¶ Return fit.

fit_data
()[source]¶ Fit the RB results to an exponential curve.
Fit each of the patterns. Use the data to construct guess values for the fits.
Puts the results into a list of fit dictionaries where each dictionary corresponds to a pattern and has fields:
params
 three parameters of rb_fit_fun. The middle one is the exponent.err
 the error limits of the parameters.epc
 error per Clifford.

fit_data_pattern
(patt_ind, fit_guess)[source]¶ Fit the RB results of a particular pattern to an exponential curve.
 Parameters
patt_ind (int) – index of the data pattern to fit.
fit_guess (list) – guess values for the fit.
Puts the results into a list of fit dictionaries where each dictionary corresponds to a pattern and has fields:
params
 three parameters of rb_fit_fun. The middle one is the exponent.err
 the error limits of the parameters.epc
 error per Clifford.

plot_rb_data
(pattern_index=0, ax=None, add_label=True, show_plt=True)[source]¶ Plot randomized benchmarking data of a single pattern.
 Parameters
pattern_index (int) – which RB pattern to plot.
ax (Axes) – plot axis (if passed in).
add_label (bool) – Add an EPC label.
show_plt (bool) – display the plot.
 Raises
ImportError – if matplotlib is not installed.

property
raw_data
¶ Return raw data.

property
rb_fit_fun
¶ Return the fit function rb_fit_fun.

property
results
¶ Return all the results.

property
seeds
¶ Return the number of loaded seeds.

property
ydata
¶ Return ydata (means and std devs).