FlowController#

class qiskit.transpiler.FlowController(passes, options, **partial_controller)[fuente]#

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 = {'condition': <class 'qiskit.transpiler.runningpassmanager.ConditionalController'>, 'do_while': <class 'qiskit.transpiler.runningpassmanager.DoWhileController'>}#

Methods

classmethod add_flow_controller(name, controller)[fuente]#

Adds a flow controller.

Parámetros:
  • name (string) – Name of the controller to add.

  • controller (type(FlowController)) – The class implementing a flow controller.

classmethod controller_factory(passes, options, **partial_controller)[fuente]#

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

Parámetros:
  • 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}

Muestra:

TranspilerError – When partial_controller is not well-formed.

Devuelve:

A FlowController instance.

Tipo del valor devuelto:

FlowController

dump_passes()[fuente]#

Fetches the passes added to this flow controller.

Devuelve:

{“options”: self.options, “passes”: [passes], “type”: type(self)}

Tipo del valor devuelto:

dict

classmethod remove_flow_controller(name)[fuente]#

Removes a flow controller.

Parámetros:

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

Muestra:

KeyError – If the controller to remove was not registered.