The classical query complexity of Bernstein–Vazirani #
The Bernstein–Vazirani problem Bernstein, Vazirani, as stated in
de Wolf, §2.4.2: the input x ∈ {0,1}^N, with N = 2^n query positions identified
with the bit strings a ∈ {0,1}^n, is the truth table x_a = s ⬝ᵥ a of a linear function for an
unknown s ∈ {0,1}^n; the goal is to find s. The positions Fin N are identified with the bit
strings K → Bool by an equivalence e, and Cslib.QueryComplexity.linearTable e s is the input.
It is the Hadamard codeword of s read through e
(Cslib.QueryComplexity.linearTable_eq_hadamardCode_comp), so distinct strings have distinct
inputs (Cslib.QueryComplexity.linearTable_injective, from
Cslib.BitString.hadamardCode_injective).
Upper bound. Querying the n unit vectors reads off s coordinate by coordinate:
Cslib.QueryComplexity.linearDecode e recovers s from linearTable e s
(Cslib.QueryComplexity.linearDecode_linearTable), and the decision tree
Cslib.QueryComplexity.linearDecodeTree e computes it with depth at most n.
Lower bound. The 2^n inputs have distinct answers, and a decision tree of depth q takes at
most 2^q values. So every deterministic decision tree recovering s has depth at least n
(Cslib.QueryComplexity.card_le_depth_of_linearTable), and every randomized decision tree that
recovers s with error at most ε on every input has depth q with 2^n (1 - ε) ≤ 2^q
(Cslib.QueryComplexity.linearTable_randomized_lower_bound); for ε < 1/2 this forces q ≥ n
(Cslib.QueryComplexity.card_le_depth_of_linearTable_randomized). The search problem is a promise
problem, so the lower bounds take any total F that answers s on the inputs linearTable e s.
Hence the deterministic complexity and every bounded-error randomized complexity of
linearDecode e are exactly n (Cslib.QueryComplexity.complexity_linearDecode,
Cslib.QueryComplexity.randomizedComplexity_linearDecode), against the single quantum query of
CslibFrontier/Computability/QueryComplexity/Quantum/BernsteinVazirani.lean. de Wolf §2.4.2 notes
that classically n queries are needed; the counting argument and its randomized form are
formulated here.
Main definitions #
Cslib.QueryComplexity.linearTable: the truth table of the linear functiona ↦ s ⬝ᵥ a.Cslib.QueryComplexity.linearDecode: read offsat the unit vectors.Cslib.QueryComplexity.linearDecodeTree: the decision tree querying the unit vectors.
Main results #
Cslib.QueryComplexity.card_le_depth_of_linearTable: a deterministic tree recoveringshas depth at leastn.Cslib.QueryComplexity.linearTable_randomized_lower_bound:2^n (1 - ε) ≤ 2^q.Cslib.QueryComplexity.card_le_depth_of_linearTable_randomized: depth at leastnfor errorε < 1/2.Cslib.QueryComplexity.complexity_linearDecode,Cslib.QueryComplexity.randomizedComplexity_linearDecode:D = R_ε = nfor0 ≤ ε < 1/2.
References #
Decoding the truth table of a ↦ s ⬝ᵥ a recovers s.
The decision tree that queries the n unit vectors and outputs the decoded string.
The unit-vector tree computes linearDecode e on every input.
The unit-vector tree has depth at most n.
The deterministic lower bound for Bernstein–Vazirani: a decision tree that recovers s
from the truth table of a ↦ s ⬝ᵥ a for every s has depth at least n.
The randomized lower bound for Bernstein–Vazirani: a randomized decision tree that
recovers s from the truth table of a ↦ s ⬝ᵥ a with error at most ε for every s (as the
restriction of a total function F) has depth q with 2^n (1 - ε) ≤ 2^q.
Bounded-error randomized decision trees need n queries for Bernstein–Vazirani: for error
ε < 1/2, a randomized decision tree that recovers s from the truth table of a ↦ s ⬝ᵥ a has
depth at least n.
The deterministic query complexity of Bernstein–Vazirani is n.
The bounded-error randomized query complexity of Bernstein–Vazirani is n, for every error
0 ≤ ε < 1/2.