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.

ParallelExperiment

class ParallelExperiment(experiments, backend=None, flatten_results=False, analysis=None)[source]

Combine multiple experiments into a parallel experiment.

Parallel experiments combine individual experiments on disjoint subsets of qubits into a single composite experiment on the union of those qubits. The component experiment circuits are combined to run in parallel on the respective qubits.

Analysis of parallel experiments is performed using the CompositeAnalysis class which handles marginalizing the composite experiment circuit data into individual child ExperimentData containers for each component experiment which are then analyzed using the corresponding analysis class for that component experiment.

See CompositeAnalysis documentation for additional information.

Initialize the analysis object.

Parameters:
  • experiments (List[BaseExperiment]) – a list of experiments.

  • backend (Optional[Backend]) – Optional, the backend to run the experiment on.

  • 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. This kwarg is ignored if the analysis kwarg is used.

  • analysis (Optional[CompositeAnalysis]) – Optional, the composite analysis class to use. If not provided this will be initialized automatically from the supplied experiments.

Attributes

ParallelExperiment.analysis

Return the analysis instance for the experiment

ParallelExperiment.backend

Return the backend for the experiment

ParallelExperiment.experiment_options

Return the options for the experiment.

ParallelExperiment.experiment_type

Return experiment type.

ParallelExperiment.num_experiments

Return the number of sub experiments

ParallelExperiment.num_qubits

Return the number of qubits for the experiment.

ParallelExperiment.physical_qubits

Return the device qubits for the experiment.

ParallelExperiment.run_options

Return options values for the experiment run() method.

ParallelExperiment.transpile_options

Return the transpiler options for the run() method.

Methods

ParallelExperiment.circuits()

Return a list of experiment circuits.

ParallelExperiment.component_experiment([index])

Return the component Experiment object.

ParallelExperiment.config()

Return the config dataclass for this experiment

ParallelExperiment.copy()

Return a copy of the experiment

ParallelExperiment.from_config(config)

Initialize an experiment from experiment config

ParallelExperiment.run([backend, analysis, ...])

Run an experiment and perform analysis.

ParallelExperiment.set_experiment_options(...)

Set the experiment options.

ParallelExperiment.set_run_options(**fields)

Set options values for the experiment run() method.

ParallelExperiment.set_transpile_options(...)

Set the transpiler options for run() method.