class MultiStateDiscriminationAnalysis[source]#

This class fits a multi-state discriminator to the data.

The class will report the configuration of the discriminator in the analysis result as well as the fidelity of the discrimination reported as

\[F = 1 - \frac{1}{d}\sum{i\neq j}P(i|j)\]

Here, \(d\) is the number of levels that were discriminated while \(P(i|j)\) is the probability of measuring outcome \(i\) given that state \(j\) was prepared.


This class requires that scikit-learn is installed.

Analysis options

These are the keyword arguments of the run() method.

  • Defined in the class MultiStateDiscriminationAnalysis:

    • plot (bool)

      Default value: True
      Set True to create figure for fit result.
    • plotter (BasePlotter)

      Default value: Instance of IQPlotter
      A plotter instance to visualize the analysis result.
    • ax (AxesSubplot)

      Default value: None
      Optional. A matplotlib axis object in which to draw.
    • discriminator (BaseDiscriminator)

      Default value: Instance of SkQDA
      The sklearn discriminator to classify the data. The default is a quadratic discriminant analysis.
  • 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.


Initialize the analysis object.



Return the analysis options for run() method.


A short-cut to the IQ plotter instance.



Return the config dataclass for this analysis

Return type:



Return a copy of the analysis

Return type:


classmethod from_config(config)#

Initialize an analysis class from analysis config

Return type:


run(experiment_data, replace_results=False, **options)#

Run analysis and update ExperimentData with analysis result.

  • experiment_data (ExperimentData) – the experiment data to analyze.

  • replace_results (bool) – If True clear any existing analysis results, figures, and artifacts in the experiment data and replace with new results. See note for additional information.

  • options – additional analysis options. See class documentation for supported options.


An experiment data object containing analysis results, figures, and artifacts.


QiskitError – If experiment_data container is not valid for analysis.

Return type:



Updating Results

If analysis is run with replace_results=True then any analysis results, figures, and artifacts in the experiment data will be cleared and replaced with the new analysis results. Saving this experiment data will replace any previously saved data in a database service using the same experiment ID.

If analysis is run with replace_results=False and the experiment data being analyzed has already been saved to a database service, or already contains analysis results or figures, a copy with a unique experiment ID will be returned containing only the new analysis results and figures. This data can then be saved as its own experiment to a database service.


Set the analysis options for run() method.


fields – The fields to update the options