ConditionalController#

class qiskit.transpiler.ConditionalController(passes, options=None, condition=None, **partial_controller)[source]#

Bases: FlowController

Implements a set of passes under a certain condition.

Attributes

registered_controllers = {'condition': <class 'qiskit.transpiler.runningpassmanager.ConditionalController'>, 'do_while': <class 'qiskit.transpiler.runningpassmanager.DoWhileController'>}#

Methods

classmethod add_flow_controller(name, controller)#

Adds a flow controller.

প্যারামিটার:
  • name (string) -- Name of the controller to add.

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

classmethod controller_factory(passes, options, **partial_controller)#

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

প্যারামিটার:
  • 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}

রেইজেস:

TranspilerError -- When partial_controller is not well-formed.

রিটার্নস:

A FlowController instance.

রিটার্ন টাইপ:

FlowController

dump_passes()#

Fetches the passes added to this flow controller.

রিটার্নস:

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

রিটার্ন টাইপ:

dict

classmethod remove_flow_controller(name)#

Removes a flow controller.

প্যারামিটার:

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

রেইজেস:

KeyError -- If the controller to remove was not registered.