stages
Specifies flow stages that will be executed within a flow.
Schema¶
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:
init
experiments
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:
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:
- migrate the schema with the
schema.ipynb
notebook - 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:
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: