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.

BaseExperiment

class BaseExperiment(physical_qubits, analysis=None, backend=None, experiment_type=None)[source]

Abstract base class for experiments.

Initialize the experiment object.

Parameters:
  • physical_qubits (Sequence[int]) – list of physical qubits for the experiment.

  • analysis (Optional[BaseAnalysis]) – Optional, the analysis to use for the experiment.

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

  • experiment_type (Optional[str]) – Optional, the experiment type string.

Raises:

QiskitError – If qubits contains duplicates.

Attributes

BaseExperiment.analysis

Return the analysis instance for the experiment

BaseExperiment.backend

Return the backend for the experiment

BaseExperiment.experiment_options

Return the options for the experiment.

BaseExperiment.experiment_type

Return experiment type.

BaseExperiment.num_qubits

Return the number of qubits for the experiment.

BaseExperiment.physical_qubits

Return the device qubits for the experiment.

BaseExperiment.run_options

Return options values for the experiment run() method.

BaseExperiment.transpile_options

Return the transpiler options for the run() method.

Methods

BaseExperiment.circuits()

Return a list of experiment circuits.

BaseExperiment.config()

Return the config dataclass for this experiment

BaseExperiment.copy()

Return a copy of the experiment

BaseExperiment.from_config(config)

Initialize an experiment from experiment config

BaseExperiment.run([backend, analysis, timeout])

Run an experiment and perform analysis.

BaseExperiment.set_experiment_options(**fields)

Set the experiment options.

BaseExperiment.set_run_options(**fields)

Set options values for the experiment run() method.

BaseExperiment.set_transpile_options(**fields)

Set the transpiler options for run() method.