← Atlas

Algorithms · Quantum walk

Element distinctness by quantum walk

Given oracle access to N items carrying no promise about the underlying function, find two items that are equal, or establish that all N are distinct.

Attested & literatureUpdated

Open on the mapView frozen graph

A small worked example, computed in your browser. It is not a result from this record's papers.

A discrete-time quantum walk on a 4-cycle

One coin qubit, two position qubits (4 positions on a cycle), 3 steps starting at position 0.

q0q1q2Step 1 of 3 · Quantum walk step (4-cycle)Quantum walk step (4-cycle)Step 2 of 3 · Quantum walk step (4-cycle)Quantum walk step (4-cycle)Step 3 of 3 · Quantum walk step (4-cycle)Quantum walk step (4-cycle)

Step 1 of 3 · Quantum walk step (4-cycle)

Probability of each outcome after this step

  • 01150%
  • 11050%
  1. Flips the coin with a Hadamard, then shifts the position by +1 if the coin is |1⟩ or -1 mod 4 if the coin is |0⟩; with the coin in superposition, both shifts happen at once, entangling coin and position.

    Probability leaves the outcome it was on and appears on 2 entirely different ones — not one outcome is populated both before and after. This is the step that entangles the qubits: from here on no single qubit has a state of its own, only the register as a whole does.

  2. The same coin flip and shift, applied again.

    Probability leaves all 2 outcomes it was on and appears on 4 entirely different ones — not one outcome is populated both before and after.

  3. The same coin flip and shift, a third time.

    Probability leaves all 4 outcomes it was on and appears on 2 entirely different ones — not one outcome is populated both before and after. The entanglement comes apart here: each qubit has a state of its own again.

Readout The position always reads 3, for either value of the coin: constructive interference on this small cycle concentrates the walk onto a single position after exactly 3 steps.

Open in Studio
  • Record typeLiterature reference
  • Speedup class (secondary source)Polynomial
  • Primary source on the speedupNot checked against the primary source yet
  • Reported costO(N^(2/3)) queries for element distinctness on N items, matching the lower bound of Shi and improving the previous O(N^(3/4))-query quantum algorithm; the same algorithm uses O(N^(k/(k+1))) queries to find k equal items among N. The Zoo gives Θ(N) classical query complexity for element distinctness, and for the two-to-one collision problem O(N^(1/3)) quantum queries against Θ(√N) classical randomized queries, with Brassard, Hoyer and Tapp stating O((N/r)^(1/3)) expected function evaluations for r-to-one functions.
  • Papers2

A part this method uses, worked through

This page says Grover's search — here is a concrete, runnable instance of it.

Grover's algorithm finds |101⟩

3 qubits, searching for |101⟩ among 8 states, with 2 Grover iterations.

q0q1q2Hadamard layer(3)Phase oracle(101)Grover diffuser(3)Phase oracle(101)Grover diffuser(3)

Where it ends up

  • 10195%
  • 0001%
  • 1101%
  • 0011%
  • 4 more outcomes3%

Measuring gives 101, the marked state, with high probability.

One of its steps changes only phase: the outcome probabilities stay put while the state does not.

Open this part in Studio

This record is not a concrete circuit.

References

  • Quantum walk algorithm for element distinctness

    Andris Ambainis · 2003

    Primary reference for element distinctness by quantum walk; the source of this record's cost claim.

  • Quantum Algorithm for the Collision Problem

    Gilles Brassard, Peter Hoyer, Alain Tapp · 1997

    The promised half of the same Zoo entry. For arbitrary r-to-one functions given as a black box the authors find collisions in O((N/r)^(1/3)) expected evaluations, more efficient than any classical algorithm even with randomization, and they extend the technique to claw finding in pairs of functions and exhibit a space-time tradeoff.

Attested & literature
  • Peer-reviewed paper
Method
Curation only. The problem statement was recorded from the literature; the speedup class is not yet checked against the record's own primary paper; the primary reference's title, authors and submission year were read from its arXiv abs page; the complexity claim was taken from a clause of that paper's abstract (abstract of arXiv:quant-ph/0311001: "For element distinctness (the problem of finding two equal items among N given items), we get an O(N^{2/3}) query quantum algorithm. This improves the previous O(N^{3/4}) query quantum algorithm of Buhrman [link mangled to 'this http URL' on the abs page] (quant-ph/0007016) and matches the lower bound by Shi (quant-ph/0112086)", and "For this problem, we get an O(N^{k/(k+1)}) query quantum algorithm"; Zoo entry "Collision Finding and Element Distinctness": element distinctness "has Θ(N) classical query complexity", and for the collision problem "The classical randomized query complexity of this problem is Θ(√N), whereas ... a quantum computer can achieve this using O(N^{1/3}) queries"; abstract of arXiv:quant-ph/9705002: "finds collisions in arbitrary r-to-one functions after only O((N/r)^(1/3)) expected evaluations of the function".). No circuit was constructed, simulated or run.
Result
Pass · the record's problem, speedup class and primary reference agree with the two sources named above.
Caveat
This is a literature record. No oracle was instantiated, no circuit compiled, and no walk simulated or run. Every figure above is a query count in the black-box model, so none of it bounds gate count, circuit depth, the cost of holding and addressing the data the walk moves over, or the constant factors hidden by O(·); the collision paper asserts a space-time tradeoff exists without this record fixing the space. Optimality is reported: the Zoo calls the O(N^(2/3)) bound optimal and the Ambainis abstract attributes the matching lower bound to Shi, neither of which is re-derived here. The remaining results in the same Zoo entry, the k-distinctness bounds, time-complexity claims, many-collision and claw-finding work for N ≠ M, frequency-moment estimation and the graph collision problem, rest on papers outside this record.
Quantum walk algorithm for element distinctness ↗
Kind
curated reference
Reviewed by
Leona Quantum curation pass
License
Citation metadata only; source publication terms apply
element distinctnessquantum walkcollision findingquery complexityoracle

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.