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.disassemble
disassemble(qobj)
Disassemble a qobj and return the circuits or pulse schedules, run_config, and user header.
Note
disassemble(assemble(qc))
is not guaranteed to produce an exactly equal circuit to the input, due to limitations in the QasmQobj
format that need to be maintained for backend system compatibility. This is most likely to be the case when using newer features of QuantumCircuit
. In most cases, the output should be equivalent, if not quite equal.
Parameters
qobj (Qobj) – The input qobj object to disassemble
Returns
The disassembled program which consists of:
- programs: A list of quantum circuits or pulse schedules
- run_config: The dict of the run config
- user_qobj_header: The dict of any user headers in the qobj
Return type
Union[CircuitModule, PulseModule]
Examples
from qiskit.circuit import QuantumRegister, ClassicalRegister, QuantumCircuit
from qiskit.compiler.assembler import assemble
from qiskit.assembler.disassemble import disassemble
# Create a circuit to assemble 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 the circuit into a Qobj
qobj = assemble(qc, shots=2000, memory=True)
# Disassemble the qobj back into a circuit
circuits, run_config_out, headers = disassemble(qobj)
Was this page helpful?
Report a bug or request content on GitHub.