qat.runtime.aggregator module

class QBloxAggregator

Bases: object

Combines acquisition objects from multiple acquire instructions in multiple readout targets. Notice that groupby() preserves (original) relative order, which makes it honour the (sequential) lexicographical order of the loop nest:

playback[target][“acq_0”] contains (potentially) a list of acquisitions collected in the same order as the order in which the packages were sent to the FPGA.

Although acquisition names are enough for unicity in practice, the playback’s structure distinguishes different (multiple) acquisitions per readout target, thus making it more robust.

append(playback, acquires)
clear()
finalise()
Return type:

dict[str, dict[str, Acquisition]]

class ResultsAggregator

Bases: object

Aggregates acquisition results from multiple acquisitions and programs.

For now, we assume that the acquisitions always appear in some nested format, with iterations over variables being the outer-most levels in the nest. All of the different acquisition modes are supported:

  • RAW: The results for each iteration are saved as (number_shots, readout_length, )

  • SCOPE: The results for each iteration are saved as (readout_length, )

  • INTEGRATOR: The results for each iteration are saved as (number_shots, )

The results for each iteration are the inner-most levels in the nest.

Results are aggregated as a numpy array, and can be returned as either a numpy array or nested lists, with numpy arrays being the default. The nested lists is here if we need to replicated legacy behaviour.

Warning

The ResultsAggregator does not support batching of shots for SCOPE acquire modes.

append(playback, acquires)
clear()
finalise(as_list=False)