Manuscript Offprint
arXiv:2610.24518Exact Quantum Query Complexity of the Five-Bit Symmetric Boolean Function
Abstract
Let be the Boolean function that equals 1 exactly on inputs of Hamming weight 3 or 4. Earlier numerical studies reported success probabilities close to one using three queries, but the existence of an exact three-query algorithm had remained unresolved. This paper settles this problem by proving that the exact quantum query complexity of f is 4. For the lower bound, we express every three-query algorithm through layer-by-layer Gram matrices of low-degree Fourier coefficients. We then construct a fixed rational dual certificate whose slack matrices are all positive definite. This certificate separates the necessary Gram-matrix region from the exact-output condition and therefore rules out every exact algorithm using at most three queries in the stated model. The positivity verification reduces to five small rational matrices and Sylvester's criterion. For the upper bound, we invoke the previously known four-query algorithm for the seven-bit function and apply the standard padding reduction. To quantify the near-exact behavior, we use the same certificate to derive a valid, though not claimed tight, lower bound on the worst-case error of every algorithm using at most three queries. This positive error gap is compatible with the near-unit success probabilities reported in earlier numerical studies, which do not establish exact computation.
Keywords: exact quantum query complexity; symmetric Boolean functions; Gram matrices; semidefinite certificates; sum-of-squares representations.
*Corresponding authors: Guoliang Xu (xu1guo2liang@foxmail.com).
1 Introduction
The exact quantum query complexity measures the minimum number of oracle calls needed to compute a Boolean function correctly with probability one on every input. It differs from the usual bounded-error query complexity, which allows a certain probability of error. Exact complexity is usually harder to determine because numerical methods, even when they give highly accurate results, cannot directly prove exactness.
For small functions, numerical methods such as semidefinite programming can find highly accurate algorithms, but rounding a numerical output to 1 does not constitute a rigorous proof. In this paper, we resolve the remaining three-versus-four gap by combining the previously known four-query upper bound with a new impossibility certificate for every algorithm using at most three queries in the stated model.
We study the function
where . Methodologically, we rely on the polynomial representation of Beals et al. The amplitudes of a T-query algorithm are multilinear polynomials of degree at most T, and hence its acceptance probability has degree at most 2T [1]. Nisan and Szegedy [2] established foundational relations between polynomial degree and classical decision-tree complexity. Gram-matrix and semidefinite-programming formulations of query algorithms were developed by Barnum, Saks, and Szegedy [3], and are closely related to adversary methods [4, 5, 6]. Špalek and Szegedy [7] proved the equivalence of the then-known adversary formulations. These tools provide the foundation for the exactness arguments in this paper.
Numerical studies of small exact-query problems include Montanaro, Jozsa, and Mitchison [8] and Uyanik [9]. The work of Montanaro, Jozsa, and Mitchison first appeared as an arXiv preprint in 2011; its journal version appeared in Volume 71 of Algorithmica in 2015 [8]. Appendix A.2 of the 2011 preprint lists the five-bit symmetric function with weight-value vector , indexed by Hamming weights . This is exactly the function studied here. Its three-query entry is 1; under the authors' stated convention, this denotes a solver-reported success probability greater than 0.999, rather than an exact value of one [8, arXiv v1, Appendix A]. This numerical evidence therefore neither proves nor disproves the existence of a three-query exact algorithm. Uyanik later studied exact query complexity using a generalized SDP approach [9]. Ambainis, Iraids, and Nagaj [10, Theorem 1] proved that for . Taking gives a four-query algorithm for . Since , padding with two fixed zeros yields . Combined with the elementary lower bound, the exact complexity of the present function is therefore either three or four.
He, Sun, Yang, and Yuan studied the related partial weight-decision problem using Chebyshev polynomials and a quantum-padding technique, but their promise-function results are distinct from the present total-function certificate [11]. Xu and Qiu [12] studied the relation between SOS representations and exact quantum query algorithms. For the present function, they showed that two specific pairs of SOS representations of and cannot produce an exact three-query algorithm through their construction. This excludes those representations within that construction, but does not determine . Yao and Ye [13] obtained tight results for additional subfamilies of , where the function equals 1 exactly when . Their new EXACT results include the cases with , and with and . These cases do not include the adjacent-weight instance considered here. Podder, Yao, and Ye studied fine-grained quantum and randomized query complexity for symmetric functions, including success probabilities close to 1/2; that broader setting provides context for, but does not replace, the present exact certificate [14].
Structural results for functions with low exact quantum query complexity provide another relevant line of work. Xu and Qiu [15] gave necessary and sufficient conditions for partial Boolean functions to have exact quantum query complexity one. Qiu and Xu [16] reviewed exact one-query algorithms and constructed a partial Boolean function that can be computed with one quantum query but not by the Deutsch–Jozsa algorithm. Xu and Qiu [17] developed polynomial representations under an equivalence relation for such functions and analyzed instances on up to four input bits. For two queries, Ye, Yang, and Huang [18] studied the classification of Boolean functions with exact quantum query complexity two. Their classification relies on the correctness of the numerical classification for four-bit functions.
Earlier exact results for EXACT and THRESHOLD functions are due to Ambainis, Iraids, and Smotrovs [19]; Midrijanis studied general total Boolean functions [20]. For promise functions defined by weight layers, Qiu and Zheng [21] studied a generalization of the Deutsch–Jozsa problem and its optimal quantum algorithm. Xu et al. [22] studied the classical randomized decision tree complexity of the Deutsch–Jozsa problem and a generalization, highlighting the role of allowed error in comparisons between classical and quantum query complexity.
Wu, Hou, Zhang, Li, and Zeng [23] developed variational learning methods for quantum query algorithms and numerically investigated additional EXACT instances, including non-central adjacent-weight cases. These numerical studies provide further motivation for exact certificates that distinguish near-unit success probabilities from exact computation. Taken together, these results motivate the universal three-query certificate developed below.
The main difficulty is to rule out every three-query process, rather than only a particular circuit ansatz. Equivalently, proving amounts to excluding every exact algorithm using at most three queries in the stated model. We therefore retain pairwise final-state inner products in a low-degree Fourier basis and use a fixed rational certificate to separate the resulting necessary region from exact-output Gram matrices. The certificate applies to arbitrary finite-dimensional ancillas, arbitrary complex amplitudes, and arbitrary input-independent unitaries; symmetry is used only to compress the certificate and its verification.
The main theorem resolves this three-versus-four gap.
Theorem 1.1. For the function f in (1.1), the exact quantum query complexity in the standard model is
The new ingredient is an explicit rational dual certificate excluding every exact three-query algorithm. The four-query upper bound is inherited from prior work.
The remainder of the paper is organized as follows. Section 2 introduces the phase-query model, Fourier notation, the necessary Gram recurrence, and the dual infeasibility lemma. Section 3 gives the explicit rational certificate, compresses its verification using permutation orbits, proves positivity of all slack matrices, and combines these ingredients to complete the proof of the main theorem. Section 4 records the symmetric degree-three SOS representation and derives the quantitative lower bound on the error of every algorithm using at most three queries. Section 5 concludes the paper. Appendix A collects the standard background and notation used throughout. The remaining appendices contain the expanded Fourier–Gram and telescoping proofs, the block-matrix positivity calculations, and the exact verification protocol, followed by the complete embedded source code.
2.1 Phase queries and Fourier notation
Let and write . The standard bit query is
Here is the query-index register, is the answer bit, and denotes the workspace; denotes XOR, i.e. addition modulo 2. In the Hadamard basis of the answer qubit, is unchanged and acquires the phase . We therefore use the equivalent phase-query model with a virtual index 0 and :
The conversion is coherent and preserves the original registers in the workspace. To simulate a bit query, compute a fresh phase-query index: use index 0 on the answer branch and index i on the branch. Apply the phase query and uncompute the fresh index. Conversely, retain the original phase-query index in the workspace. For , prepare a fresh bit-query register with index i and answer state ; for , use the fixed legal index 1 and answer state . Apply one bit query and uncompute the auxiliary registers. These input-independent reversible operations implement both simulations with one oracle call, so the two models have the same query complexity. All other operations are arbitrary input-independent unitaries on an arbitrary finite-dimensional workspace. Intermediate measurements and internal randomness may be purified and stored coherently. This state-decomposition viewpoint is closely related to the output-Gram description studied by Grillo and Marquezino [24]. The standard query-model reductions used in this paragraph are summarized in Appendix A.2.
For , let
be the Fourier character, and set
Let be . Character orthogonality gives
We use [1] and [-1] for matrices. Put , for , and let . Throughout this section, an unqualified sum over means . We write for the identity matrix and for the identity operator. Let denote the indicator of a condition (equal to 1 when holds and 0 otherwise). For , define
Thus maps a coefficient vector of degree at most t to one of degree at most . Then, for ,
because . The matrices describe the query in coefficient space, while describes the same operation on value vectors. We write below.
The ordering of X and of each subset family is arbitrary but fixed. Changing these orderings permutes the corresponding rows and columns. For square matrices whose rows and columns are indexed by the same family, this is conjugation by a permutation matrix. The rectangular matrices and instead undergo the corresponding row and column permutations. All identities and positivity statements are invariant under these changes. The characters satisfy
where is symmetric difference. For , choose an element of and pair inputs differing in that coordinate; the corresponding character product changes sign. This proves the orthogonality relation and explains why has orthonormal columns. The resulting Fourier identities are collected in Appendix A.3 for reference.
The definition of is well posed because . For a coefficient vector ,
(2.9)
Thus and are the coefficient-space and value-space forms of the same query action.
2.2 A necessary condition for three queries
With this notation in place, we now translate an arbitrary three-query computation into necessary algebraic constraints. The Gram-matrix facts used in the next lemma are reviewed in Appendix A.4. The measurement and output-orthogonality fact used in the exact-output clause is summarized in Appendix A.5.
Lemma 2.1 (Gram recurrence). Let . Every algorithm making at most three queries gives complex Hermitian positive semidefinite (PSD) matrices
(2.10) satisfying
Here is the Gram matrix of the purified final states. If the algorithm computes exactly, then whenever .
Proof. Purify the initial state, internal randomness, and intermediate measurements. If a branch stops early, add a virtual index-0 query, which acts as the identity and therefore does not change the computation. Thus the computation has three phase-query slots.
Let be the state before the st query. By induction there are input-independent vectors such that
The base case is the input-independent initial state. A query multiplies a branch by and sends to , increasing the degree by at most one; an input-independent unitary only takes linear combinations of coefficient vectors.
Define
These matrices are Gram matrices, hence positive semidefinite even when the vectors and amplitudes are complex. Initial normalization gives (2.11). Equality of the input-state inner products immediately before and after an input-independent unitary, together with (2.7) and , gives (2.12). The final query gives (2.13).
For exact computation, let be the effects of a positive-operator-valued measure (POVM), with , and let correspond to output 0. If , then , so ; if , then . Consequently . The lemma is a necessary condition; no converse is needed in the lower-bound proof.
The full seven-step derivation is collected in Appendix B.
Remark 2.2. The matrices retain all pairwise input inner products through the coefficient Gram structure. Looking only at diagonal acceptance probabilities would lose the recurrence. The dimensions 1, 6, 16 depend on the Fourier degree, not on the ancilla dimension.
2.3 A dual infeasibility certificate
The Gram recurrence describes the semidefinite feasibility region forced by any three-query computation. We next construct a dual certificate that rules out this entire region under the exact-output condition. The separating-functional interpretation of this certificate is explained in Appendix A.6.
Lemma 2.3 (Dual certificate). Let , , and be real symmetric matrices, and take . Assume whenever . Define
If the six matrices at each layer are positive semidefinite, then no exact algorithm making at most three queries can compute .
Proof. Assume a three-query exact algorithm and its matrices . Because both and are PSD, ; this remains true for complex Hermitian because . Summing over and using the recurrence telescopes all terms. The terms involving and cancel by (2.12), leaving only the initial condition and the final Gram term:
(2.18)
(2.19)
The trace is . If , then ; otherwise exactness gives . Hence , while the left side is nonnegative, a contradiction.
Arunachalam, Briët, and Palazuelos [25] characterize quantum query algorithms through completely bounded forms. The proof above instead proceeds directly from the necessary Fourier–Gram constraints and the displayed telescoping identity. The expanded trace calculation is collected in Appendix B.
Thus the lower-bound problem has been reduced to constructing one certificate and verifying its positive semidefiniteness. Section 3 gives this certificate explicitly and proves the required positivity statements.
3 The Rational Certificate and the Main Theorem
This section constructs the dual certificate required by Lemma 2.3 and completes the proof of the main theorem. The certificate consists of real symmetric matrices , specified by two rational orbit tables. We first express the lower-bound problem as a finite-dimensional dual functional and define the slack matrices. We then give the certificate data, use symmetry to compress the eighteen slack matrices to six representatives, compute the required Fourier entries exactly, and verify positive definiteness via Sylvester's criterion. To conclude, we combine the resulting lower bound with the known four-query upper bound to prove .
3.1 Certificate as a finite-dimensional dual witness
The necessary conditions in Lemma 2.1 define a finite-dimensional semidefinite feasibility region. If an exact algorithm exists, it produces a point in this region. The lower-bound proof uses only this implication and makes no converse claim. Fix and real symmetric matrices , and define the slacks as in Lemma 2.3. Set
The second equality follows from the initialization , the Gram recurrence, and the terminal Gram identity in Lemma 2.1. If vanishes on equal-label pairs, exactness gives , whereas PSD slacks give .
One may interpret and as variables of an SDP dual, but the proof does not use strong duality or strict feasibility of an abstract program. It directly verifies a fixed collection of rational matrices and exact inequalities. Numerical optimization can be used to discover a candidate, but the theorem depends only on the recovered rational data. This distinction prevents numerical near-feasibility from being confused with an exact algorithm.
3.2 Certificate data and orbit tables
We now specify the certificate data. Take . For , , set
and define using Table 1. Define . For inputs , let
and set using Table 2; all unlisted orbit coefficients are zero. In Table 1, a dash indicates an orbit type that does not occur among the indices of . All three matrices are real symmetric and invariant under simultaneous permutations of the five coordinates. Every listed orbit type in Table 2 contains one weight in and one weight outside it, so is supported on cross-label pairs, meaning pairs with .
Table 1: Orbit coefficients for and .
| -39160 | -58360 | |
| 1526355 | 1526355 | |
| - | -1298831 | |
| -1313423 | -1313423 | |
| -23040 | -42240 | |
| - | 1021083 | |
| - | 1526355 | |
| - | -2518478 | |
| - | -1320335 | |
| - | -33792 |
The nonzero coefficients of are listed in Table 2.
Table 2: Nonzero orbit coefficients for .
| (a, b, c) | |
|---|---|
| (0, 3, 0) | 21447408 |
| (0, 4, 0) | -31637000 |
| (1, 3, 0) | -11962875 |
| (1, 3, 1) | -16148508 |
| (1, 4, 0) | 16286060 |
| (1, 4, 1) | 24857047 |
| (2, 3, 0) | 5451300 |
| (2, 3, 1) | 6655097 |
| (2, 3, 2) | 7901158 |
| (2, 4, 1) | -12204683 |
| (2, 4, 2) | -15383580 |
| (3, 5, 3) | 10457368 |
All entries are specified by orbit data; no numerical sampling is involved.
The two orbit tables completely specify the certificate. We next explain how permutation symmetry reduces the verification and how the remaining Fourier entries are computed exactly.
The orbit tables above provide the complete rational data needed to reproduce the certificate verification. The proof itself reconstructs the certificate over and verifies strict positivity by exact rational decompositions and Sylvester's criterion. In particular, a small negative floating-point eigenvalue is never treated as zero, and numerical failure of one construction is never used as an impossibility argument. Symmetry reduction for semidefinite and SOS problems is developed by Gatermann and Parrilo [26]. Methods for recovering rational SOS decompositions from numerical output are studied by Peyrl and Parrilo [27]. Here the displayed rational certificate is verified directly by exact arithmetic.
3.3 -orbit compression
Let act on the input coordinates. For , let be the input permutation chosen so that , and let act on subset indices by , where is a standard basis vector. Extend by setting . Then
Since and are invariant, the slack matrices for nonzero indices are related by permutation congruence. It is therefore enough to check and ; the remaining indices follow by swapping coordinate 1 with coordinate .
The parameters classify subset-pair types up to coordinate permutations and exchange of the two subsets. Similarly, classifies input-pair types up to coordinate permutations and exchange of the two inputs. For fixed , the number of ordered pairs satisfying , , and is
When , the pairs with and form a second ordered orbit of the same size. Thus a sorted type contains ordered pairs when , and when . This explains the factor 2 used for the nonzero types in Table 2.
3.4 Fourier matrix entries
We now compute the Fourier transform of exactly, which determines the final-layer slack matrices. For , write the ordered parameters , , and ; these are unrelated to the query-index notation . Define
(3.7)
Let denote the twelve orbit triples listed in Table 2. If denotes coefficient extraction, then
Indeed, for one coordinate the four cases contribute
respectively. Grouping coordinates by membership in S and R gives . Thus the formula is an exact finite polynomial identity, with no normalization ambiguity.
Let , where the rows and columns are indexed by subsets in . Although in the terminal Gram formula, multiplication by a query character can raise the Fourier degree from two to three. Thus contains every coefficient needed below. The ordered values of in are not sorted; they retain the order of . Moreover,
This identity determines every final-layer entry once is known. For from (3.6),
(3.11)
The factor in the second line is the average character product on the first coordinate within an orbit. Consequently and . Every other entry follows from the same coefficient-extraction identity, without enumerating floating-point eigenvalues.
3.5 Positivity and permutation reduction
The preceding formulas determine every entry of the final-layer slack matrices. We can therefore reduce their positivity to a small number of invariant blocks.
The matrices and C are invariant under simultaneous permutations of the five input positions. If denotes the induced permutation on subset indices, then
Consequently all nonzero-index slack matrices are permutation-congruent. The eighteen matrices reduce to the scalar representatives , , the identity matrix , and three nontrivial blocks
The pair-space decomposition used to derive these blocks is given in Appendix C. Appendix D gives their complete quadratic-form decompositions. The five small matrices are , , , , and ; all have strictly positive leading principal minors, so Sylvester's criterion proves . The remaining terms are positive multiples of squared norms. Hence all eighteen slack matrices are in fact positive definite, which proves the hypotheses of Lemma 2.3. The version of Sylvester's criterion used here is stated in Appendix A.7.
Proposition 3.1. The rational orbit tables above define a valid dual certificate: every is real symmetric positive definite, and therefore .
Proof. The block decompositions and exact principal minors are given in Appendix D; permutation congruence transfers positivity from the six representatives to all indices. The support condition for C was checked directly from the table. Lemma 2.3 then excludes all exact algorithms making at most three queries.
Proof of Theorem 1.1. By Proposition 3.1, . The upper bound is inherited from the previously known result of Ambainis, Iraids, and Nagaj: Theorem 1 gives ; in particular, it provides a four-query exact algorithm, which we use as a black box [10]. We now spell out the standard padding reduction. Set and pad the input by two fixed zero bits:
For completeness, the standard padding simulation is as follows. A seven-bit phase query can be simulated coherently with at most one five-bit query by preserving the original index and routing it to for and to for . Apply the five-bit query and reverse the routing. This works on arbitrary superpositions of indices and uses no extra query. Therefore , completing the proof.
4 SOS Representation and Approximate-Error Lower Bound
This section reviews a degree-three SOS representation of f and derives an error lower bound from the rational certificate. The SOS identity is a pointwise algebraic fact, whereas the error bound follows from constraints on the query process. The definitions of SOS degree and the distinction between pointwise SOS identities and query-process constraints are summarized in Appendix A.8.
4.1 The symmetric polynomial and its SOS representation
We first record the symmetric polynomial representation and then derive its fully symmetric SOS form. The elementary symmetric-polynomial calculation used here is recalled in Appendix A.1.
Let . On the layer , , so the six layer values determine the unique symmetric multilinear representation. The representation is
because on weight the right side is , equal to on all six layers. Thus .
For a nonnegative function on the Boolean cube, let be the least for which on , with real multilinear polynomials of degree at most . A degree-three SOS representation for this five-bit function is given by Xu and Qiu [12, Eq. (219)]. We record a canonical fully -symmetric form; the formal definition and the pointwise interpretation are given in Appendix A.8. Put
where denotes the same unordered pair. Define
Proposition 4.1. The function has SOS degree three, and the following is its fully -symmetric representation:
Proof. Start with a degree-three SOS representation of . Since whenever , each polynomial in the SOS vanishes on these inputs. Evaluating successively at inputs of weights 0, 1, and 2 shows that its constant, linear, and quadratic coefficients are zero. Hence every summand polynomial is a linear combination of the ten cubic monomials .
Let be the resulting Gram matrix in this basis, and let permute the pair coordinates according to . Define
Then and on the Boolean cube. Its entries have three values according as the indexing pairs are equal, intersect, or are disjoint. Evaluating the represented function on the weight-3, 4, 5 layers gives
so . Its eigenvalues on the constant, vertex, and row-sum-zero subspaces are 0, 5/12, 5/3, respectively.
The pair-coordinate decomposition gives
Moreover, the definition of gives for every . Thus the three displayed components are orthogonal: they are respectively the constant, vertex, and row-sum-zero components. The constant component is annihilated by , while the two other components contribute
(4.7)
This proves (4.4). Degree 2 is impossible because a sum of squares of degree-two polynomials has multilinear degree at most four, whereas . Hence . The representation above is a canonical fully -symmetric form of the degree-three SOS identity.
4.1.1 Spectral form and a pointwise check
We now verify the SOS identity directly on the six Hamming-weight layers and identify the spectrum of its Gram matrix.
The matrix M defined above has diagonal entries 1, entries for intersecting pairs, and entries 1/6 for disjoint pairs. Its eigenvalues on the constant, vertex, and row-sum-zero subspaces are, respectively,
The identity (4.4) is . If , all vanish. If , exactly one is one. If , exactly four coordinates equal 1, and their indexing pairs all contain the unique zero coordinate of , giving . If , the all-ones vector lies in the zero-eigenvalue subspace, giving zero. Thus the identity holds on every Boolean input.
Equivalently, if are the projections onto the constant, vertex-induced zero-sum, and row-sum-zero subspaces, then
For example, at one has and all other ; then , , so , , and the right side is .
Lee, Prakash, de Wolf, and Yuen [28] study SOS degree for symmetric quadratic functions. The identity above concerns the present degree-five function and is verified independently. As a pointwise identity, it does not specify the inner products between state components at different inputs, nor the inter-layer recurrence in Lemma 2.1. Therefore does not imply ; here .
4.2 A quantitative consequence for approximate algorithms
The SOS calculation is pointwise and does not establish feasibility of a three-query quantum process. We now return to the dual certificate of Section 3 and derive a quantitative lower bound for approximate algorithms.
Corollary 4.2. For an algorithm A, let denote its worst-case number of oracle queries, and let . Define the optimal worst-case error with at most three queries by
Every algorithm making at most three queries satisfies
and consequently .
Proof. The Gram recurrence holds for an approximate algorithm as well. Pairing it with the same certificate and using gives , hence , that is, . Let be the final POVM with . For , Cauchy–Schwarz gives
because for each output value , one of the two factors is an error amplitude at most , while the other is at most 1. Since is supported only on cross-label pairs, and every nonzero orbit in Table 2 has , each unordered cross-label input pair contributes the two ordered entries and . Define its entrywise absolute sum
Then , so
Thus . Taking the infimum over all algorithms with at most three queries gives . The trace is real because and are Hermitian; no complex-phase issue is hidden in the inequality.
The displayed constant is therefore a valid lower bound on the true optimal three-query error: it may be strictly smaller than , but it cannot be larger, and we do not claim equality or optimality. The bound depends on the present certificate norm , but it is a robust consequence of the same exact certificate: initialization and the Gram recurrence remain valid for approximate algorithms, the support of still connects only cross-label pairs, and each cross-label inner product is bounded by two measurement branches, one of which carries an error factor. No symmetry assumption is made about the approximate algorithm.
5 Conclusion
We have proved . The main new ingredient is a global rational dual certificate for the necessary Fourier–Gram constraints of every three-query process. It imposes no restriction on workspace dimension, amplitudes, intermediate measurements, or permutation symmetry, and it is finite and rational, so the lower bound is checkable by exact arithmetic rather than by numerical optimization. The upper bound is inherited from the previously known four-query algorithm for EXACT via the standard padding reduction. The degree-three SOS representation is a separate pointwise algebraic fact and does not imply a three-query algorithm; it gives a concrete separation between the SOS degree of f and its exact quantum query complexity, . The same certificate also yields the valid, though not necessarily tight, bound
for the optimal worst-case error of algorithms using at most three queries. Future work may seek the optimal value of and investigate analogous rational certificates for other adjacent-weight instances.
Appendix A Background and notation
This section collects standard definitions and elementary facts used in the proof. It is intended as a short guide for readers who do not routinely work with quantum query algorithms, Fourier characters, Gram matrices, or semidefinite certificates. None of the background facts in this section is claimed as a new result. The later appendices contain paper-specific derivations, certificate calculations, and exact verification details.
A.1 Boolean functions and multilinear polynomials
The Boolean cube is , and the Hamming weight of is . A polynomial is multilinear when every variable has exponent at most one. Every real-valued function on has a unique multilinear representation: reduce powers using , and then use the evaluations on the cube to determine the monomial coefficients [1, 2]. For a symmetric function, the value depends only on . The elementary symmetric polynomial
satisfies on the layer of weight . This is why the six layer values determine the representation in (4.1).
A.2 The query model and purification
A T-query quantum algorithm alternates input-independent unitaries with calls to an oracle. After padding an algorithm that uses fewer than T calls with identity calls, its final state can be written as
The workspace may be arbitrarily large, and the unitaries may depend on the algorithm but not on x. The usual bit oracle and the phase oracle are equivalent in the standard query model [3, 24]: in the answer-qubit Hadamard basis the bit oracle leaves unchanged and multiplies by , and routing the two components to a virtual index 0 and the queried index respectively yields (2.2). The original index and the answer-branch label are retained in auxiliary registers, so the routing is reversible. The auxiliary registers are uncomputed after the query. Thus the conversion uses the same number of oracle calls in both directions.
Randomness and intermediate measurements do not enlarge the model. Attach a register containing the random seed and measurement outcomes, keep it coherent, and defer the final measurement; this purification produces a unitary computation whose final measurement has the same output distribution. An early-stopping branch is completed with the virtual index-0 identity query. Thus the Gram constraints apply to every finite-workspace query algorithm, including algorithms with internal randomness or intermediate measurements.
A.3 Fourier characters
For , the Boolean Fourier character is
Characters multiply by symmetric difference and are orthogonal under the uniform sum:
The use of these characters as a query-adapted basis is standard in quantum query complexity [1, 3]. For the second identity, if , choose and pair every input with the input obtained by flipping . The two paired summands have opposite signs. If , every summand is 1. Consequently the character-evaluation matrix, divided by , has orthonormal columns. A phase query multiplies a character by , which sends the Fourier label to and raises its degree by at most one.
A.4 Gram matrices and positive semidefiniteness
Given vectors in a complex inner-product space, their Gram matrix is
Gram matrices and their use in query-complexity semidefinite formulations are standard; see, for example, Barnum, Saks, and Szegedy [3]. For every , is a squared norm, so is Hermitian positive semidefinite (PSD). In the query proof, the vectors are the Fourier coefficient vectors ; hence their Gram matrices retain all pairwise input information even when the workspace dimension is unrestricted.
If A and Z are PSD matrices of the same size, then
This elementary trace inequality is the only positivity fact needed when the algorithm's Gram matrices are complex Hermitian and the certificate matrices are real symmetric.
A.5 Measurements and exact output
A two-outcome measurement is described by effects with ; this is the standard output-measurement formalism used in the query model [3]. Exact computation means
For a PSD effect, expectation zero implies . Therefore, if , insert between the two final states and use Cauchy–Schwarz on each branch:
This is the output-orthogonality condition used in Lemma 2.1. For bounded error, the same calculation gives the cross-label estimate in (4.12).
A.6 Dual certificates as separating functionals
The recurrence in Lemma 2.1 defines a finite-dimensional necessary feasibility region for three-query algorithms, in the spirit of the Gram-matrix and semidefinite formulations of quantum query complexity [3]. A certificate chooses fixed matrices and so that the associated slacks are PSD and vanishes on equal-label input pairs. For every feasible Gram family, the recurrence makes the following expression telescope:
The left side is nonnegative by (A.6). Exact output makes on all pairs on which C is supported, so the right side is -1. This contradiction separates the necessary three-query region from the exact-output condition. The argument checks one explicit rational functional and does not require strong duality, a converse characterization of algorithms, or a restriction to symmetric algorithms.
A.7 Sylvester's criterion
For a real symmetric matrix , Sylvester's criterion states
where is the leading principal submatrix. The proof uses an elimination without pivoting: the successive pivots are ratios of consecutive leading principal minors, so positivity of all of them is equivalent to positive definiteness. In this paper the criterion is applied only to the five explicitly displayed rational matrices in Appendix D; all remaining terms in the quadratic-form decompositions are visibly nonnegative squares.
A.8 SOS degree and its limitation
For a nonnegative function g on the Boolean cube, its SOS degree is the least d for which there are real multilinear polynomials of degree at most d satisfying the pointwise identity
This is an algebraic identity evaluated separately at each input. It constrains the values of g but does not specify inner products between final states for different inputs, nor does it impose the layer-by-layer recurrence of the query Gram matrices. A degree-three SOS representation can therefore coexist with a four-query lower bound. The degree-three SOS representation underlying Section 4 is given in [12, Eq. (219)]. The fully -symmetric form displayed here is obtained by averaging its Gram matrix over coordinate permutations. For further SOS-degree results in the symmetric setting, see [28].
Appendix B Fourier–Gram and dual proofs
This appendix records the expanded derivations specific to the present certificate that are omitted from the main text. They are included for auditability; the main theorem uses the concise statements and proofs in Sections 2–3.
B.1 Proof of the Gram recurrence
For reference, the Fourier expansion used in the seven-step proof is
For completeness, the same derivation is organized below into seven labeled steps; this is an expanded restatement for auditability.
Step 1: uniform query form. Purify the initial state, all input-independent randomness, and every intermediate measurement record. An early-stopping branch is completed with the identity query at virtual index 0, so every branch has three query slots and the only input-dependent operation is .
Step 2: low-degree Fourier expansion. Write the state before query as
The expansion (B.1) follows by induction. At the state is independent of . If it holds at level , the phase query multiplies the th branch by and sends each character to ; the following input-independent unitary only forms linear combinations. This proves the degree bound for every algorithm, not just a searched ansatz.
Step 3: coefficient Gram matrices. Define
For every complex vector z,
Thus is a complex Hermitian PSD matrix, even when the algorithm uses arbitrary complex amplitudes. Its dimension is , independent of the workspace dimension.
Step 4: initial normalization. At level , only occurs. Hence
which is precisely .
Step 5: the layer recurrence. After the query with index i, the coefficient of character R is
Therefore the post-query coefficient Gram matrix is . The next input-independent unitary preserves the inner product of the complete state for every pair and merely redistributes these coefficients among the next query-index branches. Summing those branches yields (2.12).
The same argument can be written as a kernel identity. Before and after the input-independent unitary, the value-space Gram matrices are respectively
They are equal for every pair of inputs. Since , the matrix has full column rank; multiplying on the left by and on the right by therefore recovers the coefficient recurrence. This is why the proof uses all pairwise kernels rather than only diagonal norms.
Step 6: terminal Gram matrix. Before the third query, the ith branch contributes the value-space Gram kernel . The query conjugates this kernel by , and orthogonality of the query-index branches makes the final Gram matrix the sum in (2.13). Any later input-independent unitary leaves that Gram matrix unchanged.
Step 7: exact output orthogonality. Let the final POVM be , , with . If and , exactness gives
For a PSD operator , implies . Apply this first to and then to to obtain and . Hence . This completes the proof of the necessary condition.
B.2 Proof of the dual certificate lemma
It is useful to view as a potential on the state before the st query. The difference
compares the potential before a query with the potential after its coefficient-space action. The terminal slack incorporates the final Gram constraint.
For every PSD pair ,
(B.10) with no commutativity assumption. Summing the first two layers and using cyclicity gives
At the terminal layer,
Thus the complete telescoping identity is
Since , the support condition on C and cross-label orthogonality of G imply . Therefore
This contradicts (B.10). The certificate excludes the whole necessary feasible region, rather than one circuit ansatz or one SOS decomposition.
This is a finite-dimensional dual infeasibility proof. It does not invoke strong SDP duality or assume real amplitudes. The certificate is real and rational, whereas an arbitrary algorithm may have complex Hermitian Gram matrices.
Appendix C Orthogonal decomposition on pairs
This section provides the invariant decomposition used in the block calculations of Appendix D.
Lemma C.1. Let . We use the convention and for , so that row sums may be written without ordering restrictions. Every vector has a unique decomposition
The three components are mutually orthogonal, and
Their dimensions are 1, m - 1, and .
Proof. Let and . Set
Then and each row sum is zero. Conversely, any decomposition with these constraints satisfies , proving uniqueness. Orthogonality follows by summing the zero-sum conditions, and (C.2) follows from . The map is injective on the zero-sum subspace. The row-sum map has rank , so its kernel has dimension .
Example C.2. For m = 4, take and all other pair coordinates zero. The decomposition gives
and, in the order 12, 13, 14, 23, 24, 34,
For instance and ; every row sum of h is zero.
For later use, let and be arbitrary point-coordinate vectors with , , and zero-sum . Let be pair coordinates with zero-sum and row-sum-zero . If a point matrix has diagonal/off-diagonal entries , then
If a point-pair block has entry when and otherwise, then
If a pair matrix has entries d, e, g for equal, intersecting, and disjoint pairs, then
These formulas are obtained by separating constant, vertex, and row-sum-zero components and by counting equal, intersecting, and disjoint pairs; they are the elementary block calculations used below. In particular,
while the contribution from pairs avoiding is the negative of this quantity. For a fixed pair, the sum over intersecting -coordinates is and the sum over disjoint coordinates is , which yields the coefficient in (C.9). If the scalar-to-point and scalar-to-pair blocks have constant entries and , their contributions to the mean coordinates are and ; in a symmetric quadratic form, an off-diagonal block is counted twice.
Invariant-subspace interpretation. The pair-coordinate decomposition can also be expressed in terms of invariant subspaces.
The pair-coordinate space is the space of edge functions on the complete graph . Let consist of all vectors with and . Let consist of all pair vectors satisfying for every , with the convention . With 1 denoting the all-ones vector,
These three subspaces have dimensions 1, , and , respectively. Any matrix depending only on pair intersection size preserves them. This is the reason the large slack matrices reduce to small blocks and may also be viewed as the elementary -representation decomposition on two-subsets.
Appendix D Positivity and exact verification
We now verify positivity of the three nontrivial slack blocks.
In this appendix, the uppercase block symbols A, B, D denote slack blocks and should not be confused with the query-diagonal matrices . We set , , and . Their entries are obtained from the orbit tables and (3.8).
D.1 Block A
We first analyze the slack block A.
Order coordinates as , write , and put with . Then
where
The empty-set diagonal of A is 77/96 and its cross entries with singleton coordinates are zero. The singleton diagonal entries are 883/96, 14/5, 14/5, 14/5, 14/5; the cross entry between coordinate and any other singleton is -19/5, and between two of the remaining singletons is 9/5. Hence the zero-sum coefficient is 14/5 - 9/5 = 1, the mean coefficient is , and the cross term is .
D.2 Block B
We next analyze the block B, whose coordinates consist of the empty set, singleton subsets, and pair subsets.
Order coordinates as the empty set, singletons, and unordered pairs. The independent entry types are listed in Table 3.
Table 3: Entry types of .
Put and , so that . Apply Lemma C.1 to the pair coordinates to write , where and for every . Then
with
For example, the mixed entry in is , its second diagonal entry is , and the row-sum-zero coefficient is . The dimensions account for every coordinate.
D.3 Block
Finally, we analyze the block , whose invariant decomposition involves the largest coefficient block.
Let . Use coordinates for , respectively, with and for pair coordinates. Put , , , and . Thus . Apply Lemma C.1 on the index set to write , where and for every . The complete list of independent entry types of is given in Table 4. Different letters denote distinct elements of ; thus uses three distinct indices and represents intersecting pairs, whereas uses four distinct indices and represents disjoint pairs. In the pair entries, the first/second/third values correspond respectively to equal, intersecting, and disjoint pairs, or to the indicated membership cases.
Table 4: Entry types of .
| Entry type | Value |
|---|---|
The quadratic form is
where
Derivation of the block coefficients. The decompositions of and follow from the entry calculations given above. We therefore detail only the additional calculations for . For , the first row of follows from
The row-sum-zero (harmonic) coefficient is . These calculations explain how the three slack blocks reduce to the five displayed small matrices and positive multiples of squared norms. The dimensions are , so the decomposition covers all coordinates.
D.4 Leading principal minors
It remains to prove that the five coefficient matrices appearing above are positive definite.
For a symmetric matrix , let be the determinant of its leading principal block. The exact values listed in Table 5 are all positive:
Table 5: Leading principal minors.
Sylvester's criterion proves that all five small matrices are positive definite. Together with the positive coefficients in (D.1), (D.3), and (D.5), this proves strict positivity of , and hence of all eighteen slack matrices.
D.5 Exact verification procedure
The reported verification environment used Python 3.12.14 and SymPy 1.14.0. The script reconstructs from the orbit tables, forms by direct matrix multiplication, and constructs all eighteen slack matrices. Their positive definiteness is checked by exact decomposition with rational pivots. The block identities and the fifteen displayed leading principal minors are checked separately.
The script also verifies permutation congruence for all five nonzero query indices, the Fourier basis sizes 1, 6, 16, 26, every required Fourier sum against the generating-function formula, the polynomial and SOS identities on all inputs, and the certificate norm used in the error bound. All checks use integer or rational arithmetic. The complete implementation is given in Section D.6.
D.6 Complete Python source
The following listing contains the complete exact-arithmetic verification script embedded in this manuscript. It was tested with Python 3.12.14 and SymPy 1.14.0; no floating-point tolerance is used.
Listing 1: Embedded exact rational audit source
""Exact rational audit of the certificate for EXACT^5_{3,4}. Embedded source for the exact rational audit; shown here for reproducibility. Tested with Python 3.12.14 and SymPy 1.14.0. No floating point tolerance is used. All 18 slack matrices are checked directly. "" from itertools import combinations from collections import defaultdict import sympy as s
R = s.Rational
sets = [[m for m in range(32) if m.bit_count() <= t] for t in range(4)] sets = [sorted(v, key=lambda m: (m.bit_count(), m)) for v in sets] q = [0, 1, 2, 4, 8, 16] chi = lambda x, a: (-1)**((int(x) & int(a)).bit_count()) F = [s.Matrix(32, len(v), lambda x, j: chi(x, v[j])) for v in sets] assert tuple(len(v) for v in sets) == (1, 6, 16, 26)
h1 = {(0,0,0):-39160,(0,1,0):1526355,(1,1,0):-1313423,(1,1,1):-23040} h2 = {(0,0,0):-58360,(0,1,0):1526355,(0,2,0):-1298831, (1,1,0):-1313423,(1,1,1):-42240,(1,2,0):1021083, (1,2,1):1526355,(2,2,0):-2518478,(2,2,1):-1320335,(2,2,2):-33792} ct_rows = [(0,3,0),21447408),(0,4,0),-31637000),(1,3,0),-11962875, ((1,3,1),-16148508),(1,4,0),16286060),(1,4,1),24857047, ((2,3,0),5451300),(2,3,1),6655097),(2,3,2),7901158, ((2,4,1),-12204683),(2,4,2),-15383580),(3,5,3),10457368] assert len(ct_rows) == 12 and len({key for key, _ in ct_rows}) == len(ct_rows) ct = dict(ct_rows)
def orbit(a, b): a, b = int(a), int(b) return (*sorted((a.bit_count(), b.bit_count))), (a & b).bit_count())
H = [s.Matrix([[-1]])] + [ s.Matrix(len(sets[t]), len(sets[t]), lambda j, k: R(h[orbit(sets[t][j], sets[t][k])], 19200)) for t, h in [(1, h1), (2, h2)] ]
C = s.Matrix(32, 32, lambda x, y: R(ct.get(orbit(x, y), 0), 307200)) f = lambda x: int(x.bit_count() in (3, 4)) assert C == C.T assert all(C[x, y] == 0 for x in range(32) for y in range(32) if f(x) == f(y))
T = [[s.Matrix(len(sets[t+1]), len(sets[t]), lambda r, c: int(sets[t+1][r] == (sets[t][c] ^ qi))) for qi in q] for t in (0, 1)]
Z = [[H[t] - T[t][i].T * H[t+1] * T[t][i] for i in range(6)] for t in (0, 1)]
Z.append([])
for qi in q: Dchi = s.diag(*[chi(x, qi) for x in range(32)]) Z[2].append(H[2] + F[2].T * Dchi * C * Dchi * F[2])
for t in range(3): assert F[t].T * F[t] == 32 * s.eye(len(sets[t])) for i in range(6): M = Z[t][i] assert M == M.T _, piv = M.LDLdecomposition(hermitian=False) assert all(piv[j, j] > 0 for j in range(M.rows))
print('PASS: all 18 full slack matrices are positive definite over Q.')
assert Z[0][0] == s.Matrix([[R(499, 480)])] assert all(Z[0][i] == s.Matrix([[R(1, 5)])] for i in range(1, 6)) assert Z[1][0] == s.eye(6) for t in range(3): for i in range(1, 6): def swap(a): return a ^ (1 | (1 << (i - 1))) if ((a & 1) > 0) != ((a & (1 << (i - 1))) > 0) else a perm = [sets[t].index(swap(a)) for a in sets[t]] assert Z[t][i] == Z[t][1].extract(perm, perm)
print('PASS: scalar identities and all certificate permutation identities.')
A, B, D = 5 * Z[1][1], Z[2][0], 5 * Z[2][1] bt = {(0,0,0):R(33,10),(0,1,0):-R(1,50),(0,2,0):-R(181,200), (1,1,1):R(13,5),(1,1,0):-R(1,5),(1,2,1):-R(37,400), (1,2,0):-R(23,120),(2,2,2):R(141,25),(2,2,1):-R(481,600),(2,2,0):R(529,300)} assert B == s.Matrix(16, 16, lambda j, k: bt[orbit(sets[2][j], sets[2][k]))] dt = {('alpha', 'alpha'):R(845,96), ('alpha', 'beta'):-R(1,10), ('beta', 'beta'):R(1987,96), ('alpha', 'u'):-R(37,80), ('alpha', 'v'):R(14,5), ('alpha', 'w'):-R(5,8), ('beta', 'u'):-R(333,40), ('beta', 'v'):-R(1,10), ('beta', 'w'):R(11,3), ('u', 'u',1):s.Integer(26), ('u', 'u',0):-R(53,24), ('u', 'v',1):-R(37,80), ('u', 'v',0):-R(23,24), ('u', 'w',1):R(15569,120), ('u', 'w',0):-R(5317,40), ('v', 'v',1):R(76,5), ('v', 'v',0):-R(14,5), ('v', 'w',1):-R(249,40), ('v', 'w',0):R(5671,960), ('w', 'w',2):R(51129,20), ('w', 'w',1):R(59,80), ('w', 'w',0):-R(76619,30)}
def dtype(mask): return 'alpha' if mask == 0 else 'beta' if mask == 1 else 'u' if mask.bit_count() == 1 else 'v' if mask & 1 else 'w'
for j, mask_a in enumerate(sets[2]): for k, mask_b in enumerate(sets[2]): a, b = mask_a, mask_b ta, tb = dtype(a), dtype(b) if ta > tb: a, b, ta, tb = b, a, tb, ta key = (ta, tb) if ta in ('alpha', 'beta') else (ta, tb, (a & b & 30).bit_count()) assert D[j, k] == dt[key]
print('PASS: all entries in the printed B and D orbit tables.')
KA = s.Matrix([[R(883,96), -R(76,5)], [-R(76,5), R(164,5)]]) KBO = s.Matrix([[R(33,10), -R(1,10), -R(181,20)], [-R(1,10), 9, -R(38,5)], [-R(181,20), -R(38,5), R(306,5)]]) KB1 = s.Matrix([[R(14,5), R(119,400)], [R(119,400), R(787,200)]]) KDO = s.Matrix([[R(845,96), -R(1,10), -R(37,20), R(56,5), -R(15,4)], [-R(1,10), R(1987,96), -R(333,10), -R(2,5), 22], [-R(37,20), -R(333,10), R(155,2), -R(267,20), -R(191,5)], [R(56,5), -R(2,5), -R(267,20), R(136,5), -R(61,16)], [-R(15,4), 22, -R(191,5), -R(61,16), R(163,5)]]) KD1 = s.Matrix([[R(677,24), R(119,240), R(1576,3)], [R(119,240), 18, -R(11647,480)], [R(1576,3), -R(11647,480), R(61325,6)]]) blocks = {'KA': KA, 'KBO': KBO, 'KB1': KB1, 'KDO': KDO, 'KD1': KD1} expected = { 'KA': [R(883,96), R(42391,600)], 'KBO': [R(33,10), R(2969,100), R(1751083,2000)], 'KB1': [R(14,5), R(1748719,160000)], 'KDO': [R(845,96), R(41973071,230400), R(9849241061,2304000), R(2904628609513,92160000), R(3302635567136267,14745600000)], 'KD1': [R(677,24), R(29232239,57600), R(1052362152331,5529600)] } for name, M in blocks.items(): minors = [M[:j, :j].det() for j in range(1, M.rows + 1)] assert minors == expected[name] assert all(v > 0 for v in minors) print('PASS: all 15 printed leading principal minors.')
assert 3 + 24 + 5 == 16 assert 5 + 33 + 2 == 16
def split_pairs(vals, vertices): m = len(vertices) pairs = list(combinations(vertices, 2)) rows = {j: sum(vals[e] for e in pairs if j in e) for j in vertices} avg = sum(rows.values()) / m gamma = avg / (m - 1) b = {j: (rows[j] - avg) / (m - 2) for j in vertices} h = {e: vals[e] - gamma - b[e[0]] - b[e[1]] for e in pairs} return gamma, b, h
def quad(K, vs): v = s.Matrix(vs) return (v.T * K * v)[0]
za = s.symbols('a0:6') zz = s.symbols('z0:16') alpha, beta, *us = za gamma = sum(us) / 4 rhs = R(77,96) * alpha**2 + quad(KA, [beta, gamma]) + sum((u - gamma)**2 for u in us) assert s.expand(quad(A, za) - rhs) == 0
values = dict(zip(sets[2], zz)) alpha = values[0] verts = list(range(5)) us = {j: values[1 << j] for j in verts} beta = sum(us.values()) / 5 aa = {j: us[j] - beta for j in verts} vv = {(j, k): values[(1 << j) | (1 << k)] for j, k in combinations(verts, 2)} gamma, bb, hh = split_pairs(vv, verts) rhs = quad(KB0, [alpha, beta, gamma]) rhs += sum(quad(KB1, [aa[j], bb[j]])) for j in verts) rhs += R(1351, 150) * sum(v*v for v in hh.values()) assert s.expand(quad(B, zz) - rhs) == 0
J = list(range(1, 5)) beta = values[1] us = {j: values[1 << j] for j in J} vs = {j: values[1 | (1 << j)] for j in J} gamma = sum(us.values()) / 4 delta = sum(vs.values()) / 4 aa = {j: us[j] - gamma for j in J} bb = {j: vs[j] - delta for j in J} ww = {(j, k): values[(1 << j) | (1 << k)] for j, k in combinations(J, 2)} eta, cc, hh = split_pairs(ww, J) rhs = quad(KD0, [alpha, beta, gamma, delta, eta]) rhs += sum(quad(KD1, [aa[j], bb[j], cc[j]])) for j in J) rhs += R(121, 120) * sum(v*v for v in hh.values()) assert s.expand(quad(D, zz) - rhs) == 0 print('PASS: A, B and D quadratic-form identities for unrestricted symbolic vectors.')
def coefficients(S, Rmask): poly = {(0, 0, 0): 1} for j in range(5): u, v = chi(1 << j, S), chi(1 << j, Rmask) new = defaultdict(int) for key, value in poly.items(): for shift, sign in [((0,0,0),1), ((1,0,0),u), ((0,1,0),v), ((1,1,1),u*v)]: new[tuple(a+b for a, b in zip(key, shift))] += value * sign poly = new return poly
Q = F[3].T * C * F[3] for j, S in enumerate(sets[3]): for k, Rmask in enumerate(sets[3]): poly = coefficients(S, Rmask) value = sum(c * (poly.get((a,b,r),0) + poly.get((b,a,r),0)) for (a,b,r), c in ct.items()) assert R(value, 307200) == Q[j, k] assert Q[0, 0] == R(3043, 480) assert Q[sets[3].index(1), sets[3].index(1)] == R(24, 5) print('PASS: all 26 x 26 required Fourier sums, without normalization ambiguity.')
pairs = list(combinations(range(5), 2)) M = s.Matrix(10, 10, lambda j, k: 1 if j == k else -R(1,4) if len(set(pairs[j]) & set(pairs[k])) == 1 else R(1,6)) assert M.eigenvals() == {s.Integer(0):1, R(5,12):4, R(5,3):5} for x in range(32): w = x.bit_count() assert s.binomial(w,3) - 3s.binomial(w,4) + 5s.binomial(w,5) == f(x) ys = {e: s.Integer(int((x & (31 ^ ((1 << e[0]) | (1 << e[1])))) == (31 ^ ((1 << e[0]) | (1 << e[1]))))) for e in pairs} _, b, h = split_pairs(ys, list(range(5))) sos = R(5,4) * sum(vv for v in b.values()) + R(5,3) * sum(vv for v in h.values()) assert sos == f(x) == quad(M, [ys[e] for e in pairs]) print('PASS: degree-five polynomial and explicit degree-three SOS on all 32 inputs.')
L = sum(abs(v) for v in C) assert L == R(6616607, 320) assert R(1, 4) / L2 == R(25600, 43779488192449) print('Entrywise absolute sum L =', L) print('Every <=3-query algorithm has worst-case error >=', 1/(4*L2)) print('ALL EXACT CHECKS PASSED. This does not certify historical novelty.')
Statements and Declarations
Author Contributions. Conceptualization, G.X.; methodology, G.X., H.Z. and M.W.; validation, M.W., S.X. and M.L.; formal analysis, G.X.; investigation, G.X., H.Z. and M.W.; writing—original draft preparation, G.X., H.Z., M.W. and S.X.; writing—review and editing, G.X., H.Z., M.W. and M.L.; visualization, G.X., H.Z. and M.W.; supervision, G.X.; funding acquisition, G.X. All authors have read and agreed to the published version of the manuscript.
Funding. This research was funded by the National Natural Science Foundation of China, grant numbers 62272208 and 62572221.
Competing interests. The authors declare no competing interests.
Data and code availability. No external dataset was used. The complete rational certificate, all matrix data, and the exact-arithmetic verification code supporting the results are included in the manuscript and in Appendix D.6. The embedded source code uses integer and rational arithmetic and is included in the submitted TEx source. The reported audit was run with Python 3.12.14 and SymPy 1.14.0.
Use of AI tools: During manuscript preparation, the authors used OpenAI ChatGPT to assist with language editing, checking, reformulation of some derivations, and the search and computation of some numerical values. All AI-assisted mathematical content was independently verified and revised by the authors, who take full responsibility for the results and the final manuscript.
Ethics approval and consent to participate. Not applicable.
References
[1] R. Beals, H. Buhrman, R. Cleve, M. Mosca, and R. de Wolf. Quantum lower bounds by polynomials. Journal of the ACM 48(4), 778–797 (2001). https://doi.org/10.1145/502090.502097.
[2] N. Nisan and M. Szegedy. On the degree of Boolean functions as real polynomials. Computational Complexity 4(4), 301–313 (1994). https://doi.org/10.1007/BF01263419.
[3] H. Barnum, M. Saks, and M. Szegedy. Quantum query complexity and semidefinite programming. In 18th IEEE Annual Conference on Computational Complexity, 179–193 (2003). https://doi.org/10.1109/CCC.2003.1214419.
[4] A. Ambainis. Quantum lower bounds by quantum arguments. Journal of Computer and System Sciences 64(4), 750–767 (2002). https://doi.org/10.1006/jcss.2002.1826.
[5] B. W. Reichardt. Span programs and quantum query complexity: the general adversary bound is nearly tight for every Boolean function. In FOCS 2009, 544–551 (2009). https://doi.org/10.1109/FOCS.2009.55.
[6] T. Lee, R. Mittal, B. W. Reichardt, R. Špalek, and M. Szegedy. Quantum query complexity of state conversion. In FOCS 2011, 344–353 (2011). https://doi.org/10.1109/FOCS.2011.75.
[7] R. Špalek and M. Szegedy. All quantum adversary methods are equivalent. Theory of Computing 2(1), 1–18 (2006). https://doi.org/10.4086/toc.2006.v002a001.
[8] A. Montanaro, R. Jozsa, and G. Mitchison. On exact quantum query complexity. Algorithmica 71(4), 775–796 (2015). https://doi.org/10.1007/s00453-013-9826-8. Preprint: arXiv:1111.0475v1 [quant-ph] (2011).
[9] K. Uyanik. Evaluation of exact quantum query complexities by semidefinite programming. Quantum Information Processing 18, 177 (2019). https://doi.org/10.1007/s11128-019-2297-3.
[10] A. Ambainis, J. Iraids, and D. Nagaj. Exact quantum query complexity of EXACT . In SOFSEM 2017, LNCS 10139, 243–255 (2017). https://doi.org/10.1007/978-3-319-51963-0_19; arXiv:1608.02374v2.
[11] X. He, X. Sun, G. Yang, and P. Yuan. Exact quantum query complexity of weight decision problems via Chebyshev polynomials. Science China Information Sciences 66(2), 129503 (2023). https://doi.org/10.1007/s11432-021-3468-x.
[12] G. Xu and D. Qiu. From the sum-of-squares representation of a Boolean function to an optimal exact quantum query algorithm. Quantum Information Processing 20, 33 (2021). https://doi.org/10.1007/s11128-020-02975-0.
[13] P. Yao and Z. Ye. On the exact quantum query complexity of MOD and EXACT functions. Frontiers of Computer Science 19(4), 194901 (2025); online 2024. https://doi.org/10.1007/s11704-024-3770-4.
[14] S. Podder, P. Yao, and Z. Ye. On the fine-grained query complexity of symmetric functions. Computational Complexity 34, Article 3 (2025). https://doi.org/10.1007/s00037-025-00263-w; arXiv:2309.11279.
[15] G. Xu and D. Qiu. Partial Boolean functions with exact quantum query complexity one. Entropy 23(2), 189 (2021). https://doi.org/10.3390/e23020189.
[16] D. Qiu and G. Xu. Exact quantum 1-query algorithms and complexity. SPIN 11(3), 2140001 (2021). https://doi.org/10.1142/S2010324721400014.
[17] G. Xu and D. Qiu. Polynomial representation of general partial Boolean functions with a single quantum query. International Journal of Foundations of Computer Science, advance online publication (2026). https://doi.org/10.1142/S0129054126500012. Preprint first posted in 2021: https://arxiv.org/abs/2112.12416.
[18] S. Ye, W. Yang, and L. Huang. Characterization of exact two-query quantum algorithms. Information and Computation 298, 105166 (2024). https://doi.org/10.1016/j.ic.2024.105166.
[19] A. Ambainis, J. Iraids, and J. Smotrovs. Exact quantum query complexity of EXACT and THRESHOLD. In TQC 2013, LIPIcs 22, 263–269 (2013). https://doi.org/10.4230/LIPIcs.TQC.2013.263.
[20] G. Midrijanis. Exact quantum query complexity for total Boolean functions. arXiv:quant-ph/0403168v2 (2004). https://arxiv.org/abs/quant-ph/0403168.
[21] D. Qiu and S. Zheng. Generalized Deutsch–Jozsa problem and the optimal quantum algorithm. Physical Review A 97(6), 062331 (2018). https://doi.org/10.1103/PhysRevA.97.062331.
[22] G. Xu, D. Qiu, B. Zhang, T. Wang, and Y. Zhang. Randomized decision tree complexity of Deutsch–Jozsa problem and a generalization. Quantum Information Processing 23, 79 (2024). https://doi.org/10.1007/s11128-024-04292-2.
[23] Z. Wu, S.-Y. Hou, C. Zhang, L. Li, and B. Zeng. Variational learning algorithms for quantum query complexity. New Journal of Physics 26(3), 033024 (2024). https://doi.org/10.1088/1367-2630/ad309c.
[24] S. A. Grillo and F. L. Marquezino. Quantum query as a state decomposition. Theoretical Computer Science 736, 62–75 (2018). https://doi.org/10.1016/j.tcs.2018.03.017.
[25] S. Arunachalam, J. Briët, and C. Palazuelos. Quantum query algorithms are completely bounded forms. SIAM Journal on Computing 48(3), 903–925 (2019). https://doi.org/10.1137/18M117563X.
[26] K. Gatermann and P. A. Parrilo. Symmetry groups, semidefinite programs, and sums of squares. J. Pure Appl. Algebra 192(1–3), 95–128 (2004). https://doi.org/10.1016/j.jpaa.2003.12.011.
[27] H. Peyrl and P. A. Parrilo. Computing sum of squares decompositions with rational coefficients. Theoretical Computer Science 409(2), 269–281 (2008). https://doi.org/10.1016/j.tcs.2008.09.025.
[28] T. Lee, A. Prakash, R. de Wolf, and H. Yuen. On the sum-of-squares degree of symmetric quadratic functions. In CCC 2016, LIPIcs 50, 17:1–17:31 (2016). https://doi.org/10.4230/LIPIcs.CCC.2016.17.