ChunkTiming
class ChunkTiming(spans)
Bases: object
A collection of chunk timing information for a QuantumProgramResult.
This class is a readonly list-like containing ChunkSpan objects, where each span represents a single execution chunk on the backend and contains timing information and a description of which parts of the QuantumProgram were executed in that chunk.
To iterate over chunks:
chunk_timings = job.result().timing
for chunk in chunk_timings:
print(chunk)To draw the timings for a single result:
chunk_timings.draw()To draw the timings for several results on one plot:
from qiskit_ibm_runtime.visualization import draw_chunk_timings
draw_chunk_timings(
chunk_timings1,
chunk_timings2,
names=["job 1", "job 2"],
common_start=True,
)Attributes
Parameters
spans (Iterable[ChunkSpan])
duration
The total duration from first start to last stop, in seconds.
start
The start time of the earliest chunk, in UTC.
stop
The stop time of the latest chunk, in UTC.
Methods
__getitem__
__len__
draw
draw(name=None, normalize_y=False, line_width=4, tz=None)
Draw timing information on a bar plot.
To draw chunk timings with additional options like common_start, or to draw timings of several jobs on the same axis, consider calling draw_chunk_timings() directly.
Parameters
- name (str | None) – A label for this set of chunks.
- normalize_y (bool) – Whether to display the y-axis units as a percentage of work complete, rather than cumulative elements completed.
- line_width (int) – The thickness of line segments.
- tz (timezone | None) – The timezone to use for displaying times.
None(default) uses the local system timezone. Passdatetime.timezone.utcto display times in UTC.
Returns
A plotly figure.
Return type
PlotlyFigure