---
title: IterativePhaseEstimation (v0.46)
description: API reference for qiskit.algorithms.IterativePhaseEstimation in qiskit v0.46
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/0.46/qiskit.algorithms.IterativePhaseEstimation
---

# IterativePhaseEstimation

*class* `qiskit.algorithms.IterativePhaseEstimation(num_iterations, quantum_instance=None, sampler=None)`

[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.46/qiskit/algorithms/phase_estimators/ipe.py)

Bases: `PhaseEstimator`

Run the Iterative quantum phase estimation (QPE) algorithm.

Given a unitary circuit and a circuit preparing an eigenstate, return the phase of the eigenvalue as a number in $[0,1)$ using the iterative phase estimation algorithm.

**\[1]: Dobsicek et al. (2006), Arbitrary accuracy iterative phase estimation algorithm as a two**

qubit benchmark, [arxiv/quant-ph/0610214](https://arxiv.org/abs/quant-ph/0610214)

> **Deprecated since version 0.24.0**
>
> `qiskit.algorithms.phase_estimators.ipe.IterativePhaseEstimation.__init__()`’s argument `quantum_instance` is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. Instead, use the `sampler` argument. See [https://qisk.it/algo\_migration](https://qisk.it/algo_migration) for a migration guide.

**Parameters**

- **num\_iterations** ([*int*](https://docs.python.org/3/library/functions.html#int)) – The number of iterations (rounds) of the phase estimation to run.
- **quantum\_instance** ([*QuantumInstance*](/docs/api/qiskit/0.46/qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance")  *|*[*Backend*](/docs/api/qiskit/0.46/qiskit.providers.Backend "qiskit.providers.Backend") *| None*) – Deprecated: The quantum instance on which the circuit will be run.
- **sampler** ([*BaseSampler*](/docs/api/qiskit/0.46/qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") *| None*) – The sampler primitive on which the circuit will be sampled.

**Raises**

- [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError) – if num\_iterations is not greater than zero.
- [**AlgorithmError**](/docs/api/qiskit/0.46/algorithms#qiskit.algorithms.AlgorithmError "qiskit.algorithms.AlgorithmError") – If neither sampler nor quantum instance is provided.

## Methods

### construct\_circuit

`construct_circuit(unitary, state_preparation, k, omega=0.0, measurement=False)`

Construct the kth iteration Quantum Phase Estimation circuit.

For details of parameters, see Fig. 2 in [https://arxiv.org/pdf/quant-ph/0610214.pdf](https://arxiv.org/pdf/quant-ph/0610214.pdf).

**Parameters**

- **unitary** ([*QuantumCircuit*](/docs/api/qiskit/0.46/qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit")) – The circuit representing the unitary operator whose eigenvalue (via phase) will be measured.
- **state\_preparation** ([*QuantumCircuit*](/docs/api/qiskit/0.46/qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit")) – The circuit that prepares the state whose eigenphase will be measured. If this parameter is omitted, no preparation circuit will be run and input state will be the all-zero state in the computational basis.
- **k** ([*int*](https://docs.python.org/3/library/functions.html#int)) – the iteration idx.
- **omega** ([*float*](https://docs.python.org/3/library/functions.html#float)) – the feedback angle.
- **measurement** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) – Boolean flag to indicate if measurement should be included in the circuit.

**Returns**

the quantum circuit per iteration

**Return type**

[QuantumCircuit](/docs/api/qiskit/0.46/qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")

### estimate

`estimate(unitary, state_preparation)`

Estimate the eigenphase of the input unitary and initial-state pair.

**Parameters**

- **unitary** ([*QuantumCircuit*](/docs/api/qiskit/0.46/qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit")) – The circuit representing the unitary operator whose eigenvalue (via phase) will be measured.
- **state\_preparation** ([*QuantumCircuit*](/docs/api/qiskit/0.46/qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit")) – The circuit that prepares the state whose eigenphase will be measured. If this parameter is omitted, no preparation circuit will be run and input state will be the all-zero state in the computational basis.

**Returns**

Estimated phase in an IterativePhaseEstimationResult object.

**Raises**

[**AlgorithmError**](/docs/api/qiskit/0.46/algorithms#qiskit.algorithms.AlgorithmError "qiskit.algorithms.AlgorithmError") – If neither sampler nor quantum instance is provided.

**Return type**

*IterativePhaseEstimationResult*
