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_circuits

assemble_circuits(circuits, run_config, qobj_id, qobj_header)

GitHub

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

QasmQobj

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.