About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
qiskit.assembler.assemble_circuits
assemble_circuits(circuits, run_config, qobj_id, qobj_header)
Assembles a list of circuits into a qobj that can be run on the backend.
Parameters
- circuits (
List
[QuantumCircuit
]) – circuit(s) to assemble - run_config (
RunConfig
) – configuration of the runtime environment - qobj_id (
int
) – identifier for the generated qobj - qobj_header (
QobjHeader
) – header to pass to the results
Return type
Returns
The qobj to be run on the backends
Examples
from qiskit.circuit import QuantumRegister, ClassicalRegister, QuantumCircuit
from qiskit.assembler import assemble_circuits
from qiskit.assembler.run_config import RunConfig
# Build a circuit to convert into a Qobj
q = QuantumRegister(2)
c = ClassicalRegister(2)
qc = QuantumCircuit(q, c)
qc.h(q[0])
qc.cx(q[0], q[1])
qc.measure(q, c)
# Assemble a Qobj from the input circuit
qobj = assemble_circuits(circuits=[qc],
qobj_id="custom-id",
qobj_header=[],
run_config=RunConfig(shots=2000, memory=True, init_qubits=True))
Was this page helpful?
Report a bug or request content on GitHub.