About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
ConditionalController
class ConditionalController(passes, options=None, condition=None, **partial_controller)
Bases: qiskit.transpiler.runningpassmanager.FlowController
Implements a set of passes under a certain condition.
Methods
add_flow_controller
classmethod ConditionalController.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 ConditionalController.controller_factory(passes, options, **partial_controller)
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 – When partial_controller is not well-formed.
Returns
A FlowController instance.
Return type
dump_passes
ConditionalController.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 ConditionalController.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.
Attributes
registered_controllers
Default value: {'condition': <class 'qiskit.transpiler.runningpassmanager.ConditionalController'>, 'do_while': <class 'qiskit.transpiler.runningpassmanager.DoWhileController'>}
Was this page helpful?
Report a bug or request content on GitHub.