78 lines
2.6 KiB
Plaintext
78 lines
2.6 KiB
Plaintext
---
|
||
title: Decompose
|
||
description: API reference for qiskit.transpiler.passes.Decompose
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.transpiler.passes.Decompose
|
||
---
|
||
|
||
# Decompose
|
||
|
||
<Class id="qiskit.transpiler.passes.Decompose" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.22/qiskit/transpiler/passes/basis/decompose.py" signature="Decompose(gate=None, gates_to_decompose=None)" modifiers="class">
|
||
Bases: [`qiskit.transpiler.basepasses.TransformationPass`](qiskit.transpiler.TransformationPass "qiskit.transpiler.basepasses.TransformationPass")
|
||
|
||
Expand a gate in a circuit using its decomposition rules.
|
||
|
||
Decompose initializer.
|
||
|
||
**Parameters**
|
||
|
||
* **gate** (`Optional`\[`Type`\[[`Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")]]) – DEPRECATED gate to decompose.
|
||
* **gates\_to\_decompose** (`Union`\[`Type`\[[`Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")], `List`\[`Type`\[[`Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")]], `List`\[`str`], `str`, `None`]) – optional subset of gates to be decomposed, identified by gate label, name or type. Defaults to all gates.
|
||
|
||
## Methods
|
||
|
||
### name
|
||
|
||
<Function id="qiskit.transpiler.passes.Decompose.name" signature="Decompose.name()">
|
||
Return the name of the pass.
|
||
</Function>
|
||
|
||
### run
|
||
|
||
<Function id="qiskit.transpiler.passes.Decompose.run" signature="Decompose.run(dag)">
|
||
Run the Decompose pass on dag.
|
||
|
||
**Parameters**
|
||
|
||
**dag** ([`DAGCircuit`](qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.dagcircuit.DAGCircuit")) – input dag.
|
||
|
||
**Return type**
|
||
|
||
[`DAGCircuit`](qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.dagcircuit.DAGCircuit")
|
||
|
||
**Returns**
|
||
|
||
output dag where `gate` was expanded.
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### gate
|
||
|
||
<Attribute id="qiskit.transpiler.passes.Decompose.gate">
|
||
Returns the gate
|
||
|
||
**Return type**
|
||
|
||
[`Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate")
|
||
</Attribute>
|
||
|
||
### is\_analysis\_pass
|
||
|
||
<Attribute id="qiskit.transpiler.passes.Decompose.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.Decompose.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>
|
||
|