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 None

  • quantum_instance (Union[QuantumInstance, BaseBackend, None]) – Quantum Instance or Backend

Attributes

AmplitudeEstimation.a_factory

Get the A operator encoding the amplitude a that’s approximated, i.e.

AmplitudeEstimation.backend

Returns backend.

AmplitudeEstimation.i_objective

Get the index of the objective qubit.

AmplitudeEstimation.q_factory

Get the Q operator, or Grover-operator for the Amplitude Estimation algorithm, i.e.

AmplitudeEstimation.quantum_instance

Returns quantum instance.

AmplitudeEstimation.random

Return a numpy random.

Methods

AmplitudeEstimation.confidence_interval(alpha)

Compute the (1 - alpha) confidence interval.

AmplitudeEstimation.construct_circuit([…])

Construct the Amplitude Estimation quantum circuit.

AmplitudeEstimation.run([quantum_instance])

Execute the algorithm with selected backend.

AmplitudeEstimation.set_backend(backend, …)

Sets backend with configuration.