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.

CompositeAnalysis

class CompositeAnalysis(analyses, flatten_results=False)[source]

Run analysis for composite experiments.

Composite experiments consist of several component experiments run together in a single execution, the results of which are returned as a single list of circuit result data in the ExperimentData container.

Analysis of this composite circuit data involves constructing a list of experiment data containers for each component experiment containing the marginalized circuit result data for that experiment. These are saved as :meth:.~ExperimentData.child_data` in the main ExperimentData container. Each component experiment data is then analyzed using the analysis class from the corresponding component experiment.

Note

If the composite ExperimentData does not already contain child experiment data containers for the component experiments they will be initialized and added to the experiment data when run() is called on the composite data.

When calling run() on experiment data already containing initialized component experiment data, any previously stored circuit data will be cleared and replaced with the marginalized data from the composite experiment data.

Initialize a composite analysis class.

Parameters:
  • analyses (List[BaseAnalysis]) – a list of component experiment analysis objects.

  • flatten_results (bool) – If True flatten all component experiment results into a single ExperimentData container, including nested composite experiments. If False save each component experiment results as a separate child ExperimentData container.

Attributes

CompositeAnalysis.options

Return the analysis options for run() method.

Methods

CompositeAnalysis.component_analysis([index])

Return the component experiment Analysis instance.

CompositeAnalysis.config()

Return the config dataclass for this analysis

CompositeAnalysis.copy()

Return a copy of the analysis

CompositeAnalysis.from_config(config)

Initialize an analysis class from analysis config

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

Run analysis and update ExperimentData with analysis result.

CompositeAnalysis.set_options(**fields)

Set the analysis options for run() method.