Skip to content

Running a task

When running a measurement, the measurement instance holds the code to run on a QPU but does not include any analysis or data persistence methods.

In contrast, a Task contains the instructions for submission, analysis, and data persistence in a single notebook that is executed cell by cell. It also defines input parameters that can be set externally, making it easy to run the notebook as part of a larger workflow.

Architecture choices explained: why are tasks notebooks?

This design produces a manageable, self-contained unit that enables reproducibility and orchestration into larger workflows. Notebooks also provide experimentalists with flexibility and instant set-up.

To learn what a Task is, you should first go through tutorial 01_overview_single_measurement in your Jupyter instance and run the corresponding notebook. The purpose of this tutorial is to explain how a task helps in consolidating measurement, analysis, plotting, and data persistence in a single notebook.

Tasks as QPU experiments or numerical simulations

Tasks don't necessarily involve a measurement on a QPU. For example, a notebook carrying out an optimal control algorithm to define a new set of robust gates based on current QPU knowledge can be handled as a task and performed alongside experiments tasks in a single workflow.

Structure of an experiment task

QruiseOS allows for a lot of flexibility in how a task notebook can be structured. In this section, however, we provide a typical template for structuring an experiment task.

The dashboard Experiment Viewer provides examples of tasks to look into. We suggest to select a T1 experiment run on the my-new-qpu chip and click "Open" to see the task notebook as it was executed. Here is for convenience a snapshot of the second part of the notebook.

task analysis

These notebook cells come right after having acquired the data with the measurement(qpu,QUBIT_NAME).measure() command. In the case of this notebook, the measurement is completed with an analysis with visualisation of the fit (note that the plot is picked up by the Experiment Viewer for a quick view into experiment output). Finally, the last two cells take care of data persistency.

Custom analysis catalogue

Like in the case of measurements, even though Qruise has developed an extensive analysis catalogue for a whole breadth of experiments, we expect QruiseOS users to also want to use their own in-house catalogue. With QruiseOS architecture, doing so is only a matter of adding this line to utils.py:

import yourlab.experiments as experiments

Of course, yourlab.experiments has to be prepared so that it embraces the QruiseOS way to describe experiment analysis. Qruise provides templates to streamline the whole process.