assemble¶
- assemble(experiments, backend=None, qobj_id=None, qobj_header=None, shots=None, memory=False, max_credits=None, seed_simulator=None, qubit_lo_freq=None, meas_lo_freq=None, qubit_lo_range=None, meas_lo_range=None, schedule_los=None, meas_level=MeasLevel.CLASSIFIED, meas_return=MeasReturnType.AVERAGE, meas_map=None, memory_slot_size=100, rep_time=None, parameter_binds=None, parametric_pulses=None, **run_config)[source]¶
Assemble a list of circuits or pulse schedules into a
Qobj
.This function serializes the payloads, which could be either circuits or schedules, to create
Qobj
“experiments”. It further annotates the experiment payload with header and configurations.- Parameters
experiments (
Union
[QuantumCircuit
,List
[QuantumCircuit
],Schedule
,List
[Schedule
]]) – Circuit(s) or pulse schedule(s) to executebackend (
Optional
[BaseBackend
]) – If set, some runtime options are automatically grabbed frombackend.configuration()
andbackend.defaults()
. If any other option is explicitly set (e.g.,rep_time
), it will override the backend’s. If any other options is set in the run_config, it will also override the backend’s.qobj_id (
Optional
[str
]) – String identifier to annotate theQobj
qobj_header (
Union
[QobjHeader
,Dict
,None
]) – User input that will be inserted inQobj
header, and will also be copied to the corresponding Result header. Headers do not affect the run.shots (
Optional
[int
]) – Number of repetitions of each circuit, for sampling. Default: 1024 ormax_shots
from the backend configuration, whichever is smallermemory (
Optional
[bool
]) – IfTrue
, per-shot measurement bitstrings are returned as well (provided the backend supports it). For OpenPulse jobs, only measurement level 2 supports this option.max_credits (
Optional
[int
]) – Maximum credits to spend on job. Default: 10seed_simulator (
Optional
[int
]) – Random seed to control sampling, for when backend is a simulatorqubit_lo_freq (
Optional
[List
[int
]]) – List of default qubit LO frequencies in Hz. Will be overridden byschedule_los
if set.meas_lo_freq (
Optional
[List
[int
]]) – List of default measurement LO frequencies in Hz. Will be overridden byschedule_los
if set.qubit_lo_range (
Optional
[List
[int
]]) – List of drive LO ranges each of form[range_min, range_max]
in Hz. Used to validate the supplied qubit frequencies.meas_lo_range (
Optional
[List
[int
]]) – List of measurement LO ranges each of form[range_min, range_max]
in Hz. Used to validate the supplied qubit frequencies.schedule_los (
Union
[List
[Union
[Dict
[PulseChannel
,float
],LoConfig
]],Dict
[PulseChannel
,float
],LoConfig
,None
]) – Experiment LO configurations, frequencies are given in Hz.meas_level (
Union
[int
,MeasLevel
]) – Set the appropriate level of the measurement output for pulse experiments.meas_return (
Union
[str
,MeasReturnType
]) –Level of measurement data for the backend to return.
- For
meas_level
0 and 1: single
returns information from every shot.avg
returns average measurement output (averaged over number of shots).
- For
meas_map (
Optional
[List
[List
[Qubit
]]]) – List of lists, containing qubits that must be measured together.memory_slot_size (
int
) – Size of each memory slot if the output is Level 0.rep_time (
Optional
[float
]) – Repetition time of the experiment in s. The delay between experiments will berep_time
. Must be from the list provided by the device.parameter_binds (
Optional
[List
[Dict
[Parameter
,float
]]]) – List of Parameter bindings over which the set of experiments will be executed. Each list element (bind) should be of the form {Parameter1: value1, Parameter2: value2, …}. All binds will be executed across all experiments; e.g., if parameter_binds is a length-n list, and there are m experiments, a total of m x n experiments will be run (one for each experiment/bind pair).parametric_pulses (
Optional
[List
[str
]]) –A list of pulse shapes which are supported internally on the backend. Example:
['gaussian', 'constant']
**run_config – Extra arguments used to configure the run (e.g., for Aer configurable backends). Refer to the backend documentation for details on these arguments.
- Return type
- Returns
A
Qobj
that can be run on a backend. Depending on the type of input, this will be either aQasmQobj
or aPulseQobj
.- Raises
QiskitError – if the input cannot be interpreted as either circuits or schedules