from qm import qua
import xarray as xr
from opx_control.fetching.streams import StreamManager
stm = StreamManager()
axt = stm.axis_tracker
time_coords = xr.Coordinates({
"time": xr.DataArray(time_us, dims="time", attrs={"units": "us"})
})
with qua.program() as prog:
n, t = qua.declare(int), qua.declare(int)
a = qua.declare(qua.fixed)
for qubit in qubits:
stm.add_iq_stream(
name=qubit.name, unit="mV", return_types="I",
mean_axis="averages",
)
with axt.add_axis(qua.for_(n, 0, n < n_averages, n + 1), name="averages"):
with axt.add_axis(qua.for_each_(a, amplitudes), name="drive_amplitude", unit="V"):
with axt.add_axis(qua.for_each_(t, time_ticks), name="time", coords=time_coords):
for qubit in qubits:
I, Q = qubit.measure("readout")
stm[qubit.name].save(1000 * I, 1000 * Q)
with qua.stream_processing():
stm.process()
ds = stm.fetch_dataset(job)
QUA acquisition excerpt. Pulse preparation, drive, calibrated readout, qubits, sweep values, and controller submission belong to your experiment. time_us = time_ticks × 0.004. Numerical data below are simulated; no hardware was run.