IterativeAmplitudeEstimation

class IterativeAmplitudeEstimation(epsilon, alpha, confint_method='beta', min_ratio=2, state_preparation=None, grover_operator=None, objective_qubits=None, post_processing=None, a_factory=None, q_factory=None, i_objective=None, initial_state=None, quantum_instance=None)[source]

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.

[2]: Brassard, G., Hoyer, P., Mosca, M., & Tapp, A. (2000).

Quantum Amplitude Amplification and Estimation. arXiv: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).

Parameters
  • epsilon (float) – Target precision for estimation target a, has values between 0 and 0.5

  • alpha (float) – Confidence level, the target probability is 1 - alpha, has values between 0 and 1

  • confint_method (str) – 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) – Minimal q-ratio (\(K_{i+1} / K_i\)) for FindNextK

  • state_preparation (Union[QuantumCircuit, CircuitFactory, None]) – A circuit preparing the input state, referred to as \(\mathcal{A}\).

  • grover_operator (Union[QuantumCircuit, CircuitFactory, None]) – The Grover operator \(\mathcal{Q}\) used as unitary in the phase estimation circuit.

  • objective_qubits (Optional[List[int]]) – A list of qubit indices. A measurement outcome is classified as ‘good’ state if all objective qubits are in state \(|1\rangle\), otherwise it is classified as ‘bad’.

  • post_processing (Optional[Callable[[float], float]]) – A mapping applied to the estimate of \(0 \leq a \leq 1\), usually used to map the estimate to a target interval.

  • a_factory (Optional[CircuitFactory]) – The A operator, specifying the QAE problem

  • q_factory (Optional[CircuitFactory]) – The Q operator (Grover operator), constructed from the A operator

  • i_objective (Optional[int]) – Index of the objective qubit, that marks the ‘good/bad’ states

  • initial_state (Optional[QuantumCircuit]) – A state to prepend to the constructed circuits.

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

Raises

AquaError – if the method to compute the confidence intervals is not supported

Attributes

IterativeAmplitudeEstimation.a_factory

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

IterativeAmplitudeEstimation.backend

Returns backend.

IterativeAmplitudeEstimation.grover_operator

Get the \(\mathcal{Q}\) operator, or Grover operator.

IterativeAmplitudeEstimation.i_objective

Get the index of the objective qubit.

IterativeAmplitudeEstimation.objective_qubits

Get the criterion for a measurement outcome to be in a ‘good’ state.

IterativeAmplitudeEstimation.precision

Returns the target precision epsilon of the algorithm.

IterativeAmplitudeEstimation.q_factory

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

IterativeAmplitudeEstimation.quantum_instance

Returns quantum instance.

IterativeAmplitudeEstimation.random

Return a numpy random.

IterativeAmplitudeEstimation.state_preparation

Get the \(\mathcal{A}\) operator encoding the amplitude \(a\).

Methods

IterativeAmplitudeEstimation.construct_circuit(k)

Construct the circuit Q^k A |0>.

IterativeAmplitudeEstimation.is_good_state(…)

Determine whether a given state is a good state.

IterativeAmplitudeEstimation.post_processing(value)

Post processing of the raw amplitude estimation output \(0 \leq a \leq 1\).

IterativeAmplitudeEstimation.run([…])

Execute the algorithm with selected backend.

IterativeAmplitudeEstimation.set_backend(…)

Sets backend with configuration.