An adversary for algorithms Troy Lee Rajat Mittal Ben W. Reichardt Robert ˇ Spalek § Abstract The general adversary bound is a semi-definite program that lower-bounds the number of input queries needed by a quantum algorithm to evaluate a function. It is known to be tight up to constant factors for functions (total or partial) with boolean output and binary input alphabet. We show that the general adversary bound is tight for any function whatsoever, with potentially non-boolean input or output alphabets. We also show that quantum query complexity exhibits a remarkable composition property: Q ( f (g(x 1 ),...,g(x n )) ) = O ( Q(f )Q(g) ) for any compatible functions f,g. This was previously known only in the boolean case. Both of these results are obtained by defining a new, but closely related, semi-definite program that we call the witness size. The minimization formulation of the witness size adds constraints compared with the general adversary bound to enable dual solutions to correspond to eigenvalue-zero eigenvectors of certain graphs. While the witness size can be strictly larger than the adversary bound, we show that it can be at most a factor of two larger. 1 Introduction Quantum query complexity measures the number of coherent, black-box queries to the input string needed to evaluate a function. Many quantum algorithms can be formulated in the query model, and the model has the further advantage that strong lower bounds can often be shown. One of the main techniques for placing lower bounds on quantum query complexity is the adversary method. The origins of the adversary method can be traced to the hybrid argument of Bennett et al. [BBBV97]. Ambainis developed the adversary method proper [Amb02] and subsequently many alternative formulations were given [HNS02, BS04, Amb06, Zha05, BSS03, LM04]—all later shown to be equivalent [ ˇ SS06]. Finally, the bound was modified to allow negative weights, resulting in a strictly stronger bound known as the general adversary bound [HL ˇ S07]. The general adversary bound of a function f , which we will denote as Adv ± (f ), can be written as a semi-definite program (SDP) and has pleasant properties, especially under function composition. A recent sequence of works [FGG08, CCJY09, ACR + 10, R ˇ S08] has culminated in showing that the general adversary bound characterizes, up to a constant factor, the bounded-error quantum query complexity of any function with boolean output and binary input alphabet [Rei10a, Rei10b, Rei10c]. Our work completes this picture by showing that the general adversary bound characterizes the bounded-error quantum query complexity of any function whatsoever. Theorem 1.1. Let f : D→ E, where D⊆ D n , and D and E are finite sets. Then the bounded-error quantum query complexity of f , Q(f ), satisfies Q(f )=Θ ( Adv ± (f ) ) . (1.1) Centre for Quantum Technologies, Singapore. Rutgers University and Center for Computational Intractability. School of Computer Science and Institute for Quantum Computing, University of Waterloo. § Google, Inc. 1 arXiv:1011.3020v1 [quant-ph] 12 Nov 2010