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.PurityRBFitter

class PurityRBFitter(purity_result, npurity, cliff_lengths, rb_pattern=None)

GitHub

Class for fitter for purity RB.

Derived from RBFitterBase class.

Parameters

  • purity_result (list) – list of results of the 3^n purity RB sequences per seed (qiskit.Result).
  • npurity (int) – equals 3^n (where n is the dimension).
  • 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__

__init__(purity_result, npurity, cliff_lengths, rb_pattern=None)

Parameters

  • purity_result (list) – list of results of the 3^n purity RB sequences per seed (qiskit.Result).
  • npurity (int) – equals 3^n (where n is the dimension).
  • 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

F234(n, a, b)Function than maps: 2^n x 3^n –> 4^n , namely: (a,b) –> c where a in 2^n, b in 3^n, c in 4^n
__init__(purity_result, npurity, cliff_lengths)param purity_resultlist of results of the
add_data(new_purity_result[, rerun_fit])Add a new result.
add_zdict_ops()Creating all Z-correlators in order to compute the expectation values.
calc_data()Retrieve probabilities of success from execution results.
calc_statistics()Extract averages and std dev from the raw data (self._raw_data).
fit_data()Fit the Purity 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 purity RB data of a single pattern.

Attributes

cliff_lengthsReturn clifford lengths.
fitReturn the purity fit parameters.
raw_dataReturn raw data.
rb_fit_funReturn the fit function rb_fit_fun.
rbfit_purReturn the purity RB fitter.
resultsReturn all the results.
seedsReturn the number of loaded seeds.
ydataReturn ydata (means and std devs).

F234

static F234(n, a, b)

Function than maps: 2^n x 3^n –> 4^n , namely: (a,b) –> c where a in 2^n, b in 3^n, c in 4^n

add_data

add_data(new_purity_result, rerun_fit=True)

Add a new result.

Parameters

  • new_purity_result (list) – list of RB results of the purity RB 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 where is_purity = True.

add_zdict_ops

add_zdict_ops()

Creating all Z-correlators in order to compute the expectation values.

calc_data

calc_data()

Retrieve probabilities of success from execution results.

Measure the purity calculation into an internal variable _raw_data which is a 3-dimensional list, where item (i,j,k) is the purity of 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

calc_statistics()

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].

cliff_lengths

Return clifford lengths.

fit

Return the purity fit parameters.

fit_data

fit_data()

Fit the Purity RB results to an exponential curve.

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.
  • pepc - Purity Error per Clifford.

fit_data_pattern

fit_data_pattern(patt_ind, fit_guess)

Fit the RB results of a particular pattern to an exponential curve.

Parameters

  • patt_ind (int) – index of the subsystem 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.

plot_rb_data

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

Plot purity RB data of a single pattern.

raw_data

Return raw data.

rb_fit_fun

Return the fit function rb_fit_fun.

rbfit_pur

Return the purity RB fitter.

results

Return all the results.

seeds

Return the number of loaded seeds.

ydata

Return ydata (means and std devs).

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