FlowController#

class qiskit.transpiler.FlowController(passes, options, **partial_controller)[código fonte]#

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)[código fonte]#

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)[código fonte]#

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}

Levanta:

TranspilerError – When partial_controller is not well-formed.

Retorno:

A FlowController instance.

Tipo de retorno:

FlowController

dump_passes()[código fonte]#

Fetches the passes added to this flow controller.

Retorno:

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

Tipo de retorno:

dict

classmethod remove_flow_controller(name)[código fonte]#

Removes a flow controller.

Parâmetros:

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

Levanta:

KeyError – If the controller to remove was not registered.