GenericPass

class qiskit.passmanager.GenericPass[source]

Bases: Task, ABC

Base class of a single pass manager task.

A pass instance can read and write to the provided PropertySet, and may modify the input pass manager IR.

Methods

execute(passmanager_ir, state, callback=None)[source]

Execute optimization task for input Qiskit IR.

Parameters:
  • passmanager_ir (Any) – Qiskit IR to optimize.

  • state (PassManagerState) – State associated with workflow execution by the pass manager itself.

  • callback (Callable | None) – A callback function which is caller per execution of optimization task.

Returns:

Optimized Qiskit IR and state of the workflow.

Return type:

tuple[Any, qiskit.passmanager.compilation_status.PassManagerState]

name()[source]

Name of the pass.

Return type:

str

abstract run(passmanager_ir)[source]

Run optimization task.

Parameters:

passmanager_ir (Any) – Qiskit IR to optimize.

Returns:

Optimized Qiskit IR.

Return type:

Any

update_status(state, run_state)[source]

Update workflow status.

Parameters:
  • state (PassManagerState) – Pass manager state to update.

  • run_state (RunState) – Completion status of current task.

Returns:

Updated pass manager state.

Return type:

PassManagerState