AmplitudeEstimation¶
- class AmplitudeEstimation(num_eval_qubits, a_factory=None, q_factory=None, i_objective=None, iqft=None, quantum_instance=None)[source]¶
The Quantum Phase Estimation-based Amplitude Estimation algorithm.
This class implements the original Quantum Amplitude Estimation (QAE) algorithm, introduced by https://arxiv.org/abs/quant-ph/0005055. This (original) version uses quantum phase estimation along with a set of m ancilla qubits to find an estimate, that is restricted to the grid
{sin^2(pi y / 2^m) : y = 0, …, 2^{m-1}}.
Using a maximum likelihood post processing, this grid constraint can be circumvented. This improved estimator is implemented as well, see https://arxiv.org/abs/1912.05559 Appendix A for more detail.
- Parameters
num_eval_qubits (
int
) – Number of evaluation qubits, has a min. value of 1.a_factory (
Optional
[CircuitFactory
]) – The CircuitFactory subclass object representing the problem unitary.q_factory (
Optional
[CircuitFactory
]) – The CircuitFactory subclass object representing an amplitude estimation sample (based on a_factory).i_objective (
Optional
[int
]) – The index of the objective qubit, i.e. the qubit marking ‘good’ solutions with the state |1> and ‘bad’ solutions with the state |0>.iqft (
Union
[QuantumCircuit
,IQFT
,None
]) – The Inverse Quantum Fourier Transform component, defaults to using a standard IQFT when Nonequantum_instance (
Union
[QuantumInstance
,BaseBackend
,None
]) – Quantum Instance or Backend
Attributes
Get the A operator encoding the amplitude a that’s approximated, i.e.
Returns backend.
Get the index of the objective qubit.
Get the Q operator, or Grover-operator for the Amplitude Estimation algorithm, i.e.
Returns quantum instance.
Return a numpy random.
Methods
Compute the (1 - alpha) confidence interval.
Construct the Amplitude Estimation quantum circuit.
AmplitudeEstimation.run
([quantum_instance])Execute the algorithm with selected backend.
AmplitudeEstimation.set_backend
(backend, …)Sets backend with configuration.