qiskit-documentation/docs/api/qiskit/0.30/qiskit.transpiler.passes.De...

72 lines
2.6 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: DenseLayout
description: API reference for qiskit.transpiler.passes.DenseLayout
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.transpiler.passes.DenseLayout
---
# DenseLayout
<Class id="qiskit.transpiler.passes.DenseLayout" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.18/qiskit/transpiler/passes/layout/dense_layout.py" signature="DenseLayout(*args, **kwargs)" modifiers="class">
Bases: `qiskit.transpiler.basepasses.AnalysisPass`
Choose a Layout by finding the most connected subset of qubits.
This pass associates a physical qubit (int) to each virtual qubit of the circuit (Qubit).
<Admonition title="Note" type="note">
Even though a layout is not strictly a property of the DAG, in the transpiler architecture it is best passed around between passes by being set in property\_set.
</Admonition>
DenseLayout initializer.
**Parameters**
* **coupling\_map** (*Coupling*) directed graph representing a coupling map.
* **backend\_prop** ([*BackendProperties*](qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties")) backend properties object
## Methods
### name
<Function id="qiskit.transpiler.passes.DenseLayout.name" signature="DenseLayout.name()">
Return the name of the pass.
</Function>
### run
<Function id="qiskit.transpiler.passes.DenseLayout.run" signature="DenseLayout.run(dag)">
Run the DenseLayout pass on dag.
Pick a convenient layout depending on the best matching qubit connectivity, and set the property layout.
**Parameters**
**dag** ([*DAGCircuit*](qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit")) DAG to find layout for.
**Raises**
[**TranspilerError**](qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") if dag wider than self.coupling\_map
</Function>
## Attributes
### is\_analysis\_pass
<Attribute id="qiskit.transpiler.passes.DenseLayout.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.DenseLayout.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>