qiskit-documentation/docs/api/qiskit/0.46/qiskit.transpiler.passes.No...

143 lines
6.2 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: NoiseAdaptiveLayout
description: API reference for qiskit.transpiler.passes.NoiseAdaptiveLayout
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.transpiler.passes.NoiseAdaptiveLayout
---
# NoiseAdaptiveLayout
<Class id="qiskit.transpiler.passes.NoiseAdaptiveLayout" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.46/qiskit/transpiler/passes/layout/noise_adaptive_layout.py" signature="qiskit.transpiler.passes.NoiseAdaptiveLayout(*args, **kwargs)" modifiers="class">
Bases: [`AnalysisPass`](qiskit.transpiler.AnalysisPass "qiskit.transpiler.basepasses.AnalysisPass")
Choose a noise-adaptive Layout based on current calibration data for the backend.
> This pass associates a physical qubit (int) to each virtual qubit of the circuit (Qubit), using calibration data.
>
> The pass implements the qubit mapping method from: Noise-Adaptive Compiler Mappings for Noisy Intermediate-Scale Quantum Computers Prakash Murali, Jonathan M. Baker, Ali Javadi-Abhari, Frederic T. Chong, Margaret R. Martonosi ASPLOS 2019 (arXiv:1901.11054).
<Function signature="Ordering of edges" />
<Function signature="Map qubits edge-by-edge in the order of decreasing frequency of occurrence in the program dag." />
### Initialization
<Function id="qiskit.transpiler.passes.NoiseAdaptiveLayout.Initialization" signature="Initialization()" />
<Function signature="If an edge exists with both endpoints unmapped," />
<Function signature="pick the best available hardware cx to execute this edge." />
<Function signature="Iterative step" />
<Function signature="When an edge exists with one endpoint unmapped," />
<Function signature="map that endpoint to a location which allows" />
<Function signature="maximum reliability for CNOTs with previously mapped qubits." />
<Function signature="In the end if there are unmapped qubits (which don't" />
<Function signature="participate in any CNOT), map them to any available" />
<Function signature="hardware qubit." />
### Notes
<Function id="qiskit.transpiler.passes.NoiseAdaptiveLayout.Notes" signature="Notes()">
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.
</Function>
NoiseAdaptiveLayout initializer.
<Admonition title="Deprecated since version 0.46" type="danger">
The class `qiskit.transpiler.passes.layout.noise_adaptive_layout.NoiseAdaptiveLayout` is deprecated as of qiskit 0.46. It will be removed in the 1.0.0 release.
</Admonition>
**Parameters**
* **backend\_prop** (*Union\[*[*BackendProperties*](qiskit.providers.models.BackendProperties "qiskit.providers.models.BackendProperties")*,* [*Target*](qiskit.transpiler.Target "qiskit.transpiler.Target")*]*) backend properties object
* **coupling\_map** ([*CouplingMap*](qiskit.transpiler.CouplingMap "qiskit.transpiler.CouplingMap")) Optional. To filter the backend\_prop qubits/gates. This parameter is ignored if [`Target`](qiskit.transpiler.Target "qiskit.transpiler.Target") is provided in `backend_prop`. That method is preferred.
**Raises**
[**TranspilerError**](transpiler#qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") if invalid options
## Attributes
### is\_analysis\_pass
<Attribute id="qiskit.transpiler.passes.NoiseAdaptiveLayout.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.NoiseAdaptiveLayout.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>
## Methods
### execute
<Function id="qiskit.transpiler.passes.NoiseAdaptiveLayout.execute" signature="execute(passmanager_ir, state, callback=None)">
Execute optimization task for input Qiskit IR.
**Parameters**
* **passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)")) Qiskit IR to optimize.
* **state** ([*PassManagerState*](qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")) State associated with workflow execution by the pass manager itself.
* **callback** ([*Callable*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable "(in Python v3.12)") *| None*) A callback function which is caller per execution of optimization task.
**Returns**
Optimized Qiskit IR and state of the workflow.
**Return type**
[tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)"), [qiskit.passmanager.compilation\_status.PassManagerState](qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")]
</Function>
### name
<Function id="qiskit.transpiler.passes.NoiseAdaptiveLayout.name" signature="name()">
Name of the pass.
**Return type**
[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")
</Function>
### run
<Function id="qiskit.transpiler.passes.NoiseAdaptiveLayout.run" signature="run(dag)">
Run the NoiseAdaptiveLayout pass on dag.
</Function>
### update\_status
<Function id="qiskit.transpiler.passes.NoiseAdaptiveLayout.update_status" signature="update_status(state, run_state)">
Update workflow status.
**Parameters**
* **state** ([*PassManagerState*](qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")) Pass manager state to update.
* **run\_state** (*RunState*) Completion status of current task.
**Returns**
Updated pass manager state.
**Return type**
[*PassManagerState*](qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")
</Function>
</Class>