---
title: EvolvedOperatorAnsatz (v2.1)
description: API reference for qiskit.circuit.library.EvolvedOperatorAnsatz in qiskit v2.1
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/2.1/qiskit.circuit.library.EvolvedOperatorAnsatz
---

# EvolvedOperatorAnsatz

*class* `qiskit.circuit.library.EvolvedOperatorAnsatz(operators=None, reps=1, evolution=None, insert_barriers=False, name='EvolvedOps', parameter_prefix='t', initial_state=None, flatten=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/2.1/qiskit/circuit/library/n_local/evolved_operator_ansatz.py#L281-L476)

Bases: [`NLocal`](/docs/api/qiskit/2.1/qiskit.circuit.library.NLocal "qiskit.circuit.library.n_local.n_local.NLocal")

The evolved operator ansatz.

**Parameters**

- **operators** (*BaseOperator |* [*QuantumCircuit*](/docs/api/qiskit/2.1/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")  *|*[*list*](https://docs.python.org/3/library/stdtypes.html#list) *| None*) – The operators to evolve. If a circuit is passed, we assume it implements an already evolved operator and thus the circuit is not evolved again. Can be a single operator (circuit) or a list of operators (and circuits).
- **reps** ([*int*](https://docs.python.org/3/library/functions.html#int)) – The number of times to repeat the evolved operators.
- **evolution** (*EvolutionBase |* [*EvolutionSynthesis*](/docs/api/qiskit/2.1/qiskit.synthesis.EvolutionSynthesis "qiskit.synthesis.EvolutionSynthesis") *| None*) – A specification of which evolution synthesis to use for the [`PauliEvolutionGate`](/docs/api/qiskit/2.1/qiskit.circuit.library.PauliEvolutionGate "qiskit.circuit.library.PauliEvolutionGate"). Defaults to first order Trotterization.
- **insert\_barriers** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – Whether to insert barriers in between each evolution.
- **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) – The name of the circuit.
- **parameter\_prefix** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *| Sequence\[*[*str*](https://docs.python.org/3/library/stdtypes.html#str)*]*) – Set the names of the circuit parameters. If a string, the same prefix will be used for each parameters. Can also be a list to specify a prefix per operator.
- **initial\_state** ([*QuantumCircuit*](/docs/api/qiskit/2.1/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") *| None*) – A [`QuantumCircuit`](/docs/api/qiskit/2.1/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") object to prepend to the circuit.
- **flatten** ([*bool*](https://docs.python.org/3/library/functions.html#bool) *| None*) – Set this to `True` to output a flat circuit instead of nesting it inside multiple layers of gate objects. By default currently the contents of the output circuit will be wrapped in nested objects for cleaner visualization. However, if you’re using this circuit for anything besides visualization its **strongly** recommended to set this flag to `True` to avoid a large performance overhead for parameter binding.

## Attributes

### evolution

The evolution converter used to compute the evolution.

**Returns**

The evolution converter used to compute the evolution.

**Return type**

[EvolutionSynthesis](/docs/api/qiskit/2.1/qiskit.synthesis.EvolutionSynthesis "qiskit.synthesis.EvolutionSynthesis")

### num\_qubits

Returns the number of qubits in this circuit.

**Returns**

The number of qubits.

### operators

The operators that are evolved in this circuit.

**Returns**

The operators to be evolved (and circuits) contained in this ansatz.

**Return type**

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

### preferred\_init\_points

Getter of preferred initial points based on the given initial state.

### name

Type: `str`

A human-readable name for the circuit.

**Example**

```python
from qiskit import QuantumCircuit

qc = QuantumCircuit(2, 2, name="my_circuit")
print(qc.name)
```

```text
my_circuit
```
