ChunkPart
pydantic model ChunkPart
Bases: BaseModel
A description of the contents of a single part of an execution chunk.
element_range
field
Type: tuple[int, int, int] [Required]
Which elements of the item were executed in this chunk part.
This range has entries (start_idx, stop_idx, step) that slice the flattened shape of the corresponding quantum program item, after the permutation has been applied. That is, this part corresponds to the data elements flatten(permute(arr))[start_idx:stop_idx:step] for some data array arr whose shape matches the corresponding item shape. The lower index is inclusive, the upper index is exclusive, and the step must be positive.
It should hold that size == max(0, ceil((stop_idx - start_idx) / step)).
Validated by
cross_validatemust_be_a_valid_range
idx_item
field
Type: int [Required]
The index of an item in a quantum program.
Validated by
cross_validate
permutation
field
Type: list[int] [Required]
A permutation vector of the item shape before slicing elements with the element_range.
This list should hold contiguous integers starting at 0, in some order. The convention is that permuted_shape[i] = shape[permutation[i]] for every dimension index i.
Validated by
cross_validatemust_be_permutation_of_range
size
field
Type: int [Required]
The number of elements from the quantum program item that were executed.
For example, if a quantum program item has shape (10, 5), then it has a total of 50 elements, so that if this size is 10, it constitutes 20% of the total work for the item.
Validated by
cross_validate
cross_validate
validator cross_validate
Check for mutual compatibility of types and shapes of attributes.
Return type
Self