qiskit-documentation/docs/api/qiskit/0.29/qiskit.transpiler.passes.Un...

78 lines
2.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Unroller (v0.29)
description: API reference for qiskit.transpiler.passes.Unroller in qiskit v0.29
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.transpiler.passes.Unroller
---
# Unroller
<Class id="qiskit.transpiler.passes.Unroller" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.18/qiskit/transpiler/passes/basis/unroller.py" signature="Unroller(*args, **kwargs)" modifiers="class">
Bases: `qiskit.transpiler.basepasses.TransformationPass`
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.
Unroller initializer.
**Parameters**
**basis** (*list\[str] or None*) Target basis names to unroll to, e.g. \[u3, cx] . If None, does not unroll any gate.
## Methods
<span id="qiskit-transpiler-passes-unroller-name" />
### name
<Function id="qiskit.transpiler.passes.Unroller.name" signature="Unroller.name()">
Return the name of the pass.
</Function>
<span id="qiskit-transpiler-passes-unroller-run" />
### run
<Function id="qiskit.transpiler.passes.Unroller.run" signature="Unroller.run(dag)">
Run the Unroller pass on dag.
**Parameters**
**dag** ([*DAGCircuit*](qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit")) input dag
**Raises**
* **QiskitError** if unable to unroll given the basis due to undefined
* **decomposition rules**\*\* (****such as a bad basis****) or \*\***excessive recursion.**
**Returns**
output unrolled dag
**Return type**
[DAGCircuit](qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit")
</Function>
## Attributes
### is\_analysis\_pass
<Attribute id="qiskit.transpiler.passes.Unroller.is_analysis_pass">
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.
</Attribute>
### is\_transformation\_pass
<Attribute id="qiskit.transpiler.passes.Unroller.is_transformation_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).
</Attribute>
</Class>