qiskit-documentation/docs/api/qiskit/0.45/qiskit.algorithms.FasterAmp...

124 lines
6.3 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: FasterAmplitudeEstimation
description: API reference for qiskit.algorithms.FasterAmplitudeEstimation
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit.algorithms.FasterAmplitudeEstimation
---
# FasterAmplitudeEstimation
<Class id="qiskit.algorithms.FasterAmplitudeEstimation" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/algorithms/amplitude_estimators/fae.py" signature="qiskit.algorithms.FasterAmplitudeEstimation(delta, maxiter, rescale=True, quantum_instance=None, sampler=None)" modifiers="class">
Bases: [`AmplitudeEstimator`](qiskit.algorithms.AmplitudeEstimator "qiskit.algorithms.amplitude_estimators.amplitude_estimator.AmplitudeEstimator")
The Faster Amplitude Estimation algorithm.
The Faster Amplitude Estimation (FAE) \[1] algorithm is a variant of Quantum Amplitude Estimation (QAE), where the Quantum Phase Estimation (QPE) by an iterative Grover search, similar to \[2].
Due to the iterative version of the QPE, this algorithm does not require any additional qubits, as the originally proposed QAE \[3] and thus the resulting circuits are less complex.
**References**
**\[1]: K. Nakaji. Faster Amplitude Estimation, 2020;**
[arXiv:2002.02417](https://arxiv.org/pdf/2003.02417.pdf)
**\[2]: D. Grinko et al. Iterative Amplitude Estimation, 2019;**
[arXiv:1912.05559](http://arxiv.org/abs/1912.05559)
**\[3]: G. Brassard et al. Quantum Amplitude Amplification and Estimation, 2000;**
[arXiv:quant-ph/0005055](http://arxiv.org/abs/quant-ph/0005055)
<Admonition title="Deprecated since version 0.24.0" type="danger">
`qiskit.algorithms.amplitude_estimators.fae.FasterAmplitudeEstimation.__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**
* **delta** ([*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)")) The probability that the true value is outside of the final confidence interval.
* **maxiter** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")) The number of iterations, the maximal power of Q is 2 \*\* (maxiter - 1).
* **rescale** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")) Whether to rescale the problem passed to estimate.
* **quantum\_instance** ([*QuantumInstance*](qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") *|*[*Backend*](qiskit.providers.Backend "qiskit.providers.Backend") *| None*) Deprecated: The quantum instance or backend to run the circuits.
* **sampler** ([*BaseSampler*](qiskit.primitives.BaseSampler "qiskit.primitives.BaseSampler") *| None*) A sampler primitive to evaluate the circuits.
<Admonition title="Note" type="note">
This algorithm overwrites the number of shots set in the `quantum_instance` argument, but will reset them to the initial number after running.
</Admonition>
## Attributes
### quantum\_instance
<Attribute id="qiskit.algorithms.FasterAmplitudeEstimation.quantum_instance">
Deprecated. Get the quantum instance.
<Admonition title="Deprecated since version 0.24.0" type="danger">
The property `qiskit.algorithms.amplitude_estimators.fae.FasterAmplitudeEstimation.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.FasterAmplitudeEstimation.sampler">
Get the sampler primitive.
**Returns**
The sampler primitive to evaluate the circuits.
</Attribute>
## Methods
### construct\_circuit
<Function id="qiskit.algorithms.FasterAmplitudeEstimation.construct_circuit" signature="construct_circuit(estimation_problem, k, measurement=False)">
Construct the circuit $Q^k X |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.EstimationProblem")) The estimation problem for which to construct the 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 $Q^k X |0\rangle$.
**Return type**
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") | [tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"), [list](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.12)")\[[int](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")]]
</Function>
### estimate
<Function id="qiskit.algorithms.FasterAmplitudeEstimation.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 run error.
**Return type**
[*FasterAmplitudeEstimationResult*](qiskit.algorithms.FasterAmplitudeEstimationResult "qiskit.algorithms.amplitude_estimators.fae.FasterAmplitudeEstimationResult")
</Function>
</Class>