ReadoutMetrics#

class iqm.pulse.playlist.instructions.ReadoutMetrics(num_segments, integration_occurrences=<factory>, timetrace_occurrences=<factory>, timetrace_lengths=<factory>, implementations=<factory>)#

Bases: object

Aggregates the necessary readout metrics needed for return data processing.

Module: iqm.pulse.playlist.instructions

Attributes

num_segments

Number of segments in the Playlist this ReadoutMetrics object represents.

integration_occurrences

Map each integration readout label (of the format "<component>__<readout key>") to its number of occurrences in each Playlist segment.

timetrace_occurrences

Map each time trace label (of the format "<component>__<readout key>") to its number of occurrences in each Playlist segment.

timetrace_lengths

Map each time trace label (of the format "<component>__<readout key>") to its number of time trace samples.

implementations

Map each integration or time trace readout label to its implementations (of the format "<measure gate name>.<implementation name>").

Methods

extend

Extend the metrics with a ReadoutTrigger in a given Playlist Segment.

filter_out

Filter out labels from the contents in self.

get_components

Get all components in the labels in self

get_keys

Get all readout keys in the labels in self

get_labels

Get all the labels in self

Parameters:
num_segments: int#

Number of segments in the Playlist this ReadoutMetrics object represents.

integration_occurrences: dict[str, list[int]]#

Map each integration readout label (of the format "<component>__<readout key>") to its number of occurrences in each Playlist segment.

timetrace_occurrences: dict[str, list[int]]#

Map each time trace label (of the format "<component>__<readout key>") to its number of occurrences in each Playlist segment.

timetrace_lengths: dict[str, int]#

Map each time trace label (of the format "<component>__<readout key>") to its number of time trace samples.

implementations: dict[str, set[str]]#

Map each integration or time trace readout label to its implementations (of the format "<measure gate name>.<implementation name>").

extend(trigger, seg_idx)#

Extend the metrics with a ReadoutTrigger in a given Playlist Segment.

Parameters:
  • trigger (ReadoutTrigger) – The readout trigger.

  • seg_idx (int) – The index of the Playlist segment trigger belongs to.

Return type:

None

filter_out(labels=None, components=None, keys=None)#

Filter out labels from the contents in self.

Parameters:
  • labels (list[str] | None) – The labels to filter out.

  • components (list[str] | None) – The components to filter out (all labels for these components will be removed).

  • keys (list[str] | None) – The keys to filter out (all components with these keys will be removed).

Return type:

None

get_labels(integration=True, timetrace=True)#

Get all the labels in self

Parameters:
  • integration (bool) – Whether to get integration labels.

  • timetrace (bool) – Whether to get time-trace labels.

Returns:

The applicable labels in self.

Return type:

set[str]

get_components(integration=True, timetrace=True)#

Get all components in the labels in self

Parameters:
  • integration (bool) – Whether to get components from the integration labels.

  • timetrace (bool) – Whether to get components from the time-trace labels.

Returns:

The applicable components in self.

Return type:

set[str]

get_keys(integration=True, timetrace=True)#

Get all readout keys in the labels in self

Parameters:
  • integration (bool) – Whether to get readout keys from the integration labels.

  • timetrace (bool) – Whether to get readout keys from the time-trace labels.

Returns:

The applicable readout keys in self.

Return type:

set[str]