Skip to main content
IBM Quantum Platform

qiskit_noise_learning.experiment_builder.ExperimentBuilderStage

class qiskit_noise_learning.experiment_builder.ExperimentBuilderStage

GitHub

Bases: ABC

Abstract base for a stage in the experiment-building pipeline.

Each stage takes an Experiment and returns a new Experiment with additional fields populated or existing fields transformed.

Subclasses declare which Experiment fields they require via the required_fields class attribute, and which fields they populate (can take form None to a non-None value) via populates_fields. The public run() method validates that the required fields are not None before dispatching to _run().

ExperimentBuilder uses populates_fields to compute its aggregate required_fields: a stage’s requirement is satisfied if a preceding stage populates that field.

Parameters

  • required_fields – Tuple of Experiment property names that must be non-None before this stage can execute.
  • populates_fields – Tuple of Experiment property names that this stage populates on the returned Experiment.

__init__

__init__()


Methods

Column 1
Column 2
__init__()
run(experiment)Validate required fields, then apply this stage.

Attributes

Column 1
Column 2
populates_fields
required_fields

run

run(experiment: Experiment) → Experiment

Validate required fields, then apply this stage.

Parameters

experiment – The input experiment.

Returns

A new Experiment with this stage’s transformations applied.

Raises

ValueError – If any field listed in required_fields is None.

Was this page helpful?
Report a bug, typo, or request content on GitHub.