Note
This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.
BackendTiming.round_delay¶
- BackendTiming.round_delay(*, time=None, samples=None)[source]¶
Delay duration closest to input and consistent with timing constraints
This method produces the value to pass for the
durationof aDelayinstruction of aQuantumCircuitso that the delay fills the time until the next valid pulse, assuming theDelayinstruction begins on a sample that is also valid for a pulse to begin on.The pulse timing constraints of the backend are considered in order to give the number of samples closest to the input (either
timeorsamples) for the start of a pulse in a subsequent instruction to be valid. The delay value in samples is rounded to the least common multiple of the pulse and acquire alignment values in order to ensure that either type of pulse will be aligned.If
BackendTiming.delay_unit()iss,timeis returned directly. Typically, this is the case for a simulator where converting to sample number is not needed.- Parameters:
time (
Optional[float]) – The nominal delay time to convert in secondssamples (
Union[int,float,None]) – The nominal delay time to convert in samples
- Return type:
Union[int,float]- Returns:
The delay duration in samples if
BackendTiming.delay_unit()isdt. Otherwise returntime.- Raises:
QiskitError – If either both
timeandsamplesare passed or neither is passed.