qiskit-documentation/docs/api/qiskit/0.32/qiskit.transpiler.FlowContr...

90 lines
3.0 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: 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
---
# FlowController
<Class id="qiskit.transpiler.FlowController" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.18/qiskit/transpiler/runningpassmanager.py" signature="FlowController(passes, options, **partial_controller)" modifiers="class">
Bases: `object`
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.
## Methods
### add\_flow\_controller
<Function id="qiskit.transpiler.FlowController.add_flow_controller" signature="FlowController.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="FlowController.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="FlowController.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="FlowController.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>
## Attributes
### registered\_controllers
<Attribute id="qiskit.transpiler.FlowController.registered_controllers" attributeValue="{'condition': <class 'qiskit.transpiler.runningpassmanager.ConditionalController'>, 'do_while': <class 'qiskit.transpiler.runningpassmanager.DoWhileController'>}" />
</Class>