← Atlas

Algorithms · Quantum walk

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.

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 speedupStated by the primary source: "We introduce the first subset-sum algorithm that beats 2^{n/4}. Specifically, we introduce a quantum algorithm that, under reasonable assumptions, uses at most 2^{(0.241…+o(1))n} qubit operations to solve a subset-sum problem."
  • Reported cost2^{(0.241…+o(1))n} qubit operations, where n is the number of integers x₁, …, xₙ and the paper lists an algorithm using 2^{(e+o(1))n} operations as exponent e. The classical algorithms the paper names for the same problem: brute force at 2ⁿ, the Horowitz-Sahni left-right split at 2^{n/2}, and Howgrave-Graham and Joux's representation algorithm at 2^{(0.337…+o(1))n}. The best classical exponent, 0.291… from Becker, Coron and Joux, appears in the paper's comparison table and in no sentence of its text.
  • Papers1
Unsupported
subset-sum-quantum-walk.txt
ALGORITHM: Subset-sum by quantum walk over representations
PROBLEM: 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.
IDEA: The algorithm layers three things. From Howgrave-Graham and Joux it takes the representation technique: a solution of weight n/2 is split into overlapping halves in many ways at once, so a solution can be found from any one of its representations rather than from a single fixed decomposition. From Ambainis's element-distinctness algorithm it takes a discrete-time quantum walk on a Johnson graph, whose vertices are r-element subsets of the b-bit strings and whose edges join sets differing in one element. The paper's own contribution is the data structure that makes the walk implementable: Ambainis handles the walk's memory with what the authors call an ad-hoc combination of a hash table and a skip list requiring several pages of analysis, and they replace it with a radix tree. The problem a walk's memory has is history dependence — the stored state must not remember the order in which elements arrived, or the superposition fails to interfere — and the authors solve it by putting a uniform superposition over all possible memory layouts of the nodes, which they say produces a unique quantum data structure representing the set.
REPORTED COST: 2^{(0.241…+o(1))n} qubit operations, where n is the number of integers x₁, …, xₙ and the paper lists an algorithm using 2^{(e+o(1))n} operations as exponent e. The classical algorithms the paper names for the same problem: brute force at 2ⁿ, the Horowitz-Sahni left-right split at 2^{n/2}, and Howgrave-Graham and Joux's representation algorithm at 2^{(0.337…+o(1))n}. The best classical exponent, 0.291… from Becker, Coron and Joux, appears in the paper's comparison table and in no sentence of its text.
BASIS: abstract: "This paper introduces a subset-sum algorithm with heuristic asymptotic cost exponent below 0.25."; section 1: "We introduce the first subset-sum algorithm that beats 2^{n/4}. Specifically, we introduce a quantum algorithm that, under reasonable assumptions, uses at most 2^{(0.241…+o(1))n} qubit operations to solve a subset-sum problem."; the exponent convention is Table 1.1's own caption, "An algorithm using 2^{(e+o(1))n} operations is listed as 'exponent' e."; for the classical baseline, section 5: "Howgrave-Graham and Joux introduced this technique in [17] and obtained a subset-sum algorithm that costs just 2^{(0.337…+o(1))n}." Read from the authors' own full text (cr.yp.to, dated 2013.04.07), all eighteen pages, not from the abstract.
PRIMARY SOURCE: Daniel J. Bernstein, Stacey Jeffery, Tanja Lange, Alexander Meurer (2013), Quantum algorithms for the subset-sum problem — https://doi.org/10.1007/978-3-642-38616-9_2

This is a literature reference record, not an executable circuit.

A reference record, not runnable source. Leona cannot execute it, so it cannot be saved to your Library as a circuit.

References

  • Quantum algorithms for the subset-sum problem

    Daniel J. Bernstein, Stacey Jeffery, Tanja Lange, Alexander Meurer · 2013

    Primary source and the source of every figure here. Section 1 carries both the cost exponent and the two sentences that scope it — the free-quantum-RAM convention and the statement that the analyses are heuristic. Table 1.1 is the comparison against the other eleven algorithms, quantum and classical, and is the only place the best classical exponent appears. Section 3 is the walk and the radix tree that replaces Ambainis's memory structure; section 5 is the representation technique and the final cost. The version of record is the Springer chapter; the authors' own full text is on cr.yp.to and carries no DOI or venue on its face.

Attested & literature
  • Peer-reviewed paper
Method
Curation only. The problem statement was recorded from the literature; the speedup class is checked against the record's own primary paper, which states it; 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: "This paper introduces a subset-sum algorithm with heuristic asymptotic cost exponent below 0.25."; section 1: "We introduce the first subset-sum algorithm that beats 2^{n/4}. Specifically, we introduce a quantum algorithm that, under reasonable assumptions, uses at most 2^{(0.241…+o(1))n} qubit operations to solve a subset-sum problem."; the exponent convention is Table 1.1's own caption, "An algorithm using 2^{(e+o(1))n} operations is listed as 'exponent' e."; for the classical baseline, section 5: "Howgrave-Graham and Joux introduced this technique in [17] and obtained a subset-sum algorithm that costs just 2^{(0.337…+o(1))n}." Read from the authors' own full text (cr.yp.to, dated 2013.04.07), all eighteen pages, not from the abstract.). 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 circuit was built, compiled, simulated or run here, and no subset-sum instance was solved. Four limits the authors state themselves, and the first is the one that decides what the number means. **The cost model assumes free quantum RAM.** Section 1 says that random access to an array of size 2^{O(n)} is assumed to cost only n^{O(1)}, even if the array index is a quantum superposition — and the algorithm's memory is exponential. The authors raise the objection three times and decline it each time, adding that they do not claim that improved operation counts imply improvements in other cost models. **The analysis is heuristic, not proved.** Section 1: their analyses are heuristic, they do not claim the algorithms work for all inputs, and they do not claim that what they call the hard case is the worst case; they speculate a proof is possible by adapting another paper's ideas. **It is asymptotic to the point that the input is free** — polynomial cost factors are suppressed systematically, so by the paper's own example reading the entire input costs only 1, and twice the authors note a real improvement is invisible at this level of detail. **And the statement is simplified**: sections 3 to 5 consider only half-weight solutions, n is assumed divisible by 16, the success probability is inverse polynomial in n rather than constant, and one sub-claim about that probability rests on experiments rather than analysis. Finally, two things about the Zoo's framing rather than the paper's. The Zoo files this entry under the speedup class Polynomial; **the word polynomial never describes this paper's own speedup** — all seventeen of its occurrences are about suppressed cost factors, the P versus NP framing, the data-structure limits, the success probability, or a reference's title. And the comparison against the best classical algorithm, Becker, Coron and Joux at exponent 0.291…, is made only in the comparison table, which has a Quantum yes/no column; no sentence of the paper states the margin.
Quantum algorithms for the subset-sum problem ↗
Kind
curated reference
Reviewed by
Leona Quantum curation pass
License
Citation metadata only; source publication terms apply
subset-sumquantum walkelement distinctnessrepresentationsknapsack

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