---
title: GenericPass (v2.3)
description: API reference for qiskit.passmanager.GenericPass in qiskit v2.3
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/2.3/qiskit.passmanager.GenericPass
---

# GenericPass

*class* `qiskit.passmanager.GenericPass`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/passmanager/base_tasks.py#L57-L153)

Bases: `Task`, [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC)

Base class of a single pass manager task.

A pass instance can read and write to the provided [`PropertySet`](/docs/api/qiskit/2.3/qiskit.passmanager.PropertySet "qiskit.passmanager.PropertySet"), and may modify the input pass manager IR.

## Methods

### execute

`execute(passmanager_ir, state, callback=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/passmanager/base_tasks.py#L72-L118)

Execute optimization task for input Qiskit IR.

**Parameters**

- **passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any)) – Qiskit IR to optimize.
- **state** ([*PassManagerState*](/docs/api/qiskit/2.3/qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")) – State associated with workflow execution by the pass manager itself.
- **callback** ([*Callable*](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable) *| None*) – A callback function which is called per execution of optimization task.

**Returns**

Optimized Qiskit IR and state of the workflow.

**Return type**

[tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[[*Any*](https://docs.python.org/3/library/typing.html#typing.Any), [qiskit.passmanager.compilation\_status.PassManagerState](/docs/api/qiskit/2.3/qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")]

### name

`name()`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/passmanager/base_tasks.py#L68-L70)

Name of the pass.

**Return type**

[str](https://docs.python.org/3/library/stdtypes.html#str)

### run

*abstract* `run(passmanager_ir)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/passmanager/base_tasks.py#L140-L153)

Run optimization task.

**Parameters**

**passmanager\_ir** ([*Any*](https://docs.python.org/3/library/typing.html#typing.Any)) – Qiskit IR to optimize.

**Returns**

Optimized Qiskit IR.

**Return type**

[*Any*](https://docs.python.org/3/library/typing.html#typing.Any)

### update\_status

`update_status(state, run_state)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.3/qiskit/passmanager/base_tasks.py#L120-L138)

Update workflow status.

**Parameters**

- **state** ([*PassManagerState*](/docs/api/qiskit/2.3/qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")) – Pass manager state to update.
- **run\_state** (*RunState*) – Completion status of current task.

**Returns**

Updated pass manager state.

**Return type**

[*PassManagerState*](/docs/api/qiskit/2.3/qiskit.passmanager.PassManagerState "qiskit.passmanager.compilation_status.PassManagerState")
