About this map
Sections
What this is
Quantum algorithms are not written from scratch. They are assembled from a small number of reusable steps, and almost every published method is a different route through the same handful of them.
This is a map of those routes. Circles are the things an algorithm can be holding. Lines are the steps that carry you from one to the next. A method is a path across.
Nothing here is generated. Every line was read out of a paper and checked against it.
How to read it
- Something you can hold — a state, a matrix, a circuit, an answer.
- The same, in the middle of a step you have opened.
- A step. Someone has published a way through it.
- A step whose way through has not been pinned to one method.
- A step nothing published fills yet.
- A step you have opened. What is drawn inside it is how it was done.
- There is a record in the repository for this one.
How to move around
- Two fingers move the map. Pinch to zoom, or hold ctrl and scroll.
- Click a step to open it in place — everything else stays where it is.
- Click a name to read the full record without leaving the map.
- Arrow keys move, plus and minus zoom, zero puts it back.
What a line is claiming
A solid line means a paper puts those two steps together and we have the citation. A long-dashed line means the route is recorded but no single method has been named for that step. A short-dashed line means nothing published fills it — the step is real, the way through is not written yet.
A count after a step's name — ×T/h, ×O(κ) — means the route walks that step that many times rather than once. It is the source's own symbol, and the card says what it stands for and what one turn costs. A step with no count is a step no source we read said is repeated, which is not the same as one taken once.
A line drawn nested under another, on the soft shaded band behind it, is a narrower version of the line above it: the same construction, re-analysed or re-tuned, filling the same step. It is why two lines can draw the identical interior and still be two entries. Lines outside the band are alternatives to their neighbours, not versions of them.
The map does not hide the gaps. An empty step is drawn as an empty step.
What is not here yet
The map covers the algorithm literature. The repository covers circuits and primitives. They overlap less than you would expect, and where a method has no record we say so on its page rather than leaving the space blank.
Where something named here does have a record, its name links straight to it.
Method
Walk over subsets that remember their queries
Make each vertex a subset of the input together with the values already queried for it, so that stepping to a neighbouring subset costs one query rather than a fresh batch. Grover diffusion over which element to add or remove supplies the moves, and a phase flip on subsets that already contain the answer supplies the direction.
Open the full recordFills the slot: Walk a graph to the vertex you want
The vertex has to carry its queried values, and the same subset must always be stored the same way regardless of how it was reached. Ambainis calls this the uniqueness problem and states the consequence of getting it wrong: "in the original quantum algorithm, we might have interfering with , resulting in amplitude for . If becomes , there is no interference between and " — so a data structure that remembers insertion order breaks the algorithm rather than slowing it. The published analysis of the walk assumes at most one solution — "a promise that there is at most one set of indices" — and the general case is reached by a classical wrapper that reruns the walk on random subsets, not by a different walk. The running-time claim, as opposed to the query claim, is conditional: it needs a circuit model "augmented with gates for random access to a quantum memory", without which "simple data structure operations (for example, removing from ) which require time classically would require time quantumly".
A rule naming the neighbours of any vertex, a rule saying whether a vertex is marked, somewhere to start — one named vertex, or a distribution over them — and the size bounds the schedule is computed from: the number of vertices, the depth, the maximum degree, or the size of the subsets a vertex stands for. Which of those a method needs is a property of the walk, not of the slot.
Search graph with a marked set → A marked item, with its query billadd an element, query it, diffuse, drop one
The graph has " vertices. The vertices correspond to sets of size and . Two vertices and are connected by an edge if for some . A vertex is marked if contains ." That marking condition is section 3.1's element-distinctness specialisation, stated there under "let "; the general one, which Algorithm 2 uses and which the phase flip below carries, asks for distinct indices with equal values. The walk runs on two spaces: with basis for , , , and with and . One step is six operations. Steps 1 and 4 are Grover diffusions on the register — going up, and the same form with replaced by and the sum taken over coming back down. Between them, step 2 adds to , step 3 queries and inserts it, and steps 5 and 6 use the query a second time to erase the value at the new before removing it — so the move up and the move back each cost one query. assumption: " will always be equal to where are elements of in increasing order" — the stored values must be in a canonical order, or the same subset reached two ways occupies two basis states and the interference the algorithm is built on does not happen. Outside the walk sits the phase flip on any holding indices with equal values, which costs nothing because those values are already stored. The schedule is outer repetitions of one phase flip followed by walk steps. assumption: the outer count comes from the overlap between the walk's starting state and the marked subspace, which is what a promise of at most one solution buys; a domain with many solutions changes and the paper reaches it through a classical wrapper instead. The data structure that holds is where the running time is won or lost, and the paper's hash-table-and-skip-list version is not exact: a bucket can overflow, the branch on which it does is bounded per step at , and the distribution a measurement of the real algorithm returns is shown to differ from the ideal one by in variational distance.
assumption
A marked vertex, with the evidence it is marked already in hand from the work stored on it — or the report that the graph holds none, at a stated failure probability.
None found yet.
given oracle access to x_1 ... x_N with values in [M] (Sec. 3.1)
k, the number of equal items to be found
r, the subset size; r = N^(2/3) for k = 2
# a vertex is a subset S of the inputs together with the values already
# queried for it, so a step costs one query and not r of them
generate the uniform superposition over pairs (S, y) with |S| = r, y not in S
query all x_i for i in S (Sec. 3.2, Alg. 2)
# these r queries are the whole cost of the initial state
repeat t1 = O((N/r)^(k/2)) times:
flip the phase of every S that already contains k indices with equal values
# this check costs no queries: the values for S are already stored
perform t2 = O(sqrt(r)) steps of the walk, each step being (Alg. 1)
diffuse over y among the elements not in S
move to S + {y}, querying x_y and inserting it
diffuse over y among the elements of S + {y}
erase the value at the new y by querying x_y again, and drop y
measure, and check whether the measured S contains k equal values
return that S -- its stored values are the witness, or there is none
# the same subset must always be stored the same way, however it was reached.
# Two spellings of one subset do not interfere, and the algorithm is built out
# of that interference
# the analysis above assumes at most one solution. The general case runs this
# on random subsets of the input, classically, and is not a different walk
# do not read the query count as a running time. That needs a model with
# random access to quantum memory, and the paper says soqueries for element distinctness on items and for finding equal items, which the abstract sets against the previous quantum algorithm of Buhrman et al. and against the lower bound the paper attributes to Aaronson and Shi. The bill has two terms and not three: " for creating the initial state and for the rest of the algorithm", so the total is and is where the two meet. Under a memory restriction to stored numbers the paper reports queries against a classical . Time is a separate and weaker claim: steps, and only in a model with random-access gates. The constant is not uniform in — "the big-O constant depends on ", with stated for non-constant and its proof omitted from that version.
None found yet.
None found yet.
A two-qubit circuit for the $N=4$, $k=2$ case, run on IBM Quantum Experience
- Quantum walk algorithm for element distinctness
Andris Ambainis · 2003
About
A Duke University ECE523 (Quantum Information Science, taught by Jungsang Kim) final project by Yuqi Yun and Ming-Tso Wei, posted as a public GitHub repository rather than a paper (README: "Duke University ECE523 Quantum Information Science instructed by Prof. Jungsang Kim at Duke University in Spring 2017. Final Project authored by Yuqi Yun and Ming-Tso Wei"). The report's own framing sentence names the wrong author for its own reference [2] — "we are focusing on the quantum walk algorithm for element distinctness proposed by Aaronson [2]" — but reference [2] in the same document's bibliography is Ambainis's paper, not a paper by Aaronson; the construction the report goes on to build, the -vertex graph with the phase flip and two-step diffusion, is this method's own.
Methods
The report exploits the block-diagonal structure of the walk's operators to collapse the , instance to two qubits. It first groups the twelve basis states (six size-2 sets , each with two choices of ) into five symmetry classes defined by " and ", which turns the phase flip and both diffusion steps into explicit (in general ) matrices , , acting on that basis. It then reduces further: because the instance's first basis component starts at amplitude zero and is never populated, "the unitary matrices can be reduced to matrices and represented by only two qubits." Built as circuits, "the first unitary transformation , which does the conditional phase flip, is just a controlled-Z gate"; "the next unitary transformation , the first step of quantum walk, is just a SWAP gate"; and , being block-diagonal, becomes "two controlled U gates", each decomposed into CNOTs and single-qubit gates via the construction the report cites to Nielsen and Chuang. The full walk is assembled as the matrix product , which for this instance "is just ".
Data
A synthetic instance with a single planted collision, with , giving : six size-2 subsets and four size-3 subsets , ten vertices in all, with the marked vertex being the subset . No external dataset; the report also describes a Box-hosted Mathematica script for simulating arbitrary at , with example runs quoted up to , and the repository separately checks in a notebook, `Quantum-Walk-n (2).nb`, whose code is written generically in and (using `Binomial`, `IntegerPart`, and `MatrixPower`, including ) matching that description, though its saved state has evaluated at rather than one of the larger examples the report quotes.
Code
Repository `mingweii/Element-distinctness-by-quantum-walk-algorithm-IBM-Q` on GitHub. The circuit is a Qiskit notebook, `N=4, k=2 element distinctness by quantum walk algorithm.ipynb`, importing `from qiskit import QuantumCircuit, execute, Aer, IBMQ` and simulating on `Aer.get_backend('qasm_simulator')`. The same circuits are checked in as raw OpenQASM 2.0: `U.qasm` is a 2-qubit circuit (`qreg q[2]`), and the composed walk `U2U1UU2U1U.qasm` is a 5-qubit, 96-line circuit (`qreg q[5]`) — both confirmed by reading the files directly.
Results
Table 1 of the report compares the probability of measuring the marked basis state : a Mathematica evaluation of the exact matrices gives ; the "IBM Simulator" gives at 100 shots and at 8192 shots; and the "IBM real processor" gives at 1024 shots and at 8192 shots. The report's reading: "Both the IBM simulators and real execution results agree well with the numerical results we obtained." No specific processor model is named beyond "IBM real processor", nor any simulator backend beyond "IBM Simulator" / "IBM quantum simulator". The report scopes the result in two separate places: Section 3 attributes this particular circuit's two-qubit size to the instance's own component starting and staying at zero amplitude, which lets the walk matrices reduce to ; Section 4 separately states, more generally, that element distinctness at never needs more than three qubits, while -distinctness would need matrices and "would significantly increase the complexity of the problem" — a cost that, in this circuit's gate budget, also grows with through against the roughly hundred-gate ceiling the report says both the simulator and the real device were subject to.
- Quantum walk algorithm for element distinctness
Element distinctness by quantum walk · Qiskit
From the repository — run, not written up from a paper · unsupported
About
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.
Methods
None found yet.
Data
None found yet.
Code
Qiskit
Results
Literature record · problem statement and speedup class checked against the Quantum Algorithm Zoo entry · primary reference checked against its arXiv abs page
Subset finding by quantum walk · Qiskit
From the repository — run, not written up from a paper · unsupported
About
In L-subset finding, a black box f maps a domain D of size N into a range R, and a property P picks out some L-element subsets by their arguments and values. The task is to find an L-subset {x₁, …, x_L} of D whose pairs ((x₁, f(x₁)), …, (x_L, f(x_L))) satisfy P, or to reject if none exists, using as few queries as possible. Unstructured search is the case L = 1 and element distinctness the case L = 2.
Methods
None found yet.
Data
None found yet.
Code
Qiskit
Results
Literature record · problem statement and speedup class checked against the Quantum Algorithm Zoo entry · primary reference checked against its arXiv abs page
Subset-sum by quantum walk over representations · Qiskit
From the repository — run, not written up from a paper · unsupported
About
Given integers x₁, x₂, …, xₙ and s, decide whether some subset I of {1, 2, …, n} satisfies the sum of xᵢ over I equal to s. The authors take as the typical hard case that the xᵢ are independent uniform random integers in {0, 1, …, 2ⁿ}. Subset-sum was one of the first problems shown NP-complete, so the question the paper asks is not whether it can be solved in polynomial time but how far below the 2ⁿ cost of searching every subset an exponential-time algorithm can get.
Methods
None found yet.
Data
None found yet.
Code
Qiskit
Results
Literature record · problem statement and speedup class checked against the Quantum Algorithm Zoo entry · primary reference checked against its arXiv abs page
- 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.
- Subset finding by quantum walk
In L-subset finding, a black box f maps a domain D of size N into a range R, and a property P picks out some L-element subsets by their arguments and values. The task is to find an L-subset {x₁, …, x_L} of D whose pairs ((x₁, f(x₁)), …, (x_L, f(x_L))) satisfy P, or to reject if none exists, using as few queries as possible. Unstructured search is the case L = 1 and element distinctness the case L = 2.
- Subset-sum by quantum walk over representations
Given integers x₁, x₂, …, xₙ and s, decide whether some subset I of {1, 2, …, n} satisfies the sum of xᵢ over I equal to s. The authors take as the typical hard case that the xᵢ are independent uniform random integers in {0, 1, …, 2ⁿ}. Subset-sum was one of the first problems shown NP-complete, so the question the paper asks is not whether it can be solved in polynomial time but how far below the 2ⁿ cost of searching every subset an exponential-time algorithm can get.
References
- Quantum walk algorithm for element distinctness
Andris Ambainis · 2003
Where the routes meet
11 problems nothing else needs — the places a reader arrives. Open a line to see what is recorded inside it, or click its name to go there.
13 lines have something recorded inside that you have not opened.
Of the routes that have been taken apart, 15 are built entirely from named slots, 15 hand off part of the work and finish the rest themselves, and 20 are one undivided act. None of the three is a defect; they are different things to reuse.
Every line on this figure, in words
The lines on this figure
Solve a nonlinear ODE dy/dt = F(y)
- Embed a nonlinear system into a linear one — opens into 6 · a way across — click it to open it here
- Solve a linear ODE du/dt = A(t)u + b(t) — opens into 9 · a way across — click it to open it here
- Choose a time discretization or propagator approximation → Quantum linear solve — open
- Choose a time discretization or propagator approximation — opens into 6 · a way across — click it to open it here
- Quantum linear solve — opens into 5 · a way across — click it to open it here
- Simulate Hamiltonian evolution → Estimate an observable — open
- Simulate Hamiltonian evolution — opens into 3 · a way across — click it to open it here
- Estimate an observable — opens into 4 · a way across — click it to open it here
Estimate an excited-state energy
- Variational quantum deflation — opens into 3 · a way across — click it to open it here
- Subspace-search variational eigensolver — opens into 3 · a way across — click it to open it here
- Quantum subspace expansion
- Quantum equation of motion
- Folded-spectrum variational eigensolver — opens into 3 · a way across — click it to open it here
- Penalty-constrained variational eigensolver — opens into 3 · a way across — click it to open it here
- Multistate contracted variational eigensolver — opens into 3 · a way across — click it to open it here
Every step you can open
1 of these have an object recorded in the middle; the rest open into the methods that fill them.
- Solve a nonlinear ODE dy/dt = F(y)
- Replace a spatial domain with a finite grid
- Discretize a PDE into one linear system
- Embed a nonlinear system into a linear one
- Solve a linear ODE du/dt = A(t)u + b(t)
- Recast a non-Hermitian generator as Hamiltonian evolution
- Choose a time discretization or propagator approximation
- Quantum linear solve
- Matrix function
- QSP phase factors
- Polynomial approximation
- Block-encode a matrix
- Prepare an input state
- Amplify a success branch
- Simulate Hamiltonian evolution
- Estimate an observable
- Compile a circuit to a specific device
- Satisfy the hardware connectivity constraint
- Approximate a continuous rotation in a discrete gate set
- Recover a noiseless expectation value by post-processing
- Build logical qubits at a target logical error rate
- Estimate a Hamiltonian's ground-state energy
- Choose a parameterised trial state
- Minimise the objective over the parameters
- Estimate an excited-state energy
- Measure what the machine can actually do
- Recover the period of a periodic function
- Estimate the eigenphase of a unitary
- Find the item a check accepts
- Walk a graph to the vertex you want
- Search a cost Hamiltonian for the assignment it minimises
What is on this map, counted
What is here, counted
147 nodes — 31 slots and 116 methods.
76 of the 147 link to a record in the Atlas, between them naming 89 records. The rest name papers and nothing else: this graph describes work the catalogue has not got yet, and the nodes with no record are the list of what a corpus pass has to go and read.
0 slots have no method recorded, and 32 methods have not been taken apart. Both are shown as what they are rather than left blank.
Every claim here rests on a source. This graph cites 140 papers; they and the 172 the Atlas cites alone are registered in one place, with what each reports and everywhere it is cited from. Papers