ExecutionSpans
class ExecutionSpans(spans)
A collection of timings for pub results.
This class is a list-like containing ExecutionSpan
s, where each execution span represents a time window of data collection, and contains a reference to exactly which of the data were collected during the window.
It is possible for distinct time windows to overlap. This is not because a QPU was performing multiple executions at once, but is instead an artifact of certain classical processing that may happen concurrently with quantum execution. The guarantee being made is that the referenced data definitely occurred in the reported execution span, but not necessarily that the limits of the time window are as tight as possible.
Attributes
duration
The total duration of this collection, in seconds.
Return type
float
pub_idxs
Which pubs, by index, have dependence on one or more execution spans present.
Return type
list
[int
]
start
The start time of the entire collection, in UTC.
Return type
datetime
stop
The stop time of the entire collection, in UTC.
Return type
datetime
Methods
__getitem__
__getitem__(idxs: int) → ExecutionSpan
__getitem__(idxs: slice | list[int]) → ExecutionSpans
Return type
ExecutionSpan | ‘ExecutionSpans
__len__
draw
draw(name=None, normalize_y=False, line_width=4)
Draw these execution spans.
To draw multiple sets of execution spans at once, for example coming from multiple jobs, consider calling draw_execution_spans()
directly.
Parameters
- name (
Optional
[str
]) – The name of this set of spans. - normalize_y (
bool
) – Whether to display the y-axis units as a percentage of work complete, rather than cumulative shots completed. - line_width (
int
) – The thickness of line segments.
Return type
Figure
Returns
A plotly figure.
filter_by_pub
filter_by_pub(pub_idx)
Return a new set of spans where each one has been filtered to the specified pubs.
See also :meth:~.ExecutionSpan.filter_by_pub`.
Parameters
pub_idx (int | Iterable[int]) – One or more pub indices to filter.
Return type
sort
sort(inplace=True)
Return the same execution spans, sorted.
Sorting is done by the start
timestamp of each execution span.
Parameters
inplace (bool
) – Whether to sort this instance in place, or return a copy.
Return type
Returns
This instance if inplace
, a new instance otherwise, sorted.