Running a pre-defined workflow
This guide shows you step-by-step how to run a pre-defined workflow in QruiseOS.
If you haven't already, familiarise yourself with the basic concept of workflows in QruiseOS, particularly the purposes of the relevant files.
You should also acquaint yourself with the dashboard. If you already have login credentials for QruiseOS, you can do this in the live dashboard using the URL you received that looks like https://dashboard.{your_instance_name}.dev.qruise.eu
. From here, you can look at any workflow runs that have already been completed. If you don't have credentials yet, you can learn more on our Navigating the dashboard docs page.
02-running-a-workflow
This guide covers the same content as the 02-running-a-workflow
example in JupyterLab. If you have access, it might be a better idea to follow the example there, as this will give you hands on experience navigating the different files required to run a workflow.
qruise-flow.yaml
¶
As described in the Running a workflow getting started guide, the workflow is defined in qruise-flow.yaml
. Let's walk through the most important entries in this file, shown below.
name: onboarding-02-running-a-workflow
qubits: [Q1]
couplings: []
batch_groups:
- name: all_qubits
qubits:
- [Q1]
stages:
init: []
experiments:
qubit:
- name: resonator-spectroscopy
- name: filter-spectroscopy
dependencies:
- resonator-spectroscopy
- name: pulsed-spectroscopy
dependencies:
- filter-spectroscopy
coupling: []
name: onboarding-02-running-a-workflow
: the name of your workflow.qubits: [Q1]
: the qubits involved in the workflow, here just a single qubit.couplings: []
: the qubit-qubit couplings. As we're working with only a single qubit, we don't have any couplings. (This line is optional and can be omitted.)experiments
: all the experiments tasks that make up the workflow.dependencies
: for each experiment, the list of other tasks that must be completed before it can start. You can see in the screenshot thatfilter-spectroscopy
has the dependencyresonator-spectroscopy
. This means thatfilter-spectroscopy
cannot be executed until afterresonator-spectroscopy
is complete.
On dependencies
In this case, the defined dependencies
don't affect the task execution order because they align with the order they appear in qruise-flow.yaml
. To learn more about how to use dependencies in QruiseOS, see our user guide.
Executing a workflow and checking the output in the dashboard¶
Now we understand the contents of qruise-flow.yaml
, we can jump right to executing our workflow.
-
In Jupyter (
https://jupyter.{your_instance_name}.dev.qruise.eu
), launch a new terminal. (File → New → Terminal) -
If needed, change to the appropriate directory with the command
cd ~/qruise/examples/02_running_a_workflow
. (You can find out which directory you're in using the commandpwd
.) -
Execute the workflow by running
qruise flow run
in the command line. The workflow is assigned an easy-to-remember ID made up of an adjective and an animal species; in the screenshot below,calculating ibis
. -
To access the dashboard, paste
https://dashboard-{your_instance_name}.dev.qruise.eu/workflows
into your web browser, making sure to replace{your_instance_name}
with your own instance name. You can then selectonboarding-02-running-a-workflow
, where you should be able to see your latest workflow runs, including the one just executed.
Now that you know how to run a pre-defined workflow, you can take a look at adding new tasks to your workflow or writing your own.
Custom qubit or task selection
This workflow involved only a single qubit. If you have multiple qubits, but only want to measure certain ones, you can specify this using qruise flow run --qubits QUBIT_NAME
. Similarly, you can use the --start
and --end
flags to specify specific tasks to run. You can learn more about these on the qruise flow run
CLI reference page.