Simon's algorithm and the exponential quantum–classical query separation #
Simon's problem (CslibFrontier/Computability/QueryComplexity/Simon.lean, Simon,
de Wolf, §3.1): given f : {0,1}^n → {0,1}^n with the promise that for some s,
f(a) = f(b) exactly when b ∈ {a, a ⊕ s} (Cslib.QueryComplexity.SimonPromise), decide whether
s ≠ 0. The input is the truth table X : Fin N → Bool of the N = n 2^n output bits of f,
indexed by E : Fin N ≃ {0,1}^n × Fin n (Cslib.QueryComplexity.simonFun), and queries are bit
queries (Cslib.Quantum.bitQueryAlg): each query reads one bit f(a)_j.
The algorithm (Cslib.Quantum.simonAlg m E i₀, de Wolf §3.2) runs m rounds of Simon's
subroutine side by side. Its workspace (Cslib.Quantum.SimonWork m n) holds an input register xs
and an output register ys of m strings of n bits each. It starts in |i₀, 0, 0, 0⟩ for a
fixed query index i₀ (Cslib.Quantum.simonInit), applies the Hadamard transform to xs, computes
ys_{r,j} = f(xs_r)_j with m n bit queries, and applies the Hadamard transform to xs again.
For query (r, j) the basis permutation Cslib.Quantum.simonRoute moves the position
E⁻¹(xs_r, j) of the bit f(xs_r)_j into the query register and the target bit ys_{r,j} into
the control bit; after the bit query the same permutation moves them back. Measuring gives m
rows z_1, …, z_m ∈ {0,1}^n, and the algorithm accepts when they have a common nonzero orthogonal
vector (Cslib.Quantum.simonAccept), which Gaussian elimination decides without further queries.
Analysis. The final amplitude of |i₀, 0, z, y⟩ is 2^{-mn} ∑_{a : f(a) = y} (-1)^{a ⬝ z},
with f applied rowwise (Cslib.Quantum.run_simonAlg_apply). If s ≠ 0 and z_r ⬝ s = 1 for a
row r, then adding s to row r of a pairs the terms of this sum with opposite signs. So every
measured row is orthogonal to s, and the algorithm accepts with certainty
(Cslib.Quantum.measureProb_simonAlg_of_ne_zero). If f is injective (s = 0), each row matrix
z is measured with probability 2^{-mn}, and a fixed nonzero w is orthogonal to all rows of
2^{(n-1)m} of the 2^{nm} matrices, so the algorithm accepts with probability at most
(2^n - 1) / 2^m (Cslib.Quantum.measureProb_simonAlg_le_of_injective). With m = n + 2 rounds,
n (n + 2) bit queries decide Simon's problem with one-sided error below 1/4
(Cslib.Quantum.simonAlg_spec).
The separation. Every randomized decision tree that decides Simon's problem with error 1/3
has depth q with 2^n ≤ q² (Cslib.QueryComplexity.simon_two_pow_le_depth_sq), so the
separation is exponential: n (n + 2) quantum bit queries against 2^{n/2} randomized ones
(Cslib.Quantum.simon_separation). In terms of the input length N = n 2^n, for which
n ≤ log₂ N, the quantum algorithm makes at most 3 log₂² N queries and every such randomized
decision tree has N ≤ q² log₂ N, so q ≥ (N / log₂ N)^{1/2} = N^{1/2 - o(1)}
(Cslib.Quantum.simon_separation_inputLength). Both sides count bit queries, so the comparison is
like for like; the quantum side pays a factor n over the n + 2 value queries of de Wolf §3.2.
Simulating value queries by bit queries transfers the classical bound to value queries only up to
that factor (q_v ≥ 2^{n/2} / n); the coupling argument, which uses only that q queries touch at
most q inputs a, would give 2^n ≤ q_v² directly, but that is not formalized.
Source mapping. de Wolf §3.2 repeats the subroutine O(n) times and solves the resulting
linear system to find s; de Wolf §3.3.2 proves the classical lower bound for the decision
version, which is the version separated here. Running the rounds side by side in one bit-query
algorithm, accepting by the rank test, and the union bound (2^n - 1) / 2^m with its constants
are formulated here. Finding s itself (the search version) is in
CslibFrontier/Computability/QueryComplexity/Quantum/SimonSearch.lean, which uses the general bound
Cslib.Quantum.measureProb_simonAlg_le on the outcome probabilities.
Main definitions #
Cslib.Quantum.SimonWork: the workspace of Simon's algorithm.Cslib.Quantum.simonRoute: the routing permutation of a bit query.Cslib.Quantum.simonAlg,Cslib.Quantum.simonInit: Simon's algorithm and its initial state.Cslib.Quantum.simonAccept: the accepting outcomes, row matrices with a nonzero kernel vector.
Main results #
Cslib.Quantum.run_simonAlg_apply: the final amplitudes.Cslib.Quantum.measureProb_simonAlg_le: under the promise with fibers of size at mostK, a setZof row matrices is measured with probability at mostK / 2^{mn}times the number of matrices inZwith all rows orthogonal tos.Cslib.Quantum.measureProb_simonAlg_of_ne_zero: certain acceptance whens ≠ 0.Cslib.Quantum.measureProb_simonAlg_le_of_injective: acceptance probability at most(2^n - 1) / 2^mwhenfis injective.Cslib.Quantum.simonAlg_spec:n (n + 2)bit queries decide Simon's problem with error below1/4.Cslib.Quantum.simon_separation: the exponential separation,n (n + 2)quantum queries against depthqwith2^n ≤ q²for randomized decision trees.Cslib.Quantum.simon_separation_inputLength: the same in the input lengthN = n 2^n.
References #
The routing permutation of query k = (r, j) with resting query index i₀: it exchanges the
query index i₀ with the position E⁻¹(xs_r, j) of the bit f(xs_r)_j, and the control bit with
the output bit ys_{r,j}. It is an involution.
Simon's algorithm with m rounds and resting query index i₀: the Hadamard transform on
the input register, m n bit queries computing ys_{r,j} = f(xs_r)_j, each between two routing
permutations Cslib.Quantum.simonRoute, and the Hadamard transform on the input register.
The final state of Simon's algorithm: the amplitude of |i₀, 0, z, y⟩ is
2^{-mn} ∑_{a : f(a) = y} (-1)^{a ⬝ z}, with f applied rowwise, and every other amplitude is
0.
Simon's algorithm accepts with certainty when s ≠ 0: every measured row is orthogonal to
the hidden string s.
Outcome probabilities of Simon's algorithm. Under Simon's promise with hidden string s,
if every fiber of the rowwise f has at most K elements, then the measured rows lie in a set Z
of row matrices with probability at most K / 2^{mn} times the number of matrices in Z whose rows
are all orthogonal to s.
Simon's algorithm rarely accepts when f is injective: with probability at most
(2^n - 1) / 2^m.
Simon's algorithm decides Simon's problem with n (n + 2) bit queries: from a unit
initial state, with n + 2 rounds, it accepts every promise input with acceptance probability
within 1/4 of the answer s ≠ 0; the error is one-sided, as it accepts with certainty when
s ≠ 0.
The exponential quantum–classical separation for Simon's problem, in the bit-query model
on the truth table X : Fin N → Bool of f : {0,1}^n → {0,1}^n, for n ≥ 1: Simon's algorithm
decides Simon's problem with n (n + 2) queries and error below 1/4, while every randomized
decision tree deciding it with error 1/3 (as the restriction to the promise inputs of a total
function F) has depth q with 2^n ≤ q².
The separation in the input length N = n 2^n, for n ≥ 1: Simon's algorithm decides
Simon's problem with error below 1/4 using n (n + 2) queries, which is at most 3 log₂² N,
while every randomized decision tree deciding it with error 1/3 (as the restriction to the
promise inputs of a total function F) has depth q with N ≤ q² log₂ N, so
q ≥ (N / log₂ N)^{1/2} = N^{1/2 - o(1)}.