Span programs form a linear-algebraic model of computation, with span program "size" used in proving classical lower bounds. Quantum query complexity is a coherent generalization, for quantum algorithms, of classical decision-tree complexity. It is bounded below by a semi-definite program (SDP) known as the general adversary bound. We connect these classical and quantum models by proving that for any boolean function, the optimal "witness size" of a span program for that function coincides exactly with the general adversary bound.
A consequence is an optimal quantum algorithm for evaluating "balanced," read-once formulas over any finite boolean gate set. For example, the gate set may be taken to be all functions $\{0,1\}^k \rightarrow \{0,1\}$ with $k \leq 1000$. A formula is a tree whose nodes are associated to functions from the gate set. The notion of balance is technical, but it includes layered formulas. A previous quantum algorithm optimally evaluates formulas for which an optimal span program is given for each constant-size gate. However, span programs have been found only by hand. The SDP automates this procedure, and its value surprisingly always matches the lower bound. Other implications of the SDP include an exact composition rule for the general adversary bound, and that the general adversary bound upper-bounds the sign degree.
The connection can also be seen as half of a universality result for span programs. For any boolean function, there exists a span program with witness size at most the function's quantum query complexity. Conversely, solutions to the SDP give span programs, and therefore also new quantum algorithms---beyond evaluating formulas. Subsequent work has bounded the query complexity by the witness size, thus implying that the general adversary bound is tight.