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.verification.CNOTDihedralRBFitter

class CNOTDihedralRBFitter(cnotdihedral_Z_result, cnotdihedral_X_result, elmnts_lengths, rb_pattern=None)

GitHub

Class for fitters for non-Clifford CNOT-Dihedral RB.

Derived from RBFitterBase class. Contains two RBFitter objects.

Parameters

  • cnotdihedral_Z_result (qiskit.Result) – list of results of the RB sequence that measures the ground state.
  • cnotdihedral_X_result (qiskit.Result) – list of results of the RB sequence that measures the +...+>|+...+> state.
  • elmnts_lengths (list) – the group elements lengths, 2D list i x j where i is the number of patterns, j is the number of elements lengths.
  • rb_pattern (list) – the pattern for the RB sequences.

__init__

__init__(cnotdihedral_Z_result, cnotdihedral_X_result, elmnts_lengths, rb_pattern=None)

Parameters

  • cnotdihedral_Z_result (qiskit.Result) – list of results of the RB sequence that measures the ground state.
  • cnotdihedral_X_result (qiskit.Result) – list of results of the RB sequence that measures the +...+>|+...+> state.
  • elmnts_lengths (list) – the group elements lengths, 2D list i x j where i is the number of patterns, j is the number of elements lengths.
  • rb_pattern (list) – the pattern for the RB sequences.

Methods

__init__(cnotdihedral_Z_result, …[, …])param cnotdihedral_Z_resultlist of results of the
add_data(new_cnotdihedral_Z_result, …[, …])Add a new result.
calc_data()Retrieve probabilities of success from execution results.
calc_statistics()Extract averages and std dev.
fit_data()Fit the non-Clifford cnot-dihedral RB results.
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 non-Clifford cnot-dihedral randomized benchmarking data of a single pattern.

Attributes

cliff_lengthsReturn group elements lengths.
fitReturn fit as a 2 element list.
fit_cnotdihedralReturn cnotdihedral fit parameters.
raw_dataReturn raw_data as 2 element list.
rb_fit_funReturn the fit function rb_fit_fun.
rbfit_XReturn the cnotdihedral X fitter.
rbfit_ZReturn the cnotdihedral Z fitter.
resultsReturn all the results as a 2 element list.
seedsReturn the number of loaded seeds as a 2 element list.
ydataReturn ydata (means and std devs) as a 2 element list.

add_data

add_data(new_cnotdihedral_Z_result, new_cnotdihedral_X_result, rerun_fit=True)

Add a new result.

Parameters

  • new_cnotdihedral_Z_result (list) – list of rb results of the cnot-dihedral Z circuits.
  • new_cnotdihedral_X_result (list) – list of rb results of the cnot-dihedral X circuits.
  • 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

calc_data()

Retrieve probabilities of success from execution results. Outputs results into an internal variable: _raw_data .

calc_statistics

calc_statistics()

Extract averages and std dev. Outputs results into an internal variable: _ydata .

cliff_lengths

Return group elements lengths.

fit

Return fit as a 2 element list.

fit_cnotdihedral

Return cnotdihedral fit parameters.

fit_data

fit_data()

Fit the non-Clifford cnot-dihedral RB results.

Fit each of the patterns. According to the paper:

Scalable randomized benchmarking of non-Clifford gates

Returns

A list of dictionaries where each dictionary corresponds to a pattern and has fields:

  • alpha - alpha parameter of the non-Clifford cnot-dihedral RB.
  • 'alpha_err - the error of the alpha parameter of the non-Clifford cnot-dihedral RB.
  • epg_est - the estimated error per a CNOT-dihedral element.
  • epg_est_error - the estimated error derived from the params_err.

Return type

list

fit_data_pattern

fit_data_pattern(patt_ind, fit_guess, fit_index=0)

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.
  • fit_index (int) – 0 fit the standard data, 1 fit the interleaved data.

plot_rb_data

plot_rb_data(pattern_index=0, ax=None, add_label=True, show_plt=True)

Plot non-Clifford cnot-dihedral 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 EPG label.
  • show_plt (bool) – display the plot.

Raises

ImportError – if matplotlib is not installed.

raw_data

Return raw_data as 2 element list.

rb_fit_fun

Return the fit function rb_fit_fun.

rbfit_X

Return the cnotdihedral X fitter.

rbfit_Z

Return the cnotdihedral Z fitter.

results

Return all the results as a 2 element list.

seeds

Return the number of loaded seeds as a 2 element list.

ydata

Return ydata (means and std devs) as a 2 element list.

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