Skip to content

stages

Specifies flow stages that will be executed within a flow.

Schema

YAML
init: List[task | subflow] | None
experiments: experiments | None
final: List[task | subflow] | None

Properties

Property Type Description References
init List[task | subflow] | None Initial tasks executed before any experiments. task, subflow
experiments experiments | None Calibration and characterisation tasks on qubits and couplings. experiments
final List[task | subflow] | None Final tasks executed after all the experiments. task, subflow

Remarks

The order of execution of tasks specified in the stages object is the following:

  1. init
  2. experiments
  3. final

The stages are not overlapping, i.e. tasks defined in a stage can only be executed if the preceeding stage has been completed successfuly.

Examples

Running experiments only

For simple flows or during initial stages of work with a new QPU, you might want to run the flow with only a few experiments, without updating the knowledge base, schema, and so on. To do this, it suffices to just specify the experiments stage:

stages:
  experiments:
    - name: experiment-1
  # ...

Running experiments with init and final stages

For more advanced flows that you develop over time, you'll most likely encounter situations in which you need to execute a notebook before or after running experiments. Examples include schema migration, data migration, or signalling that a flow is finished. You can easily achieve those tasks by specifying the init and final stages.

For instance, suppose you want to run the following two tasks before any experiments:

  1. migrate the schema with the schema.ipynb notebook
  2. migrate the data stored in the knowledge base to match the new schema with the data-migration.ipynb notebook

You can achieve that with the following:

stages:
  init:
    - name: schema
    - name: data-migration
      dependencies: 
  experiments:
    # ...

Similarily, if you want to execute the signal-flow-completion.ipynb notebook after all the experiments are finished, you can modify the above snippet like so:

stages:
  init:
    - name: schema
    - name: data-migration
      dependencies: 
  experiments:
    # ...
  final:
    - name: signal-flow-completion