qiskit.assembler.assemble_schedules
assemble_schedules(schedules, qobj_id, qobj_header, run_config)
Assembles a list of schedules into a qobj that can be run on the backend.
Parameters
- schedules (
List
[Union
[ScheduleBlock
,Schedule
,Instruction
,Tuple
[int
,Union
[Schedule
,Instruction
]]]]) – Schedules to assemble. - qobj_id (
int
) – Identifier for the generated qobj. - qobj_header (
QobjHeader
) – Header to pass to the results. - run_config (
RunConfig
) – Configuration of the runtime environment.
Return type
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.