align_measures(schedules, inst_map=None, cal_gate='u3', max_calibration_duration=None, align_time=None, align_all=True)¶
Return new schedules where measurements occur at the same physical time.
This transformation will align the first
qiskit.pulse.Acquireon every channel to occur at the same time.
Minimum measurement wait time (to allow for calibration pulses) is enforced and may be set with
This method assumes that
AcquireChannel(i)correspond to the same qubit and the acquire/play instructions should be shifted together on these channels.
from qiskit import pulse from qiskit.pulse import transforms d0 = pulse.DriveChannel(0) m0 = pulse.MeasureChannel(0) a0 = pulse.AcquireChannel(0) mem0 = pulse.MemorySlot(0) sched = pulse.Schedule() sched.append(pulse.Play(pulse.Constant(10, 0.5), d0), inplace=True) sched.append(pulse.Play(pulse.Constant(10, 1.), m0).shift(sched.duration), inplace=True) sched.append(pulse.Acquire(20, a0, mem0).shift(sched.duration), inplace=True) sched_shifted = sched << 20 aligned_sched, aligned_sched_shifted = transforms.align_measures([sched, sched_shifted]) assert aligned_sched == aligned_sched_shifted
If it is desired to only shift acquisition and measurement stimulus instructions set the flag
aligned_sched, aligned_sched_shifted = transforms.align_measures( [sched, sched_shifted], align_all=False, ) assert aligned_sched != aligned_sched_shifted
Instruction]]) – Collection of schedules to be aligned together
InstructionScheduleMap]) – Mapping of circuit operations to pulse schedules
str) – The name of the gate to inspect for the calibration time
int]) – If provided, inst_map and cal_gate will be ignored
int]) – If provided, this will be used as final align time.
bool]) – Shift all instructions in the schedule such that they maintain their relative alignment with the shifted acquisition instruction. If
Falseonly the acquisition and measurement pulse instructions will be shifted.
- 반환 형식
The input list of schedules transformed to have their measurements aligned.
PulseError – If the provided alignment time is negative.