QProgram Qblox
Qblox extensions for QProgram, a Python DSL for pulse-level quantum experiments.
The core DSL knows nothing about any instrument. This package teaches it about the Qblox cluster. It adds six operations that the portable language does not cover, a capability profile that says what QCM and QRM sequencers accept, and .qp serialization for everything it adds. Importing the package is the whole activation step.
Installation
pip install qprogram-qblox
The core qprogram package installs with it.
A first program
Calibrate the acquisition rotation angle of a readout bus: sweep the angle, discriminate the qubit state at each point, and average the outcome.
import math
import qprogram as qp
from qprogram.buses import BusSchema
from qprogram.waveforms import IQDrag, IQPair, Square
from qprogram_qblox import QProgram # qprogram.QProgram with a typed .qblox namespace
schema = BusSchema.transmon()
q = schema.q
program = QProgram(label="rotation_calibration", schema=schema)
angle = program.variable("angle", units="rad")
with program.average(shots=1000):
with program.sweep(angle).from_linspace(0.0, math.pi, 21):
program.qblox.set_acquisition_rotation(q[0].readout, angle)
program.play(q[0].drive, "pi_pulse")
program.sync()
m0 = program.qblox.acquire(q[0].readout, "weights", fields=(qp.MeasurementField.STATE,))
# Bind calibrated waveforms at the very end; the program itself only names them.
resolved = program.with_waveforms(
{
"pi_pulse": IQDrag(amplitude=0.5, duration=40, sigma=8, beta=0.1),
"weights": IQPair(Square(1.0, 2000), Square(1.0, 2000)),
}
)
result = qp.simulate(resolved)
population = result.get(m0, field=qp.MeasurementField.STATE)
print(population.dims, population.shape) # ('angle',) (21,)
qp.simulate is the reference software executor that ships with the core package. It runs the qblox operations generically: qblox.acquire produces measurement records, the rest have no effect on the simulated outcome. A Qblox platform is a drop-in for the same call and lowers each operation onto real sequencers.
What you get
- Six operations under
program.qblox.acquirereads a bus without playing a readout pulse.set_markersandset_triggerdrive the digital outputs,wait_triggerwaits on a digital input.set_acquisition_thresholdandset_acquisition_rotationconfigure thresholded acquisition, and take effect off the sequencer as slow-control parameter writes at execution time. - Typed or dynamic access.
qprogram_qblox.QProgramhas.qbloxtyped for autocomplete,QbloxMixincomposes with other vendor mixins, and the plainqprogram.QProgramgets the same namespace at runtime once this package is imported. - A capability profile.
QBLOX_DEFAULT_V1declares the operations, waveforms, measurement fields, and limits of a qblox-driven bus, plus the two constraints the hardware imposes: an arbitrary-valued sweep cannot drive a wait duration, and sweeping anIQDragsigma forces its loop to iterate host-side. - Round-tripping
.qpfiles. Every operation serializes asqblox.<name> <args>and reloads to a structurally equal program. Files carryrequire qblox 0.2, which the parser checks against the installed version. - Auto-activation on load.
qprogram.load("file.qp")imports this package on demand when the file requires theqbloxvendor, so a reader never has to know which extensions a file uses.
Documentation
Full documentation, including the operation reference, the capability profile, and the generated API reference, lives at https://qilimanjaro-tech.github.io/qprogram-qblox/.
Development
The project uses uv.
git clone https://github.com/qilimanjaro-tech/qprogram-qblox
cd qprogram-qblox
uv sync --group dev # create .venv and install the package plus dev tools
uv run pytest # run the test suite
uv run ruff check . # lint
uv run ruff format . # format
uv run ty check # type-check
uv run --group docs zensical serve # preview the documentation
License
Apache License 2.0 - see LICENSE.
Metadata
Release files for qprogram-qblox 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| qprogram_qblox-0.2.0.tar.gz | 66.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| qprogram_qblox-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 89.5 kB
Release files / qprogram_qblox-0.2.0.tar.gz
| Download URL | qprogram_qblox-0.2.0.tar.gz |
|---|---|
| Size | 66.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60b5e73a3e3a5cf99e13c6af4f06b869ab1f4a54a7d1c0babf3521906cffba33
|
|
BLAKE2b-256 checksum How to use checksums |
e23ac6f78c81ad8644e2ad046831e1c2f2739798df4dfd829b709f4ac9780c6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / qprogram_qblox-0.2.0-py3-none-any.whl
| Download URL | qprogram_qblox-0.2.0-py3-none-any.whl |
|---|---|
| Size | 22.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e5548f3b5120c29809671537b77f72ff6ebb87aeca550ea2cee02ac1fbb8482
|
|
BLAKE2b-256 checksum How to use checksums |
f6e3e3cd3871dcee4e796af731ff4b39dd033bf22db6166fafc6bd3875a89a96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|