See also
A Jupyter notebook version of this tutorial can be downloaded here.
Qblox Scheduler - Hello World#
In this page we will be writing our first Qblox Scheduler program and execute the program on hardware.
Note: This tutorial requires the installation of Qblox Scheduler. If you have not installed it yet, then click here to visit the installation page.
The purpose of Qblox Scheduler is to use high-level software to construct experimental workflow in to so called schedules on both pulse and gate levels. The schedules are then executed on the Qblox Cluster. As the physical execution is performed by the Qblox Cluster we need to properly initialize the hardware.
Hardware Configuration#
To create this representation of the Qblox Cluster in Qblox Scheduler, we need a hardware configuration file. The hardware configuration file is where the description of our Qblox Cluster will situate. The hardware configuration file includes:
Cluster description
{python} "version": "0.2", "config_type": "QbloxHardwareCompilationConfig", "hardware_description": { "cluster0": { "instrument_type": "Cluster", "ip": "192.168.0.2", "sequence_to_file": False, "ref": "internal", } },
Connectivity description
{python} "connectivity": { "graph": [ ["cluster0.module2.real_output_0", "q0:mw"], ["cluster0.module2.real_output_1", "q1:mw"], ] },
Hardware options which allows the user to set specific parameters tied to the modules in the Cluster e.g.:
Attenuation.
LO frequency.
IF frequency.
etc.
{python} "hardware_options": { "output_att": { "q0:mw-q0.01": 0, "q1:mw-q1.01": 0, }, "modulation_frequencies": { "q0:mw-q0.01": {"interm_freq": 80000000}, "q1:mw-q1.01": {"interm_freq": 80000000}, }, },
For the Qblox Scheduler - Hello world, we will be using the following hardware configuration:
[1]:
hardware_cfg = {
"version": "0.2",
"config_type": "QbloxHardwareCompilationConfig",
"hardware_description": {
"cluster0": {
"instrument_type": "Cluster",
"modules": {
"2": {"instrument_type": "QCM"},
},
"ip": None,
"sequence_to_file": False,
"ref": "internal",
}
},
"connectivity": {
"graph": [
["cluster0.module2.real_output_0", "q0:mw"],
["cluster0.module2.real_output_1", "q1:mw"],
]
},
"hardware_options": {
"output_att": {
"q0:mw-q0.01": 0,
"q1:mw-q1.01": 0,
},
"modulation_frequencies": {
"q0:mw-q0.01": {"interm_freq": 80000000},
"q1:mw-q1.01": {"interm_freq": 80000000},
},
},
}
Note: The full description of what can be contained inside the hardware configuration file can be seen here
Now we have defined our hardware configuration and we want to execute a Qblox Scheduler program on the hardware. To do so, we introduce an object called HardwareAgent to facilitate the communication with our hardware.
Hardware Agent#
The HardwareAgent is a Qblox Scheduler Object, which transmits the created schedules in Qblox Scheduler to the Qblox Cluster. The HardwareAgent takes the created schedule as input, compiles it to Q1ASM and executes it on the hardware. To let the HardwareAgent know what hardware it will communicate to, we have to pass the name of our hardware configuration file as an argument:
[2]:
from qblox_scheduler import HardwareAgent
agent = HardwareAgent(hardware_cfg)
The HardwareAgent is now aware of which Qblox Cluster the created programs need to be executed on, thus it is time to create our first schedule. The schedule includes what pulses are executed, and where (at which physical port) and when (timing) to execute the defined pulses. In order to create and run the schedule, we need to define the schedule and pass it on to the HardwareAgent:
[3]:
from qblox_scheduler import Schedule
schedule = Schedule("Hello World!")
agent.run(schedule)
/builds/0/.venv/lib/python3.10/site-packages/qblox_scheduler/qblox/hardware_agent.py:460: UserWarning: cluster0: Trying to instantiate cluster with ip 'None'.Creating a dummy cluster.
warnings.warn(
[3]:
<xarray.Dataset> Size: 0B
Dimensions: ()
Data variables:
*empty*
Attributes:
tuid: 20251030-004749-994-76a196Note that the schedule does not contain any particular information other than its name at this stage. To expand on the concept and showcase the usefulness of Qblox Scheduler, we’ll introduce more in the Qblox Scheduler - Pulse level tutorial. In that tutorial you will learn how to add pulses to your defined schedule and to execute it on the hardware.