136 lines
7.5 KiB
Plaintext
136 lines
7.5 KiB
Plaintext
---
|
||
title: IterativeAmplitudeEstimation
|
||
description: API reference for qiskit.algorithms.IterativeAmplitudeEstimation
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.algorithms.IterativeAmplitudeEstimation
|
||
---
|
||
|
||
# IterativeAmplitudeEstimation
|
||
|
||
<Class id="qiskit.algorithms.IterativeAmplitudeEstimation" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.25/qiskit/algorithms/amplitude_estimators/iae.py" signature="qiskit.algorithms.IterativeAmplitudeEstimation(epsilon_target, alpha, confint_method='beta', min_ratio=2, quantum_instance=None, sampler=None)" modifiers="class">
|
||
Bases: [`AmplitudeEstimator`](qiskit.algorithms.AmplitudeEstimator "qiskit.algorithms.amplitude_estimators.amplitude_estimator.AmplitudeEstimator")
|
||
|
||
The Iterative Amplitude Estimation algorithm.
|
||
|
||
This class implements the Iterative Quantum Amplitude Estimation (IQAE) algorithm, proposed in \[1]. The output of the algorithm is an estimate that, with at least probability $1 - \alpha$, differs by epsilon to the target value, where both alpha and epsilon can be specified.
|
||
|
||
It differs from the original QAE algorithm proposed by Brassard \[2] in that it does not rely on Quantum Phase Estimation, but is only based on Grover’s algorithm. IQAE iteratively applies carefully selected Grover iterations to find an estimate for the target amplitude.
|
||
|
||
**References**
|
||
|
||
**\[1]: Grinko, D., Gacon, J., Zoufal, C., & Woerner, S. (2019).**
|
||
|
||
Iterative Quantum Amplitude Estimation. [arXiv:1912.05559](https://arxiv.org/abs/1912.05559).
|
||
|
||
**\[2]: Brassard, G., Hoyer, P., Mosca, M., & Tapp, A. (2000).**
|
||
|
||
Quantum Amplitude Amplification and Estimation. [arXiv:quant-ph/0005055](http://arxiv.org/abs/quant-ph/0005055).
|
||
|
||
The output of the algorithm is an estimate for the amplitude a, that with at least probability 1 - alpha has an error of epsilon. The number of A operator calls scales linearly in 1/epsilon (up to a logarithmic factor).
|
||
|
||
<Admonition title="Deprecated since version 0.24.0" type="danger">
|
||
`qiskit.algorithms.amplitude_estimators.iae.IterativeAmplitudeEstimation.__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.
|
||
</Admonition>
|
||
|
||
**Parameters**
|
||
|
||
* **epsilon\_target** ([*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)")) – Target precision for estimation target a, has values between 0 and 0.5
|
||
* **alpha** ([*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)")) – Confidence level, the target probability is 1 - alpha, has values between 0 and 1
|
||
* **confint\_method** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")) – Statistical method used to estimate the confidence intervals in each iteration, can be ‘chernoff’ for the Chernoff intervals or ‘beta’ for the Clopper-Pearson intervals (default)
|
||
* **min\_ratio** ([*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)")) – Minimal q-ratio ($K_{i+1} / K_i$) for FindNextK
|
||
* **quantum\_instance** ([*QuantumInstance*](qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") *|*[*Backend*](qiskit.providers.Backend "qiskit.providers.Backend") *| None*) – Deprecated: Quantum Instance or Backend
|
||
* **sampler** ([*BaseSampler*](qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") *| None*) – A sampler primitive to evaluate the circuits.
|
||
|
||
**Raises**
|
||
|
||
* [**AlgorithmError**](algorithms#qiskit.algorithms.AlgorithmError "qiskit.algorithms.AlgorithmError") – if the method to compute the confidence intervals is not supported
|
||
* [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – If the target epsilon is not in (0, 0.5]
|
||
* [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – If alpha is not in (0, 1)
|
||
* [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – If confint\_method is not supported
|
||
|
||
## Attributes
|
||
|
||
### epsilon\_target
|
||
|
||
<Attribute id="qiskit.algorithms.IterativeAmplitudeEstimation.epsilon_target">
|
||
Returns the target precision `epsilon_target` of the algorithm.
|
||
|
||
**Returns**
|
||
|
||
The target precision (which is half the width of the confidence interval).
|
||
</Attribute>
|
||
|
||
### quantum\_instance
|
||
|
||
<Attribute id="qiskit.algorithms.IterativeAmplitudeEstimation.quantum_instance">
|
||
Deprecated. Get the quantum instance.
|
||
|
||
<Admonition title="Deprecated since version 0.24.0" type="danger">
|
||
The property `qiskit.algorithms.amplitude_estimators.iae.IterativeAmplitudeEstimation.quantum_instance` is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. See [https://qisk.it/algo\_migration](https://qisk.it/algo_migration) for a migration guide.
|
||
</Admonition>
|
||
|
||
**Returns**
|
||
|
||
The quantum instance used to run this algorithm.
|
||
</Attribute>
|
||
|
||
### sampler
|
||
|
||
<Attribute id="qiskit.algorithms.IterativeAmplitudeEstimation.sampler">
|
||
Get the sampler primitive.
|
||
|
||
**Returns**
|
||
|
||
The sampler primitive to evaluate the circuits.
|
||
</Attribute>
|
||
|
||
## Methods
|
||
|
||
### construct\_circuit
|
||
|
||
<Function id="qiskit.algorithms.IterativeAmplitudeEstimation.construct_circuit" signature="construct_circuit(estimation_problem, k=0, measurement=False)">
|
||
Construct the circuit $\mathcal{Q}^k \mathcal{A} |0\rangle$.
|
||
|
||
The A operator is the unitary specifying the QAE problem and Q the associated Grover operator.
|
||
|
||
**Parameters**
|
||
|
||
* **estimation\_problem** ([*EstimationProblem*](qiskit.algorithms.EstimationProblem "qiskit.algorithms.amplitude_estimators.estimation_problem.EstimationProblem")) – The estimation problem for which to construct the QAE circuit.
|
||
* **k** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")) – The power of the Q operator.
|
||
* **measurement** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")) – Boolean flag to indicate if measurements should be included in the circuits.
|
||
|
||
**Returns**
|
||
|
||
The circuit implementing $\mathcal{Q}^k \mathcal{A} |0\rangle$.
|
||
|
||
**Return type**
|
||
|
||
[*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit")
|
||
</Function>
|
||
|
||
### estimate
|
||
|
||
<Function id="qiskit.algorithms.IterativeAmplitudeEstimation.estimate" signature="estimate(estimation_problem)">
|
||
Run the amplitude estimation algorithm on provided estimation problem.
|
||
|
||
**Parameters**
|
||
|
||
**estimation\_problem** ([*EstimationProblem*](qiskit.algorithms.EstimationProblem "qiskit.algorithms.amplitude_estimators.estimation_problem.EstimationProblem")) – The estimation problem.
|
||
|
||
**Returns**
|
||
|
||
An amplitude estimation results object.
|
||
|
||
**Raises**
|
||
|
||
* [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – A quantum instance or Sampler must be provided.
|
||
* [**AlgorithmError**](algorithms#qiskit.algorithms.AlgorithmError "qiskit.algorithms.AlgorithmError") – Sampler job run error.
|
||
|
||
**Return type**
|
||
|
||
[*IterativeAmplitudeEstimationResult*](qiskit.algorithms.IterativeAmplitudeEstimationResult "qiskit.algorithms.amplitude_estimators.iae.IterativeAmplitudeEstimationResult")
|
||
</Function>
|
||
</Class>
|
||
|