Manuscript Offprint
arXiv:2609.05812Quantum Query Algorithms for the Constructive Diagonal Ramsey Theorem
Abstract
The constructive diagonal Ramsey problem asks, given adjacency-oracle access to an -vertex graph, for a clique or independent set of the order guaranteed by Ramsey's theorem. We give a bounded-error quantum algorithm that, for every and , finds and verifies a homogeneous -set using
edge queries with failure probability at most . At the Ramsey scale , this yields a homogeneous set of order using queries, improving on the queries of the explicit classical recursion and giving, to our knowledge, the first sublinear worst-case algorithm for the Ramsey relation. We also derive an quantum lower bound by a reduction from collision finding.
The algorithm runs the constructive recursion over implicit candidate sets. Each set is represented by a short conjunction of adjacency constraints and sampled using capped unknown-solution quantum search, and a scale-aware concentration schedule balances estimation accuracy against the increasing cost of sampling deeper sets. We complement the upper bound with an randomized lower bound, transported from the random-Painter analysis of online Ramsey numbers, which holds on the uniform distribution . On that distribution a greedy quantum search uses only queries, giving a provable polynomial quantum speedup for Ramsey search on random graphs. We also give an estimation-free size-biased recursion and extend it to every fixed number of edge colours.
1 Introduction
Ramsey's theorem guarantees that every graph on vertices contains a clique or an independent set of order . Its classical constructive proof [8] repeatedly chooses a pivot and restricts the candidate set to one of the pivot's two colour neighbourhoods; truncating each retained neighbourhood to half its current size, it finds a homogeneous -set with adjacency queries. The corresponding total search problem, RAMSEY, has been studied in proof complexity and in TFNP [15, 16, 14, 20, 13]: the input graph on vertices is given by a circuit or an oracle, and the target order is . The query complexity of this relation in the deterministic, randomized, and quantum models is posed as an open question in [13, Section III]. This paper answers the quantum question up to a polynomial gap and clarifies the lower-bound record on both the quantum and the classical side.
The central observation is that the candidate sets of the constructive proof need not be materialized. After rounds, membership in the current set is determined by the adjacency constraints imposed by the previous pivots. These short predicates allow quantum search to sample from the same recursion at substantially smaller query cost. The threshold is the natural scale for this recursive construction.
| model | input | lower bound | upper bound |
|---|---|---|---|
| randomized | worst case | [theorem 4.1] | [8] |
| randomized | [theorem 4.1] | [theorem 4.4] | |
| quantum | worst case | [theorem 4.5] | [theorem 1.2] |
| quantum | open | [theorem 4.3] |
Table 1: Bounded-error query complexity of finding a homogeneous set of order in a graph on vertices, in the worst case and on the uniform distribution ; here . The lower bounds are the random-Painter estimate of [5] and the collision reduction of [13] at multiplicity two (theorem 4.5 is stated for order and hence valid here).
Theorem 1.1 (Implicit-majority quantum Ramsey search). Let , , and . Given coherent edge-oracle access to a simple undirected graph on vertices, there is a quantum algorithm which, with probability at least , outputs a -clique or a -vertex independent set using
edge queries in the worst case. The algorithm verifies every returned witness and may output on the exceptional event.
At the succinct Ramsey scale, the theorem gives the following form.
Corollary 1.2. Let , , and . Given coherent edge-oracle access to a simple graph on vertices, one can find a clique or independent set of order using
edge queries in the worst case.
Proof. Set . Then , so theorem 1.1 applies, and , , and .
To our knowledge, this is the first sublinear worst-case query algorithm for the Ramsey relation in any model. Table 1 places it among the known bounds together with the further results of this paper.
An estimation-free recursion. Following the colour of a uniformly sampled edge selects a colour class with probability proportional to its size, and a one-dimensional survival recurrence shows that this recursion completes with probability greater than from vertices. This gives an -query algorithm without any majority estimation (theorem 3.2), which extends to every fixed number of edge colours (theorem D.1).
A randomized lower bound. Every randomized algorithm needs queries to find a homogeneous -set in a graph on vertices, even on the uniform distribution (theorem 4.1); this improves the black-box bound of [12, 14]. The proof transports the random-Painter weight estimate of [5] to the query model, with a self-contained version in section C.
A quantum speedup on random graphs. On , a greedy quantum neighbourhood search finds a -clique with queries (theorem 4.2). Together with the distributional form of the lower bound, this gives a polynomial separation between the quantum and randomized query complexities of the Ramsey relation on its natural hard distribution (theorem 4.3). We are not aware of an earlier provable quantum speedup for this relation. In the worst case, no separation is claimed: the randomized complexity is only known to lie between and .
The quantum lower-bound record. The paragraph of [13] that raises the query question also reports an quantum lower bound at the default parameters, obtained by composing its collision reduction with the multicollision lower bound of [18]. Theorem 1.1 shows that no such bound can hold at these parameters, and section 5 shows that the cited ingredients compose to an exponent of at most (at most under the parameter condition as printed), attained at multiplicity two. The resulting bound (theorem 4.5) is, to our knowledge, the best known quantum lower bound; the main theorems of [13] do not depend on the remark.
1.2 Techniques
Both algorithms represent the candidate set after round by the conjunction of the adjacency constraints generated by the first pivots, so a membership test costs edge queries, and sample it with capped unknown-solution search (theorem 2.2); conditional on success, permutation symmetry makes each sample exactly uniform. The scale-aware recursion estimates a near-majority colour at every pivot. Sampling a deep set is exponentially more expensive than sampling an early one, so we distribute a fixed error budget across the levels, doubling the allowed error every six levels; a product invariant then keeps every candidate set within a constant factor of its ideal size, and the query sum is dominated by the last levels.
The lower bound and the random-graph speedup both rest on the predictable size of common neighbourhoods in . A martingale weight argument in the style of [5] shows that an adaptive algorithm with queries exposes a monochromatic -set with probability at most for every , and optimizing gives the exponent ; a union bound shows that every -set has common neighbourhood of density about , so greedy quantum search costs predicate evaluations at depth .
Organization. Section 2 fixes the query model and the sampler. Section 3 presents the two recursions, their analysis, and the proof sketch of theorem 1.1; section 4 states the lower bounds and the random-graph speedup. Section 5 discusses related work and the reported lower bound, and section 6 lists open questions. All full proofs are in the appendices: the sampler and the encoding corollary in section A, the upper bounds in section B, the lower bounds and random-graph results in section C, and the multicolour extension, numerical illustrations, and AI disclosure in section D.
2 Oracle model and capped quantum sampling
Let be a promised simple undirected graph, extended symmetrically to ordered pairs with . Its coherent edge oracle acts as . Query complexity counts calls to ; reversible operations on vertex labels are free, as usual in the query model. The same asymptotic bound applies to the standard locally verifiable TFNP relation with arbitrary Boolean-circuit encodings.
Corollary 2.1 (Locally verifiable arbitrary encoding). The standard Ramsey TFNP relation that accepts either a local invalidity certificate or a locally verified homogeneous set has the same quantum-query upper bound as theorem 1.1.
The proof (section A) canonicalizes the circuit into a simple graph, runs theorem 1.1, and checks the entries induced by the output for a self-loop or an asymmetric pair. Our algorithms use the following consequence of unknown-solution quantum search [2], proved in section A; the analysis needs both bounded termination and exact conditional uniformity.
Lemma 2.2 (Capped uniform marked-item search). Let have density at least , and suppose its membership predicate costs edge queries. There is a quantum block which uses at most edge queries, succeeds with probability at least an absolute constant , and, conditional on verified success, returns an exactly uniform element of . The same predetermined cap makes the block terminate if the density promise is false or is empty. Moreover, independent uniform samples can be collected, except with probability , using a predetermined blocks whenever the density promise holds.
For comparison, the explicit classical recursion on vertices, , queries at level all edges from a pivot to the other candidates and retains exactly vertices of a majority colour, for queries in total. The quantum algorithms retain the entire selected colour class but access it only implicitly.
3 Implicit-set recursions and the main theorem
3.1 An estimation-free size-biased recursion
Set and , restrict the input to its first vertices, let , and fix any . At step , define . Apply the repeated capped search from theorem 2.2, with the universal density lower bound , to sample an exactly uniform ; abort if the fixed cap is exhausted. Query and set
After the final step, put . Among the labels , choose a colour that appears at least times, and return the corresponding pivots together with after directly verifying the induced edges. The algorithm never materializes : its membership predicate is the conjunction of the edge constraints imposed by the earlier pivots, together with the exclusions of those pivots, and costs edge queries. Repeating each capped block times reduces its conditional failure probability on a nonempty set to .
For integers , let be the infimum, over all graphs, candidate sets of size , and distinguished pivots in those sets, of the probability that the ideal size-biased recursion completes additional steps; set for , , and for .
Lemma 3.1 (Size-biased survival). For every and , , where . In particular, for and , the ideal recursion completes with probability at least .
The proof is an induction on : the sample selects the two colour classes of sizes with probabilities and , and collapses the resulting sum to one positive part. Exact conditional uniformity couples an implemented run to the ideal recursion, so charging each search failure probability leaves completion probability at least 0.49; counting tests per block, blocks per level, and queries per test then gives the following bound (section B).
Proposition 3.2 (Size-biased quantum recursion). Under the hypotheses of theorem 1.1, the estimation-free algorithm returns a verified homogeneous K-set with probability at least using edge queries in the worst case.
3.2 Scale-aware approximate majorities
The sharper recursion estimates a near-majority colour at each pivot. Fix input vertices, , and . For , define
and allocate
so that . The allowable error doubles once every six levels, matching the increasing cost of sampling the deeper candidate sets. Before round , the recorded pivots and colours define the exact implicit set
whose reversible membership predicate uses edge queries.
At round , use theorem 2.2 to obtain a verified pivot . Then collect, with replacement,
independent uniform samples from , query their edges to , and let be the observed fraction of colour 1. Set when and otherwise; appending this edge constraint to eq. (2) defines . After rounds, one final capped search returns . Select a colour that occurs at least times among , take any pivots carrying that colour, add , query all induced edges, and return the set only if this check confirms homogeneity. Every search and batch has a predetermined cap, so every execution terminates; a failed search or batch returns .
3.3 Analysis
Lemma 3.3 (Conditional near-majorities). Except with probability at most , every completed sampling batch reached after successful searches and an accurate prefix satisfies , where is the true colour-1 fraction from to .
Conditional on the classical history before level and on batch success, the samples are independent and uniform on a fixed set, so Hoeffding's inequality and eq. (3) bound the inaccuracy probability by ; a union bound over the first inaccurate level gives the lemma. Giving each of the searches and batches failure probability adds at most , so all searches and estimates are good with probability at least . Let , , and .
Lemma 3.4 (Variable recurrence and density). On every prefix satisfying theorem 3.3, and . Consequently is nonempty, for every sampling level , and .
An accurate majority retains at least a fraction of the non-pivot vertices, so ; the bound on follows from , the invariant propagates because , and makes the integer exceed 3/4 (section B).
Lemma 3.5 (Exact homogeneous output). Whenever the algorithm reaches its final verified output, that output is a K-clique or a K-vertex independent set.
Proof. For , the definition of gives and ; a colour occurring times among the colours therefore yields, with , a homogeneous -set, and the final direct check is independent of earlier errors.
Proof sketch of theorem 1.1. With probability at least all searches succeed and all estimates are accurate; then theorem 3.4 guarantees every density promise used by the sampler and the nonemptiness of , and theorem 3.5 gives a homogeneous output. A capped block at level uses membership tests of queries each, a batch uses blocks, and gives in eq. (1). With and , the batches cost
the amplified searches cost the same order, and gives . The full computation is in section B.
4 Lower bounds and a quantum speedup on random graphs
4.1 A randomized classical lower bound
The following bound is the random-Painter estimate of Conlon, Fox, Grinshpun, and He [5, proof of Theorem 1] for online Ramsey numbers, transported to the query model. Because that estimate concerns uniformly random colourings, the bound holds on the uniform distribution and not only in the worst case.
Proposition 4.1 (Randomized classical lower bound). Let and let . For every , every randomized algorithm that makes at most edge queries outputs a homogeneous -set of with probability at most . Consequently, for , every randomized edge-query algorithm that finds a homogeneous -set with worst-case probability at least uses queries.
The self-contained proof (section C) tracks, through the matching number of the queried graph, the conditional probability that a vertex set becomes a monochromatic clique: a T-query algorithm fully exposes a monochromatic K-set with probability at most for every integer , which is at most at , and otherwise some pair of the output is an unexposed fair coin, so the success probability is at most . The exponent improves the black-box bound of [12, 14]; no worst-case separation from theorem 1.1 is claimed.
4.2 A quantum speedup on random graphs
Proposition 4.2 (Quantum greedy search on random graphs). Let , , and , and let . There is a quantum algorithm which makes edge queries on every input, never outputs a set that is not a K-clique, and outputs a K-clique with probability at least over and its internal randomness, where satisfies for all .
With probability at least , every j-set with has at least common neighbours, and the algorithm then grows a clique one vertex at a time by the capped search of theorem 2.2 with density parameter at level j (section C.3): no majority estimation is needed and the depth is K rather than 2K - 3.
Corollary 4.3 (Separation on random graphs at the Ramsey scale). Let , , , , and .
-
A quantum algorithm making edge queries outputs a homogeneous -set of with probability at least .
-
Every randomized algorithm making at most edge queries outputs a homogeneous -set of with probability at most .
Since , the bounded-error quantum query complexity of the Ramsey relation on is polynomially smaller than its bounded-error randomized query complexity.
The corollary applies theorem 4.2 to the first vertices and theorem 4.1 to (section C.3).
Remark 4.4 (Classical greedy search). On the same expanding graphs, classical rejection sampling finds with trials of at most queries each, except with probability ; so for a classical greedy search outputs a verified -clique with probability at least using queries, the classical entry of table 1.
4.3 A quantum lower bound from collision finding
The reduction of Jain et al. [13, Lemma III.1], generalizing Komargodski, Naor, and Yogev [14], maps a function and a fixed graph on to the graph
on . Composed with the quantum collision lower bound, it gives the best quantum lower bound we know; section 5 compares it with the bound reported in [13]. A lower bound for target order applies a fortiori to every larger target.
Proposition 4.5 (Quantum lower bound from collision finding). Let with . Every quantum algorithm that, given coherent edge-oracle access to a simple graph on vertices, outputs a clique or independent set of order with probability at least on every input makes edge queries.
In the proof (section C.4), and is an Erdős graph on with no homogeneous set of order . Independent sets of have distinct -values and map to independent sets of , cliques map to cliques, so every homogeneous set of order at least contains two vertices with the same -value; a -query Ramsey algorithm therefore finds a collision of a random with queries, which requires [25].
5 Related work and the reported lower bound
Quantum algorithms for Ramsey problems. Quantum approaches based on adiabatic computation, annealing, or quantum counting search for colourings that establish or test Ramsey-number bounds [9, 1, 24, 22, 23, 21]; our input is one fixed graph given by an oracle. Generic quantum algorithms for clique, independent set, and fixed-subgraph containment [6, 4, 17, 26] and quantum backtracking [19] operate in a closer oracle model; quantum walks also give sublinear-query algorithms for fixed sub-hypergraph containment [10]. We are not aware of an earlier implementation of the Erdős–Szekeres recursion over implicit sets in the adjacency-query model.
Constructive Ramsey search. Ramsey search is connected to weak and structured pigeonhole principles [15, 16], its white-box hardness follows from collision-resistant hashing [14], and it belongs to the polynomial long-choice class PLC [20]. The closest matching query relation is studied in [13], which shows that it is not black-box reducible to PIGEON and raises the question of its query complexity in the deterministic, randomized, and quantum models. The online Ramsey game (see [5]), in which Builder queries edges and Painter answers adversarially, is the deterministic version of this question with an unbounded vertex set; its best known lower bound is the random-Painter bound used in theorem 4.1.
Comparison with a reported quantum lower bound. Model and parameter alignment. Definition II.6 of [13] uses vertices, and the convention following Definition II.7 sets the default target to . The unnumbered “Query complexity of RAMSEY” paragraph in Section III (p. 415) reports an quantum lower bound, based on its Lemma III.1 and the multicollision lower bound of [18]. Lemma III.1 produces the product graph eq. (4), a simple graph whose coherent queries cost queries to , so the reduction lies within our promise; theorem 2.1 covers arbitrary circuits, and theorem 1.2 meets the default target after discarding one vertex. The two formulations therefore align.
Exponent obtained by direct substitution. Let denote the multicollision range size and the number of vertices in the resulting Ramsey instance. For fixed multiplicity , the sufficient condition in Theorem I.3 of [13] is . At the boundary , the exponent of [18] transfers to as for , with equality at ; for , gives . Increasing relative to only reduces the transferred exponent, and the multicollision theorem is stated for fixed , so the cited result does not support a growing-multiplicity limit either. The printed condition is not tight: the proof of Lemma III.1 only uses that a homogeneous set of the product graph maps to at most values of , where is the forbidden order in , so a homogeneous set of order already forces a -collision, the reduction only needs , and the transferred exponent improves to , which is at and below for . Direct composition of the cited ingredients therefore yields an exponent at most , rather than ; theorem 4.5 is exactly this bound, and theorem 1.1 rules out an lower bound at these parameters. The remark is not used elsewhere in [13], and the black-box separation theorems of that paper are unaffected.
6 Discussion and open questions
The query improvement rests on storing each candidate set as the conjunction of the adjacency constraints created by earlier pivots, and on allocating estimation error according to the cost of each level. Table 1 leaves two central questions.
A worst-case quantum advantage. Can the quantum and randomized query complexities be separated in the worst case? The randomized complexity on vertices lies between and , while the quantum upper bound is . A randomized lower bound of would establish such a separation. The implicit-set recursion explains the difference between the available upper bounds: classical rejection sampling at depth needs membership tests, whereas quantum search needs .
The optimal quantum exponent. Is optimal in the worst case? The current quantum bounds are and . The final levels of the recursion search sets of constant size inside a universe of size , but these sets are defined by adjacency constraints, so the optimality of Grover search does not establish a lower bound for this relation.
Scope. The distributional separation on in theorem 4.3 and the multicolour bound in theorem D.1 hold under their stated contracts. Section D.2 reports small sanity-check experiments; the query bounds rest on the proofs in the appendices. The paper claims query bounds only, not gate complexity or hardware performance.
References
[1] Zhengbing Bian, Fabian Chudak, William G. Macready, Geordie Rose, and Frank Gaitan. Experimental determination of Ramsey numbers. Physical Review Letters, 111:130505, 2013. URL: https://arxiv.org/abs/1201.1842, arXiv:1201.1842, doi:10.1103/PhysRevLett.111.130505.
[2] Michel Boyer, Gilles Brassard, Peter Høyer, and Alain Tapp. Tight bounds on quantum searching. Fortschritte der Physik, 46(4-5):493–506, 1998. URL: https://arxiv.org/abs/quant-ph/9605034, arXiv:quant-ph/9605034.
[3] Herman Chernoff. A measure of asymptotic efficiency for tests of a hypothesis based on the sum of observations. The Annals of Mathematical Statistics, 23(4):493–507, 1952. doi:10.1214/aoms/1177729330.
[4] Andrew M. Childs and Jason M. Eisenberg. Quantum algorithms for subset finding. Quantum Information and Computation, 5(7):593–604, 2005. arXiv:quant-ph/0311038, doi:10.26421/QIC5.7-7.
[5] David Conlon, Jacob Fox, Andrey Grinshpun, and Xiaoyu He. Online Ramsey numbers and the subgraph query problem. In Building Bridges II: Mathematics of László Lovász, volume 28 of Bolyai Society Mathematical Studies, pages 159–194. Springer, 2019. URL: https://arxiv.org/abs/1806.09726, arXiv:1806.09726, doi:10.1007/978-3-662-59204-5_4.
[6] Sebastian Dörn. Quantum complexity bounds for independent set problems. arXiv preprint, 2005. URL: https://arxiv.org/abs/quant-ph/0510084, arXiv:quant-ph/0510084.
[7] Paul Erdős. Some remarks on the theory of graphs. Bulletin of the American Mathematical Society, 53(4):292–294, 1947. doi:10.1090/S0002-9904-1947-08785-1.
[8] Paul Erdős and George Szekeres. A combinatorial problem in geometry. Compositio Mathematica, 2:463–470, 1935. URL: https://eudml.org/doc/88611.
[9] Frank Gaitan and Lane Clark. Ramsey numbers and adiabatic quantum computing. Physical Review Letters, 108:010501, 2012. URL: https://arxiv.org/abs/1103.1345, arXiv:1103.1345.
[10] François Le Gall, Harumichi Nishimura, and Seiichiro Tani. Quantum algorithms for finding constant-sized sub-hypergraphs. Theoretical Computer Science, 609:569–582, 2016. arXiv:1310.4127, doi:10.1016/j.tcs.2015.10.006.
[11] Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association, 58(301):13–30, 1963. doi:10.1080/01621459.1963.10500830.
[12] Russell Impagliazzo and Moni Naor. Decision trees and downward closures. In Proceedings of the Third Annual Structure in Complexity Theory Conference, pages 29–38. IEEE, 1988. doi:10.1109/SCT.1988.5260.
[13] Siddhartha Jain, Jiawei Li, Robert Robere, and Zhiyang Xun. On pigeonhole principles and Ramsey in TFNP. In 2024 IEEE 65th Annual Symposium on Foundations of Computer Science (FOCS), pages 406–428. IEEE, 2024. arXiv:2401.12604, doi:10.1109/FOCS61266.2024.00033.
[14] Ilan Komargodski, Moni Naor, and Eylon Yogev. White-box vs. black-box complexity of search problems: Ramsey and graph property testing. Journal of the ACM, 66(5):34:1–34:28, 2019. doi:10.1145/3341106.
[15] Jan Krajíček. On the weak pigeonhole principle. Fundamenta Mathematicae, 170(1-2):123–140, 2001. doi:10.4064/fm170-1-8.
[16] Jan Krajíček. Structured pigeonhole principle, search problems and hard tautologies. The Journal of Symbolic Logic, 70(2):619–630, 2005. doi:10.2178/jsl/1120224731.
[17] Troy Lee, Frédéric Magniez, and Miklos Santha. A learning graph based quantum query algorithm for finding constant-size subgraphs. Chicago Journal of Theoretical Computer Science, 2012(10), 2012. URL: https://arxiv.org/abs/1109.5135, arXiv:1109.5135.
[18] Qipeng Liu and Mark Zhandry. On finding quantum multi-collisions. In Advances in Cryptology—EUROCRYPT 2019, Part III, volume 11478 of Lecture Notes in Computer Science, pages 189–218. Springer, 2019. arXiv:1811.05385, doi:10.1007/978-3-030-17659-4_7.
[19] Ashley Montanaro. Quantum walk speedup of backtracking algorithms. Theory of Computing, 14(15):1–24, 2018. URL: https://arxiv.org/abs/1509.02374, arXiv:1509.02374, doi:10.4086/toc.2018.v014a015.
[20] Amol Pasarkar, Christos Papadimitriou, and Mihalis Yannakakis. Extremal combinatorics, iterated pigeonhole arguments and generalizations of PPP. In 14th Innovations in Theoretical Computer Science Conference (ITCS 2023), volume 251 of Leibniz International Proceedings in Informatics (LIPIcs), pages 88:1–88:20. Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2023. doi:10.4230/LIPIcs.ITCS.2023.88.
[21] Joel E. Pion and Susan M. Mniszewski. Toward computing bounds for Ramsey numbers using quantum annealing. Quantum Information Processing, 24(7):221, 2025. URL: https://arxiv.org/abs/2311.04405, arXiv:2311.04405, doi:10.1007/s11128-025-04839-x.
[22] Ri Qu, Zong shang Li, Juan Wang, Yan ru Bao, and Xiao chun Cao. Computing hypergraph Ramsey numbers by using quantum circuit. Quantum Information Processing, 12(7):2487–2496, 2013. arXiv:1210.3419, doi:10.1007/s11128-013-0541-9.
[23] Mani Ranjbar, William G. Macready, Lane Clark, and Frank Gaitan. Generalized Ramsey numbers through adiabatic quantum optimization. Quantum Information Processing, 15(9):3519–3542, 2016. arXiv:1606.01078, doi:10.1007/s11128-016-1363-3.
[24] Hefeng Wang. Determining Ramsey numbers on a quantum computer. Physical Review A, 93(3):032301, 2016. arXiv:1510.01884, doi:10.1103/PhysRevA.93.032301.
[25] Mark Zhandry. A note on the quantum collision and set equality problems. Quantum Information and Computation, 15(7-8):557–567, 2015. arXiv:1312.1027, doi:10.26421/QIC15.7-8-2.
[26] Yechao Zhu. Quantum query complexity of constant-sized subgraph containment. International Journal of Quantum Information, 10(3):1250019, 2012. arXiv:1109.4165, doi:10.1142/S0219749912500190.
A Proofs of the sampler lemma and the encoding corollary
Proof of theorem 2.2. Begin in the uniform superposition on and apply the randomized-iteration unknown-solution search of [2]. When the marked density is at least , truncate the geometric iteration schedule once its maximum iteration count reaches a sufficiently large constant multiple of . The cited analysis gives a success probability , independent of and , using calls to the membership predicate. Because the cap is fixed before any oracle outcome is observed, the block terminates for every predicate.
For each fixed number of Grover iterations, all marked basis states have the same amplitude. Randomizing the iteration count preserves this permutation symmetry. After measuring a candidate, evaluate the exact membership predicate and accept only a marked outcome. Conditional on acceptance, the output is therefore uniform on the marked set . Independent blocks reinitialize all registers and random choices, so their accepted outputs are independent conditional on the block-success indicators.
To collect a batch, run
independent capped blocks, where the absolute constant is chosen from . The number of accepted blocks stochastically dominates . A Chernoff lower-tail bound [3] makes the probability of fewer than acceptances at most . Conditional on any success pattern with at least acceptances, the first accepted outputs are independent and uniform on .
Proof of theorem 2.1. Given a circuit , define the canonical simple graph
One query to uses queries to , including uncomputation. Run theorem 1.1 on and let be the returned homogeneous set. Query the diagonal and both ordered entries induced by , using additional queries. A self-loop or an asymmetric pair is a local invalidity certificate. Otherwise agrees with on , so is a valid clique or independent-set witness. The verification cost is absorbed by the bound in theorem 1.1.
B Proofs for section 3
B.1 The size-biased recursion
Proof of theorem 3.1. The case is immediate. Suppose and , and let the two colour classes among the non-pivot vertices have sizes and . A uniform sample selects these classes with probabilities and . The induction hypothesis therefore gives
Because and , the numerator is at least . Replacing the denominator by weakens the bound and proves the claim; the definitions cover . Finally, , so the bound at is .
Exact conditional uniformity of each successful capped search couples an implemented run to the ideal recursion. Assign each of the searches failure probability at most . A union bound decreases the completion probability by at most , so a single fixed-cap run succeeds with probability at least 0.49. Independent repetition, followed by exact verification, amplifies this probability to using runs. On every completed run, nesting gives for ; the pigeonhole argument in theorem 3.5 then gives a homogeneous output.
Proof of theorem 3.2. A capped sample from a nonempty subset of the -element universe costs membership tests. Repeating the block times reduces its failure probability to . Since the membership predicate at level costs edge queries, one fixed-cap run uses
edge queries. The survival analysis above gives a constant success probability for each run, including capped-search failures and final verification. Repeating independent runs times proves the stated worst-case bound.
B.2 The scale-aware recursion
Proof of theorem 3.3. Condition on the complete classical history before the samples at level . The graph, , and are then fixed. Let be the event that the verified batch succeeds. Conditional on , theorem 2.2 gives independent uniform samples from the fixed set. Hoeffding's inequality [11] and eq. (3) imply
Multiplying by gives the same upper bound for a completed but inaccurate batch conditional on . Apply this bound to the first inaccurate completed level after an accurate prefix. The tower property removes the conditioning, and a union bound over the possible levels completes the proof. The argument does not require independence across levels.
There are pivot searches, sampling batches, and one final search. Give each operation failure probability at most using the capped amplification in theorem 2.2. Applying these conditional bounds after good prefixes, as above, shows that their union has probability at most . Together with theorem 3.3, all searches and estimates used below are good with probability at least .
Proof of theorem 3.4. An accurate empirical majority retains at least the fraction of the non-pivot vertices. Hence
Since and for ,
We prove by induction. The claim holds at . If it holds at level , then eq. (5) and give
Because , we obtain , and therefore the integer is positive. For , we have and
Finally, and , which proves the last assertion.
Proof of theorem 1.1. Set and run the algorithm of section 3 on any fixed set of input vertices. The failure allocation above, together with theorem 3.3, implies that all required searches succeed and all completed estimates are accurate with probability at least . On this event, theorem 3.4 guarantees every density promise used by the sampler and ensures that is nonempty. The final output is homogeneous by theorem 3.5. Because the algorithm verifies the returned set directly, every non- output is valid even outside the good event.
It remains to bound the number of queries. By theorem 3.4, a capped search block at level uses membership tests. Computing and uncomputing membership and querying the sampled edge costs edge queries. Define
The batch cap in theorem 2.2 uses blocks. By eq. (3), the total cost of the sampling batches is therefore
At most six indices share any value of , and hence
Using eq. (1),
Write . Since , the last display is at most
The amplified pivot searches and the final search cost
and the output verification is smaller. Substituting into eq. (6) gives
as claimed. Each search begins in the uniform state on the fixed power-of-two universe , and the recorded pivot labels and colours define the reversible membership predicate for , so the algorithm requires no materialized representation of any candidate set.
C Proofs for section 4
C.1 A weight bound for adaptive queries to a random graph
We record the random-Painter estimate of Conlon, Fox, Grinshpun, and He [5, proof of Theorem 1] in the form used in this paper. We follow their weight argument, taking the matching number of the queried graph as the potential; removing the critical edge from a maximum matching then leaves a matching of the smaller set, which keeps the recursion closed.
Throughout this subsection , and assigns independent uniform colours in to the pairs of . A deterministic algorithm queries distinct pairs adaptively. Let be the queried pairs, let be the graph formed by , and let be the -algebra generated by the first answers. Because the algorithm is deterministic, is an -measurable pair distinct from , and its colour is therefore a uniform bit independent of .
For and , let be the number of pairs inside among , and call consistent at time if all of these pairs have colour 1. Define
the conditional probability, given , that becomes a colour-1 clique when its remaining pairs are revealed. Let be the matching number of ; it is nondecreasing in and increases by at most one when a pair is added. For integers set
Lemma C.1 (Weight bound). For all integers ,
Proof. Martingale property. Fix . If , then . If , then with probability the new pair has colour 1 and , and otherwise . Hence , and in particular . Summing over all -sets gives the case :
Monotonicity. Since is nondecreasing, , and each event is -measurable. Taking conditional expectations gives .
Critical times. Let . For each let , with if ; this is a stopping time with . Since and is a martingale,
where
Charging. Fix and write . Suppose and . Then , , and . Moreover, every maximum matching of contains , since a maximum matching avoiding would be a matching of size in . Fix such a matching , let , let be the set of vertices covered by , and let . Then is a matching of , so . We claim that at most of the pairs between and belong to . Indeed, if with , then is a matching of size in , a contradiction; the same holds for . For each , the pairs and cannot both lie in , since would again be a matching of size in ; likewise and cannot both lie in . Hence at most two of lie in , and the claim follows by summing over the edges of .
Consequently , and is consistent at time only if is consistent at time and has colour 1. Using , we obtain
and otherwise. The map is injective because . Therefore
The indicator is independent of with mean 1/2, while is -measurable. Taking expectations and using monotonicity,
and summing over gives
Iteration. Applying the last inequality times, the exponents for sum to , and the case gives
because .
Corollary C.2 (Fully exposed monochromatic sets). Let , let , let , and let a deterministic algorithm make at most adaptive edge queries to . For every integer , the expected number of -sets all of whose pairs have been queried and carry the same colour is at most
Proof. Simulate the algorithm while renaming vertices in order of first appearance in a query, using a table from original to canonical labels. This does not change the joint distribution of the queried graph and its colours, because the colours of distinct pairs are independent and uniform; the renamed algorithm queries pairs inside with , and the number of fully exposed monochromatic K-sets is unchanged. After the renamed algorithm halts, append distinct unqueried pairs inside in a fixed order until exactly pairs have been queried; this can only increase that number. A fully exposed colour-1 K-set U satisfies and , so the number of such sets is at most . Theorem C.1 with and bounds its expectation by . The same bound holds for colour 0 by symmetry.
C.2 Proof of the randomized lower bound
Proof of theorem 4.1. Let and , so that and . Set
Since , we have , and gives .
Consider first a deterministic algorithm making at most queries to . By theorem C.2 and Markov's inequality, the probability that the queried pairs contain a fully exposed monochromatic -set is at most
Since , the base-2 logarithm of eq. (7) is at most
where the identity follows by substituting and and using . For this quantity is at most -2, so the event has probability at most .
Now condition on the query transcript and suppose that the algorithm outputs a -set whose internal pairs have not all been exposed in one colour. If the exposed internal pairs contain both colours, the output is not homogeneous. If they contain exactly one colour, at least one unexposed pair must match that colour, which has conditional probability at most , because unexposed pairs are independent fair coins given the transcript. If no internal pair has been exposed, the success probability is for . Thus the conditional success probability is at most outside the fully exposed event, and the success probability under is at most
A randomized algorithm making at most queries is a distribution over such deterministic algorithms, so its success probability on is also at most 5/8. Finally, an algorithm whose worst-case success probability on graphs with vertices is at least must make more than queries, and gives
which proves the proposition.
C.3 Proof of the random-graph speedup
Proof of theorem 4.2. Let . For let
be the common neighbourhood of . Call expanding if for every and every -set ; for the bound holds trivially.
Random graphs are expanding. Fix and a -set . Then with mean . Since , we have , hence and . The Chernoff bound [3] with gives
A union bound over the at most sets shows that fails to be expanding with probability at most . For the numerical claim, gives
which equals at , and for all , since the subtracted term doubles at each step while the first term grows by . Hence for all .
The algorithm. Set . For , given the clique , run the capped search of theorem 2.2 on for the predicate “ and for all ”, with density parameter , repeating the block times so that its failure probability is at most whenever the density promise holds. The predicate costs edge queries, including uncomputation. Let be the verified output and . If any search fails, output ; otherwise output .
Correctness and cost. Every accepted vertex was verified to be adjacent to all earlier vertices, so a non-⊥ output is a K-clique for every input graph. If is expanding, then the search at level has marked density at least , and a union bound over the searches shows that the algorithm outputs with probability at least . Hence it succeeds with probability at least over and its internal randomness. Each capped block at level uses predicate evaluations, so the total number of edge queries is
on every input, because every block has a predetermined cap.
Proof of theorem 4.3. The subgraph induced on the first vertices is distributed as , so the first part follows from theorem 4.2, using and . The second part is the distributional statement of theorem 4.1, which applies because . For the final sentence, note that gives , so ; with the quantum algorithm succeeds with probability greater than , while .
C.4 Proof of the quantum lower bound
Proof of theorem 4.5. Let and . By Erdős's bound for [7], there is a graph on [H] with no clique or independent set of order 2m; fix one and hardwire it, so that evaluating costs no queries. For let be the graph eq. (4). It is a simple graph, and one coherent query to costs queries to .
Every homogeneous set of with contains two vertices with the same -value. Indeed, if is independent, then its -values are distinct, because equal values force an edge, and is an independent set of ; hence , which is impossible. So is a clique, is a clique of , and .
Since , a set of the order in the statement qualifies. Given a -query algorithm as in the statement, run it on , evaluate on the returned vertices, and output two of them with equal -value. This finds a collision of with probability at least using queries to , for every . Finding a collision in a uniformly random function with requires quantum queries [25, 18], so . Finally gives , and , so .
D Multicolour extension, numerical illustrations, and AI disclosure
D.1 A multicolour extension of size-biased survival
Suppose every edge has one of colours, and define
Choose the power of two
so .
Corollary D.1 (Multicolour size-biased Ramsey search). For , every -edge-coloured complete graph on at least vertices admits a bounded-error quantum algorithm that outputs a monochromatic -clique using
colour-oracle queries in the worst case, where , , and are as defined above.
Proof. Run the size-biased recursion of section 3 for rounds on the first vertices, now following the colour of a uniformly sampled edge among possibilities. Let be the minimum probability that the ideal recursion completes further rounds from a candidate set of size and a fixed pivot. We claim that
for all and . The case is immediate. For and , let the colour classes among the non-pivot vertices have sizes . The induction hypothesis gives
Since and , the numerator is at least . This proves the claimed bound after weakening the denominator from to . The preceding display also gives the stronger bound whenever and . Consequently, starting from , the ideal recursion survives all rounds with probability strictly greater than .
A membership predicate at level contains colour constraints and costs oracle queries. Using the universal density bound , one capped sample costs colour queries. Repeating the capped block times makes each sampling failure probability , so one fixed-cap run costs
The union bound preserves a positive constant success probability. Since , one of the recorded colours occurs at least times. The corresponding pivots and the final vertex form a monochromatic -clique by the same nesting argument as in theorem 3.5. Independent repetition and direct verification amplify the success probability to at an additional factor.
D.2 Small-instance numerical illustrations
Ideal-sampler recursion. We ran the scale-aware recursion at , , and for 1,000 trials in each of five graph families. The error schedule was , with sample counts , corresponding to a total estimation-failure budget of 0.01. Pivots were sampled uniformly, majority-estimation samples were independent with replacement, and ties selected colour 1. We replaced quantum search by ideal uniform sampling to isolate the combinatorial recursion.
The deterministic inputs were the complete graph, the empty graph, and the balanced complete bipartite graph . For the random inputs, one graph was held fixed across all 1,000 trials, while the final family drew a fresh graph in each trial. Every returned triple was verified; exhaustion or a nonhomogeneous output counted as failure.
| Graph family on 16 vertices | failed/trials | minimum final |
|---|---|---|
| complete | 0/1000 | 13 |
| empty | 0/1000 | 13 |
| balanced complete bipartite | 0/1000 | 6 |
| one fixed | 0/1000 | 2 |
| fresh per trial | 0/1000 | 2 |
All 5,000 trials returned homogeneous triples. The final column records the smallest observed value of in each family.
Isolated Grover sampler. We evolved a 16-dimensional state vector initialized in the uniform superposition, using marked-set sizes 1, 2, 3, 4, 8, 15. The measurement distribution was averaged over a uniformly chosen number of Grover iterations from zero through four. The probability of measuring a marked item ranged from 0.4026746749 to 0.5973253251. Conditional on a marked outcome, the largest deviation from the uniform distribution on marked items was zero to machine precision. This calculation isolates the permutation symmetry used in theorem 2.2.
Finite split-tree survival. Minimizing the ideal size-biased survival probability over every admissible colour-class split gives exact finite-depth comparisons with the analytic bounds. For nine binary levels starting from 1,024 candidates, the minimum was approximately 0.5086135566, above the lower bound 513/1024. For four ternary levels starting from 128 candidates, the minimum was approximately 0.7155732457, above 88/127.
D.3 AI Disclosure
We used ChatGPT and Claude as auxiliary tools for literature search, brainstorming, proof checking, drafting and editing, and building experiment scripts (Sections 1, 3–6, and Appendices A–D). The authors determined the research direction and presentations, evaluated and revised all AI-assisted material, and take full responsibility for the correctness, originality, and final content of the paper, including every proof and reference.