QsysShot¶
- class hugr.qsystem.result.QsysShot(entries: Iterable[TaggedResult] | None = None)[source]¶
Bases:
object
Results from a single shot execution.
Methods
append
Convert results to a dictionary.
Collate all the entries with the same tag in to a dictionary with a list containing all the data for that tag.
Convert results to a dictionary of register bit values.
Attributes
List of tagged results, where each result is a tuple of tag and data value.
- as_dict() dict[str, int | float | bool | list[int | float | bool]] [source]¶
Convert results to a dictionary.
For duplicate tags, the last value is used.
- Returns:
A dictionary where the keys are the tags and the values are the data.
- Return type:
Example
>>> results = QsysShot() >>> results.append("tag1", 1) >>> results.append("tag2", 2) >>> results.append("tag2", 3) >>> results.as_dict() {'tag1': 1, 'tag2': 3}
- collate_tags() dict[str, list[int | float | bool | list[int | float | bool]]] [source]¶
Collate all the entries with the same tag in to a dictionary with a list containing all the data for that tag.