BHT algorithm

and needs to find two inputs that f maps to the same output.

The BHT algorithm only makes

queries to f, which matches the lower bound of

[1][2] The algorithm was discovered by Gilles Brassard, Peter Høyer, and Alain Tapp in 1997.

[3] It uses Grover's algorithm, which was discovered the year before.

Intuitively, the algorithm combines the square root speedup from the birthday paradox using (classical) randomness with the square root speedup from Grover's (quantum) algorithm.

First, n1/3 inputs to f are selected at random and f is queried at all of them.

Otherwise, all these inputs map to distinct values by f. Then Grover's algorithm is used to find a new input to f that collides.

Since there are n inputs to f and n1/3 of these could form a collision with the already queried values, Grover's algorithm can find a collision with