Introduces the quantum counting algorithm combining Grover's iterator with phase estimation.
arxiv.org/abs/quant-ph/9805082 ↗Quantum counting
Estimates how many items in an unstructured search space satisfy an oracle, without checking them one by one.
Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.
Quantum counting combines Grover's amplitude amplification with phase estimation: instead of finding a marked item, it estimates how many marked items exist.
Circuit & simulation
What this takes and returns
TakesNothingWhat joins here
No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
ReturnsNothingWhat joins here
No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →
Where this sits
This record is named by the layer graph at:
- Estimate the eigenphase of a unitary Slot
Takes A circuit for U that can be applied as controlled U^(2^j), a preparation routine for a state whose overlap with the target eigenvector is not negligible, the number of bits of the phase wanted, and the failure probability that may be tolerated. Returns An estimate of the eigenphase to the requested number of bits, with the failure probability it was obtained at, plus the two costs that actually differ between routes: how many ancillas were held at once, and how many sequential rounds were run.
How it works
Quantum counting answers "how many of the basis states satisfy an oracle" without checking each one, by running quantum phase estimation on the Grover iterator built from that oracle.
Why it works. In the 2-dimensional subspace spanned by the uniform superposition of marked ("good") and unmarked ("bad") states, acts as a rotation by angle where
so has eigenvalues on the two eigenvectors of that rotation. Phase estimation with counting qubits applied to (controlled powers of) estimates to -bit precision; the count is recovered as .
Small worked instance. Take ( system qubits) with marked state. Then . In units of , the phase to be estimated is . A 3-bit counting register (t=3, giving -resolution phase bins) would place the estimate near the bin closest to , i.e. bin or out of — illustrating why more counting qubits are needed as gets small or precise counts are required.
Complexity. With counting qubits the circuit uses controlled applications of (each one Grover-oracle call), giving an estimate of with additive error with high probability — a quadratic improvement in oracle calls over classical sampling-based estimation of to the same precision, matching the standard Grover speedup structure it is built from.
Implementation
from qiskit import QuantumCircuit
from qiskit.circuit.library import QFT, GroverOperator
# Oracle marking |11> out of N=4 basis states (M=1)
oracle = QuantumCircuit(2)
oracle.cz(0, 1)
grover_op = GroverOperator(oracle)
t = 3 # counting qubits
qc = QuantumCircuit(t + 2, t)
qc.h(range(t))
qc.h(range(t, t + 2))
for i in range(t):
power = 2 ** i
controlled_g = grover_op.repeat(power).to_gate().control(1)
qc.append(controlled_g, [i] + list(range(t, t + 2)))
qc.append(QFT(t, inverse=True), range(t))
qc.measure(range(t), range(t))
FINAL_CIRCUIT = qcQuantum vs classical
Classical baseline
Exact classical counting requires checking all N items, O(N) oracle evaluations, to determine M exactly.
Quantum claim
Quantum counting estimates M to a given precision using O(√N) oracle-equivalent calls via phase estimation on the Grover iterator, at the cost of only an estimate rather than an exact count.
How to compare
Compare the number of counting qubits (precision), total controlled-oracle calls, and the resulting confidence interval on M against classical sampling or exhaustive counting for the same N.
Declared gaps
Nobody has reviewed this record for gaps yet.
Literature & references
Defines the Grover iterator whose eigenphase this algorithm estimates.
arxiv.org/abs/quant-ph/9605043 ↗