Unroll a circuit to a given basis.
Unroll (expand) non-basis, non-opaque instructions recursively to a desired basis, using decomposition rules defined for each instruction.
qiskit.transpiler.passes.basis.unroller.Unroller is deprecated as of qiskit 0.45.0. It will be removed no earlier than 3 months after the release date. This has been replaced by the BasisTranslator pass and is going to be removed in Qiskit 1.0.
- basis (list (opens in a new tab)[str (opens in a new tab)] or None) – Target basis names to unroll to, e.g. [‘u3’, ‘cx’] . If None, does not unroll any gate.
- target (Target) – The
Targetrepresenting the target backend, if both
basisand this are specified then this argument will take precedence and
basiswill be ignored.
Check if the pass is an analysis pass.
If the pass is an AnalysisPass, that means that the pass can analyze the DAG and write the results of that analysis in the property set. Modifications on the DAG are not allowed by this kind of pass.
Check if the pass is a transformation pass.
If the pass is a TransformationPass, that means that the pass can manipulate the DAG, but cannot modify the property set (but it can be read).
execute(passmanager_ir, state, callback=None)
Execute optimization task for input Qiskit IR.
- passmanager_ir (Any (opens in a new tab)) – Qiskit IR to optimize.
- state (PassManagerState) – State associated with workflow execution by the pass manager itself.
- callback (Callable (opens in a new tab) | None) – A callback function which is caller per execution of optimization task.
Optimized Qiskit IR and state of the workflow.
Name of the pass.
Run the Unroller pass on dag.
dag (DAGCircuit) – input dag
- QiskitError – if unable to unroll given the basis due to undefined
- decomposition rules** (such as a bad basis) or **excessive recursion. –
output unrolled dag
Update workflow status.
- state (PassManagerState) – Pass manager state to update.
- run_state (RunState) – Completion status of current task.
Updated pass manager state.