Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

qiskit.assembler.assemble_schedules

assemble_schedules(schedules, qobj_id, qobj_header, run_config)

GitHub

Assembles a list of schedules into a qobj that can be run on the backend.

Parameters

Return type

PulseQobj

Returns

The Qobj to be run on the backends.

Raises

QiskitError – when frequency settings are not supplied.

Examples

from qiskit import pulse
from qiskit.assembler import assemble_schedules
from qiskit.assembler.run_config import RunConfig
# Construct a Qobj header for the output Qobj
header = {"backend_name": "FakeOpenPulse2Q", "backend_version": "0.0.0"}
# Build a configuration object for the output Qobj
config = RunConfig(shots=1024,
                   memory=False,
                   meas_level=1,
                   meas_return='avg',
                   memory_slot_size=100,
                   parametric_pulses=[],
                   init_qubits=True,
                   qubit_lo_freq=[4900000000.0, 5000000000.0],
                   meas_lo_freq=[6500000000.0, 6600000000.0],
                   schedule_los=[])
# Build a Pulse schedule to assemble into a Qobj
schedule = pulse.Schedule()
schedule += pulse.Play(pulse.Waveform([0.1] * 16, name="test0"),
                       pulse.DriveChannel(0),
                       name="test1")
schedule += pulse.Play(pulse.Waveform([0.1] * 16, name="test1"),
                       pulse.DriveChannel(0),
                       name="test2")
schedule += pulse.Play(pulse.Waveform([0.5] * 16, name="test0"),
                       pulse.DriveChannel(0),
                       name="test1")
# Assemble a Qobj from the schedule.
pulseQobj = assemble_schedules(schedules=[schedule],
                               qobj_id="custom-id",
                               qobj_header=header,
                               run_config=config)
Was this page helpful?
Report a bug or request content on GitHub.