Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

FlowController

class qiskit.transpiler.FlowController(passes, options, **partial_controller)

GitHub

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.


Attributes

registered_controllers

Default value: {'condition': <class 'qiskit.transpiler.runningpassmanager.ConditionalController'>, 'do_while': <class 'qiskit.transpiler.runningpassmanager.DoWhileController'>}


Methods

add_flow_controller

classmethod add_flow_controller(name, controller)

Adds a flow controller.

Parameters

  • name (string) – Name of the controller to add.
  • controller (type(FlowController)) – The class implementing a flow controller.

controller_factory

classmethod controller_factory(passes, options, **partial_controller)

Constructs a flow controller based on the partially evaluated controller arguments.

Parameters

  • passes (list[TBasePass]) – 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 – When partial_controller is not well-formed.

Returns

A FlowController instance.

Return type

FlowController

dump_passes

dump_passes()

Fetches the passes added to this flow controller.

Returns

{‘options’: self.options, ‘passes’: [passes], ‘type’: type(self)}

Return type

dict

remove_flow_controller

classmethod remove_flow_controller(name)

Removes a flow controller.

Parameters

name (string) – Name of the controller to remove.

Raises

KeyError – If the controller to remove was not registered.

Was this page helpful?
Report a bug or request content on GitHub.