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

92 lines
4.6 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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: UnitarySynthesis
description: API reference for qiskit.transpiler.passes.UnitarySynthesis
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.transpiler.passes.UnitarySynthesis
---
# qiskit.transpiler.passes.UnitarySynthesis
<Class id="qiskit.transpiler.passes.UnitarySynthesis" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.17/qiskit/transpiler/passes/synthesis/unitary_synthesis.py" signature="UnitarySynthesis(basis_gates, approximation_degree=1)" modifiers="class">
Synthesize gates according to their basis gates.
Synthesize unitaries over some basis gates.
This pass can approximate 2-qubit unitaries given some approximation closeness measure (expressed as approximation\_degree). Other unitaries are synthesized exactly.
**Parameters**
* **basis\_gates** (`List`\[`str`]) List of gate names to target.
* **approximation\_degree** (`float`) closeness of approximation (0: lowest, 1: highest).
### \_\_init\_\_
<Function id="qiskit.transpiler.passes.UnitarySynthesis.__init__" signature="__init__(basis_gates, approximation_degree=1)">
Synthesize unitaries over some basis gates.
This pass can approximate 2-qubit unitaries given some approximation closeness measure (expressed as approximation\_degree). Other unitaries are synthesized exactly.
**Parameters**
* **basis\_gates** (`List`\[`str`]) List of gate names to target.
* **approximation\_degree** (`float`) closeness of approximation (0: lowest, 1: highest).
</Function>
## Methods
| | |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [`__init__`](#qiskit.transpiler.passes.UnitarySynthesis.__init__ "qiskit.transpiler.passes.UnitarySynthesis.__init__")(basis\_gates\[, approximation\_degree]) | Synthesize unitaries over some basis gates. |
| [`name`](#qiskit.transpiler.passes.UnitarySynthesis.name "qiskit.transpiler.passes.UnitarySynthesis.name")() | Return the name of the pass. |
| [`run`](#qiskit.transpiler.passes.UnitarySynthesis.run "qiskit.transpiler.passes.UnitarySynthesis.run")(dag) | Run the UnitarySynthesis pass on dag. |
## Attributes
| | |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [`is_analysis_pass`](#qiskit.transpiler.passes.UnitarySynthesis.is_analysis_pass "qiskit.transpiler.passes.UnitarySynthesis.is_analysis_pass") | Check if the pass is an analysis pass. |
| [`is_transformation_pass`](#qiskit.transpiler.passes.UnitarySynthesis.is_transformation_pass "qiskit.transpiler.passes.UnitarySynthesis.is_transformation_pass") | Check if the pass is a transformation pass. |
### is\_analysis\_pass
<Attribute id="qiskit.transpiler.passes.UnitarySynthesis.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.UnitarySynthesis.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>
### name
<Function id="qiskit.transpiler.passes.UnitarySynthesis.name" signature="name()">
Return the name of the pass.
</Function>
### run
<Function id="qiskit.transpiler.passes.UnitarySynthesis.run" signature="run(dag)">
Run the UnitarySynthesis pass on dag.
**Parameters**
**dag** (`DAGCircuit`) input dag.
**Return type**
`DAGCircuit`
**Returns**
Output dag with UnitaryGates synthesized to target basis.
</Function>
</Class>