{ "cells": [ { "cell_type": "markdown", "id": "b4db0bfb-f716-41a4-a0e5-a7761c3ec941", "metadata": {}, "source": [ "# Tutorial 0) Arbok, a dynamicially generated qcodes driver" ] }, { "cell_type": "markdown", "id": "162bc0ec-9b00-48ea-871f-b38703a739d3", "metadata": {}, "source": [ "## 0. Introduction and overwiew" ] }, { "cell_type": "markdown", "id": "adaec79a-a403-4fce-ae88-72dd303cd149", "metadata": {}, "source": [ "Welcome to the `arbok_driver` tutorials!" ] }, { "cell_type": "markdown", "id": "4ccff823-1345-4220-85fe-6fa6350bfbe1", "metadata": {}, "source": [ "In this series we will explore how this python package generates a qcodes\n", "driver on the fly to modularize and parameterize our complex measurement sequences.\n", "\n", "Arbok is a top-level python control framework based on [QCoDeS](https://microsoft.github.io/Qcodes/index.html) compiling into FPGA instructions ([QM-QUA SDK](https://pypi.org/project/qm-qua/1.1.7/)) for [quantum machines hardware](https://www.quantum-machines.co/). The core idea behind arbok is to write **qubit control sequences in a device and measurement setup agnostic manner** that are configured/ scaled to larger systems by providing the respective **configurations that characterize that given system**.\n", "\n", "
\n",
"
\n",
"
\n",
"
\n",
"
\n",
" \n",
"
\n",
"# Single QUA script generated at 2026-04-06 05:18:49.564030\n",
"# QUA library version: 1.2.5\n",
"\n",
"\n",
"from qm import CompilerOptionArguments\n",
"from qm.qua import *\n",
"\n",
"with program() as prog:\n",
" v1 = declare(int, value=0)\n",
" with infinite_loop_():\n",
" pause()\n",
" assign(v1, 0)\n",
" align()\n",
" play(\"ramp\"*amp(0.1), \"gate_1\", duration=200)\n",
" wait(100, \"gate_1\")\n",
" play(\"ramp\"*amp(0.1), \"gate_1\", duration=200)\n",
" align()\n",
" assign(v1, (v1+1))\n",
" r1 = declare_stream()\n",
" save(v1, r1)\n",
" align()\n",
" with stream_processing():\n",
" r1.buffer(1).save(\"mock_driver_mock_measurement_shots\")\n",
"\n",
"config = None\n",
"\n",
"loaded_config = None\n",
"\n",
"\n",
"\n"
],
"text/plain": [
"\n",
"# Single QUA script generated at \u001b[1;36m2026\u001b[0m-\u001b[1;36m04\u001b[0m-\u001b[1;36m06\u001b[0m \u001b[1;92m05:18:49\u001b[0m.\u001b[1;36m564030\u001b[0m\n",
"# QUA library version: \u001b[1;36m1.2\u001b[0m.\u001b[1;36m5\u001b[0m\n",
"\n",
"\n",
"from qm import CompilerOptionArguments\n",
"from qm.qua import *\n",
"\n",
"with \u001b[1;35mprogram\u001b[0m\u001b[1m(\u001b[0m\u001b[1m)\u001b[0m as prog:\n",
" v1 = \u001b[1;35mdeclare\u001b[0m\u001b[1m(\u001b[0mint, \u001b[33mvalue\u001b[0m=\u001b[1;36m0\u001b[0m\u001b[1m)\u001b[0m\n",
" with \u001b[1;35minfinite_loop_\u001b[0m\u001b[1m(\u001b[0m\u001b[1m)\u001b[0m:\n",
" \u001b[1;35mpause\u001b[0m\u001b[1m(\u001b[0m\u001b[1m)\u001b[0m\n",
" \u001b[1;35massign\u001b[0m\u001b[1m(\u001b[0mv1, \u001b[1;36m0\u001b[0m\u001b[1m)\u001b[0m\n",
" \u001b[1;35malign\u001b[0m\u001b[1m(\u001b[0m\u001b[1m)\u001b[0m\n",
" \u001b[1;35mplay\u001b[0m\u001b[1m(\u001b[0m\u001b[32m\"ramp\"\u001b[0m*\u001b[1;35mamp\u001b[0m\u001b[1m(\u001b[0m\u001b[1;36m0.1\u001b[0m\u001b[1m)\u001b[0m, \u001b[32m\"gate_1\"\u001b[0m, \u001b[33mduration\u001b[0m=\u001b[1;36m200\u001b[0m\u001b[1m)\u001b[0m\n",
" \u001b[1;35mwait\u001b[0m\u001b[1m(\u001b[0m\u001b[1;36m100\u001b[0m, \u001b[32m\"gate_1\"\u001b[0m\u001b[1m)\u001b[0m\n",
" \u001b[1;35mplay\u001b[0m\u001b[1m(\u001b[0m\u001b[32m\"ramp\"\u001b[0m*\u001b[1;35mamp\u001b[0m\u001b[1m(\u001b[0m\u001b[1;36m0.1\u001b[0m\u001b[1m)\u001b[0m, \u001b[32m\"gate_1\"\u001b[0m, \u001b[33mduration\u001b[0m=\u001b[1;36m200\u001b[0m\u001b[1m)\u001b[0m\n",
" \u001b[1;35malign\u001b[0m\u001b[1m(\u001b[0m\u001b[1m)\u001b[0m\n",
" \u001b[1;35massign\u001b[0m\u001b[1m(\u001b[0mv1, \u001b[1m(\u001b[0mv1+\u001b[1;36m1\u001b[0m\u001b[1m)\u001b[0m\u001b[1m)\u001b[0m\n",
" r1 = \u001b[1;35mdeclare_stream\u001b[0m\u001b[1m(\u001b[0m\u001b[1m)\u001b[0m\n",
" \u001b[1;35msave\u001b[0m\u001b[1m(\u001b[0mv1, r1\u001b[1m)\u001b[0m\n",
" \u001b[1;35malign\u001b[0m\u001b[1m(\u001b[0m\u001b[1m)\u001b[0m\n",
" with \u001b[1;35mstream_processing\u001b[0m\u001b[1m(\u001b[0m\u001b[1m)\u001b[0m:\n",
" \u001b[1;35mr1.buffer\u001b[0m\u001b[1m(\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1m)\u001b[0m\u001b[1;35m.save\u001b[0m\u001b[1m(\u001b[0m\u001b[32m\"mock_driver_mock_measurement_shots\"\u001b[0m\u001b[1m)\u001b[0m\n",
"\n",
"config = \u001b[3;35mNone\u001b[0m\n",
"\n",
"loaded_config = \u001b[3;35mNone\u001b[0m\n",
"\n",
"\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"rprint(mock_measurement.get_qua_program_as_str())"
]
},
{
"cell_type": "markdown",
"id": "7412983c-bb38-43a0-a388-34e155e7b060",
"metadata": {},
"source": [
"## 3. Summary"
]
},
{
"cell_type": "markdown",
"id": "8bf6fba8-e663-4800-82b4-ec4219a70cfe",
"metadata": {},
"source": [
"In this tutorial, we introduced the core concepts and workflow of the `arbok_driver` package. We demonstrated how to set up a mock device and driver using configuration files, and how to add a measurement to the driver. We explored the modular structure of measurements by adding a simple `SquarePulse` sub-sequence, and visualized the resulting instrument hierarchy. Finally, we generated a QUA program from the configured measurement, showing how the high-level abstractions in `arbok_driver` translate into executable code for quantum hardware. This foundation prepares us for more advanced topics in subsequent tutorials, such as scaling up measurements, data readout and processing as well as asynchronous operations like feedback or heraled operations."
]
},
{
"cell_type": "markdown",
"id": "5407e790-04e9-460c-97d6-5edde4b43da0",
"metadata": {},
"source": [
"Continue with tutorial 1"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cfe9f0bf-d0d2-4fb3-9040-274541819354",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "arbok-driver",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}