137 lines
6.0 KiB
Plaintext
137 lines
6.0 KiB
Plaintext
---
|
||
title: DynamicCircuitInstructionDurations (latest version)
|
||
description: API reference for qiskit_ibm_runtime.transpiler.passes.scheduling.DynamicCircuitInstructionDurations 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.transpiler.passes.scheduling.DynamicCircuitInstructionDurations
|
||
---
|
||
|
||
# DynamicCircuitInstructionDurations
|
||
|
||
<Class id="qiskit_ibm_runtime.transpiler.passes.scheduling.DynamicCircuitInstructionDurations" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/transpiler/passes/scheduling/utils.py#L140-L330" signature="DynamicCircuitInstructionDurations(instruction_durations=None, dt=None, enable_patching=True)" modifiers="class">
|
||
Bases: [`InstructionDurations`](/api/qiskit/qiskit.transpiler.InstructionDurations "(in Qiskit v1.3)")
|
||
|
||
For dynamic circuits the IBM Qiskit backend currently reports instruction durations that differ compared with those required for the legacy Qobj-based path. For now we use this class to report updated InstructionDurations. TODO: This would be mitigated by a specialized Backend/Target for dynamic circuit backends.
|
||
|
||
Dynamic circuit instruction durations.
|
||
|
||
## Attributes
|
||
|
||
**Parameters**
|
||
|
||
* **instruction\_durations** (*List\[Tuple\[str, Iterable\[int] | None, float, Iterable\[float] | None, str]] | List\[Tuple\[str, Iterable\[int] | None, float, Iterable\[float] | None]] | List\[Tuple\[str, Iterable\[int] | None, float, str]] | List\[Tuple\[str, Iterable\[int] | None, float]] |* [*InstructionDurations*](/api/qiskit/qiskit.transpiler.InstructionDurations "(in Qiskit v1.3)") *| None*)
|
||
* **dt** (*float*)
|
||
* **enable\_patching** (*bool*)
|
||
|
||
### MEASURE\_PATCH\_CYCLES
|
||
|
||
<Attribute id="qiskit_ibm_runtime.transpiler.passes.scheduling.DynamicCircuitInstructionDurations.MEASURE_PATCH_CYCLES" attributeValue="160" />
|
||
|
||
### MEASURE\_PATCH\_ODD\_OFFSET
|
||
|
||
<Attribute id="qiskit_ibm_runtime.transpiler.passes.scheduling.DynamicCircuitInstructionDurations.MEASURE_PATCH_ODD_OFFSET" attributeValue="64" />
|
||
|
||
## Methods
|
||
|
||
### from\_backend
|
||
|
||
<Function id="qiskit_ibm_runtime.transpiler.passes.scheduling.DynamicCircuitInstructionDurations.from_backend" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/transpiler/passes/scheduling/utils.py#L162-L174" signature="from_backend(backend)" modifiers="classmethod">
|
||
Construct a `DynamicInstructionDurations` object from the backend. :param backend: backend from which durations (gate lengths) and dt are extracted.
|
||
|
||
**Returns**
|
||
|
||
The InstructionDurations constructed from backend.
|
||
|
||
**Return type**
|
||
|
||
DynamicInstructionDurations
|
||
|
||
**Parameters**
|
||
|
||
**backend** ([*Backend*](/api/qiskit/qiskit.providers.Backend "(in Qiskit v1.3)"))
|
||
</Function>
|
||
|
||
### from\_target
|
||
|
||
<Function id="qiskit_ibm_runtime.transpiler.passes.scheduling.DynamicCircuitInstructionDurations.from_target" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/transpiler/passes/scheduling/utils.py#L176-L193" signature="from_target(target)" modifiers="classmethod">
|
||
Construct a `DynamicInstructionDurations` object from the target. :param target: target from which durations (gate lengths) and dt are extracted.
|
||
|
||
**Returns**
|
||
|
||
The InstructionDurations constructed from backend.
|
||
|
||
**Return type**
|
||
|
||
DynamicInstructionDurations
|
||
|
||
**Parameters**
|
||
|
||
**target** ([*Target*](/api/qiskit/qiskit.transpiler.Target "(in Qiskit v1.3)"))
|
||
</Function>
|
||
|
||
### get
|
||
|
||
<Function id="qiskit_ibm_runtime.transpiler.passes.scheduling.DynamicCircuitInstructionDurations.get" signature="get(inst, qubits, unit='dt', parameters=None)">
|
||
Get the duration of the instruction with the name, qubits, and parameters.
|
||
|
||
Some instructions may have a parameter dependent duration.
|
||
|
||
**Parameters**
|
||
|
||
* **inst** (*str |* [*qiskit.circuit.Instruction*](/api/qiskit/qiskit.circuit.Instruction "(in Qiskit v1.3)")) – An instruction or its name to be queried.
|
||
* **qubits** (*int | list\[int]*) – Qubit indices that the instruction acts on.
|
||
* **unit** (*str*) – The unit of duration to be returned. It must be ‘s’ or ‘dt’.
|
||
* **parameters** (*list\[float] | None*) – The value of the parameters of the desired instruction.
|
||
|
||
**Returns**
|
||
|
||
The duration of the instruction on the qubits.
|
||
|
||
**Return type**
|
||
|
||
float|int
|
||
|
||
**Raises**
|
||
|
||
**TranspilerError** – No duration is defined for the instruction.
|
||
</Function>
|
||
|
||
### units\_used
|
||
|
||
<Function id="qiskit_ibm_runtime.transpiler.passes.scheduling.DynamicCircuitInstructionDurations.units_used" signature="units_used()">
|
||
Get the set of all units used in this instruction durations.
|
||
|
||
**Returns**
|
||
|
||
Set of units used in this instruction durations.
|
||
|
||
**Return type**
|
||
|
||
set\[str]
|
||
</Function>
|
||
|
||
### update
|
||
|
||
<Function id="qiskit_ibm_runtime.transpiler.passes.scheduling.DynamicCircuitInstructionDurations.update" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/transpiler/passes/scheduling/utils.py#L195-L241" signature="update(inst_durations, dt=None)">
|
||
Update self with inst\_durations (inst\_durations overwrite self). Overrides the default durations for certain hardcoded instructions.
|
||
|
||
**Parameters**
|
||
|
||
* **inst\_durations** (*List\[Tuple\[str, Iterable\[int] | None, float, Iterable\[float] | None, str]] | List\[Tuple\[str, Iterable\[int] | None, float, Iterable\[float] | None]] | List\[Tuple\[str, Iterable\[int] | None, float, str]] | List\[Tuple\[str, Iterable\[int] | None, float]] |* [*InstructionDurations*](/api/qiskit/qiskit.transpiler.InstructionDurations "(in Qiskit v1.3)") *| None*) – Instruction durations to be merged into self (overwriting self).
|
||
* **dt** (*float | None*) – Sampling duration in seconds of the target backend.
|
||
|
||
**Returns**
|
||
|
||
The updated InstructionDurations.
|
||
|
||
**Return type**
|
||
|
||
InstructionDurations
|
||
|
||
**Raises**
|
||
|
||
**TranspilerError** – If the format of instruction\_durations is invalid.
|
||
</Function>
|
||
</Class>
|
||
|