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.
BatchExperiment¶
- class BatchExperiment(experiments, backend=None, flatten_results=False, analysis=None)[source]¶
Combine multiple experiments into a batch experiment.
Batch experiments combine individual experiments on any subset of qubits into a single composite experiment which appends all the circuits from each component experiment into a single batch of circuits to be executed as one experiment job.
Analysis of batch experiments is performed using the
CompositeAnalysis
class which handles sorting the composite experiment circuit data into individual childExperimentData
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 a batch experiment.
- 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
Return the analysis instance for the experiment
Return the backend for the experiment
Return the options for the experiment.
Return experiment type.
Return the number of sub experiments
Return the number of qubits for the experiment.
Return the device qubits for the experiment.
Return options values for the experiment
run()
method.Return the transpiler options for the
run()
method.Methods
Return a list of experiment circuits.
BatchExperiment.component_experiment
([index])Return the component Experiment object.
Return the config dataclass for this experiment
Return a copy of the experiment
BatchExperiment.from_config
(config)Initialize an experiment from experiment config
BatchExperiment.run
([backend, analysis, timeout])Run an experiment and perform analysis.
BatchExperiment.set_experiment_options
(**fields)Set the experiment options.
BatchExperiment.set_run_options
(**fields)Set options values for the experiment
run()
method.BatchExperiment.set_transpile_options
(**fields)Set the transpiler options for
run()
method.