Level 3 · Algorithms

Quantum Amplitude Estimation: Measuring a Probability With Quadratically Fewer Samples

About 5,078 words · roughly 23 minute read · sources checked December 3, 2026

Many useful numbers are probabilities in disguise. How likely is a financial portfolio to lose more than a set amount? What fraction of the items in a huge database satisfy a condition? How large is the expected value of some noisy quantity? A standard way to estimate such numbers on a classical computer is Monte Carlo sampling: run the random process many times and count how often the event happens. The accuracy improves slowly. To make the error ten times smaller you need a hundred times more samples.

Quantum amplitude estimation, often shortened to QAE, estimates the same kind of number with a different scaling. In terms of how many times you must run the underlying process, the error shrinks in proportion to one over the number of runs instead of one over the square root. That is a quadratic improvement, the same kind as Grover’s search offers over classical search. In fact QAE is built from Grover’s machinery and phase estimation, and it is the main reason those two ideas matter beyond searching.

This lesson builds QAE from the ground up. We start with the sampling problem and its classical error, then see that the Grover operator is just a rotation by a known angle, then use phase estimation to read the angle. We work three examples with exact probabilities, measure the accuracy against classical sampling over a range of unknown probabilities, and discover a subtle point about heavy tails. We then apply it to counting items, and finish with what the abstracts I opened say about uses and with the honest limits.

Everything numerical here was computed by me with NumPy. The Qiskit-style listing is not run, because Qiskit was not installed, but I checked the same algebra with matrices: the one-qubit Grover operator I describe has eigenphases that match the formula to eight decimal places. Where I rely on a source I say which one and I only use what its abstract states.

What you will learn

  • What amplitude estimation computes and why classical sampling is slow.
  • How the Grover operator acts as a rotation by 2θ, where the unknown probability is sin²θ.
  • How phase estimation turns that angle into a binary number, and how to convert the result back into a probability.
  • Three worked examples, including one where the answer is exact and one where it is not.
  • How the accuracy compares with classical sampling, with a computed table, and why the average squared error hides the speed-up.
  • How to count the marked items in a list, and what the sources I opened say about Monte Carlo speed-ups.

Helpful first: Quantum Phase Estimation, Grover’s Algorithm.

The problem: estimating an unknown probability

Suppose you have a process that, each time you run it, either succeeds or fails, and you do not know the probability of success. Call this unknown probability a. It could be the chance that a random trade loses money, the fraction of items in a list that pass a test, or the chance that a random sample of a simulation lands in some region. Your job is to estimate a to a chosen accuracy while running the process as few times as possible.

The classical method is straightforward. Run the process M times and count the successes. If you saw s successes, the estimate is s/M. Because each run is an independent coin flip with success probability a, the number of successes has a spread of √(M·a·(1−a)), so the estimate s/M has a typical error, called the standard error, of √(a(1−a)/M). To halve the error you need four times as many runs. To reduce it by a factor of 100 you need ten thousand times as many.

Runs MStandard error when a = 0.3Runs needed for error 0.01Runs needed for error 0.001
1000.04582,100210,000
1,0000.0145——
10,0000.0046——
1,000,0000.00046——

Classical sampling for a = 0.3. The standard error is √(0.21/M). To reach error 0.01 takes 0.21/0.0001 = 2,100 runs; for error 0.001 it takes 0.21/0.000001 = 210,000.

This 1/√M behaviour is a consequence of independent random sampling. It is the reason simulation-heavy fields, such as risk analysis in finance, spend enormous computing effort on Monte Carlo methods: halving the error is expensive.

What makes the quantum version possible

The quantum version assumes that the process is given as a quantum operation, which we call A. Starting from the all-zeros state, A prepares a state in which some outcomes are labelled good and the rest bad. The probability of measuring a good outcome is a. In symbols, A|0⟩ = √a |good⟩ + √(1−a) |bad⟩. Here |good⟩ and |bad⟩ stand for normalised superpositions of all good and all bad basis states.

The classical method treats A as a random sampler and just runs it repeatedly. The quantum method uses A and its inverse as building blocks in a larger circuit, so the amplitudes of different runs interfere. The measurable result of that interference is a number that depends on a with much finer resolution per use of A.

The assumption you must not forget

QAE needs the process to be available as a quantum circuit A that you can run forwards and, for the Grover operator, also backwards. If your process is a black-box random number generator on a classical machine, you cannot plug it in. This is a real restriction, and it comes back in the limits section.

The Grover operator is a rotation by 2θ

Because the probability a is between 0 and 1, we can write it as a = sin²θ for an angle θ between 0 and π/2. Then A|0⟩ = sin θ |good⟩ + cos θ |bad⟩. The state lives in a two-dimensional plane spanned by |good⟩ and |bad⟩, and θ is the angle between the state and the |bad⟩ axis.

Grover’s algorithm uses two reflections. The first, S_χ, flips the sign of the good component. The second reflects the state about A|0⟩ itself, which is done by applying A†, flipping the sign of the all-zeros state, and applying A again. The combination of two reflections is a rotation. The Grover operator Q, defined as Q = −A S₀ A† S_χ, rotates the state in the good-bad plane by the angle 2θ. Each application of Q moves the state 2θ further toward |good⟩.

That gives the familiar formula: after k applications of Q, the probability of measuring a good outcome is sin²((2k + 1)θ). I checked this numerically for a = 0.3, so θ = 0.57964 radians. The first four values match the formula to five decimal places:

Applications kP(good) from the circuit matricessin²((2k+1)θ)
00.30.3
10.9720.972
20.058080.05808
30.629010.62901
40.766460.76646

Check of the rotation picture for a = 0.3, using a one-qubit model with A = Ry(2θ), S_χ = Z and S₀ flipping the sign of |0⟩. The probability oscillates as the state rotates around the plane.

The values oscillate because the state keeps rotating: after one application it overshoots near |good⟩ (0.972), and after two it has gone past and fallen to 0.058. This oscillation is exactly the reason Grover’s search must stop at the right moment.

Eigenphases of Q

A rotation by 2θ in a plane, viewed as a matrix acting on two-dimensional vectors, has two eigenvalues, e^(+2iθ) and e^(−2iθ). In phase-estimation language, an eigenvalue e^(2πiφ) has phase φ, so these two eigenvalues have phases φ = θ/π and φ = 1 − θ/π. I checked numerically that for a = 0.3 the eigenphases of Q are +0.18450506 and −0.18450506, in turns, and that θ/π = 0.18450506. Both agree.

a = sin²θ     Q rotates by 2θ     eigenvalues of Q:  e^(+2iθ), e^(−2iθ)
phases:  φ = θ/π   and   1 − θ/π
so  a = sin²(π·φ)
The chain of identities that makes amplitude estimation work: if you can find φ, you can compute a.

This is the whole idea. The unknown probability is hiding in the eigenphase of Q. Phase estimation, from the previous lesson, is a tool for reading eigenphases. So we run phase estimation on Q.

The algorithm: phase estimation on the Grover operator

  1. Choose m, the number of counting qubits, and set M = 2ᵐ. This will decide the accuracy.
  2. Prepare the counting register in an equal superposition with Hadamard gates, and apply A to the working register, so the working register holds A|0⟩.
  3. Apply controlled powers of Q: counting qubit j controls Q raised to the power 2ʲ. In total this uses Q a number of times equal to 1 + 2 + … + 2^(m−1) = M − 1.
  4. Apply the inverse quantum Fourier transform to the counting register.
  5. Measure the counting register and read an integer y between 0 and M − 1.
  6. Convert: the estimate of the probability is ã = sin²(π·y/M).

Why does this work when the working register is not in an eigenstate of Q? Because A|0⟩ lies in the good-bad plane, and it is an equal-weight combination of the two eigenstates of Q, those with eigenvalues e^(+2iθ) and e^(−2iθ). Phase estimation on a superposition of eigenstates returns the phase of one of them at random. So y is near M·θ/π with probability about one half, and near M·(1 − θ/π) with probability about one half. The two outcomes, y and M − y, give the same estimate, because sin²(π(M − y)/M) = sin²(π − πy/M) = sin²(πy/M). The mirror image is harmless.

Cost in units of A

Each application of Q uses A once and A† once. The whole circuit uses Q a total of M − 1 times, so about 2(M − 1) + 1 uses of A or its inverse. For a rough comparison with classical sampling, we treat these as the M queries of the algorithm, up to a constant factor of about 2.

The structure is exactly the phase-estimation circuit from the earlier lesson, with the controlled-U replaced by the controlled Grover operator. The depth grows with M, since the circuit contains controlled Q of power M/2, so the longer you want the circuit to be, the more coherent evolution you need. This is the same trade-off as for phase estimation in general, and for the same reason the full algorithm is considered a fault-tolerant-era method.

Three worked examples

Example 1: a = 0.5 with 3 counting qubits (exact)

For a = 0.5 we get sin²θ = 0.5, so θ = π/4, and the phase is φ = θ/π = 1/4. With m = 3 counting qubits, M = 8, and φ = 1/4 = 2/8 is exactly representable. My simulation of the phase-estimation distribution gave probability 0.5 on y = 2 and 0.5 on y = 6, nothing else. The estimate from either is sin²(π·2/8) = sin²(π/4) = 0.5. It is exact.

Example 2: a chosen to fit 4 counting qubits (exact)

Take m = 4, so M = 16, and choose a = sin²(3π/16) = 0.30866. Then θ = 3π/16 and φ = 3/16, which is exactly three sixteenths. The simulation gave probability 0.5 on y = 3 and 0.5 on y = 13 (the mirror 16 − 3), and the estimate is sin²(3π/16) = 0.30866, exact again. So whenever the true phase is a multiple of 1/M, amplitude estimation returns the probability without error.

Example 3: a = 0.3 with 4 counting qubits (not exact)

Now a = 0.3, which gives θ = 0.5796 and φ = 0.18451. Then M·φ = 16 × 0.18451 = 2.952, very close to the integer 3 but not equal. The distribution is therefore concentrated on y = 3 and its mirror y = 13, with a little leakage elsewhere.

Outcome yProbabilityEstimate sin²(πy/16)
30.49630.30866
130.49630.30866
20.00130.14645
140.00130.14645
40.00110.5
120.00110.5

Most likely outcomes for a = 0.3 and m = 4, from my calculation. The two mirror outcomes y = 3 and y = 13 give the same estimate, 0.30866, with total probability 0.9926.

The estimate 0.30866 is within 0.0087 of the true 0.3. With probability 0.9926 the algorithm returns this value; the remaining 0.74% is spread over other outcomes. Note that 16 counting levels cannot represent 0.3 exactly, so the answer is the nearest available value.

This example is a little lucky, because M·φ = 2.952 happens to be so close to an integer. In general the probability of the best outcome is lower, as we saw in the phase-estimation lesson, where the best-outcome probability for a non-fitting phase stayed near 0.68. To see the typical accuracy we need to average over many values of a, which we do next.

How accurate is it? A computed comparison with classical sampling

A single example does not show the typical accuracy, because the error depends on how well the unknown phase fits the grid of 1/M. So I averaged over many values. I took 181 evenly spaced values of the true probability a from 0.05 to 0.95 and, for each, computed the exact probability distribution of the algorithm’s outcomes. From each distribution I extracted the median error, meaning the error that half of the runs fall below, and the 90th-percentile error. I then averaged these over the 181 values of a.

For classical sampling with M runs I used the standard error √(a(1−a)/M), averaged over the same values of a, and converted to a median and 90th percentile with the usual normal approximation (median about 0.6745 times the standard error, 90th percentile about 1.645 times). To compare fairly I used the same number M = 2ᵐ for both, remembering that the quantum circuit uses A about twice per unit of M, so the real quantum cost is up to about twice higher.

Counting qubits mM = 2ᵐQuantum median errorClassical median error (about)Quantum 90th-percentile errorClassical 90th-percentile error (about)
4160.04260.07060.13380.1723
6640.01060.03530.03690.0861
82560.002640.01770.009190.0431
101,0240.000640.00880.00210.0215

Computed accuracy, averaged over 181 values of a between 0.05 and 0.95. Each step of two extra counting qubits (a factor of 4 in M) cuts the quantum median error by about 4, but the classical one only by about 2.

Look at the quantum median column: 0.0426, 0.0106, 0.00264, 0.00064. Each entry is about a quarter of the one before, while M grows by a factor of four. So the median error is proportional to 1/M. The classical column falls by half each time, which is the 1/√M law. At M = 1,024, the quantum median error is 0.00064 and the classical one is 0.0088, about fourteen times larger.

The same comparison as a cost

Turn the comparison around: for a target accuracy, how many runs does each method need? I took the quantum 90th-percentile error for each m, and computed how many classical runs give the same 90th-percentile error, averaged over a.

mQ applications M − 1Quantum 90th-percentile errorClassical runs for the same errorClassical ÷ quantum
4150.1338271.8
6630.03693625.7
82550.00925,82922.9
101,0230.0021111,605109.1
112,0470.0012355,128173.5

Cost comparison from my calculation. The ratio grows roughly in proportion to M. Because each Q uses A twice, the realistic gain in uses of A is about half the ratio shown.

With very few counting qubits the quantum method has almost no advantage (a ratio of 1.8 at m = 4, which is about 1 after allowing for the factor of two in uses of A). The advantage appears when you want high accuracy: at 1,023 applications of Q the quantum method matches the accuracy that needs over a hundred thousand classical runs. The numbers in the last column fluctuate from row to row, for example the jump from 37 at m = 9 (not shown) to 109 at m = 10, because the grid of possible estimates is coarse and the 90th percentile jumps between grid points. The overall trend, a ratio growing roughly in proportion to M, is robust.

A word on what this does and does not show

This is a comparison of the number of uses of the underlying process, assuming that process is available as a quantum circuit. It says nothing about the time one use takes on real hardware, nor about the noise that the long circuit would accumulate.

A subtle point: the root-mean-square error hides the advantage

In statistics, the standard way to summarise error is the root-mean-square error, the square root of the average squared error. When I computed it for the quantum algorithm, I found something that surprised me at first: it showed almost no advantage.

mMQuantum root-mean-square errorClassical standard error
380.15560.1481
4160.11450.1047
6640.05630.0524
82560.02850.0262
101,0240.01370.0131

Root-mean-square error of the quantum estimate versus the classical standard error, both averaged over a. The quantum value is not smaller; it is slightly larger and falls only like 1/√M.

The reason is the shape of the outcome distribution. The probability of an outcome y far from the true value decays only like one over the square of the distance, which is a heavy tail. A rare outcome that is far off contributes a big squared error. Squaring weights these rare large errors strongly, and since the tail falls off slowly, the average squared error is dominated by them. The median and percentile errors, which ignore how far off the rare outcomes are, show the 1/M behaviour clearly.

This is a real feature of the basic algorithm, not a bug in my calculation: the same exact distribution gives a median error that scales as 1/M and a root-mean-square error that scales as 1/√M. It tells you how to state the claim honestly. The correct statement is that, with high probability, the error is of order 1/M. It is not that the average squared error is of order 1/M. When people say that QAE gives a quadratic speed-up, they mean the former. I computed these two scalings myself and did not check the full-text analysis in the source paper, so I flag that as my own finding.

Why the distinction matters

If you build a system that needs a guaranteed bound on the mean squared error, the basic algorithm does not give the quadratic gain. I have not studied whether variants of the algorithm improve the tail behaviour, so I make no claim about them.

A short program for the outcome distribution

The program below computes the exact distribution of the measurement outcomes of amplitude estimation for a chosen a and m. It does not simulate every gate; it uses the fact that the working register is an equal mixture of the two eigenstates of Q with phases θ/π and 1 − θ/π, and that phase estimation on an eigenstate with phase φ has a known outcome distribution. I ran exactly this listing for a = 0.3 and m = 4, and it printed the four rows shown in the comment, with total probability 1.0.

import numpy as np

def qae_distribution(a, m):
    M = 2 ** m
    theta = np.arcsin(np.sqrt(a))
    phi = theta / np.pi
    y = np.arange(M)
    k = np.arange(M)

    def phase_estimation(ph):            # outcome probabilities for a pure eigenphase
        amp = np.exp(2j * np.pi * np.outer(ph - y / M, k)).sum(axis=1) / M
        return np.abs(amp) ** 2

    P = 0.5 * phase_estimation(phi) + 0.5 * phase_estimation(1 - phi)
    estimate = np.sin(np.pi * y / M) ** 2
    return P, estimate

P, est = qae_distribution(0.3, 4)
for i in np.argsort(-P)[:4]:
    print(int(i), round(float(P[i]), 4), round(float(est[i]), 5))
# prints:  3 0.4963 0.30866 / 13 0.4963 0.30866 / 14 0.0013 0.14645 / 2 0.0013 0.14645
Exact outcome distribution of amplitude estimation. Output matches the worked Example 3.

The inner function is the standard phase-estimation formula: the amplitude of outcome y is the average over k of e^(2πi(φ − y/M)k). When φ is exactly a multiple of 1/M, all terms cancel except for one outcome and the probability is 1 on it. Otherwise, you get the bump around M·φ that we saw in the phase-estimation lesson.

To check the real circuit on a simulator you would build A, S_χ and S₀ from gates, construct controlled powers of Q, add the inverse QFT, and run it. I did not build that circuit with Qiskit, since Qiskit was not installed. What I did verify, in a one-qubit model with matrices, is the heart of it: the operator Q = −A S₀ A† S_χ has eigenphases ±θ/π, and applying it k times gives the probability sin²((2k+1)θ).

Application: approximate counting

One of the most natural uses is counting. Suppose a list has N items, an unknown number k of which are marked, and you can test membership with a quantum oracle. A uniform superposition over all items gives a marked item with probability a = k/N. Amplitude estimation then estimates a, and N times that estimate approximates k. The abstract of the paper by Brassard, Høyer, Mosca and Tapp, which I opened, states that the estimation method is applied to counting the number of good elements, giving optimal quantum algorithms in several settings. I use only that statement; I did not read the details.

Worked example

Counting k = 5 marked items among N = 1,024 with 8 counting qubits

  1. Here a = 5/1024 = 0.00488, θ = arcsin√a = 0.0699, and the estimate of k is N sin²(πy/256).
  2. In my calculation, the two mirror outcomes with the highest probability both give the estimate k̂ = 5.542, with total probability 0.7354. The next outcome gives 3.85 with total probability 0.1372, and the next gives 7.538 with probability 0.0398.
  3. So with probability about 0.74 the estimate is within 1 of the true count 5, and the possible estimates (3.85, 5.54, 7.54) form a coarse grid, so the exact value 5 is never returned.
  4. The number of applications of Q is M − 1 = 255.

For this small N the example is not impressive: scanning 1,024 items classically gives the exact count with 1,024 checks. Quantum counting becomes interesting when N is so large that scanning is infeasible and when a marked-item test is available as a fast quantum circuit. In such regimes the 1/M scaling of the estimate matters. I did not run examples with huge N, since the calculation only depends on the ratio k/N and not on how the oracle is implemented, but the accuracy does depend on how well the count fits the grid.

Estimating expectations: Monte Carlo

The same trick estimates an average value of a random quantity, not just a probability. Montanaro’s paper, whose abstract I opened, gives a quantum algorithm that estimates the expected output of a subroutine with bounded variance and achieves a near-quadratic speed-up over the best possible classical algorithm. The abstract also says that, combined with quantum walks, the method speeds up the fastest known classical algorithms with rigorous guarantees for computing partition functions, and that it can estimate the total variation distance between probability distributions. This links this lesson with the previous one on quantum walks. I only use what the abstract says; I did not examine the variance conditions.

Choosing the number of counting qubits in practice

A common practical question is how many counting qubits m to use for a target accuracy. My computed 90th-percentile errors, averaged over a between 0.05 and 0.95, give a direct answer for the values of m I tested. Read the table as: with this many counting qubits, nine runs in ten land within this distance of the true probability, on average over a.

Target: 90% of runs withinSmallest m I tested that meets itQ applications 2ᵐ − 1Measured 90th-percentile error
0.154150.1338
0.056630.0369
0.0182550.00919
0.0025101,0230.0021

Counting qubits needed for a target 90th-percentile error, from my table. I tested m = 4, 5, 6, 7, 8, 9, 10 and 11, so the entries are the smallest tested m that meets each target.

Two rules of thumb follow, both based only on these computed values. First, every extra counting qubit roughly halves the typical error, as expected from the 1/M law, and doubles the number of applications of Q. Second, because the classical cost to match a given error grows as the square of the quantum cost, the practical gain is largest where you want small errors. For a loose target such as 0.15, the quantum method needs 15 applications of Q against about 27 classical runs, a gain of under a factor of two and probably none after counting that each Q uses A twice.

When you use the algorithm, you also have to decide what to do with the result. A single run gives one value on a grid. To be safe you can repeat the whole algorithm a few times and take the median of the estimates, a standard trick for turning a result that is right with probability above one half into one that is right with very high probability. I describe this as a general technique; I did not simulate it for this algorithm.

A planning example

Suppose you want a probability to within 0.01 with 90% confidence. My table says 8 counting qubits, which means 255 applications of Q, and each uses the circuit A twice. A classical sampler would need about 5,800 runs for the same accuracy. The quantum circuit is much deeper, but it uses far fewer calls to the underlying process.

Limits and honest caveats

  • The process must be a quantum circuit. QAE needs A, and for the Grover operator also A†, as circuits. A classical simulator that you can only sample from cannot be used. Preparing the right state for a financial or physical model can itself be expensive, and I did not study that cost.
  • The circuit is deep. The largest controlled power of Q is Q^(M/2), so the circuit length grows in proportion to the accuracy you want. A run with M = 1,024 uses 1,023 applications of Q in total, each containing A and A†, plus controls. This is far beyond what noisy hardware can do reliably. The Cerezo and Preskill papers I opened for the earlier lessons describe noise limiting circuit size on near-term devices, and the same applies here.
  • The advantage is quadratic, not exponential. Reaching accuracy ε needs about 1/ε uses of A, against about 1/ε² classically. For a modest quadratic gain on a quantum computer whose operations are slower and more expensive than classical ones, the break-even point can be far away. I did not compute an actual break-even for any application.
  • The error statement needs care. As shown in the heavy-tail section, the guarantee is about the typical error, not about the mean squared error.
  • A good classical competitor may exist. For many Monte Carlo problems, classical variance-reduction tricks can reduce the number of samples a lot, and I did not compare against them.
  • My tables are for a one-parameter problem. The accuracy figures average over the single unknown a and use an ideal noiseless model.

None of this makes amplitude estimation less important. It is a key building block, because it turns Grover’s speed-up from finding items into estimating quantities, which opens up counting, expectations and many subroutines in other algorithms. The honest summary is that it is a well-understood subroutine with a provable quadratic advantage in the query model, and an open question about when that advantage is practical.

Common mistakes

  • Forgetting the mirror outcome. The outcomes y and M − y give the same estimate; counting only one of them halves your apparent probability.
  • Using sin²(y/M) instead of sin²(πy/M). The factor π comes from φ = θ/π.
  • Treating the output as exact. Unless the true phase is a multiple of 1/M, the estimate is on a grid and has a distribution around the truth.
  • Comparing the number of counting qubits with the number of samples. The relevant cost is the number of applications of Q, which is M − 1 = 2ᵐ − 1, exponential in the number of counting qubits.
  • Assuming that more counting qubits always gives a better single-run answer. They improve the typical error but a rare outcome far from the truth can still occur, with a probability that does not vanish.
  • Confusing amplitude estimation with amplitude amplification. Amplification boosts the probability of a good outcome by repeating Q; estimation measures what that probability was. The abstract I opened treats amplification as the generalisation of Grover’s search and estimation as a separate main result.

Frequently asked questions

Why is it called amplitude estimation when we estimate a probability?

Because the thing being estimated is the amplitude √a of the good component of the state. The probability a is its square, so the two carry the same information.

How is this related to Grover’s algorithm?

The Grover operator is the engine of both. Grover’s search applies Q a chosen number of times and measures. Amplitude estimation applies controlled powers of Q and reads out the rotation angle with phase estimation. The first finds good items; the second tells you how many there are, or how likely they are.

Do I need to know a in advance?

No, that is the point. The algorithm estimates an unknown a. The abstract of the paper I opened says amplitude amplification works whether or not the probability is known in advance, and amplitude estimation is the tool for measuring it.

What if a is very small?

The angle θ is then about √a, so the phase φ = θ/π is small, and resolving it requires M large compared with 1/√a. In my counting example, a = 0.00488 and 8 counting qubits gave estimates on a grid of spacing about 1.7 in k. I did not study the small-a regime further.

Can this run on today’s hardware?

Only in tiny demonstrations. A run with 1,023 applications of Q is far too deep for current noisy devices, which is why people also study methods that use shorter circuits at the cost of more repetitions. I did not open any source on those, so I do not describe them.

Practice questions

Check yourself

A phase estimation run on the Grover operator with m = 3 returns y = 2. What probability estimate does it give?

ã = sin²(π · 2/8) = sin²(π/4) = 0.5.

Why do outcomes y and M − y give the same estimate?

sin²(π(M − y)/M) = sin²(π − πy/M) = sin²(πy/M), because sin(π − x) = sin x.

How many applications of Q does a run with m = 6 use?

2⁶ − 1 = 63.

For a = 0.3 and m = 4, what is the total probability of the estimate 0.30866?

0.4963 + 0.4963 = 0.9926, from y = 3 and y = 13.

A classical sampler needs about how many runs for a standard error of 0.01 when a = 0.3?

0.21 / 0.01² = 2,100 runs.

Why does the root-mean-square error of the quantum estimate fail to show a quadratic advantage?

The outcome distribution has a heavy tail, so rare far-off outcomes dominate the average squared error, even though the median error scales as 1/M.

Summary

  • Classical sampling estimates a probability with error about √(a(1−a)/M) after M runs.
  • Writing a = sin²θ, the Grover operator rotates by 2θ and has eigenphases ±θ/π; I verified this numerically for a = 0.3.
  • Phase estimation on Q returns an integer y with ã = sin²(πy/M), and the mirror outcome M − y gives the same estimate.
  • The estimate is exact when θ/π is a multiple of 1/M, as in the a = 0.5 and a = sin²(3π/16) examples.
  • Averaged over a, the quantum median error falls like 1/M while the classical one falls like 1/√M; at M = 1,024 the quantum median error is 0.00064 versus about 0.0088.
  • The root-mean-square error does not show this gain because of heavy tails.
  • Counting, Monte Carlo estimates and other subroutines use the same method, with a quadratic advantage in the query model and a deep circuit as the practical obstacle.

References and further reading

I opened the arXiv abstract pages for Brassard, Høyer, Mosca and Tapp (amplitude amplification and estimation) and for Montanaro (quantum speed-up of Monte Carlo methods). From the abstracts I used only: amplitude estimation combines Grover’s and Shor’s techniques to estimate the success probability and is applied to approximate counting; and Montanaro’s algorithm gives a near-quadratic speed-up for estimating the expected output of a subroutine with bounded variance. I did not open the full texts. All numbers in the tables are my own computations. The Qiskit-style listing was not run.

  1. Quantum Amplitude Amplification and Estimation (arXiv (Brassard, Høyer, Mosca, Tapp, 2000)) Opened the abstract page. Amplitude amplification generalises Grover’s search; amplitude estimation combines Grover’s and Shor’s techniques and is applied to approximate counting.
  2. Quantum speedup of Monte Carlo methods (arXiv / Proc. R. Soc. A (A. Montanaro, 2015)) Opened the abstract page. Near-quadratic speed-up for estimating the expected output of a subroutine with bounded variance; partition functions with quantum walks.
  3. Quantum Computing in the NISQ era and beyond (arXiv / Quantum (J. Preskill, 2018)) Opened the abstract page earlier in this project. Near-term devices of about 50 to 100 qubits, limited by noise.

Key terms in the dictionary