104 lines
4.7 KiB
Plaintext
104 lines
4.7 KiB
Plaintext
---
|
||
title: FlowController
|
||
description: API reference for qiskit.transpiler.FlowController
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.transpiler.FlowController
|
||
---
|
||
|
||
<span id="qiskit-transpiler-flowcontroller" />
|
||
|
||
# qiskit.transpiler.FlowController
|
||
|
||
<Class id="qiskit.transpiler.FlowController" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.16/qiskit/transpiler/runningpassmanager.py" signature="FlowController(passes, options, **partial_controller)" modifiers="class">
|
||
Base class for multiple types of working list.
|
||
|
||
This class is a base class for multiple types of working list. When you iterate on it, it returns the next pass to run.
|
||
|
||
### \_\_init\_\_
|
||
|
||
<Function id="qiskit.transpiler.FlowController.__init__" signature="__init__(passes, options, **partial_controller)">
|
||
Initialize self. See help(type(self)) for accurate signature.
|
||
</Function>
|
||
|
||
## Methods
|
||
|
||
| | |
|
||
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
|
||
| [`__init__`](#qiskit.transpiler.FlowController.__init__ "qiskit.transpiler.FlowController.__init__")(passes, options, \*\*partial\_controller) | Initialize self. |
|
||
| [`add_flow_controller`](#qiskit.transpiler.FlowController.add_flow_controller "qiskit.transpiler.FlowController.add_flow_controller")(name, controller) | Adds a flow controller. |
|
||
| [`controller_factory`](#qiskit.transpiler.FlowController.controller_factory "qiskit.transpiler.FlowController.controller_factory")(passes, options, …) | Constructs a flow controller based on the partially evaluated controller arguments. |
|
||
| [`dump_passes`](#qiskit.transpiler.FlowController.dump_passes "qiskit.transpiler.FlowController.dump_passes")() | Fetches the passes added to this flow controller. |
|
||
| [`remove_flow_controller`](#qiskit.transpiler.FlowController.remove_flow_controller "qiskit.transpiler.FlowController.remove_flow_controller")(name) | Removes a flow controller. |
|
||
|
||
## Attributes
|
||
|
||
| | |
|
||
| ------------------------ | - |
|
||
| `registered_controllers` | |
|
||
|
||
### add\_flow\_controller
|
||
|
||
<Function id="qiskit.transpiler.FlowController.add_flow_controller" signature="add_flow_controller(name, controller)" modifiers="classmethod">
|
||
Adds a flow controller.
|
||
|
||
**Parameters**
|
||
|
||
* **name** (*string*) – Name of the controller to add.
|
||
* **controller** (*type(*[*FlowController*](#qiskit.transpiler.FlowController "qiskit.transpiler.FlowController")*)*) – The class implementing a flow controller.
|
||
</Function>
|
||
|
||
### controller\_factory
|
||
|
||
<Function id="qiskit.transpiler.FlowController.controller_factory" signature="controller_factory(passes, options, **partial_controller)" modifiers="classmethod">
|
||
Constructs a flow controller based on the partially evaluated controller arguments.
|
||
|
||
**Parameters**
|
||
|
||
* **passes** (*list\[BasePass]*) – passes to add to the flow controller.
|
||
* **options** (*dict*) – PassManager options.
|
||
* **\*\*partial\_controller** (*dict*) – Partially evaluated controller arguments in the form \{name:partial}
|
||
|
||
**Raises**
|
||
|
||
[**TranspilerError**](qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") – When partial\_controller is not well-formed.
|
||
|
||
**Returns**
|
||
|
||
A FlowController instance.
|
||
|
||
**Return type**
|
||
|
||
[FlowController](#qiskit.transpiler.FlowController "qiskit.transpiler.FlowController")
|
||
</Function>
|
||
|
||
### dump\_passes
|
||
|
||
<Function id="qiskit.transpiler.FlowController.dump_passes" signature="dump_passes()">
|
||
Fetches the passes added to this flow controller.
|
||
|
||
**Returns**
|
||
|
||
\{‘options’: self.options, ‘passes’: \[passes], ‘type’: type(self)}
|
||
|
||
**Return type**
|
||
|
||
dict
|
||
</Function>
|
||
|
||
### remove\_flow\_controller
|
||
|
||
<Function id="qiskit.transpiler.FlowController.remove_flow_controller" signature="remove_flow_controller(name)" modifiers="classmethod">
|
||
Removes a flow controller.
|
||
|
||
**Parameters**
|
||
|
||
**name** (*string*) – Name of the controller to remove.
|
||
|
||
**Raises**
|
||
|
||
**KeyError** – If the controller to remove was not registered.
|
||
</Function>
|
||
</Class>
|
||
|