qiskit-documentation/docs/api/qiskit/0.35/qiskit.transpiler.DoWhileCo...

88 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: DoWhileController
description: API reference for qiskit.transpiler.DoWhileController
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.transpiler.DoWhileController
---
# DoWhileController
<Class id="qiskit.transpiler.DoWhileController" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.20/qiskit/transpiler/runningpassmanager.py" signature="DoWhileController(passes, options=None, do_while=None, **partial_controller)" modifiers="class">
Bases: `qiskit.transpiler.runningpassmanager.FlowController`
Implements a set of passes in a do-while loop.
## Methods
### add\_flow\_controller
<Function id="qiskit.transpiler.DoWhileController.add_flow_controller" signature="DoWhileController.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.DoWhileController.controller_factory" signature="DoWhileController.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.DoWhileController.dump_passes" signature="DoWhileController.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.DoWhileController.remove_flow_controller" signature="DoWhileController.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.DoWhileController.registered_controllers" attributeValue="{'condition': <class 'qiskit.transpiler.runningpassmanager.ConditionalController'>, 'do_while': <class 'qiskit.transpiler.runningpassmanager.DoWhileController'>}" />
</Class>