Skip to main content
IBM Quantum Platform
This page is from the dev version of Qiskit Runtime client. Go to the stable version.

ChunkTiming

class ChunkTiming(spans)

GitHub

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__

__getitem__(idxs: int) → ChunkSpan

__getitem__(idxs: slice) → ChunkTiming

GitHub

__len__

__len__()

GitHub

Return type

int

draw

draw(name=None, normalize_y=False, line_width=4, tz=None)

GitHub

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. Pass datetime.timezone.utc to display times in UTC.

Returns

A plotly figure.

Return type

PlotlyFigure

Was this page helpful?
Report a bug, typo, or request content on GitHub.