Skip to main content

QProgram QDAC

Tests Code Quality Python License

QDevil QDAC extensions for QProgram, the pulse-level quantum programming DSL. The QDAC is a slow high-precision DAC, used most often for flux biasing.

The core DSL knows nothing about any instrument. This package adds the qdac vendor namespace to it: four operations covering DC offsets, the waveform engine, and the chassis trigger network, a capability profile that says what a QDAC channel can do, and .qp serialization for all of it. Importing the package is what turns those on.

Installation

pip install qprogram-qdac

The only dependency is qprogram itself.

A first program

import qprogram as qp
from qprogram import BusSchema
from qprogram.waveforms import IQPair, Square
from qprogram_qdac import QProgram

schema = BusSchema.flux_tunable_transmon()
q = schema.q

program = QProgram(label="flux-spectroscopy", schema=schema)
bias = program.variable("bias", units="V")

with program.sweep(bias).from_range(-0.2, 0.2, 0.01):
    program.qdac.set_offset(q[0].flux, bias)
    with program.average(shots=100):
        program.play(q[0].drive, "pi_pulse")
        program.sync([q[0].drive, q[0].readout])
        m0 = program.measure(q[0].readout, "readout", "weights")

resolved = program.with_waveforms(
    {
        "pi_pulse": IQPair(Square(0.5, 40), Square(0.0, 40)),
        "readout": IQPair(Square(1.0, 2000), Square(0.0, 2000)),
        "weights": IQPair(Square(1.0, 2000), Square(1.0, 2000)),
    }
)

result = qp.simulate(resolved)
data = result.get(m0)
print(data.dims, data.shape)  # ('bias', 'IQ') (41, 2)

The flux bias comes from the QDAC, the drive and readout from whatever vendor owns those buses. One program describes both, and the nesting is what makes a mixed platform accept it: the bias sweep dispatches from the host, one upload per point, while the average block under it runs in the real-time sequencer. Flatten the two into one block and no domain runs both. sync names its buses because the argument-less form syncs every bus in the program, and a QDAC channel is not something a real-time barrier can wait on.

What you get

  • Four operations under one namespace. set_offset holds a DC voltage on a channel, play uploads an envelope to the channel's waveform engine with explicit dwell (in microseconds), delay (in seconds), repetitions and stepped mode, and set_trigger / wait_trigger wire the channel into the chassis trigger network so QDAC sequences line up with instruments driving other buses.
  • Host-side sweeps, declared rather than guessed. The QDAC has no FPGA, so a swept parameter has to be re-uploaded from the host between iterations. The qdac-default-v1 profile says so through a domain constraint, and qp.explain(program, capabilities) prints the enclosing loop as [host] instead of failing at compile time.
  • Single-channel by declaration. The profile lists only single-channel waveform tokens. An IQ waveform on a QDAC bus is a missing-capability error from qp.validate, not a runtime surprise.
  • Serialization included. Every operation round-trips through the .qp text format, under a require qdac 0.3 header line. A file that names qdac activates this package on load through its entry point, so the reader does not have to import it first.
  • Typed access. QProgram from this package is the core builder with a typed .qdac property. QdacMixin composes with other vendor mixins when a platform spans several instruments.

Documentation

Full documentation, including the operation reference, the capability profile, and the generated API reference, lives at https://qilimanjaro-tech.github.io/qprogram-qdac/.

Development

The project uses uv.

git clone https://github.com/qilimanjaro-tech/qprogram-qdac
cd qprogram-qdac

uv sync --group dev                  # create .venv and install everything
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-qdac 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qprogram-qdac 0.3.0
File Size Uploaded Provenance Actions
qprogram_qdac-0.3.0.tar.gz 64.3 kB Without provenance Details for qprogram_qdac-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qprogram-qdac 0.3.0
File Interpreter ABI Platform Actions
qprogram_qdac-0.3.0-py3-none-any.whl Python 3 none any Details for qprogram_qdac-0.3.0-py3-none-any.whl

Total release size: 86.2 kB

Release files / qprogram_qdac-0.3.0.tar.gz

Download URL qprogram_qdac-0.3.0.tar.gz
Size 64.3 kB
Tags Source
SHA-256 checksum
How to use checksums
580a16b8040dc61d4490ffb00a5a59f7215b8ee3f12e657647f103fe98c791f2
BLAKE2b-256 checksum
How to use checksums
e1b302820caecb1b0b84b21ca78a32da0396ef8dd9c475b2bb530110af1af00f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qprogram_qdac-0.3.0-py3-none-any.whl

Download URL qprogram_qdac-0.3.0-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e789e49205937d6c5d87d0b59cb9a2e4db46d7e7c9f0ca92c68635c3e56c50ce
BLAKE2b-256 checksum
How to use checksums
c1237a59145cd3cda5ec465c7c518bb794fca5017f7537e77bf076211acd1cdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for qprogram-qdac 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page