Computing Library › Quantum Algorithms
Quantum Algorithms
Quantum Counting
Quantum counting combines Grover's operator with phase estimation to count how many solutions exist — not just find one.
- Core
- QPE on the Grover operator
- Output
- number of marked items M
What it does
The Grover iteration is a rotation whose angle depends on the number of solutions. Running phase estimation on that operator reads the angle, and hence M, without enumerating solutions.
Where it's used
Deciding satisfiability, estimating set sizes, and calibrating how many Grover iterations to run.
In code (Qiskit)
python
# QPE applied to the Grover diffusion*oracle operator