from qiskit.pulse import Schedule, Play from qiskit.pulse.instructions import SamplePulse # create a new instruction new_pulse = SamplePulse(samples=[0.1, -0.2, 0.3]) # create a schedule and add the new instruction schedule1 = Schedule() schedule1 += Play(new_pulse, 0) # create another schedule and append the new instruction to it schedule2 = Schedule() schedule2 += Play(new_pulse, 0) schedule2.append(schedule1)
from qiskit.pulse import Schedule, Play from qiskit.pulse.instructions import SamplePulse # create two schedules schedule1 = Schedule() schedule1 += Play(SamplePulse(samples=[0.1, -0.2, 0.3]), 0) schedule1 += Play(SamplePulse(samples=[-0.1, 0.2, -0.3]), 1) schedule2 = Schedule() schedule2 += Play(SamplePulse(samples=[0.2, -0.3, 0.4]), 0) schedule2 += Play(SamplePulse(samples=[-0.2, 0.3, -0.4]), 1) # create a third schedule and append the two schedules to it combined_schedule = Schedule() combined_schedule.append(schedule1) combined_schedule.append(schedule2)In both examples, we use the append() function to add new instructions or schedules to existing schedules. The qiskit.pulse package library is used to create and manipulate pulse schedules in quantum circuits.