111 lines
4.7 KiB
Plaintext
111 lines
4.7 KiB
Plaintext
---
|
||
title: DoubleSliceSpan (latest version)
|
||
description: API reference for qiskit_ibm_runtime.execution_span.DoubleSliceSpan in the latest version of qiskit-ibm-runtime
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit_ibm_runtime.execution_span.DoubleSliceSpan
|
||
---
|
||
|
||
# DoubleSliceSpan
|
||
|
||
<Class id="qiskit_ibm_runtime.execution_span.DoubleSliceSpan" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/execution_span/double_slice_span.py#L27-L79" signature="DoubleSliceSpan(start, stop, data_slices)" modifiers="class">
|
||
Bases: [`ExecutionSpan`](execution-span-execution-span "qiskit_ibm_runtime.execution_span.execution_span.ExecutionSpan")
|
||
|
||
An [`ExecutionSpan`](execution-span-execution-span "qiskit_ibm_runtime.execution_span.ExecutionSpan") for data stored in a sliceable format.
|
||
|
||
This type of execution span references pub result data by assuming that it is a sliceable portion of the data where the shots are the outermost slice and the rest of the data is flattened. Therefore, for each pub dependent on this span, the constructor accepts two `slice` objects, along with the corresponding shape of the data to be sliced; in contrast to [`SliceSpan`](execution-span-slice-span "qiskit_ibm_runtime.execution_span.SliceSpan"), this class does not assume that *all* shots for a particular set of parameter values are contiguous in the array of data.
|
||
|
||
**Parameters**
|
||
|
||
* **start** (*datetime*) – The start time of the span, in UTC.
|
||
* **stop** (*datetime*) – The stop time of the span, in UTC.
|
||
* **data\_slices** (*dict\[int, tuple\[ShapeType, slice, slice]]*) – A map from pub indices to `(shape_tuple, flat_shape_slice, shots_slice)`.
|
||
|
||
## Attributes
|
||
|
||
### duration
|
||
|
||
<Attribute id="qiskit_ibm_runtime.execution_span.DoubleSliceSpan.duration">
|
||
The duration of this span, in seconds.
|
||
</Attribute>
|
||
|
||
### pub\_idxs
|
||
|
||
<Attribute id="qiskit_ibm_runtime.execution_span.DoubleSliceSpan.pub_idxs" />
|
||
|
||
### size
|
||
|
||
<Attribute id="qiskit_ibm_runtime.execution_span.DoubleSliceSpan.size" />
|
||
|
||
### start
|
||
|
||
<Attribute id="qiskit_ibm_runtime.execution_span.DoubleSliceSpan.start">
|
||
The start time of the span, in UTC.
|
||
</Attribute>
|
||
|
||
### stop
|
||
|
||
<Attribute id="qiskit_ibm_runtime.execution_span.DoubleSliceSpan.stop">
|
||
The stop time of the span, in UTC.
|
||
</Attribute>
|
||
|
||
## Methods
|
||
|
||
### contains\_pub
|
||
|
||
<Function id="qiskit_ibm_runtime.execution_span.DoubleSliceSpan.contains_pub" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/execution_span/execution_span.py#L112-L122" signature="contains_pub(pub_idx)">
|
||
Return whether the pub with the given index has data with dependence on this span.
|
||
|
||
**Parameters**
|
||
|
||
**pub\_idx** (*int | Iterable\[int]*) – One or more pub indices from the original primitive call.
|
||
|
||
**Returns**
|
||
|
||
Whether there is dependence on this span.
|
||
|
||
**Return type**
|
||
|
||
bool
|
||
</Function>
|
||
|
||
### filter\_by\_pub
|
||
|
||
<Function id="qiskit_ibm_runtime.execution_span.DoubleSliceSpan.filter_by_pub" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/execution_span/double_slice_span.py#L76-L79" signature="filter_by_pub(pub_idx)">
|
||
Return a new span whose slices are filtered to the provided pub indices.
|
||
|
||
For example, if this span contains slice information for pubs with indices 1, 3, 4 and `[1, 4]` is provided, then the span returned by this method will contain slice information for only those two indices, but be identical otherwise.
|
||
|
||
**Parameters**
|
||
|
||
**pub\_idx** (*int | Iterable\[int]*) – One or more pub indices from the original primitive call.
|
||
|
||
**Returns**
|
||
|
||
A new filtered span.
|
||
|
||
**Return type**
|
||
|
||
[DoubleSliceSpan](#qiskit_ibm_runtime.execution_span.DoubleSliceSpan "qiskit_ibm_runtime.execution_span.DoubleSliceSpan")
|
||
</Function>
|
||
|
||
### mask
|
||
|
||
<Function id="qiskit_ibm_runtime.execution_span.DoubleSliceSpan.mask" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/execution_span/double_slice_span.py#L70-L74" signature="mask(pub_idx)">
|
||
Return an array-valued mask specifying which parts of a pub result depend on this span.
|
||
|
||
**Parameters**
|
||
|
||
**pub\_idx** (*int*) – The index of the pub to return a mask for.
|
||
|
||
**Returns**
|
||
|
||
An array with the same shape as the pub data.
|
||
|
||
**Return type**
|
||
|
||
[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v2.2)")\[*Any*, [*dtype*](https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype "(in NumPy v2.2)")\[[*bool*](https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.bool "(in NumPy v2.2)")]]
|
||
</Function>
|
||
</Class>
|
||
|