Note

This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.

InterleavedRBAnalysis

class InterleavedRBAnalysis[source]

A class to analyze interleaved randomized benchmarking experiment.

Overview

This analysis takes only two series for standard and interleaved RB curve fitting. From the fit α and αc value this analysis estimates the error per Clifford (EPC) of the interleaved gate.

The EPC estimate is obtained using the equation

rCest=(d1)(1αC/α)d

The systematic error bounds are given by

E=min{(d1)[|ααC|+(1α)]d2(d21)(1α)αd2+41αd21α

See Ref. [1] for more details.

Fit model

This is the curve fitting analysis. The following equation(s) are used to represent curve(s).

The fit is based on the following decay functions:

Fit model for standard RB

F(x)=aαx+b

Fit model for interleaved RB

F(x)=a(αcα)x2+b

Fit parameters

The following fit parameters are estimated during the analysis.

Descriptions
  • a: Height of decay curve.

  • b: Base line.

  • α: Depolarizing parameter.

  • αc: Ratio of the depolarizing parameter of interleaved RB to standard RB.

Initial Guess
  • a: Determined by 1b.

  • b: Determined by (1/2)n where n is number of qubit.

  • α: Determined by rb_decay() with standard RB curve.

  • αc: Determined by alpha of interleaved RB curve divided by one of standard RB curve. Both alpha values are estimated by rb_decay().

Boundaries
  • a: [0, 1]

  • b: [0, 1]

  • α: [0, 1]

  • αc: [0, 1]

References

[1] Easwar Magesan, Jay M. Gambetta, B. R. Johnson, Colm A. Ryan, Jerry M. Chow, Seth T. Merkel, Marcus P. da Silva, George A. Keefe, Mary B. Rothwell, Thomas A. Ohki, Mark B. Ketchen, M. Steffen, Efficient measurement of quantum gate error by interleaved randomized benchmarking, Phys. Rev. Lett. 109, 080505 (2012), doi: 10.1103/PhysRevLett.109.080505 (open)

Analysis options

These are the keyword arguments of run() method.

Options
  • Defined in the class BaseCurveAnalysis:

    • plotter (BasePlotter)

      Default value: Instance of CurvePlotter
      A curve plotter instance to visualize the analysis result.
    • plot_raw_data (bool)

      Default value: False
      Set True to draw processed data points, dataset without formatting, on canvas. This is False by default.
    • plot (bool)

      Default value: True
      Set True to create figure for fit result. This is True by default.
    • return_fit_parameters (bool)

      Default value: True
      Set True to return all fit model parameters with details of the fit outcome. Default to True.
    • return_data_points (bool)

      Default value: False
      Set True to include in the analysis result the formatted data points given to the fitter. Default to False.
    • data_processor (Callable)

      Default value: None
      A callback function to format experiment data. This can be a DataProcessor instance that defines the self.__call__ method.
    • normalization (bool)

      Default value: False
      Set True to normalize y values within range [-1, 1]. Default to False.
    • average_method (str)

      Default value: "sample"
      Method to average the y values when the same x values appear multiple times. One of “sample”, “iwv” (i.e. inverse weighted variance), “shots_weighted”. See mean_xy_data() for details. Default to “shots_weighted”.
    • p0 (Dict[str, float])

      Default value: {}
      Initial guesses for the fit parameters. The dictionary is keyed on the fit parameter names.
    • bounds (Dict[str, Tuple[float, float]])

      Default value: {}
      Boundary of fit parameters. The dictionary is keyed on the fit parameter names and values are the tuples of (min, max) of each parameter.
    • fit_method (str)

      Default value: "least_squares"
      Fit method that LMFIT minimizer uses. Default to least_squares method which implements the Trust Region Reflective algorithm to solve the minimization problem. See LMFIT documentation for available options.
    • lmfit_options (Dict[str, Any])

      Default value: {}
      Options that are passed to the LMFIT minimizer. Acceptable options depend on fit_method.
    • x_key (str)

      Default value: "xval"
      Circuit metadata key representing a scanned value.
    • result_parameters (List[Union[str, ParameterRepr])

      Default value: ["alpha", "alpha_c"]
      Parameters reported in the database as a dedicated entry. This is a list of parameter representation which is either string or ParameterRepr object. If you provide more information other than name, you can specify [ParameterRepr("alpha", "α", "a.u.")] for example. The parameter name should be defined in the series definition. Representation should be printable in standard output, i.e. no latex syntax.
    • extra (Dict[str, Any])

      Default value: {}
      A dictionary that is appended to all database entries as extra information.
    • fixed_parameters (Dict[str, Any])

      Default value: {}
      Fitting model parameters that are fixed during the curve fitting. This should be provided with default value keyed on one of the parameter names in the series definition.
    • filter_data (Dict[str, Any])

      Default value: {}
      Dictionary of experiment data metadata to filter. Experiment outcomes with metadata that matches with this dictionary are used in the analysis. If not specified, all experiment data are input to the curve fitter. By default, no filtering condition is set.
    • data_subfit_map (Dict[str, Dict[str, Any]])

      Default value: {"standard": ("standard", {"interleaved": ("interleaved", False)}), "interleaved": ("interleaved", {"interleaved": ("interleaved", True)})}
      The mapping of experiment result data to sub-fit models. This dictionary is keyed on the LMFIT model name, and the value is a sorting key-value pair that filters the experiment results, and the filtering is done based on the circuit metadata.
  • Defined in the class BaseAnalysis:

    • figure_names (str or List[str])

      Default value: None
      Identifier of figures that appear in the experiment data to sort figures by name.

See also

Initialization

Initialize data fields that are privately accessed by methods.

Parameters:
  • models – List of LMFIT Model class to define fitting functions and parameters. If multiple models are provided, the analysis performs multi-objective optimization where the parameters with the same name are shared among provided models. When multiple models are provided, user must specify the data_subfit_map value in the analysis options to allocate experimental results to a particular fit model.

  • name – Optional. Name of this analysis.

Attributes

InterleavedRBAnalysis.drawer

A short-cut for curve drawer instance, if set.

InterleavedRBAnalysis.models

Return fit models.

InterleavedRBAnalysis.name

Return name of this analysis.

InterleavedRBAnalysis.options

Return the analysis options for run() method.

InterleavedRBAnalysis.parameters

Return parameters of this curve analysis.

InterleavedRBAnalysis.plotter

A short-cut to the curve plotter instance.

Methods

InterleavedRBAnalysis.config()

Return the config dataclass for this analysis

InterleavedRBAnalysis.copy()

Return a copy of the analysis

InterleavedRBAnalysis.from_config(config)

Initialize an analysis class from analysis config

InterleavedRBAnalysis.run(experiment_data[, ...])

Run analysis and update ExperimentData with analysis result.

InterleavedRBAnalysis.set_options(**fields)

Set the analysis options for run() method.