Skip to content

Running multiple-qubit workflows

So far we've dealt only with single-qubit tasks & workflows. In this guide, we'll take a look at workflows involving multiple qubits.

04_customizing_workflows

This guide covers some of the same content from the 04_customizing_workflows example in JupyterLab. If you have access, it might be a better idea to follow the examples there, as this will give you hands on experience navigating the different files required to run a workflow.

Qubit-qubit coupling

To include multiple qubits in a workflow, we simply define the qubits and their couplings in qruise-flow.yaml. The experiments are then separated into qubit experiments, which run on each qubit individually, and coupling experiments, which characterise the interaction between qubits. These are highlighted in the snippet below.

name: demo-example-4-coupling
qubits: [Q1, Q3]
couplings: [[Q1, Q3]]
stages:
  init:
    - name: schema
    - name: bootstrap-kb
    - name: update-kb
  experiments:
    qubit:
      - name: ramsey
      - name: time-t1
        dependencies:
          - ramsey
      - name: readout-discriminator-train
        dependencies:
          - time-t1
      - name: ramsey-ef
        dependencies:
          - readout-discriminator-train
      - name: t2star-qpt-ramsey
        dependencies:
          - ramsey-ef
    coupling:
      - name: correlated-readout-error
        dependencies:
          - ramsey

In this case, we have two qubits, Q1 and Q3, on which we'll run single- and two-qubit tasks (couplings: [[Q1, Q3]]). It's that simple! You can then run qruise flow run in your terminal as usual.

Note

If you don't have any couplings, you can either set couplings: [] or remove this line entirely.

workflow with coupled qubits

Note

If one task on a specific qubit fails, the subsequent tasks on that qubit won't be executed, but tasks will continue to be executed on the other qubit(s).

Batch groups

Batch groups let you run the same experiment on multiple qubits concurrently, speeding up your workflow significantly.

You can define batch_groups to specify which qubits can be measured concurrently. For example, in the qruise-flow.yaml snippet below, Q1 and Q3 are not coupled, meaning their qubit-qubit interaction is negligible. We can save time by executing experiments on these two qubits concurrently without affecting the results.

name: demo-example-6-batch-tasks
qubits: [Q1, Q3]
couplings: []
batch_groups:
  - name: all_qubits
    qubits:
      - [Q1, Q3]
stages:
  init:
    - name: schema
    - name: bootstrap-kb
    - name: update-kb
  experiments:
    qubit:
      - name: ramsey
      - name: time-t1
        dependencies:
          - ramsey
      - name: readout-discriminator-train
        dependencies:
          - time-t1
        batch_group: all_qubits
      - name: ramsey-ef
        dependencies:
          - readout-discriminator-train
      - name: t2star-qpt-ramsey
        dependencies:
          - ramsey-ef
    coupling: []

In the above snippet, we've applied the batch_group to readout_discriminator_train, so this task will be carried out concurrently on Q1 and Q3 using a single notebook. You can see this in the screen capture of the workflow run below (or on the dashboard if you executed the workflow yourself).

03_adding_new_task_to_workflow folder