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.

BaseAnalysis

class BaseAnalysis[source]

Abstract base class for analyzing Experiment data.

The data produced by experiments (i.e. subclasses of BaseExperiment) are analyzed with subclasses of BaseAnalysis. The analysis is typically run after the data has been gathered by the experiment. For example, an analysis may perform some data processing of the measured data and a fit to a function to extract a parameter.

Analysis subclasses must implement the abstract method _run_analysis. This method should not have side-effects on the analysis class itself since it could potentially be called asynchronously in multiple threads. Any configurable option values should be specified in the _default_options class method. These values can be overriden by a user by calling the set_options method or for a single-run can be specified by passing kwarg options to the run() method.

Initialize the analysis object.

Attributes

BaseAnalysis.options

Return the analysis options for run() method.

Methods

BaseAnalysis.config()

Return the config dataclass for this analysis

BaseAnalysis.copy()

Return a copy of the analysis

BaseAnalysis.from_config(config)

Initialize an analysis class from analysis config

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

Run analysis and update ExperimentData with analysis result.

BaseAnalysis.set_options(**fields)

Set the analysis options for run() method.