Optimal one-shot quantum algorithm for EQUALITY and AND

We study the computation complexity of Boolean functions in the quantum black box model. In this model our task is to compute a function $f:\{0,1\}\to\{0,1\}$ on an input $x\in\{0,1\}^n$ that can be accessed by querying the black box. Quantum algorithms are inherently probabilistic; we are interested in the lowest possible probability that the algorithm outputs incorrect answer (the error probability) for a fixed number of queries. We show that the lowest possible error probability for $AND_n$ and $EQUALITY_{n+1}$ is $1/2-n/(n^2+1)$.


Introduction
In this paper we study the computational complexity of Boolean functions in the quantum black box model. It is a generalization of the decision tree model, where we are computing an n-bit function f : {0, 1} n → {0, 1} on an input x ∈ {0, 1} n that can only be accessed through a black box by querying some bit For and 0 ≤ ǫ < 1 2 we denote by Q ǫ (f ) the smallest number of queries for an quantum algorithm outputting f (x) with probability at least 1 − ǫ. Usually the ǫ is omitted from Q ǫ (f ) because it changes Q ǫ (f ) by a constant factor, and Q(f ) is called the bounded error quantum query complexity of f . This complexity measure is widely studied as most computational problems can be expressed in the query model. The most well known examples are by [3,8]. For the searching problem Grover's algorithm is exactly optimal as shown by [9].
However, if one is interested in computing functions with constant number of inputs (for example, as a part of small circuit), then it may be useful to fix the number queries and minimize the probability of an incorrect answer. In this paper we will be concerned with quantum algorithms performing at most 1 query, thus we introduce E (f ).
Definition 1. Let f be a Boolean function. Then let E (f ) be the minimum error probability for a quantum algorithm that calculates f using just one query, i.e., We will be focusing on two Boolean functions defined as follows: In her doctoral thesis [5] gave quantum algorithms showing that Our main result asserts that The proof can be summarized in a series of three inequalities: The first inequality can be proven using a characterization of symmetric sum-of-squares polynomials known as the Blekherman's theorem.
Theorem 4 (Blekherman). Let q(x) be the symmetrization of a polynomial p 2 (x) where p(x) is a multilinear polynomial of degree t ≤ n 2 andx = (x 1 , . . . , x n ). Then, over the Boolean hypercubex ∈ {−1, 1} n , where p t−j is a univariate polynomial that is a sum of squares of polynomials of degree at most t − j and |x| denotes the number of variables i : Even though it is an unpublished result, there are proofs -see [4] or Section 4 in this paper for a considerably shorter proof using representation theory.
The second inequality is trivial, since AND n (x 1 , . . . , x n ) = EQUALITY n+1 (x 1 , . . . , x n , 1), and so we can use an algorithm for EQUALITY n+1 to calculate AND n . The third inequality can be proved by constructing a quantum algorithm for the function EQUALITY n+1 . Since the algorithm is very simple we present it before the more involved proof of the first inequality.
If we compare E (f ) with the classical analogue, let us call it E C (f ), [5] has shown that E C (EQUALITY n ) = 1 2 and E C (AND n ) = 1 2 − 1 4n−2 .
2 Algorithm for EQUALITY Proof. We will prove that the following algorithm has the claimed error probability: x j n+1 |i 5: Perform a complete measurement 6: if the result is state |1 then 7: With probability 1 2 − n n 2 +1 output 0; otherwise output 1 8: else 9: Output 0 First, let us consider the case when EQUALITY n+1 = 1. In that case the state |1 will be measured with certainty and hence the probability to output the incorrect answer 0 is 1 2 − n n 2 +1 . If on the other hand the input is such that EQUALITY n+1 = 0, the algorithm has an opportunity to answer incorrectly only in the case it measures |1 . Denote by m := n+1 i=1 x i . The probability that the algorithm answers 1 is m n+1 2 · 1 2 + n n 2 +1 . The value of this expression is maximized when m = ±(n − 1) and so the probability to answer 1 on the worst kind of input (namely the input where only one bit is different from every other bit) is Proof. First, we will restrict the domain of the inputs of the AND n function to bit lists with Hamming weight of 0, n−1 or n. It turns out that this promise problem has the same optimal error probability. Consider any quantum algorithm computing AND n with error probability ǫ. Following the familiar reasoning of [1] we can write the probability that the algorithm outputs 1 as a sum-of-squares polynomial of degree at most 2: From Blekherman's theorem we obtain that by symmetrization there must exist a degree at most 2 univariate polynomial of the form A geometric representation of the potential regions where p(s) intersects s = 0, s = n− 1 and s = n is depicted in Figure 1. Clearly, a degree 0 polynomial p -a constant, would produce an error probability ǫ = 1 2 . Consider a degree 1 polynomial -a straight line. We will apply transformations to the line that . This line has a slope ǫ n−1 = 1−ǫ n and so ǫ = 1 2 − 1 4n−2 . Finally, consider a degree 2 polynomial p -a parabola. If the parabola is concave, we may reason similarly as in the line case, except, the point (n − 1, ǫ) must now be above the line passing through (0, 0) and (n, 1 − ǫ) and so the error probability is higher. If the parabola is convex, we consider further two cases. a) If the vertex of the parabola has s ≤ 0, then we perform the same vertical stretchings. Since the parabola now passes through (0, 0) we can describe it with an equation as 2 + bs where a > 0. Since the vertex of the parabola has s ≤ 0, the coefficient b must be non-negative. The smallest ǫ possible for such parabolas can be described through the system an 2 + bn such that From the equality we can express b = 1−a(n 2 +(n−1) 2 ) 2n−1 and hence a ≤ 1 n 2 +(n−1) 2 . Plugging it all into the objective function we have that 1 − ǫ ≤ an 2 + n(1 − a(n 2 + (n − 1) 2 )) 2n − 1 ≤ ≤ n 2 n 2 + (n − 1) 2 ≤ (n + 1) 2 2(n 2 + 1) = 1 2 + n n 2 + 1 b) If the vertex of the parabola has s ≥ 0 then clearly the vertex has to be in the interval s ∈ [0, n]. Therefore we use the property from Blekherman's characterization that the polynomial p(s) is non-negative in the interval s ∈ [0, n], i.e., the term i (a i s + b i ) 2 is non-negative everywhere and (n − s)s j c 2 j is non-negative for s ∈ [0, n]. Now we stretch the parabola horizontally with respect to line s = n until p(0) = p(n − 1). This will not increase ǫ and preserve the non-negativity in the interval s ∈ [0, n]. Next we stretch the parabola vertically with respect to line y = p(n) until p n−1 2 = 0. Again, this step does not increase ǫ. Finally, we stretch vertically with respect to y = 0 until p(0) = 1 − p(n). The last step preserved the vertex at ( n−1 2 , 0) so the parabola has an equation But from the equation p(0) = 1 − p(n) we obtain a n − 1 2 2 = 1 − a n + 1 2 2 ; a = 2 n 2 + 1 . Consequently,

⊓ ⊔
Interestingly, the proof only really requires the sum-of-squares characterization when n−1 2 is not an integer. The fact that the parabola p(s) is non-negative at s = n−1 2 is sufficient.

Proof of Blekherman's Theorem
In this section we prove Blekherman's theorem.
Theorem 4 (Blekherman). Let q(x) be the symmetrization of a polynomial p 2 (x) where p(x) is a multilinear polynomial of degree t ≤ n 2 andx = (x 1 , . . . , x n ). Then, over the Boolean hypercubex ∈ {−1, 1} n , where p t−j is a univariate polynomial that is a sum of squares of polynomials of degree at most t − j and |x| denotes the number of variables i :x i = −1.
Our proof utilizes concepts of representation theory. For a description of the core tools of representation theory that we require refer to the first two chapters of [7].

Group representation
Let H ℘ be a Hilbert space with basis statesx S (for all S ⊆ [n]) corresponding to monomials i∈Sx i . Then, the vectors in H ℘ correspond to multilinear polynomials in variablesx i . We consider a group representation of the symmetric group S n on H ℘ with transformations U π defined by U πxS =x π(S) . The irreducible representations contained in H ℘ are well known: Let S m (x 1 , . . . ,x n ) = i1,...,imx i1 . . .x im be the m th elementary symmetric polynomial. We use S 0 (x 1 , . . . ,x n ) to denote the constant 1.
See [2] for a short proof of Lemma 1.

Decomposition of q(x)
Let We associate p 2 (x 1 , . . . ,x n ) with the matrix (P S1,S2 ) with rows and columns indexed by S ⊆ [n], |S| ≤ t defined by P S1,S2 = a S1 a S2 . Let − → x be a column vector consisting of allx S for S : |S| ≤ t. Then, p 2 (x 1 , . . . ,x n ) = − → x T P − → x . This means that P is positive semidefinite. For a permutation π ∈ S n , let P π be the matrix defined by P π S1,S2 = a π(S1) a π(S2) and let Q = 1 n! π∈Sn P π be the average of all P π . Then, q(x) = − → x T Q − → x . Q is also positive semidefinite (as a linear combination of positive semidefinite matrices P π with positive coefficients).
We decompose Q = i λ i Q i with λ i ranging over different non-zero eigenvalues and Q i being the projectors on the respective eigenspaces. Since Q is positive semidefinite, we have λ i > 0 for all i.
We interpret transformations U π as permutation matrices defined by (U π ) S,S ′ = 1 if S = π(S ′ ) and (U π ) S,S ′ = 0 otherwise. Then, we have Since we also have we must have Q i = U π Q i U † π . This means that Q i is a projector to a subspace H i ⊆ H ℘ that is invariant under the action of S n . If H i is not irreducible, we can decompose it into a direct sum of irreducible subspaces − → x and it suffices to show the theorem for one polynomial q i,j (x) instead of the whole sum q(x).

Projector to one subspace.
Let H ℘,ℓ ⊆ H ℘ be an irreducible invariant subspace. We claim that the projection to the subspace H ℘,ℓ denoted by Π ℘,ℓ is of the following form: for some constant c.
Proof. If we restrict to the subspace H ℘,ℓ , then Π ℘,ℓ is just the identity I. On the right hand side, ρ ℘,ℓ is mapped to itself by any U π (since any U π permutes the vectors − → p i1,...,j b in some way). Therefore, all U π also map the eigenspaces of ρ ℘,ℓ to themselves. This means that, if ρ ℘,ℓ has an eigenspace V ⊂ H ℘,ℓ , then U π acting on V also form a representation of S n but that would contradict H ℘,ℓ being an irreducible representation. Therefore, the only eigenspace of ρ ℘,ℓ is the entire H ℘,ℓ . This can only happen if ρ ℘,ℓ is cI for some constant c.

Final polynomial
From the previous subsection, it follows that q i,j (x) is a positive constant times where S(x ′ ) is a symmetric polynomial of degree at most t − b. Instead of the sum, we consider the expected value of ( Since S is a symmetric polynomial, we have S(x ′ ) = S ′ (s ′ ) where S ′ is a polynomial of one variable s ′ , with s ′ equal to the number of variablesx ′ j = −1. Since there are b variablesx j = −1 that do not appear inx ′ , we have s ′ = s − b. This means that S ′ can be rewritten as a polynomial in s (instead of s ′ ).

Conclusion
In this paper we have shown that E (AND n ) = E EQUALITY n+1 = 1 2 − n n 2 + 1 .
There is a natural way to generalize E (f ) to any fixed number of queries t. We may denote it by E t (f ) and have From the numerical experiments of [6] it seems that the connection between EQUALITY n+1 and AND n goes much deeper.

Conjecture 1. For all positive integers t and n:
E t EQUALITY n+1 = E t (AND n ) .