$^{a}$Department of Mathematics and CITIC,
Universidade da Coruña, A Coruña, Spain

$^{b}$Department of Physics and Instituto de Ciencias y Tecnologías Espaciales de Asturias (ICTEA),

Universidad de Oviedo, Oviedo, Spain

$^{c}$Centro de Supercomputación de Galicia (CESGA),
Santiago de Compostela, Spain

We introduce the Real Quantum Amplitude Estimation (RQAE) algorithm, an extension of Quantum Amplitude Estimation (QAE) which is sensitive to the sign of the amplitude.
RQAE is an iterative algorithm which offers explicit control over the amplification policy through an adjustable parameter.
We provide a rigorous analysis of the RQAE performance and prove that it achieves a quadratic speedup, modulo logarithmic corrections, with respect to unamplified sampling. Besides, we corroborate the theoretical analysis with a set of numerical experiments.

§ INTRODUCTION, MOTIVATION AND MAIN RESULTS

Quantum Amplitude Estimation (QAE) is an algorithm which retrieves information stored in the amplitude of a quantum state. It is argued to have a quadratic speedup over simple repeated sampling of the quantum state. For this reason, QAE is a central subroutine in quantum computation for various applications, e.g., in chemistry <cit.>, finance <cit.>, and machine learning <cit.>. The original QAE algorithm <cit.> is built composing Quantum Phase Estimation (QPE) <cit.> and Grover’s algorithms <cit.>. Standard QPE relies on a Quantum Fourier Transform (QFT) which is very demanding in terms of computational resources, especially if considered for the Noise Intermediate-Scale Quantum era (NISQ).

Several approaches have been proposed to reduce the resources needed by QAE, both in terms of qubits and circuit depth, while approximately preserving the same speedup. These approaches can be broadly categorized in three families.

* The first family consists in techniques which take advantage of classical post-processing. As an example, in <cit.> the authors show how to replace QPE by a set of Grover iterations combined with a Maximum Likelihood Estimation (MLE) post-processing algorithm. To correctly asses the overall performance of such techniques, one needs to include the overhead due to the classical post-processing in the total cost of the algorithm, therefore diminishing the potential speedup. Moreover, at the time of writing, no rigorous proof of the correctness of the proposed algorithms has been given yet.

* The second family includes strategies which still rely on phase estimation, but eliminate the need of a QFT. The main idea is to replace the QFT with  Hadamard tests <cit.>. This variation of QPE was first suggested by Kitaev <cit.> and is called “iterative phase estimation”. In papers following this approach such as <cit.> it is not even clear how to control the accuracy of the algorithm other than possibly increasing the number of measurements. Besides, they do not give rigorous proof of the correctness of the algorithm.

* The methods belonging to the third and last family are based entirely on Grover iterations and they do not require any post-processing. The main difference among algorithms of this family is in the amplification policy. Representative examples of this approach are the Iterative Quantum Amplitude Estimation (IQAE) and the Quantum Amplitude Estimation Simplified (QAES) algorithms <cit.>. Both provide rigorous proofs of the correctness of the techniques. Although the strategy described in <cit.> achieves the desired asymptotic complexity exactly (i.e. without logarithmic factors), the constants involved are very large, and likely to render the algorithm impractical. In <cit.> they do not exactly match the desired asymptotic complexity, yet the constants involved are much lower.

RQAE can be thought of as a generalization of the Quantum Coin algorithm <cit.> and it is based on an iterative strategy, like <cit.>. In particular, RQAE utilizes a set of auxiliary amplitudes which allow to shift in a controlled fashion the amplitude to be retrieved. Such shift can be easily and efficiently implemented following the methods presented in <cit.>. Relying on this, we propose a specific strategy to iteratively choose the amplification factor $k$ (i.e. the Grover exponent) and the shift $b$ at each iteration, progressively improving the estimation of the quantum amplitude to be retrieved i.e. the target amplitude.

We prove for RQAE a set of tight bounds. Moreover, the bounds for RQAE depend on a free parameter $q$ which directly controls the amplification policy. More specifically, the parameter $q$ is a minimum bound for the ratio between the amplification on consecutive steps:

\begin{equation}\label{eq:qqq}
q\leq q_i
\equiv \dfrac{K_{i+1}}{K_i}
\equiv \dfrac{2k_{i+1}+1}{2k_{i}+1}\ .
\end{equation}

The parameter $q$ affects both the depth of the circuit and the performance (in terms of calls to the oracle) of the algorithm, thus offering a handle to discuss the trade-off between the two.

The other feature that makes RQAE different from alternative amplitude estimation algorithms is the possibility of recovering the sign of the amplitude to be retrieved, hence the name Real Quantum Amplitude Estimation (RQAE). Concretely, RQAE is a parametric algorithm that depends on a real input amplitude $b_1$,
which provides a reference, through which we can unambiguously assign a phase to every other amplitude in the quantum register. Then, when referring to the sign of an amplitude, we mean the relative phase between such amplitude and $b_1$. As the notation already suggests, $b_1$ is the shift mentioned above for the first iteration. The new sensitivity to the relative sign of an amplitude allows one to tackle a wider variety of problems, precluded to standard algorithms.

The remainder of this paper is organized as follows. Section <ref> introduces the intuition behind the construction of the algorithm. In Section <ref> we state some theoretical results on the performance of the algorithm for a specific set of parameters (for the rigorous proof see Appendix <ref>). Moreover, we confirm the theoretical properties with a set of simulated experiments. To conclude, we discuss the results and related open questions in Section <ref>.

§ REAL QUANTUM AMPLITUDE ESTIMATION

Consider a one-parameter family of oracles $\mathcal{A}_{b}$ that, acting on the state $\ket{0}$, yield

\begin{equation}\label{eq:shi_def}
\mathcal{A}_{b}\ket{0} = \ket{\psi} = \left(a+b\right)\ket{\phi}+c_b\, \ket{\phi^\perp}_b\ ,
\end{equation}

where $a$ is a real number, $b$ is an auxiliary, continuous and real parameter that we call “shift”, and $\ket{\phi}$ is a specified direction in the Hilbert space ${\cal H}$.
The RQAE algorithm estimates the amplitude $a$ exploiting the possibility of tuning the shift $b$ iteratively. The ket $\ket{\psi}$ belongs to the plane $\Pi_b = \text{span}\{\ket{\phi},\ket{\phi^\perp}_b\} \subset {\cal H}$ for which the kets $\ket{\phi}$ and $\ket{\phi^\perp}_b$ provide an orthonormal basis. Note that all the quantities with a sub-index $b$ depend on the actual value of the shift. In practice, the construction of oracles such as $\mathcal{A}_b$ from a given un-shifted oracle $\mathcal{A}_0$ is generally not difficult. In most cases, a controlled shift of an amplitude can be efficiently implemented via Hadamard gates and some controlled operations. We give an example on how to build such a shifted oracle in Appendix <ref>. In particular, its implementation is straightforward in the framework described in <cit.>.

Given a precision level $\epsilon$ and a confidence level $1-\gamma$, the goal of the algorithm is to compute an interval $(a_I^{\min},a_I^{\max}) \subset [-1,1]$ of width smaller than $2\epsilon$ which contains the value of $a$ with probability greater or equal to $1-\gamma$ (see Figure <ref>). We take as a representative of the interval its center, $a_I = \frac{a_I^{\min}+a_I^{\max}}{2}$, thus admitting a maximum error of $\epsilon$:

\begin{equation}\label{eq:initial_problem}
\mathbb{P}\Big[|a-a_I|\geq \epsilon \Big] \leq \gamma\ .
\end{equation}

$a$ is the target amplitude to be estimated, $2\epsilon$ is the width of the estimation interval with bounds $(a_I^{\min},a_I^{\max})$, $a_I$ is the center of the confidence interval. In the image we distinguish three possibilities to emphasize that the algorithm described below is sensitive to the sign of $a$.

It is convenient to express the amplitudes in terms of their corresponding angles, that is, we consider the generic mapping $\theta_x = \arcsin(x)$ for any real amplitude $x$. Note that the angle representation is particularly suited to describe Grover amplifications, which indeed admit an interpretation as rotations in the plane $\Pi_b$. As an example, the state $\ket{\psi}$ given in (<ref>) can be written as

\begin{equation}
\ket{\psi} = \sin(\theta_{a+b})\ket{\phi}+\cos(\theta_{a+b})\ket{\phi^\perp}_b\ ,
\end{equation}

where $\theta_{a+b}$ represents a rotation in the plane $\Pi_b$ defined above.
Throughout the paper, we will be changing back and forth from the representation in terms of the actual amplitude or its associated angle whenever needed. To avoid notational clutter, we henceforth drop the sub-index $b$ on the perpendicular ket, leaving its dependence on the shift as understood. Actually, such dependence does not play any role for the algorithm.

In the following subsections we address the details of the procedure describing all the steps contained in each iteration.

§.§ First iteration: estimating the sign

This step achieves a first estimation of the bounds of the confidence interval $(a_1^{\min},a_1^{\max})$.  Normally, this estimation would not be sensitive to the sign of the underlying amplitude because, when sampling from a quantum state, we obtain the square of the amplitude. Nevertheless, taking advantage of the shift $b$ we can circumvent this limitation. In order to compute the sign, we will combine two different pieces of information: the result of measuring the two oppositely shifted states $\ket{\psi_1}_{\pm}$ defined as:

\begin{equation}
\begin{aligned}
\ket{\psi_1}_{+}
\left(a+b_1\right)\ket{\phi} + ... \ ,\\
\ket{\psi_1}_{-}
&:= \left(a-b_1\right) \ket{\phi} + ...\ ,
\end{aligned}
\end{equation}

for an arbitrary real shift $b_1$. The sign of $b_1$ has to be decided at the start of the algorithm to have a clear reference. In practice, in some setups it is possible to measure at the same time both states taking advantages of Hadamard gates as in the quantum arithmetic techniques discussed in <cit.> (more details are given in Appendix <ref>).
As $a$ and $b_1$ are real numbers, we have the identity:

\begin{equation}\label{ide}
a = \dfrac{\left(a+b_1\right)^2-\left(a-b_1\right)^2}{4b_1}\ ,
\end{equation}

and we can build a first empirical estimation $\hat{a}_1$ of $a$ as follows:

\begin{equation}\label{eqn:first_empirical_amplitude_estimation}
\hat{a}_1 = \dfrac{\hat{p}_{\text{sum}}-\hat{p}_{\text{diff}}}{4b_1}\ ,
\end{equation}

where $\hat{p}_{\text{sum}}$ and $\hat{p}_{\text{diff}}$ are the empirical probabilities of getting $\ket{\phi}$ when measuring $\ket{\psi_1}_{-}$ and $\ket{\psi_1}_{+}$, respectively. Throughout the paper, when we measure, we will use $\hat{p}$ to denote the empirical probability obtained from direct sampling. As an example, if in iteration $i$ we sample the state $N_i$ times, getting $\ket{\phi}$ as an outcome $\hat{N}_i$ times, the estimated probability of $\ket{\phi}$ will be $\hat{p}_i = \dfrac{\hat{N}_i}{N_i}$.

From (<ref>) and (<ref>), we can obtain a first confidence interval:

\begin{equation}\label{eq:first_amplitude_bounds}
\begin{aligned}
&a^{\max}_1 = \min\left(\dfrac{\hat{p}_{\text{sum}}-\hat{p}_{\text{diff}}}{4b_1}+\dfrac{\epsilon^{p}_1}{|2b_1|},1\right),\\
&a^{\min}_1 = \max\left(\dfrac{\hat{p}_{\text{sum}}-\hat{p}_{\text{diff}}}{4b_1}-\dfrac{\epsilon^{p}_1}{|2b_1|},-1\right),\\
&a_1 = \dfrac{a^{\max}_1+a^{\min}_1}{2}\ ,\\
&\epsilon_1^a = \dfrac{a^{\max}_1-a^{\min}_1}{2}\ ,
\end{aligned}
\end{equation}

where the $\max$ and the $\min$ operations are introduced because we know a priori that probabilities are bounded between $0$ and $1$. The assignment of an error $\epsilon^{p}_1$ to the empirical result $\hat{p}_1$ relies on a statistical analysis and depends on the statistical bound one employs, such as Chebysev, Chernoff (Hoeffding) and Clopper-Pearson bounds.
Here one of the main differences with respect to the other algorithms present in the literature becomes obvious, although the probabilities are bounded between $0$ and $1$ the estimated amplitude obtained by the identity (<ref>) is now bounded between $-1\leq a_1\leq 1$, that is, it can be negative (see Figure <ref>). Note that the sign of the amplitude depends on the sign of $b_1$, which is taken as being positive for simplicity. However, this election is arbitrary and it could be chosen negative.

Left: the red dot corresponds to $a$, the probability to be estimated; $a_1^{\min}$ and $a_1^{\max}$ define the confidence interval whose width is $2\epsilon_1$. Right: the same, but represented in terms of the angles. Note that the “true value" –represented by either $a$ and $\theta_a$– falls in a generic position within the confidence interval.

§.§ Following iterations: amplifying the probability and shrinking the interval

Starting point.

Undoing the amplification.

Undoing the shift.

Steps on each iteration.

On consecutive iterations, given an input confidence interval $(a^{\min}_i,a^{\max}_i)$ (see Figure <ref>) we want to obtain a tighter one $(a^{\max}_{i+1},a^{\min}_{i+1})$ and iterate the process until the desired precision $\epsilon$ is reached. At each iteration, the process for narrowing the interval starts by choosing a new shift according to

\begin{equation}\label{shifti+1}
b_{i+1} = -a^{\min}_{i}\ .
\end{equation}

This election is not unique. Again, we could have chosen  $b_{i+1} = -a^{\max}_{i}$. Always keep in mind that the phase that we are obtaining is relative to the original value of $b = b_1$.
Considering the choice (<ref>), we force our lower bound to match exactly zero (See Figure <ref>). The boundaries of the confidence interval $(a^{\min}_i,a^{\max}_i)$, when shifted and then expressed in terms of the corresponding angles, become:

\begin{equation}\label{alphamax}
\begin{aligned}
&\alpha^{\max}_{i} = \arcsin\left(a^{\max}_i-a^{\min}_i\right) = \arcsin\left(2\epsilon^a_i \right),\\
&\alpha^{\min}_{i} = 0.
\end{aligned}
\end{equation}

The angular region $\alpha_i^{\min} \leq \alpha_i \leq \alpha_i^{\max}$ represents the confidence interval and we refer to it as confidence fan.

The next step takes advantage of the Grover operator, defined as

\begin{equation}\label{groove}
\mathcal{G} = -\mathcal{A}_{b}\mathcal{R}_{\ket{0}}\mathcal{A}_{b}^{\dagger}\mathcal{R}_{\ket{\phi}}\ ,
\end{equation}

\begin{equation}
\begin{aligned}
\mathcal{R}_{\ket{0}} &=\mathbb{1}-2\ket{0}\bra{0}\ ,\\
\mathcal{R}_{\ket{\phi}} &=\mathbb{1}-2\ket{\phi}\bra{\phi}\ ,
\end{aligned}
\end{equation}

and $\mathcal{A}_{b}$ is the oracle defined in (<ref>).
The Grover operator applied $k_{i+1}$ times allows us to multiply the angles associated to the $i$-th bounds by $2k_{i+1}+1$ (see Figure <ref>). When doing so, the distance measured in angles between the upper and the lower bounds increases by a factor $2k_{i+1}+1$:

\begin{align}
&\ket{\psi_{i+1}}_+ = \left(a_i+b_{i+1}\right)\ket{\phi}+c_i\ket{\phi^\perp}= \left(a_i-a_i^{\min}\right)\ket{\phi}+c_i\ket{\phi^\perp} \equiv \sin(\theta_{i+1})\ket{\phi}+\cos(\theta_{i+1})\ket{\phi^\perp}\\ \nonumber
&\qquad \xrightarrow{{\cal G}^{k_{i+1}}}\qquad
\sin\Big[(2k_{i+1}+1)\theta_{i+1}\Big]\ket{\phi}+\cos\Big[(2k_{i+1}+1)\theta_{i+1}\Big]\ket{\phi^\perp}\ ,
\end{align}

where ${\cal G}^{k_{i+1}}$ indicates the Grover operator applied $k_{i+1}$ times. In order to avoid ambiguities due to the lack of a bijective correspondence angle/amplitude, when measuring amplified probabilities, we cannot allow the amplified angles to go beyond $\left[0,\dfrac{\pi}{2}\right]$. Namely, we need the amplified confidence fan to stay within the first quadrant. Relying on (<ref>), we choose the Grover amplification exponent as:

\begin{equation}\label{eq:next_k}
k_{i+1} = \left\lfloor\dfrac{\pi}{4\arcsin\left(2\epsilon^a_{i}\right)}-\dfrac{1}{2}\right\rfloor\ ,
\end{equation}

so that we maximize the amplification factor while respecting the angle constraint.

Now, we measure the state $\ket{\psi_{i+1}}$ in the amplified space, obtaining the empirical probability

\begin{equation}
\hat{p}_{i+1}\approx \sin^2 \Big[(2k_{i+1}+1)\theta_{i+1}\Big]\ ,
\end{equation}

with the statistical error $ \epsilon^{p}_{i+1}$, and define:

\begin{align}\nonumber
& p^{\max}_{i+1} := \min\left(\hat{p}_{i+1}+\epsilon^{p}_{i+1},1\right)\ ,\\ \label{pmaxmin}
& p^{\min}_{i+1} := \max\left(\hat{p}_{i+1}-\epsilon^{p}_{i+1},0\right)\ ,\\ \nonumber
& p_{i+1} := \dfrac{p^{\max}_{i+1}+p^{\min}_{i+1}}{2}\ ,
\end{align}

where the $\max$ and $\min$ functions play an analogous role as in Section <ref> (see Figure <ref>).

In the next step we transform the angles corresponding to $p^{\max}_{i+1}$ and $p^{\min}_{i+1}$ to the non-amplified space:

\begin{equation}
\begin{aligned}
& \theta^{\max}_{i+1} = \dfrac{\arcsin\left(\sqrt{p^{\max}_{i+1}}\right)}{2k_{i+1}+1}\ ,\\
& \theta^{\min}_{i+1} =  \dfrac{\arcsin\left(\sqrt{p^{\min}_{i+1}}\right)}{2k_{i+1}+1}\ .
\end{aligned}
\end{equation}

In other words, we have just “undone" the amplification (see Figure <ref>).

Finally, we have to undo the shift (<ref>), actually performing an opposite shift (see Figure <ref>). Using definitions analogous to those given in (<ref>), we
finally obtain:

\begin{equation}
\begin{aligned}\label{eqn:following_amplitude_bounds}
& a^{\max}_{i+1} = \sin\left(\dfrac{\arcsin\left(\sqrt{p^{\max}_{i+1}}\right)}{2k_{i+1}+1}\right)-b_{i+1}\ ,\\
& a^{\min}_{i+1} =  \sin\left(\dfrac{\arcsin\left(\sqrt{p^{\min}_{i+1}}\right)}{2k_{i+1}+1}\right)-b_{i+1}\ ,\\
& a_{i+1} = \dfrac{a^{\max}_{i+1}+a^{\min}_{i+1}}{2}\ ,\\
& \epsilon^a_{i+1} = \dfrac{a^{\max}_{i+1}-a^{\min}_{i+1}}{2} = \frac{1}{2}\sin\left(\dfrac{\arcsin\left(\sqrt{p^{\max}_{i+1}}\right)}{2k_{i+1}+1}\right)-\frac{1}{2}\sin\left(\dfrac{\arcsin\left(\sqrt{p^{\min}_{i+1}}\right)}{2k_{i+1}+1}\right).
\end{aligned}
\end{equation}

Recall that the goal is to reduce the width of the confidence interval until the desired precision $\epsilon$ is reached. To this sake, one has to repeat the iteration just described until the goal is met.

Throughout this section we have addressed the general structure of the algorithm. Nevertheless, we have not specified the values of all the parameters involved. More specifically, we have not discussed how $\epsilon^p_i$ is obtained. This parameter strictly depends on the number of shots on each iteration, $N_i$, and the confidence required on each iteration, $1-\gamma_i$, through a set of bounds such as Hoeffding's inequality or Clopper-Pearson bound (see <cit.>). In Section <ref>, more insight about these choices is provided.

§ RQAE: CONFIGURATION AND PROPERTIES

As mentioned before, in order to complete the RQAE method, we need to incorporate a particular choice for the parameter $\epsilon^p_i$ and, thus, the parameters involved in its computation, i.e., $N_i$ and $1-\gamma_i$, the number of shots and confidence level of the $i$-th iteration, respectively. With the aim of being able to characterize theoretically the algorithm, we propose to take, $\forall i$, the following constant values:

\begin{equation*}
\begin{aligned}
N_i(q,\epsilon,\gamma) &= \left\lceil \dfrac{1}{2\epsilon^p(q)^2}\log\left(\dfrac{2T(q,\epsilon)}{\gamma}\right) \right\rceil, \\
\gamma_i(q,\epsilon,\gamma) &= \dfrac{\gamma}{T(q,\epsilon)},\\
b_1(q) &= \dfrac{1}{2}\sin\left(\dfrac{\pi}{2(q+2)}\right),
\end{aligned}
\end{equation*}

\begin{equation*}
\epsilon^p (q) = \dfrac{1}{2}\sin^2\left(\dfrac{\pi}{2(q+2)}\right) \quad \text{and} \quad T(q,\epsilon) = \log_q\left(q^2\dfrac{\arcsin\left(\sqrt{2\epsilon^p(q)}\right)}{\arcsin\left(2\epsilon\right)}\right).
\end{equation*}

Once the free parameters are selected, the RQAE is completed and ready to be used. Of course, other choices can be made. In Algorithm <ref>, the RQAE algorithm is schematically described. Note that our selection of the parameters is uniquely determined by the input quantities $q$, $\epsilon$ and $\gamma$. As we will see in Section <ref>, the choice considered here presents several interesting properties.

RQAE pseudocode

$\epsilon$ required precision
$\gamma$ $1-\gamma$ is the confidence level
$q$  amplification policy
$\mathcal{A}$ oracle
$a$ estimated amplitude with sign
Define relevant parameters
Set $\epsilon^p = \dfrac{1}{2}\sin^2\left(\dfrac{\pi}{2(q+2)}\right)$
Set $T = \log_q\left(q^2\dfrac{\arcsin\left(\sqrt{2\epsilon^p}\right)}{\arcsin\left(2\epsilon\right)}\right)$
Set $\gamma_i = \dfrac{\gamma}{T}$Confidence for each iteration
Set $N_i = \left\lceil \dfrac{1}{2(\epsilon^p)^2}\log\left(\dfrac{2T}{\gamma}\right) \right\rceil$ Number of shots for each iteration
Set $\epsilon^p_i = \sqrt{\dfrac{1}{2N_i}\log\left(\dfrac{2}{\gamma_i}\right)}$
Set $k^{\max}=\left\lceil \dfrac{1}{2}\dfrac{\arcsin\left(\sqrt{2\epsilon^p}\right)}{\arcsin\left(2\epsilon\right)}-\dfrac{1}{2}\right\rceil$
First Iteration
Set $b = \dfrac{1}{2}\sin\left(\dfrac{\pi}{2(q+2)}\right)$Shift
Measure $p_{\text{sum}}$ and $p_{\text{diff}}$
$a^{\max} = \min\left(\dfrac{\hat{p}_{\text{sum}}-\hat{p}_{\text{diff}}}{4b}+\dfrac{\epsilon^{p}_i}{|2b|},1\right)$
$a^{\min} = \max\left(\dfrac{\hat{p}_{\text{sum}}-\hat{p}_{\text{diff}}}{4b}-\dfrac{\epsilon^{p}_i}{|2b|},-1\right)$
$a = \dfrac{a^{\max}+a^{\min}}{2}$
$\epsilon^a = \dfrac{a^{\max}-a^{\min}}{2}$
Following Iterations
Set $b = -a^{\min}$ Shift
Set $k = \left\lfloor\dfrac{\pi}{4\arcsin(2\epsilon^a)}-\dfrac{1}{2} \right\rfloor$ Number of amplifications
$k = k^{\max}$
Measure $p$ shifted probability with $k$ amplifications
$p^{\max}= \min(p+\epsilon^p_i,1)$
$p^{\min}= \max(p-\epsilon^p_i,0)$
$\theta^{\max} = \dfrac{\arcsin(\sqrt{p^{\max}})}{2k+1}$
$\theta^{\min} = \dfrac{\arcsin(\sqrt{p^{\min}})}{2k+1}$
$a^{\max} = \sin\left(\theta^{\max}\right)-b $
$ a^{\min} =  \sin\left(\theta^{\min}\right)-b$
$a = \dfrac{a^{\max}+a^{\min}}{2}$
$\epsilon^a = \dfrac{a^{\max}-a^{\min}}{2}$
return $a$

§.§ Properties

Given the proposed configuration in Algorithm <ref>, the RQAE algorithm presents several properties which are listed in the next theorem.

Given $\epsilon,\gamma$ and $q$, and taking the parameters:

\begin{equation}\label{eq:number_shots}
N_i(q,\epsilon,\gamma) =\left\lceil N \right\rceil = \left\lceil \dfrac{1}{2\epsilon^p(q)^2}\log\left(\dfrac{2T(q,\epsilon)}{\gamma}\right) \right\rceil,
\end{equation}

\begin{equation}\label{eq:max_confidence}
\gamma_i(q,\epsilon,\gamma) = \dfrac{\gamma}{T(q,\epsilon)},
\end{equation}

\begin{equation}\label{eq:b1}
b_1 = \dfrac{1}{2}\sin\left(\dfrac{\pi}{2(q+2)}\right)\ ,
\end{equation}

\begin{equation}\label{eq:min_precision}
\epsilon^p (q) = \dfrac{1}{2}\sin^2\left(\dfrac{\pi}{2(q+2)}\right)\ ,
\end{equation}

\begin{equation}\label{eq:max_iterations}
T(q,\epsilon) = \log_q\left(q^2\dfrac{\arcsin\left(\sqrt{2\epsilon^p(q)}\right)}{\arcsin\left(2\epsilon\right)}\right)\ ,
\end{equation}

* The error at each iteration is bounded by:

\begin{equation}\label{eq:precision_bound}
\epsilon^p_i\leq \epsilon^p
\end{equation}

* We get the amplification policy:

\begin{equation}\label{eq:amplification_policy_bound}
q_i = \dfrac{2k_{i+1}+1}{2k_i+1}\geq q
\end{equation}

* The depth of the circuit is bounded by:

\begin{equation}\label{eq:depth_bound}
k_I\leq \left\lceil\dfrac{1}{2}\dfrac{\arcsin\left(\sqrt{2\epsilon^p}\right)}{\arcsin(2\epsilon)}-\dfrac{1}{2}\right\rceil =k_I^{\max}
\end{equation}

* The algorithm finishes before $T(q,\epsilon)$ iterations:

\begin{equation}\label{eq:max_iterations_bound}
\end{equation}

* The algorithm obtains a precision $\epsilon$ with confidence $1-\gamma$ (Proof of Correctness):

\begin{equation}\label{eq:master_equation}
\mathbb{P}\Big[a\not\in (a^{\min}_I,a^{\max}_I)\Big]\leq \gamma
\end{equation}

* The total number of calls to the oracle is bounded by:

\begin{align}\label{eq:oracle_bound}
N_{\text{oracle}}<&\dfrac{1}{\sin^4\left(\dfrac{\pi}{2(q+2)}\right)}\log\left[\dfrac{2\sqrt{e}\log_q\left(\dfrac{q^2\pi}{2(q+2)\arcsin(2\epsilon)}\right)}{\gamma}\right]\\ \nonumber &\qquad\cdot\left(\dfrac{\pi}{2(q+2)\arcsin(2\epsilon)}+2\right)\left(1+\dfrac{q}{q-1}\right)\ .
\end{align}

The proof of Theorem <ref> can be found in Appendix <ref>.

The first important feature is the fourth property, where we see that the algorithm achieves the desired precision $\epsilon$ with confidence at least $1-\gamma$, which was our goal in the beginning (see Equation (<ref>)).
Property number two justifies why we call the parameter $q$ the “amplification policy”. The reason for this is that $q$ is indeed the minimum ratio of the amplification of an iteration with respect to the previous, thus controlling the amplification policy.
The depth of the circuit is intimately related with the amplification policy. In property number three we have a clear bound $k_I^{\max}$ for the depth. To get a clearer idea of this bound, in Figure <ref> we depict the maximum depth of the circuit $k_I^{\max}$ in terms of the precision $\epsilon$ for different amplification policies $q$.

legend pos=north west,
xmode =log,
x dir=reverse,
line width = 2pt,
style = solid,
[]Theoretical $q = 2$
line width = 2pt,
dash pattern=on 5pt off 5pt,
[]Theoretical $q = 10$
line width = 2pt,
style = densely dotted,
[]Theoretical $q = 20$

Theoretical maximum depth of the circuit $k_I^{\max}$ in terms of the precision $\epsilon$.

As we see, the depth decreases with $q$, but at the cost of increasing the number of shots on each iteration (see Equation (<ref>)). This directly leads to the question about what is more relevant in relation to the total number of shots: either performing more shots for each iteration with less iterations (and thus less circuit depth) or performing less shots at the cost of increasing the total number of iterations.
This question is directly answered with the sixth property, where we have a bound for the number of shots in terms of the required precision $\epsilon$, the confidence $1-\gamma$ and the amplification policy $q$. To facilitate the interpretation of the expression, in Figure <ref> we represent the theoretical number of calls to the oracle in terms of the precision $\epsilon$ for different amplification policies $q$ and a fixed confidence level of $1-\gamma = 0.95$ .

legend pos=north west,
xmode =log,
x dir=reverse,
line width = 2pt,
style = solid,
[]Theoretical $q = 2$
line width = 2pt,
dash pattern=on 5pt off 5pt,
[]Theoretical $q = 10$
line width = 2pt,
style = densely dotted,
[]Theoretical $q = 20$
style=densely dashdotted,
Theoretical IQAE

Theoretical maximum number of calls to the oracle $N_{\text{oracle}}$ in terms of the precision $\epsilon$ for different values of the amplification policy $q$ and a fixed confidence level $1-\gamma = 0.95$. Lines $1/\epsilon$ and $1/\epsilon^2$
are depicted for comparison purposes.

The dash dotted line, the black solid thin line and the gray solid thin lines are there for comparison purposes. We know that, without amplification, the number of executions of the circuit needed to achieve a precision $\epsilon$ grows as:

\begin{equation*}
N_{oracle}\sim \dfrac{1}{\epsilon^2},
\end{equation*}

as it is given by classical bounds such as Chebysev or Clopper-Pearson. A quadratic speedup would then be obtaining the same precision with a total number of oracle calls:

\begin{equation*}
N_{oracle}\sim \dfrac{1}{\epsilon}.
\end{equation*}

As we see in Figure <ref> the number of calls needed in our method to achieve a precision $\epsilon$ grows approximately as $1/\epsilon$. This means that we have approximately achieved a quadratic speedup compared with unamplified  sampling.
Furthermore, we see that it is more efficient in terms of the total number of calls to the oracle to use lower amplification policies.

In general, the appropriate amplification policy depends on each specific case. On the one hand, the optimal $q$ depends both on the precision $\epsilon$ and the confidence level $1-\gamma$. On the other hand, in real hardware it could be more interesting to choose higher values of $q$, as we can not run arbitrarily long circuits.

Last, we have depicted the theoretical bound for the IQAE algorithm which, to our knowledge, represents the state of the art. As we see, the RQAE performance is better than that of the IQAE for some values of $q$. Note that the comparison with IQAE is not direct since they are estimating the probability and we are estimating the amplitude. However, in Appendix <ref> we show that, under some weak assumptions, this bounds are comparable.

§.§ Empirical performance

The sixth property of Theorem <ref> gives us an upper bound to the number of calls to the oracle. However, it is always interesting to see how this theoretical bound compares with a real execution of the algorithm. Using the Quantum Learning Machine (QLM) developed by Atos we build a circuit with a total of $5$ qubits and we estimate one of the amplitudes encoded in the circuit with our method. Our algorithm is executed with a confidence level of $1-\gamma = 0.95$ and different amplification policies $q \in \{2,10,20\}$. For each level of target precision $\epsilon$, we perform $100$ experiments.

legend pos=north west,
xmode =log,
x dir=reverse,
line width = 2pt,
[]Theoretical $q = 2$
line width = 2pt,
dash pattern=on 5pt off 5pt,
[]Theoretical $q = 10$
line width = 2pt,
style=densely dotted,
[]Theoretical $q = 20$
only marks,
error bars/.cd,
y dir=both,
y explicit,
y error plus=y-max,
y error minus=y-min,
[]Empirical $q = 2$
only marks,
error bars/.cd,
y dir=both,
y explicit,
y error plus=y-max,
y error minus=y-min,
[]Empirical $q = 10$
only marks,
error bars/.cd,
y dir=both,
y explicit,
y error plus=y-max,
y error minus=y-min,
[]Empirical $q = 20$

Number of calls to the oracle, $N_{\text{oracle}}$, versus the target precision $\epsilon$. The plot is in a log-log scale with the $x$-axis inverted. The experimental points (circles, squares and diamonds) represent the mean number of oracle calls obtained over 100 experiments each, while the error bars stretch from the maximum to the minimum value obtained in the same set of experiments. The lines are the corresponding theoretical bounds from Equation (<ref>).

As we see in Figure <ref>, the experiments respect the theoretical bound for the total number of calls to the oracle. In particular, the theoretical bound proves not to be loose, meaning that –in general– the experimental results keep close to the theoretical bound. Furthermore, we underline that the empirical behavior of $N_{\text{oracle}}$ with respect to $\epsilon$ follows the qualitative trend expected theoretically.

legend pos=north west,
legend style=nodes=scale=0.85, transform shape,
xmode =log,
x dir=reverse,
line width = 2pt,
style = solid,
[]Theoretical $q = 2$

line width = 2pt,
style = densely dotted,
[]Theoretical $q = 20$
only marks,
error bars/.cd,
y dir=both,
y explicit,
y error plus=y-max,
y error minus=y-min,
[]Empirical $q = 2$

only marks,
error bars/.cd,
y dir=both,
y explicit,
y error plus=y-max,
y error minus=y-min,
[]Empirical $q = 20$

legend pos=north west,
legend style=nodes=scale=0.85, transform shape,
xmode = log,
x dir=reverse,
line width = 2pt,
[]Theoretical $q = 2$

line width = 2pt,
style=densely dotted,
[]Theoretical $q = 20$
only marks,
error bars/.cd,
y dir=both,
y explicit,
y error plus=y-max,
y error minus=y-min,
[]Empirical $q = 2$

only marks,
error bars/.cd,
y dir=both,
y explicit,
y error plus=y-max,
y error minus=y-min,
[]Empirical $q = 20$

In the left figure we plot the amplification of the last iteration $k_I$ versus the target precision $\epsilon$. In the right figure we plot the number of iterations $I$ versus the target precision $\epsilon$. The left picture is in a log-log scale with the $x$-axis inverted. The right picture is in a $x-$log scale with the $x$-axis inverted. Each experimental point (circles and diamonds) represent the mean for the last amplification and number of rounds of $100$ experiments. The error bars stretch from the maximum to the minimum value obtained in the same $100$ experiments. The lines are the corresponding theoretical bounds from Equation (<ref>) and Equation (<ref>). To avoid clutter, we have omitted the results for $q =10$.

Figure <ref> shows the empirical result and the theoretical bounds for the amplification in the last iteration and the number of iterations performed. In order to explain the behavior depicted in Figure <ref>, we focus on the results obtained for $q = 20$ (grey diamonds). The first five points in the right plot correspond to large values of $\epsilon$ (thus a low target precision); they are associated to the lowest value for the number of iteration $I$, namely $I = 1$. Equivalently, they correspond to $2 k_I + 1 = I = 1$, thus $k_I = 0$. The same five points are not represented in the left plot, because the log scale does not allow to represent $k_I=0$. This phenomenon occurs when the precision of the first estimation, $\epsilon^a_1$, is already lower than the target precision $\epsilon$, so that the algorithm does not need to perform more than one iteration.

Following the $q=20$ grey diamonds towards smaller $\epsilon$ in the right plot of Figure <ref>, we note a jump from $I=1$ to $I=2$. For the same points that in the right plot give rise to the $I=2$ plateau, in the left plot we observe two different regimes, one approximately raising linearly, the other being a plateau at $k_I = 10$. In the linearly raising regime, we see that the amplification matches that predicted by the theoretical bound for the maximum amplification $k_I^{\max}$, the experimental diamonds and the theoretical line superpose. Such linear ramp, however, saturates to $k_I = 10$. To give an explanation for this behavior we can proceed as follows. We first compute which is the minimum  possible value for $k_2$ when $q= 20$, namely

\begin{equation}\label{qset}
\dfrac{2k_2+1}{2k_1+1} = 2k_2+1 = q_1\geq 20\implies k_2 \geq 9.5\ ,
\end{equation}

obtained for $k_1=0$.
Since $k_2$ can only take natural values, we conclude that $k_2$ is at least $10$. Now the explanation of the two regimes becomes more clear. With the first iteration the algorithm does not reach the target precision $\epsilon$, so it proceeds to a second iteration. In this second iteration, as $q=20$, we are sure that $k_2$ is at least $10$. But $k_2=10$ corresponds to too big an amplification, thus the condition in Algorithm <ref> on the maximum amplification is activated, thus making the value of the last amplification match the theoretical maximum $k_I = k_I^{\max}$. This occurs until we reach $k_2 = 10$. At this point, $k_I^{\max}$ exceeds the number of amplifications set by $q$ through (<ref>), and the condition on the maximum amplification deactivates. The number of amplifications corresponding to the plateau at $k_I=10$ is by large sufficient to attain the target precision, so that the algorithm maintains the same level of amplification and the same number of iterations for a while, until $k_I=10$ is not enough to obtain the target precision any more. At such point, the algorithm needs to perform a further iteration (the third) and the number of amplifications of the last iterations is again fixed to $k_I^{\max}$.

§ CONCLUSION

Throughout this paper we have proposed a new methodology for estimating an amplitude encoded in a quantum circuit. This methodology depends on the possibility of defining a new class of shifted oracles which is easily built, at least in some cases of practical interest.

For a suitable choice of parameters described in Algorithm <ref>, we have proven a set of interesting properties. They include a proof of correctness, a bound on the maximum depth of the algorithm and an upper bound on the total number of shots, hence characterizing the performance of the algorithm.

If we compare RQAE to similar algorithms in the literature such as QAE, QAES and IQAE we have three advantages and one caveat. The caveat is obviously that we are constrained by the possibility of constructing an appropriate oracle including the shift. The first advantage is that we are extracting more information from the quantum circuit than just the module of the amplitude. This feature can be of extreme importance for certain applications where the result can be positive or negative. The second advantage is that we can control to some extent the depth of the circuit, a crucial feature in the current NISQ era. The third advantage is that the total number of calls to the oracle is lower to that QAES and IQAE with an appropriate choice of the amplification policy. It is true that QAES has a better order of convergence, however the constants involved are very large, making the method unfeasible for most values of $\epsilon$ used in practice (see the comparison done in <cit.>).

The choice of parameters considered in the present paper is not unique and alternative choices could be more efficient in terms, for example, of the total number of shots or the total circuit depth.
[A recent study on amplitude estimation with shallow circuits has been performed in <cit.>.]
In fact, we believe it is interesting to explore different parameter settings in the future. One such possibility consists in considering to change the number of shots on each iteration in a dynamical manner. This is motivated by the fact that, in the early stages, $q$ has to be large in order to ensure that we get amplification while, as we increase the number of amplifications, we can lower the value of $q$ while still getting amplification. In this sense, we could consider our current proposal as a “static scheme” which could be generalized to a “dynamical” or “adaptive” scheme. Moreover, since we observed that lower values of $q$ tend to be better in terms of the total number of calls to the oracle, a suitable dynamical strategy could further improve the performance of the method.
One could even pose a more ambitious question pursuing the scheme that minimizes the total number of oracle calls. The generalization to a dynamical scheme is not particularly difficult neither from the conceptual nor from the implementation viewpoint. Nonetheless, the proof of theoretical rigorous bounds becomes more challenging than the static scheme considered here.

Another interesting direction to extend the RQAE algorithm presented here would be that of retrieving not only the sign but the full phase of a complex amplitude. Morally, we would then move in the opposite direction with respect to the standard QAE. Namely, instead of using the QPE to perform a QAE, we would use a QAE algorithm to define an alternative QPE algorithm. Such an extension would probably be challenging in terms of proving rigorous bounds for the performance of the algorithm.

§ ACKNOWLEDGEMENTS

All  authors  acknowledge  the  European  Project  NExt  ApplicationS  of  Quantum  Computing (NEASQC), funded by Horizon 2020 Program inside the call H2020-FETFLAG-2020-01(Grant Agreement 951821).
A. Manzano and Á. Leitao wish to acknowledge the support received from the Centro de Investigación de Galicia “CITIC", funded by Xunta de Galicia and the European Union (European Regional Development Fund- Galicia 2014-2020 Program), by grant ED431G 2019/01.
D. Musso acknowledges support from the Physics Department at Oviedo University (UNIOVI), the High Energy Physics Group (FPAUO) and the Institute of Space Sciences and Technologies of Asturias (ICTEA).
Part of the computational resources for this project were provided by the Galician Supercomputing Center (CESGA).

We would like to thank Elías Combarro, Vedran Dunjko, Andrés Gómez, Javier Mas, María R. Nogueiras, Gustavo Ordóñez, Juan Santos Suárez and Carlos Vázquez for fruitful discussions on some aspects of the present work.

§ PROOF OF THEOREM <REF>

Here we proof each of the statements of Theorem <ref> one by one in order of appearance.

§.§ First proposition

When finding an empirical estimate $\hat{p}$ of a probability $p$, we can assign to it a confidence interval (i.e. estimating an associated statistical error) by using Hoeffding's inequality <cit.>:
[Although there exist tighter bounds, they are much less tractable from an analytic point of view. One such example is  Clopper-Pearson <cit.>.]

\begin{equation}\label{eqn:Hoeffding_bounds}
\mathbb{P}\Big(\left|p-\hat{p}\right|\geq {\epsilon}_p \Big)\leq 2e^{-n \epsilon_p^2} = \gamma\ ,
\end{equation}

where $\epsilon_p$ is the precision, $1-\gamma$ is the confidence level and $n$ is the number of shots (i.e. samplings) used for the measurement. As we fixed the values for $N_i$ and $\gamma_i$ in Equations (<ref>) and (<ref>), using (<ref>) we get a fixed value for $\epsilon^p_i$:

\begin{equation}
\mathbb{P}\Big[\left|\sin^2\left[(2k_i+1)\theta_i\right]-\hat p_i\right|\geq\epsilon^p_i\Big] \leq 2e^{-2N_i(\epsilon^p_i)^2} = \gamma_i\ .
\end{equation}

Rewriting the previous expression in terms of $\epsilon^p_i$ we have:

\begin{equation}
\left(\epsilon^p_i\right)^2 = \dfrac{1}{2N_i}\log\left(\dfrac{2}{\gamma_i}\right) = \dfrac{1}{2\left\lceil N \right\rceil}\log\left(\dfrac{2}{\gamma_i}\right)\leq \dfrac{1}{2N}\log\left(\dfrac{2}{\gamma_i}\right)= (\epsilon^p)^2\ ,
\end{equation}

where we recalled the definition in (<ref>). We have thus proven the first proposition.

§.§ Second proposition

By definition we have that:

\begin{equation}
q_i = \dfrac{2k_{i+1}+1}{2k_i+1}\ .
\end{equation}

From Equation (<ref>), this expression can be rewritten as:

\begin{equation}
q_i = \dfrac{2\left\lfloor\dfrac{\pi}{4\arcsin(2\epsilon^a_i)}-\dfrac{1}{2}\right\rfloor+1}{2k_i+1}\ .
\end{equation}

We now consider the fact that $\left\lfloor x\right\rfloor\geq x-1$ thus obtaining:

\begin{equation}
q_i \geq \dfrac{\dfrac{\pi}{2\arcsin(2\epsilon^a_i)}-2}{2k_i+1} = \dfrac{\pi}{2\arcsin(2\epsilon^a_i)(2k_i+1)}-\dfrac{2}{2k_i+1}\ .
\end{equation}

Since $k_i\geq 0$, we have also

\begin{equation}\label{eq:intermediate_step}
q_i \geq \dfrac{\pi}{2\arcsin(2\epsilon^a_i)(2k_i+1)}-2\ .
\end{equation}

Now we focus on the term $(2k_i+1)\arcsin(2\epsilon_i^a)$ which can be rewritten in terms of $\epsilon^p_i$ as

\begin{equation}\label{eq:ampi_k}
(2k_{i}+1)\arcsin\left[ \sin\left(\dfrac{\arcsin\left(\sqrt{\min(\hat{p}_i+\epsilon^p_i,1)}\right)}{2k_{i}+1}\right)-\sin\left(\dfrac{\arcsin\left(\sqrt{\max(\hat{p}_i-\epsilon^p_i,0)}\right)}{2k_{i}+1}\right)\right]\ ,
\end{equation}

where we have used (<ref>) and (<ref>) after an obvious relabelling of the index.
Next, we define the following functions:

\begin{align}\label{funciona}
f(\epsilon^p_i;k_i,p_i) :=  (2k_{i}+1)\arcsin&\left[ \sin\left(\dfrac{\arcsin\left(\sqrt{\min(\hat{p}_i+\epsilon^p_i,1)}\right)}{2k_{i}+1}\right)\right.\\ \nonumber &\qquad \qquad \left.-\sin\left(\dfrac{\arcsin\left(\sqrt{\max(\hat{p}_i-\epsilon^p_i,0)}\right)}{2k_{i}+1}\right)\right]\ ,
\end{align}

\begin{equation}
\overline{f}(\epsilon^p_i) :=\arcsin\left(\sqrt{\min(2\epsilon^p_i,1)}\right)\ .
\end{equation}

The function $\overline{f}$ is useful because:

\begin{equation}\label{dise1}
\overline{f}(\epsilon^p_i) \geq f(\epsilon^p_i;k_i,p_i)\ , \qquad \forall k\in \mathbb{N},\ \hat{p}_i\in [0,1]\ ,
\end{equation}

and we are going to use it to bound expression (<ref>):

\begin{equation}
q_i \geq \dfrac{\pi}{2\arcsin(2\epsilon^a_i)(2k_i+1)}-2\geq \dfrac{\pi}{2\arcsin\left(\sqrt{\min(2\epsilon^p,1)}\right)}-2\ .
\end{equation}

As $\epsilon^p_i\leq \epsilon^p\leq \dfrac{1}{2}$ then

\begin{equation}
q_i \geq \dfrac{\pi}{2\arcsin\left(\sqrt{\min(2\epsilon^p,1)}\right)}-2\geq \dfrac{\pi}{2\arcsin\left(\sqrt{2\epsilon^p}\right)}-2\ .
\end{equation}

By the definition of $\epsilon^p$ we have that:

\begin{equation}
q_i\geq q\ ,
\end{equation}

and we have proven the second proposition.
So far, we have not treated the first iteration, $i= 1$, which we now consider explicitly:

\begin{equation}\label{eq:intermediate_first_iteration}
q_1 = \dfrac{2k_2+1}{2k_1+1} = 2k_2+1 = 2\left\lfloor\dfrac{\pi}{4\arcsin(2\epsilon^a_1)}-\dfrac{1}{2}\right\rfloor+1 \geq \dfrac{\pi}{2\arcsin(2\epsilon^a_1)}-2\ ,
\end{equation}

where we have recalled that $k_1 = 0$.
We focus our attention on the term

\begin{equation}
\arcsin(2\epsilon^a_1) = \arcsin\left[ \min\left(\dfrac{\hat{p}_{\text{sum}}-\hat{p}_{\text{diff}}}{4b_1}+\dfrac{\epsilon^{p}_1}{|2b_1|},1\right)
-\max\left(\dfrac{\hat{p}_{\text{sum}}-\hat{p}_{\text{diff}}}{4b_1}-\dfrac{\epsilon^{p}_1}{|2b_1|},-1\right)\right]\ ,
\end{equation}

where we have considered (<ref>).
Following the same strategy as before we define:

\begin{equation}\label{sec:b_function}
f(\epsilon^p_1) = \arcsin\left[ \min\left(\dfrac{\hat{p}_{\text{sum}}-\hat{p}_{\text{diff}}}{4b_1}+\dfrac{\epsilon^{p}_1}{|2b_1|},1\right)
-\max\left(\dfrac{\hat{p}_{\text{sum}}-\hat{p}_{\text{diff}}}{4b_1}-\dfrac{\epsilon^{p}_1}{|2b_1|},-1\right)\right]\ .
\end{equation}

An upper bound for (<ref>) is:

\begin{equation}\label{sec:b_function_upper}
\overline{f}(\epsilon^p_1) = \arcsin\left( \dfrac{\epsilon^p_1}{\left|b_1\right|}\right)\geq f(\epsilon_1^p)\ ,
\end{equation}

which can be directly obtained from (<ref>).
Hence, from Equation (<ref>), we have that:

\begin{equation}\label{dise2}
q_1 \geq \dfrac{\pi}{2\arcsin\left(\dfrac{\epsilon^p}{|b_1|}\right)}-2\ ,
\end{equation}

where we have used

\begin{equation}
2\epsilon^a_1 \geq \frac{\epsilon_1^p}{|b_1|}\ ,
\end{equation}

derived from (<ref>).

Eventually, by the definition of $b_1$ we have:

\begin{equation}
q_1\geq q\ .
\end{equation}

§.§ Third proposition

Using (<ref>), we have

\begin{equation}
\epsilon^a_I(k_I^{\max}) = \frac{1}{2}\sin\left(\dfrac{\arcsin\left(\sqrt{p^{\max}_{I}}\right)}{2k_{I}^{\max}+1}\right)-\frac{1}{2}\sin\left(\dfrac{\arcsin\left(\sqrt{p^{\min}_{I}}\right)}{2k_{I}^{\max}+1}\right)\ .
\end{equation}

Following the same reasoning as in Equation (<ref>) we have that:

\begin{equation}
\epsilon^a_I(k_I^{\max}) \leq \dfrac{1}{2}\text{sin}\left(\dfrac{\text{arcsin}\left(\sqrt{2\epsilon^p_I}\right)}{2k_I^{\max}+1}\right)\leq  \dfrac{1}{2}\text{sin}\left(\dfrac{\text{arcsin}\left(\sqrt{2\epsilon^p}\right)}{2\left\lceil\dfrac{1}{2}\dfrac{\arcsin\left(\sqrt{2\epsilon^p}\right)}{\arcsin(2\epsilon)}-\dfrac{1}{2}\right\rceil+1}\right) \leq \epsilon\ ,
\end{equation}

where we have used the first proposition and the definition of $k_I^{\max}$. We have proven the fifth proposition.

§.§ Fourth propositon

In this subsection we bound the maximum number of iterations needed to achieve the target accuracy $\epsilon$. First note that, if $I$ represents the last iteration, we have that

\begin{equation}\label{penul}
\epsilon<\epsilon^a_{I-1} =  \frac{1}{2}\sin\left(\dfrac{\arcsin\left(\sqrt{p^{\max}_{I-1}}\right)}{2k_{I-1}+1}\right)-\frac{1}{2}\sin\left(\dfrac{\arcsin\left(\sqrt{p^{\min}_{I-1}}\right)}{2k_{I-1}+1}\right),
\end{equation}

otherwise we would be in the last iteration, and that is false by hypothesis. To write (<ref>) we have used (<ref>) with $I=i+1$. Using similar arguments as in the previous section, we bound $\epsilon^a_{I-1}$ by

\begin{equation}\label{target_bou}
\epsilon < \epsilon^a_{I-1} \leq \frac{1}{2}\sin\left(\dfrac{\arcsin\left(\sqrt{2\epsilon^p_{I-1}}\right)}{2k_{I-1}+1}\right)\ .
\end{equation}

We can rewrite (<ref>) as

\begin{equation}\label{rt2}
\begin{aligned}
&(2k_1+1)\prod_{i = 1}^{I-2} q_i = 2k_{I-1}+1 <\dfrac{\arcsin\left(\sqrt{2\epsilon^p_{I-1}}\right)}{\arcsin(2\epsilon)}\\
&\leq \dfrac{\arcsin\left(\sqrt{2\epsilon^p}\right)}{\arcsin(2\epsilon)} =: (2k_1+1)\,\prod_{i = 1}^{T-2}q = (2k_1+1) q^{T-2}\ ,
\end{aligned}
\end{equation}

where we have used $\epsilon^p_{i}\leq \epsilon^p$ and we have introduced the positive number $T$. Still from (<ref>), we obtain that

\begin{equation}\label{eq:max_iterations_aux}
\prod_{i = 1}^{I-2} q_i<q^{T-2}\ .
\end{equation}

Using the second proposition $q_i\geq q$ we get

\begin{equation}
T =
\log_q\left(q^2\dfrac{\arcsin\left(\sqrt{2\epsilon^p}\right)}{\arcsin(2\epsilon)}\right)>I.
\end{equation}

This means that, eventually, we have an upper bound $T$ for the number of iterations $I$, when –for each new iteration– we increase the amplification $K_i=2k_i+1$ by at least a factor $q$
and we have proven the third proposition. Moreover, from (<ref>) and $q_i\geq q$ we have that:

\begin{equation}\label{eq:max_iterations_inequality}
\prod_{i = 1}^{I-2-j} q_i<q^{T-2-j}\ .
\end{equation}

§.§ Fourth proposition

We now want to ensure that the precision $\epsilon$ is met with confidence $1-\gamma$. In order to achieve this, note that:

\begin{align*}
\mathbb{P}\Big[a\not\in [a^{\min}_I,a^{\max}_I]\Big] &=\mathbb{P}\Big[\sin^2\left[(2k_I+1)\theta_{I}\right]\not\in [p^{\min}_I,p^{\max}_I]\Big]\\
&\leq \mathbb{P}\Big[\bigcup\limits_{i = 1}^{I} \sin^2\left[(2k_i+1)\theta_{i}\right]\not\in [p^{\min}_i,p^{\max}_i]\Big]\\
&\leq \sum\limits_{i = 1}^I \mathbb{P}\Big[\sin^2\left[(2k_i+1)\theta_{i}\right]\not\in [p^{\min}_i,p^{\max}_i]\Big] \\
&\leq \sum\limits_{i = 1}^I\gamma_i=
\sum\limits_{i = 1}^I\dfrac{\gamma}{T} = \gamma\dfrac{I}{T}<\gamma ,
\end{align*}

where we have used the definitions and the third proposition. We remind ourselves that $1-\gamma_i$ represents the confidence level of the single iteration.

§.§ Sixth proposition

We want to find the necessary maximum number of calls to the oracle in order to obtain a target precision $\epsilon$ with confidence $1-\gamma$. Suppose that we finish after $I$ iterations, then the number of calls to the oracle is given by

\begin{equation*}
N_{\text{oracle}} = \sum_{i = 1 }^{I}N_ik_i =  \sum_{i = 1}^{I}N_ik_i = \sum_{i = 1}^{I}N_i\dfrac{K_i-1}{2},
\end{equation*}

As the number of shots $N_i$ of the individual iteration is constant we have that:

\begin{equation}
\begin{aligned}
&= \dfrac{N_i}{2}\sum_{i = 1}^{I-1}(K_i-1)+\dfrac{N_iK_I}{2} = \dfrac{N_i}{2}\left(1+\sum_{i = 2}^{I-1}K_i-I\right)+\dfrac{N_iK_I}{2} \\
&=\dfrac{N_i}{2}\left(1+K_1\sum_{i = 1}^{I-2}\prod_{j = 1}^{i}q_i-I\right)+\dfrac{N_iK_I}{2} \\
&= \dfrac{N_i}{2}\left(1+\sum_{i = 1}^{I-2}\prod_{j = 1}^{i}q_i-I\right)+\dfrac{N_iK_I}{2}\ ,
\end{aligned}
\end{equation}

where we have used $K_1 = 1$, i.e. $k_1=0$.
Then, using the inequality for $q^T$ in (<ref>), we obtain

\begin{equation}
N_{\text{oracle}} < \dfrac{N_i}{2}\left(1+\sum_{i = 1}^{I-2}q^{T-I+i}-I\right)+\dfrac{N_iK_I}{2} = \dfrac{N_i}{2}\left(1+q^{T-I+1}\dfrac{1-q^{I-2}}{1-q}-I\right)+\dfrac{N_iK_I}{2},
\end{equation}

where, in order to perform the second step, we have used that $q>1$.
Developing the expression, we have

\begin{align*}
N_{\text{oracle}} &< \dfrac{N_i}{2}\left(1+\dfrac{q^{T-I+1}}{1-q}-\dfrac{q^{T-1}}{1-q}-I\right)+\dfrac{N_iK_I}{2}\\
&< \dfrac{N_i}{2}\dfrac{q^{T-1}}{q-1}+\dfrac{N_iK_I}{2}\\&= \dfrac{N_i}{2}q^{T-2}\dfrac{q}{q-1}+\dfrac{N_iK_I}{2}\ ,
\end{align*}

where we have used $I\geq1$ and $\dfrac{q}{q-1}q^{T-I}> 1$.
Eventually, using (<ref>) and the fifth proposition we obtain

\begin{equation}
N_{\text{oracle}} <
\dfrac{N_i}{2}K^{\max}\left(1+\dfrac{q}{q-1}\right)\ .
\end{equation}

It is straightforward to define an upper bound for the number of shots:

N_i = ⌈N ⌉< N+1 = 12(ϵ^p)^2log(2Tγ)+log(e) =

= log((2Tγ)^12(ϵ^p)^2)+log(e) = log(e(2Tγ)^12(ϵ^p)^2) =

= log((e^2(ϵ^p)^22Tγ)^12(ϵ^p)^2) =12(ϵ^p)^2log(e^2(ϵ^p)^22Tγ) <

< 12(ϵ^p)^2log(√(e)2Tγ) =N^max ,

Thus, we can have

\begin{equation}
\begin{aligned}
N_{\text{oracle}}&<  \dfrac{N_i}{2}K_I^{\max}\left(1+\dfrac{q}{q-1}\right)\\
=\dfrac{1}{(2\epsilon^p)^2}\log\left(\dfrac{2\sqrt{e}T}{\gamma}\right)K_I^{\max}\left(1+\dfrac{q}{q-1}\right)\ .
\end{aligned}
\end{equation}

Finally, expressing $\epsilon^p$ in terms of $q$ we get a bound for the number of calls to the oracle in terms of the input parameters $\epsilon$, $\gamma$ and $q$:

\begin{equation}\label{Nq}
N_{\text{oracle}}<\dfrac{1}{\sin^4\left(\dfrac{\pi}{2(q+2)}\right)}\log\left[\dfrac{2\sqrt{e}\log_q\left(\dfrac{q^2\pi}{2(q+2)\arcsin(2\epsilon)}\right)}{\gamma}\right]\left(\dfrac{\pi}{2(q+2)\arcsin(2\epsilon)}+2\right)\left(1+\dfrac{q}{q-1}\right)\ ,
\end{equation}

and we have proven the sixth proposition.

We have done the proof for the case where we consider the number of calls to the oracle as $\sum_{i=1}^I N_ik_i$. This is the same as in IQAE (see <cit.>). However, here we are only computing the number of calls to the Grover oracle and that cannot be considered a fair comparison with the unamplified case where we are referring to the number of calls to the original oracle $\mathcal{A}$. For that reason we will show what will be the bound for the number of calls to the oracle $\mathcal{A}$ when we consider $\mathbb{A}^\dagger$ the same as $\mathcal{A}$. The number of calls would then be defined as:

\begin{equation}
\begin{aligned}
N^{\mathcal{A}}_{\text{oracle}} &= N_1+\sum_{i = 2}^{I-1}N_i(2k_i+1)+(2k_I+1)N_I = N_i\left(1+\sum_{i = 2}^{I-1}(2k_i+1)+(2k_I+1)\right) \\
&= N_i\left(1+\sum_{i = 2}^{I-2}\prod_{j=1}^{i}q_i+(2k_I+1)\right)\ ,
\end{aligned}
\end{equation}

where we have used $2k_i$ because each time you call the Grover oracle you are calling once to $\mathcal{A}$ and once to $\mathcal{A}^{\dagger}$. The term $+1$ is for the first aplication of the oracle (recall that we are calling the operator $\mathcal{A}\mathcal{G}^k$). In the first iteration we don't call to the Grover oracle, so we only $N_i$ calls to $\mathcal{A}$. Following the same reasoning as before we can bound the term $1+\sum_{i = 2}^{I-2}\prod_{j=1}^{i}q_i$

\begin{equation}
\begin{aligned}
N^{\mathcal{A}}_{\text{oracle}} &= N_i\left(1+\sum_{i = 2}^{I-2}\prod_{j=1}^{i}q_i+(2k_I+1)\right)\\
&< N_i\left(1+q^{T-2}\dfrac{q}{q-1}+(2k_I+1)\right)\leq  N_i\left(1+\left(1+\dfrac{q}{q-1}\right)K^{\max}\right)\ .
\end{aligned}
\end{equation}

Finally we see that:

\begin{equation}
N^{\mathcal{A}}_{\text{oracle}}\approx 2N_{\text{oracle}}+N_i\ .
\end{equation}

§ CONSTRUCTING THE SHIFTED STATES

Given an oracle $\mathcal{G}$ such that:

\begin{equation}
\mathcal{G}\ket{0} = a\ket{0}+\sqrt{1-a^2}\ket{0^\perp},
\end{equation}

we can build an oracle $\mathcal{A}_{\theta_b}$ such that:

\begin{equation}
\mathcal{A}_{\theta_b}\left|0\right)\ket{0}= \frac{a+b}{2}\left|0\right)\ket{0}+...\ .
\end{equation}

We start by applying a Hadamard gate to the auxiliary register:

\begin{equation}
\left(H\otimes \mathbb{1}\right)  \left|0\right)\ket{0} =\dfrac{1}{\sqrt{2}}\left( \left|0\right)\ket{0}+\left|1\right)\ket{0}\right).
\end{equation}

Next, apply $\mathcal{G}$ controlled in the auxiliary register:

\begin{equation}
c\otimes \mathcal{G}\left(\dfrac{1}{\sqrt{2}}\left( \left|0\right)\ket{0}+\left|1\right)\ket{0}\right)\right) = \dfrac{1}{\sqrt{2}}\left( \left|0\right)\ket{0}+a\left|1\right)\ket{0}+\sqrt{1-a^2}\left|1\right)\ket{0^\perp}\right).
\end{equation}

We continue by applying $y$-rotation with angle $\theta_b$ controlled in the auxiliary register:

\begin{equation}
\overline{c}\otimes \mathcal{R}_y(\theta_b)\left(\dfrac{1}{\sqrt{2}}\left( \left|0\right)\ket{0}+a\left|1\right)\ket{0}+\sqrt{1-a^2}\left|1\right)\ket{0^\perp}\right)\right) = \dfrac{1}{\sqrt{2}}\left( \cos(\theta_b)\left|0\right)\ket{0}+a\left|1\right)\ket{0}\right)+...\ .
\end{equation}

Finally, applying a Hadamard gate to the first register we get:

\begin{equation}
\left(H\otimes \mathbb{1}\right)\left(\dfrac{1}{\sqrt{2}}\left( \cos(\theta_b)\left|0\right)\ket{0}+a\left|1\right)\ket{0}\right)+...\right) = \frac{a+\cos(\theta)}{2}\left|0\right)\ket{0}+\frac{-a+\cos(\theta)}{2}\left|1\right)\ket{0}+...\ .
\end{equation}

§ ESTIMATION OF THE

In Appendix <ref> we have proven some bounds for the amplitudes. However, in the literature one typically finds analogous bounds proven for the probabilities (i.e. for the square of the amplitudes). In this Appendix we show that, under some restrictions, given an estimation for the amplitudes $(a_{\min},a_{\max})$ such that $a_{\max}- a_{\max}\leq 2\epsilon$, we can build a pair of bounds for the probabilities $(p_{\min},p_{\max})$ such that $p_{\max}- p_{\max}\leq 2\epsilon$. So, we can indistinctly refer to the properties of the method when estimating amplitudes or estimating probabilities.

* Case 1: $a_{\max}>0$ and $a_{\min}>0$.

We build the bounds for the probability as $p_{\max} = a_{\max}^2$, $p_{\min} = a_{\min}^2$.

\begin{equation}
p_{\max}-p_{\min} = a_{\max}^2-a_{\min}^2 = (a_{\max}+a_{\min})(a_{\max}-a_{\min})\leq (a_{\max}-a_{\min})\leq 2\epsilon,
\end{equation}

where we have used that $\left|a_{\max}\right|\leq 0.5\ $, $\left|a_{\min}\right|\leq 0.5\ $.

* Case 2: $a_{\max}<0$ and $a_{\min}<0$.

We build the bounds for the probability as $p_{\max} = a_{\min}^2$, $p_{\min} = a_{\max}^2$.

\begin{equation}
p_{\max}-p_{\min} = a_{\min}^2-a_{\max}^2 = (-a_{\max}-a_{\min})(a_{\max}-a_{\min})\leq (a_{\max}-a_{\min})\leq 2\epsilon,
\end{equation}

where we have used that $\left|a_{\max}\right|\leq 0.5\ \ $, $\left|a_{\min}\right|\leq 0.5\ \ $.

* Case 3: $a_{\max}>0$ and $a_{\min}<0$ and $|a_{\max}|>|a_{\min}|$

We build the bounds for the probability as $p_{\max} = a_{\max}^2$, $p_{\min} = 0$.

\begin{equation}
p_{\max}-p_{\min} = a_{\max}^2\leq a_{\max}-0\leq a_{\max}-a_{\min} \leq 2\epsilon.
\end{equation}

* Case 4: $a_{\max}>0$ and $a_{\min}<0$ and $|a_{\max}|<|a_{\min}|$

We build the bounds for the probability as $p_{\max} = a_{\min}^2$, $p_{\min} = 0$.

\begin{equation}
p_{\max}-p_{\min} = a_{\min}^2\leq |a_{\min}|\leq a_{\max}-a_{\min} \leq 2\epsilon.
\end{equation}

Missing 'biblatex' package
The bibliography requires the 'biblatex' package.

titleThe use of confidence of fiducial limits illustrated in the case of the binomial

[American Statistical Association, Taylor     Francis, Ltd.]

journaltitleJournal of the American Statistical Association
titleProbability Inequalities for Sums of Bounded Random Variables

titleQuantum measurements and the Abelian stabilizer problem

booktitleProceedings of the twenty-eighth annual ACM symposium on Theory of computing
titleA fast quantum mechanical algorithm for database search

titleFast Quantum Algorithms for Numerical Integrals and Stochastic Processes

journaltitlePhys. Today
titleQuantum computation and quantum information

American Mathematical Society

journaltitleQuantum Computation and Information
titleQuantum amplitude amplification and estimation

journaltitlePhysical Review A
titleOptimal quantum measurements of expectation values of observables

National Acad Sciences

journaltitleProceedings of the National Academy of Sciences
titlePolynomial-time quantum algorithm for the simulation of chemical dynamics

titleQuantum algorithms for nearest-neighbor methods for supervised and unsupervised learning

titleQuantum perceptron models

journaltitlePhysical Review A
titleQuantum computational finance: Monte Carlo pricing of financial derivatives

journaltitlearXiv preprint arXiv:1907.08119
titleSimpler quantum counting

Nature Publishing Group

journaltitlenpj Quantum Information
titleQuantum risk analysis

Society for Industrial
Applied Mathematics

journaltitleSymposium on Simplicity in Algorithms
titleQuantum Approximate Counting, Simplified

titleQuantum Coin Method for Numerical Integration

Springer Science
Business Media LLC

journaltitleQuantum Information Processing
titleAmplitude estimation without phase estimation

Springer Science
Business Media LLC

journaltitlenpj Quantum Information
titleIterative quantum amplitude estimation

journaltitleArchives of Computational Methods in Engineering
titleA Survey on Quantum Computational Finance for Derivatives Pricing and VaR

titleA Modular Framework for Generic Quantum Algorithms

Verein zur Förderung des Open Access Publizierens in den Quantenwissenschaften

titleVariational quantum amplitude estimation