qiskit.passmanager.BaseController(options=None)GitHub(opens in a new tab)
ABC(opens in a new tab)
Base class of controller.
A controller is built with a collection of pass manager tasks, and a subclass provides a custom logic to choose next task to run. Note a controller can be nested into another controller, and a controller itself doesn’t provide any subroutine to modify the input IR.
Create new flow controller.
execute(passmanager_ir, state, callback=None)
Execute optimization task for input Qiskit IR.
- passmanager_ir (Any(opens in a new tab)) – Qiskit IR to optimize.
- state (PassManagerState) – State associated with workflow execution by the pass manager itself.
- callback (Callable(opens in a new tab) | None) – A callback function which is caller per execution of optimization task.
Optimized Qiskit IR and state of the workflow.
A custom logic to choose a next task to run.
Controller subclass can consume the state to build a proper task pipeline. The updated state after a task execution will be fed back in as the “return” value of any
yield statements. This indicates the order of task execution is only determined at running time. This method is not allowed to mutate the given state object.
- state (PassManagerState) – The state of the passmanager workflow at the beginning of this flow controller’s execution.
- state – the state of pass manager after the execution of the last task that was yielded. The generator does not need to inspect this if it is irrelevant to its logic, nor update it.
Task – Next task to run.