How statement and proof provenance work
The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.
- Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
- AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
- AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.
These labels describe origin, not correctness: citations and verification chips remain separate evidence.
Computational Problems, Promises, and Cost Models
1 · Prerequisites
- Absolute and Conditional Convergence; Rearrangement; Products
- Algebraic Closure, Embeddings, and Separability
- Algebraic Extensions, Extension Degree, and Finite Fields
- Binary Operations, Monoids, Groups and Subgroups
- Boolean Circuits and Nonuniform Complexity
- Bounded Linear Operators and Quotient Spaces
- Circuit Syntax, Denotational Semantics, and Measurement
- Clifford+T Exact and Approximate Synthesis
- Compactness in Metric Spaces
- Completeness, Completion, and Uniform Continuity
- Complex Norms and Realification
- Complexification, Realification and Real Structures
- Composition Series, the Jordan–Hölder Theorem and Solvable Groups
- Congruences, the Integers Modulo n and the Chinese Remainder Theorem
- Construction of the Natural Numbers
- Construction of the Real Numbers via Cauchy Sequences
- Construction of the Real Numbers via Dedekind Cuts
- Continuity, IVT, EVT, and Uniform Continuity
- Continuous-Gate Universality and Exact Synthesis
- Controlled Gates, Phase, and Entanglement
- Cosets, Index and Lagrange's Theorem
- Countability and Uncountability
- Cyclic Groups and Direct Products
- Determinants of Matrices over a Commutative Ring
- Diagonalisation and the Minimal Polynomial
- Divisibility, Euclidean Domains, Principal Ideal Domains and Unique Factorisation
- Divisibility, Greatest Common Divisors and Bézout's Identity
- Dual Spaces, Bilinear and Quadratic Forms, and Sylvester's Law of Inertia
- Effective Numberings, Reductions, Resources, and Randomness
- Eigenvalues, Eigenvectors and the Characteristic Polynomial
- Filters and Ultrafilters
- Finite Counting, Factorials and Binomial Coefficients
- Finite Dimensional Normed Spaces and Riesz Lemma
- Finite Probability Spaces and Random Variables
- Finite-Dimensional Complex Inner-Product Spaces and Matrix Interfaces
- Formal Languages, Encodings, and Decision Problems
- Foundations of the Real Numbers for Analysis
- Free Modules, Exact Sequences, Projective and Injective Modules
- Fundamental Trigonometric Identities
- Group Actions, Orbits, Stabilisers and Cayley's Theorem
- Group Homomorphisms and the Isomorphism Theorems
- Hilbert Space Geometry and Riesz Representation
- Ideals, Quotient Rings and the Isomorphism Theorems for Rings
- Inner Product Spaces, Gram-Schmidt, Projections and Adjoints
- Limits of Real Functions
- limsup, liminf, and Subsequential Limits
- Linear Independence, Bases and Dimension
- Linear Recurrences and Rational Generating Functions
- Linear Transformations, Rank-Nullity and Quotient Spaces
- Matrices, the Matrix of a Linear Map, and Change of Basis
- Measurements, POVMs, and Instruments
- Metric Spaces
- Modules, Submodules, Quotient Modules and the Isomorphism Theorems
- Monotone Functions, Discontinuities, and Continuity Sets
- Monotone Sequences, Bolzano-Weierstrass, and Cauchy Completeness
- Normal Subgroups and Quotient Groups
- Normed and Banach Spaces
- Order, Zorn's Lemma, and the Axiom of Choice
- Polynomial Rings, the Division Algorithm and Roots
- Power Series and Real-Analytic Functions
- Primes, Euclid's Lemma and the Fundamental Theorem of Arithmetic
- Properties of the Integral and the Working FTC
- Pure and Mixed States, Ensembles, and Schmidt Decomposition
- Qubits, Bloch Sphere, Pauli Algebra, and One-Qubit Gates
- Registers, Tensor Products, and Partial Trace
- Relations, Functions, and Quotients
- Resource Bounds and Machine Invariance
- Reversible Computation, Ancillas, and Coherent Oracles
- Rings, Subrings, Integral Domains and Fields
- Rⁿ as a Normed Space; Vector-Valued Functions
- Roots, Rational Powers, and Classical Inequalities
- Sequences and Limits
- Sequences and Series of Functions; Uniform Convergence
- Series: Convergence and the Nonnegative Tests
- Simple Field Extensions and the Construction of the Complex Numbers
- Sine, Cosine, and the Definition of Pi
- Splitting Fields
- Strongly Continuous Semigroups and Hille Yosida
- Suprema and Infima
- Sylow's Theorems, p-Groups and Nilpotent Groups
- Symmetric Groups, Cycle Decomposition and the Sign Homomorphism
- Tensor Products of Modules
- The Complex Exponential and Euler's Formula
- The Derivative and the Mean Value Theorems
- The Determinant of a Linear Operator, Cofactors and Cramer's Rule
- The Exponential Function
- The Fundamental Theorem of Algebra
- The Fundamental Theorem of Finite Abelian Groups
- The Galois Correspondence
- The Polynomial Hierarchy and Relativization
- The Riemann Integral: Definition and Integrability
- The Spectral Theorem, Positive Operators and Singular Value Decomposition
- The ZFC Axioms and the Basic Set Constructions
- Topology of ℝ
- Triangularisation, Generalised Eigenspaces and Jordan Canonical Form
- Turing Machines, Configurations, and Computation
- Uniform Circuit Families, Promise Problems, and Complexity
- Vector Spaces, Linear Subspaces, Span and Direct Sums
2 · Summary
This page fixes the interfaces used to state promise-query algorithms and compare their resources. A decision task uses a disjoint yes/no promise pair; a search task requires a witness relation only on its declared domain. Input encoding and input length are explicit. The encoding labels the hidden oracle instance; the algorithms receive only the task's declared public data and access capabilities. At fixed public data, all other dependence on the hidden instance is through its oracle calls. Every promised query instance selects a total function on all addresses, and its standard quantum query is the coherent XOR action.
Quantum and classical algorithms may adapt their queries to the information they receive, but query counts are worst-case over promised inputs and execution branches. The local finite-branch law assigns weights to instrument outcomes and terminal computational-basis outputs, and proves normalization by finite induction. Finite-prefix expectations define expected query cost for sequential procedures without assigning a probability measure to an unbounded history space. Exact and bounded-error guarantees are per instance. Nonoracle quantum gates, preparation, measurements, classical bit transitions, and oracle calls occupy separate cost coordinates.
Promise-preserving reductions transfer correctness only when the source access contract supplies the target oracle or gives an exact, charged simulation of each target call, and an admissible protocol initializes the target solver and lifts its outputs. The and query bounds require no additional source queries for this work; a version with initialization and lifting queries has the respective bounds and . For search reductions, the instance and witness maps must also be computable; target-input preparation and witness lifting are charged separately. For the standard XOR query, the inverse is the same ordinary query; controlled access remains an explicit capability. The companion page works through decision and search reductions, off-promise completions, and two circuits with equal query count and different gate cost.
3 · Logical flowchart
4 · Definitions, theorems and proofs
Expected query cost from finite execution prefixes
Definition
Fix a promised input and a sequential procedure whose elementary steps are deterministic transitions, finite random transitions, finite-outcome measurements, or a single oracle call. At every live history, the next transition has a specified probability law on a finite outcome set; a query step has one successor and issues one call. A halted history is extended by deterministic idle steps that issue no calls.
For , let be the finite set of length- histories with the recursively assigned transition weights. Let count the oracle calls actually executed in those steps. Define the expected query cost on input by
where each expectation is taken on the finite probability space of the corresponding prefix. Define the pathwise total query count on an infinite history by . No probability measure or expectation of on an infinite history space is presumed by this definition.
If a procedure is organized into rounds of at most elementary steps for some fixed integer , each containing at most one query, pad each round with deterministic idle steps to exactly steps. In this padded procedure, its first rounds are the prefix of length . Hence the supremum of its finite-round expected query counts equals the displayed finite-step supremum. In particular, query-indexed rounds are valid when each round contains exactly one query, as in Simon sampling.
Facts & Assumptions
Given: A fixed promised input and a sequential procedure satisfying the finite-outcome transition and one-query-per-step conditions in the Definition.
At each live finite history , the next-step probabilities are nonnegative and sum to one over the finite next-outcome set; after halting, the unique idle successor has probability one.
denotes the extended nonnegative reals with the usual least-upper-bound convention, so every subset has a supremum in that interval.
Finite probability spaces, outcome weights, events, and event probabilities: a finite probability space has nonnegative outcome weights summing to one, and events are subsets of its finite outcome set.
Real random variables on finite probability spaces and their finite distributions: a real random variable on a finite probability space is a function on its finite outcome set and therefore has finite range.
Expectation of a real random variable on a finite probability space: the expectation is the finite sum of outcome values multiplied by their probability weights.
Finite commutative-monoid sums are invariant under bijective reindexing, split over disjoint unions, and satisfy the finite Fubini rule: finite sums can be reindexed by bijections and a sum over a finite Cartesian product equals either iterated finite sum.
The principle of mathematical induction: a property holding at zero and preserved from to holds for every natural number .
Verification
For , the only history is the empty history with weight one, so is a finite probability space by [F1].
Assume the length- histories form a finite probability space. Each has finitely many successors, so their length- extensions form a finite set. For each parent history , the total weight of its children is by [A1]. Summing over the finite parent set by [F4] shows that the extended weights again sum to one. Thus is a finite probability space.
Steps 1.1 and 2.1 establish the base and successor cases; induction [F5] proves that every is a finite probability space.
For any length- history , the sum of the weights of its length- extensions is by [A1]. Therefore projection to length- prefixes preserves every prefix's probability weight.
The count is a function on the finite set , so it is a finite real random variable by [F2]. Every additional step either adds one query or is a nonquery or idle step; consequently, under the prefix projection, pathwise.
By [F3] and the prefix-marginal identity in step 3.2, the expectation of computed on the length- tree equals its length- expectation. The pointwise inequality in step 4.1 and nonnegative transition weights then give . Each expectation is finite because .
Each is bounded between and , so its finite-space expectation is a finite nonnegative real by [F1] and [F3]. Step 3.1 supplies a normalized prefix space for every , and [A2] therefore makes the displayed supremum well-defined in .
For round length bounded by , pad every round by idle steps so its end is a length- prefix after rounds. These round-end indices are cofinal in : for every choose with . By step 5.1 the expected counts are nondecreasing, so . This proves the finite-round claim without applying a finite-space theorem to an unbounded total count.
QA task and promise domain
Definition
A decision task is a root promise pair of disjoint subsets of , as in Promise problem: its promise domain is , and the required output is yes on and no on . No correctness condition is imposed outside that promise.
A search task is a pair where is the promise domain and is a witness relation. On each , a correct solver must output a binary string with . It has no output obligation for . Unlike a decision task, a search task need not divide its promise into yes and no sets.
For either task, an input encoding and input-length convention are specified separately; correctness is required only for encoded inputs in the declared promise.
Input encoding and size for algorithmic tasks
Definition
An input encoding is an injective map from the declared instance set into . The input size of an instance is . If task instances are already binary strings, the default encoding is the identity. The encoding is part of the task specification, and any length or padding convention must be stated.
For a task family, let denote the encoded instances of length that lie in its promise domain, with the decision sides or search relation inherited from QA task and promise domain. A statement indexed by input length concerns only .
Normalized output law for finite quantum query branches
Definition
Fix an encoded input and a finite rooted execution tree on the same declared finite register at every node. Its root state is the density operator of the standard input basis state with zero-initialized work registers. Every nonterminal node is either a unitary endomorphism or a finite instrument whose branch maps are from to . The observed outcome label is retained for classical feed-forward, while a hidden Kraus label is not a branch. The tree has finite depth and finite outcome sets.
Assign the root weight . At a unitary edge set and . At an instrument node set and . If , set ; if , that child and its descendants have weight zero and contribute no state or output weight. The instrument and conditional-state conventions are those of Finite instruments and conditional states.
At each positive-weight leaf , the ordered output wires have a fixed length and are disjoint from the remaining wires . For and a bit string on , let be the full-register computational-basis vector with those bits in their declared wire positions. Define the leaf output weight and total output law by The classical output predicate selects the acceptance event by summing over the finite set of accepted strings. This definition extends the terminal-output convention of Finite quantum promise-computation model to finite instrument branches; the verification proves that is a normalized probability law and every acceptance probability lies in .
Facts & Assumptions
Given: The finite execution tree, its specified unitary and instrument nodes, standard basis-state input and zero work registers, and its ordered output-wire tuple and total classical predicate.
The tree has finite depth and finitely many nodes on the fixed register ; each unitary edge is an explicitly declared unitary endomorphism, each measurement node is a finite instrument on with observed outcomes as above, and terminal output wires partition the complete ordered register together with the remaining wires.
Finite quantum promise-computation model: the standard input is a computational-basis vector with zero-initialized auxiliary wires, and the computation specifies an ordered output-wire tuple and a total output predicate.
Finite instruments and conditional states: each observed-outcome branch is a completely positive map, the branch traces sum to the input trace, and a positive-probability conditional state is the branch output divided by its probability.
Instrument outcome weights normalize: for a density input, finite instrument branch weights are nonnegative and sum to one.
Positive-probability instrument branches are density operators: every positive-probability instrument branch has a density-operator conditional state.
Density operator and Non-negative and positive operators: a density operator is self-adjoint, has nonnegative quadratic form, and has trace one.
The adjoint is characterised by and Adjoints satisfy , , , and : adjoints are characterized by the inner-product identity and reverse the order of composition.
Linear isometries, and orthogonal or unitary operators on finite-dimensional inner product spaces and For an endomorphism in finite dimension, preserving lengths, preserving inner products, carrying orthonormal bases to orthonormal bases, and are equivalent: a finite-dimensional unitary endomorphism is a norm-preserving map and satisfies .
For and , and The basis-independent trace of an endomorphism of a finite-dimensional vector space: compatible finite-dimensional products have cyclic trace, and trace is the sum of diagonal entries in any basis.
Finite registers and their ordered computational bases and The computational basis is orthonormal: each register has its declared ordered orthonormal computational basis, with the zero-qubit register one-dimensional.
The product basis is orthonormal and tensor dimensions multiply: ordered product-basis vectors form an orthonormal basis of the full finite register.
A unit-vector outer product is a density operator: the rank-one projector of every unit vector is a density operator.
Finite circuit syntax and ordered wire labels and Denotational semantics of a finite layered circuit: finite ordered gate layers on declared wires denote a unitary in their stated chronological order.
Finite commutative-monoid sums are invariant under bijective reindexing, split over disjoint unions, and satisfy the finite Fubini rule: finite sums over products of finite index sets can be interchanged.
The principle of mathematical induction: a property holding at zero and preserved at each successor stage holds at every natural-number stage.
Verification
The standard input register vector and zero-work-register vector are supplied by [F1]; they are computational-basis vectors and hence unit vectors by [F9]–[F10]. Their combined basis vector is unit by the same orthonormal product-basis fact. Its rank-one projector is a density operator by [F11], so the root state has trace one and is nonnegative.
If is a density operator and is a unitary endomorphism node, then [F12] supplies the unitary denotation for circuit blocks; any other unitary edge is explicit in [A1]. The operator is self-adjoint by [F6] and . For every , the adjoint identity gives . Cyclicity and [F7] give . Thus the successor state is a density operator and the edge preserves its branch weight.
At an instrument node with density input , [F3] gives and . If , [F4] gives a density operator at that child; if , the child weight is zero and no conditional state is used. Therefore the sum of child weights is .
At depth zero the frontier consists only of the root, whose weight is one and whose state is a density operator by step 1.1. Assume the same assertions for a finite frontier. At each live unitary node, step 1.2 preserves the state property and weight; at each instrument node, step 1.3 gives density states on positive children and preserves the sum of child weights. For the induction, carry an already-terminal positive-weight node forward along a single identity-unitary edge, retaining its state and weight; carry a zero-weight terminal node forward at weight zero without assigning a state. These padding edges add no outcome branch. Summing over the finite frontier by [F13] shows that the next frontier again has total weight one and a density state at every positive-weight node.
Let be the maximum depth of the original tree. Repeating the extension from step 2.1 carries each earlier positive-weight leaf to depth without changing its state, weight, or assigned output wires; zero-weight leaves remain weight zero and have no assigned state. The base and successor cases are those in step 2.1, so induction [F14] reaches this common frontier. Therefore the original positive-weight leaves have total weight one and density-operator states.
At a positive-weight leaf, each pair specifies exactly one full computational-basis word because the output-wire tuple has distinct indices and is its complement. Conversely every full word has exactly one such pair. Thus [F9]–[F10] make the vectors a complete orthonormal basis. Each is nonnegative by [F5], and their finite sum over is by [F8]. Therefore and , including the empty-output or empty-work-register cases.
Summing the definition of over all output strings and interchanging its finite leaf and output sums by [F13] gives by steps 3.1 and 4.1. Each term is nonnegative, so any predicate-selected subset has probability between zero and one. The terminal marginal is normalized directly by the basis-and-trace calculation in step 4.1; instrument branch normalization and conditional-state density use [F3] and [F4] in step 1.3.
Promise query instance and oracle family
Definition
For each encoded promised instance of length (with as in Input encoding and size for algorithmic tasks and its task promise as in QA task and promise domain), a query instance specifies nonnegative integer widths and a total function
The promise restricts which are legal; it does not restrict the address domain of . Bit strings label the big-endian computational basis: for a word , its slot is , with the empty word in slot (Big-endian encoding of ordered bit strings). Ket and bra notation uses the root convention (Dirac Notation Conversion). Its standard quantum query is the coherent XOR oracle from Coherent XOR function oracle, acting on those ordered register bases:
where is coordinatewise addition modulo two, is an -bit address, and is a -bit target. One invocation is one query, regardless of the output width. A supplied matrix or a classical description of does not itself supply a circuit decomposition, state preparation, or controlled access at zero cost.
The access contract must specify whether controlled calls are supplied: a controlled call is the explicitly granted block operation (Controlled Unitary Access) and does not follow from an ordinary black-box call. For this standard XOR oracle, by A total Boolean XOR oracle is unitary and involutive, so an inverse query is the same operation as one ordinary query. Inverse access to any other unitary operation has its own explicitly declared availability and charge (Inverse Unitary Access). An explicit matrix or classical description supplies no free circuit implementation, preparation, or data loading; those costs are recorded under the declared circuit and gate resource coordinates (Circuit-family and computation cost model, Finite circuit resource accounting).
Classical query algorithm
Definition
A classical query algorithm is a finite decision procedure for a fixed encoded instance length and explicitly declared public data , whose query actions are to the total function of Promise query instance and oracle family. The procedure is fixed independently of the hidden instance at fixed . Its encoding in Input encoding and size for algorithmic tasks labels the instance and determines its size; it does not provide a readable copy of the hidden encoding. Each query chooses an address from , earlier replies, and any random bits used so far; it receives the entire -bit reply as one query answer. The address choices may be adaptive. Its terminal output is determined by the same public data, replies, and random tape.
In the ordinary oracle-only model, all dependence on the hidden instance is through these replies. Public parameters such as register widths, a supplied marked count, or an explicit arithmetic input may be used only when the task declares them. A lower bound in the oracle-only model fixes the declared public data across the hidden instances it compares. Additional input-access or preparation capabilities must be explicitly declared with their charges; they are extra resources, not supplied by the hidden instance encoding.
For a randomized algorithm, each branch is determined by the public data, oracle replies, and its finite random tape; the fair-bit tape convention for a bounded-time probabilistic machine is supplied by Probabilistic polynomial time machine interface. The query model itself imposes no polynomial bit-time bound. A query bound is a worst-case bound over promised inputs and every random branch; classical computation between queries is charged separately only when a bit-cost model is specified.
Quantum query algorithm
Definition
For each encoded instance length and explicitly declared public data , a quantum query algorithm is a specified finite circuit protocol on its query and work registers, fixed independently of the hidden instance at fixed . The hidden encoding labels the oracle instance; it is not supplied as a readable input register. A register is a finite-dimensional complex inner-product space with its ordered computational basis; an -qubit register uses the lexicographic bit-string basis, with the first wire most significant (Finite registers and their ordered computational bases). The finite promise-computation model Finite quantum promise-computation model supplies the public-classical-input, zero-initialized ancillary-register, ordered-output-tuple, and final-predicate conventions. Its classical input and terminal predicate receive only the declared public data, not the hidden encoding. Circuit syntax fixes the ordered wires and finite gate list Finite circuit syntax and ordered wire labels, and its denotation fixes the chronological gate composition Denotational semantics of a finite layered circuit. The execution tree starts in the standard public-input basis state with all other registers zero. Any explicit preparation interface is executed as a specified finite prefix of unitary or instrument nodes of this tree, with its preparation calls and other resource costs charged under the declared access contract. Intermediate measurements and classical feed-forward are represented by finite trees of instrument outcomes and branch-specific unitary operations. In the ordinary oracle-only model, all preparation operations, nonoracle gates and instruments, branch-control rules, and terminal output rules are independent of the hidden instance at fixed ; later operations may depend on observed outcomes. For each instantiated oracle, Normalized output law for finite quantum query branches gives the normalized output law of this tree with its public classical input. The output is interpreted according to the decision bit or search relation in QA task and promise domain.
In the ordinary oracle-only model, hidden-instance dependence enters only through the designated oracle calls. Explicit public parameters and arithmetic inputs remain available when the task declares them. Any additional instance-dependent state preparation or data-access operation is a separately declared and charged resource. Oracle-only lower bounds compare instances with the same public data and without such additional input access; the hidden encoding itself supplies none.
A -query algorithm has at most designated calls to the oracle of Promise query instance and oracle family and Coherent XOR function oracle on every execution branch for every promised . Calls count once each; gates in the circuit outside those designated calls are not query calls. Uniformity is asserted only when the family satisfies Full-list uniform quantum circuit family. A controlled call has the block action in Controlled Unitary Access and is available only when the access contract explicitly supplies and charges it. An inverse call to this XOR oracle has the same action as an ordinary call by A total Boolean XOR oracle is unitary and involutive; inverses of other unitaries use the separate availability and charge convention in Inverse Unitary Access.
Remarks
The finite promise-computation model supplies the public-input and terminal-output conventions. The finite instrument tree extends it to intermediate measurements; its branch law is applied separately to each instantiated oracle, without granting the terminal predicate access to the hidden encoding. No uniformity claim is made unless the full-list condition is supplied.
Worst-case bounded-error correctness
Definition
A quantum or classical solver in Quantum query algorithm and Classical query algorithm for a decision task of QA task and promise domain has bounded error (with the QA convention) if its normalized output law assigns probability at least to the correct answer for every encoded promised instance. A search solver has bounded error if, for every encoded in its domain , its output law assigns probability at least to outputs satisfying . The guarantee is worst-case per instance, not averaged over an input distribution. The constant is a convention; amplification and its query/access cost are separate results.
For quantum algorithms the success event is evaluated from the normalized finite-branch output law of Normalized output law for finite quantum query branches. Its normalization follows from the finite instrument and unitary branches in that definition; the success threshold remains a per-instance condition.
Classical bit-operation cost
Definition
For a classical query algorithm Classical query algorithm, bit-operation cost is the number of transitions of a declared multitape Turing machine over a fixed finite alphabet; the -tape transition reads and writes one symbol on each of its tapes and moves each head once per transition (Multitape and nondeterministic Turing machine variants). It includes random-bit generation, any encoding work actually performed by that machine on declared public data or received replies, address formation, reading and writing every bit of an oracle reply, comparison/postprocessing, and writing the classical output. The abstract instance encoding in Input encoding and size for algorithmic tasks fixes the size parameter; it supplies neither a readable hidden input nor an encoding procedure to execute. The fair-bit machine convention is supplied by Probabilistic polynomial time machine interface. The oracle invocation itself is one separately counted query action; its returned bits are not free to process.
For a query with an -bit address and a -bit reply, the machine's charged work includes forming the address and processing the reply symbols. A claimed time bound also specifies whether it is worst-case over promised inputs and random tapes, as in Probabilistic polynomial time machine interface. Query, nonoracle quantum gate, measurement, and classical bit costs remain distinct.
Exact correctness for promise tasks
Definition
For a decision task from QA task and promise domain, a solver is exact if its normalized output law assigns probability one to yes on every encoded and probability one to no on every encoded . For a search task from the same definition, it is exact if, for every encoded , its normalized output law assigns probability one to outputs satisfying . These are per-instance requirements; no correctness is asserted outside the promise.
The solver is one of the quantum algorithms in Quantum query algorithm or classical algorithms in Classical query algorithm. For a quantum solver, its output weights are the normalized finite-branch law of Normalized output law for finite quantum query branches. For a randomized classical solver, they are the probabilities induced by its declared finite random-tape law. Exactness does not follow merely from a circuit or algorithm description; it is a condition on its output law.
Nonoracle quantum gate cost
Definition
Given the circuit-family model and cost record in Circuit-family and computation cost model and elementary gate alphabet in Finite circuit resource accounting, a query circuit Quantum query algorithm has nonoracle gate cost equal to the maximum number of elementary gates outside designated black-box query calls on any branch. It counts preparation gates, ancilla operations, inverse gates, and every other stated nonoracle gate, including identity operations if the declared syntax counts them. It does not count a black-box query as an elementary gate; if the oracle is implemented from a supplied circuit, that implementation's gates are charged under the declared resource model.
Non-input registers start in . Any nonzero initial state or data-access resource must name its preparation/access model and charge that cost. Measurements, classical feed-forward, circuit-description length, and classical bit operations are reported in the selected QC resource convention rather than silently assigned zero cost. Query count and gate count are separate coordinates.
Classical query complexity
Definition
For a classical query algorithm Classical query algorithm at input length , its worst-case classical query cost is the maximum number of oracle calls over every promised instance and every random tape. When there are no promised instances of length , define this cost to be . If those counts are not uniformly bounded, the cost is infinite. One query returns the full value , regardless of its bit width. Expected-query bounds are reported separately using Expected query cost from finite execution prefixes.
For a bounded-error classical solver, the query cost is still worst-case over inputs and random tapes; the success requirement is the per-instance probability in Worst-case bounded-error correctness. Distributional input averages and expected query counts are different quantities.
Quantum query complexity
Definition
For a -query quantum algorithm Quantum query algorithm at input length , its worst-case quantum query cost is the maximum number of designated oracle calls over all promised instances in and all measurement branches. When is empty, define this cost to be . For nonempty , a finite circuit and finite branch sets ensure that this maximum exists; a solver whose branch counts are not uniformly bounded has infinite worst-case query cost. An expected-query bound is the separate quantity defined by Expected query cost from finite execution prefixes.
In the pure query model, ordinary gates outside the oracle calls are uncharged by the query coordinate. If a task also reports gate, preparation, measurement, or classical costs, those are separate coordinates. Bounded-error query cost uses the same worst-case maximum; its success threshold is the per-instance condition in Worst-case bounded-error correctness, not an average over oracle inputs.
Promise-preserving reduction composes with a query solver
Statement
For decision tasks, let and be promise problems and let be a promise-preserving total many-one reduction from to in the sense of Promise preserving reduction. For search tasks, let and be source and target search tasks, and suppose a total instance map sends into and a total witness map satisfies In the search case, assume additionally that both and are computable; no time bound is required.
Let be fixed nonnegative integers. Let be a classical or quantum query solver for the target task that makes at most target-oracle calls on every branch and is exact or has bounded error at least on every target-promised instance. Suppose that for every source-promised , its access contract either directly supplies the target oracle selected by at one source query per target invocation or supplies an exact simulation of each target query using at most source queries on every branch. If uses controlled oracle calls, that exact block operation must also be explicitly supplied and its charge included in the same cost bound (Controlled Unitary Access). An inverse call to the standard XOR oracle has the same action as one ordinary query by A total Boolean XOR oracle is unitary and involutive. In the quantum case, exact simulation means equality of the full query action on the query and algorithm workspace registers, with identity on unrelated registers.
Require, in addition, a fixed executable protocol under the source access interface that obtains the target public parameters (including target length), initializes the target solver exactly, and in the search case converts its returned witness to . For the bounds and below, this initialization and output lifting use no source queries outside the target-query replacements. The protocol, including each replacement procedure, depends only on source public data and the available reply or measurement history, not on a freely readable hidden encoding. When the source instance is explicitly supplied as public input, computing and on that input is permitted, with the stated bit and preparation charges. Computability on the full encoding alone grants no extra hidden-input access.
Then the composed source solver has the same per-instance correctness guarantee as . Its worst-case source query cost is at most in the direct-access case and at most in the simulated-access case. Computing the reduction map, preparing the target solver's input, computing the search witness lift, and performing any simulation gates or classical work are charged separately under the declared bit and gate models. In the search case this theorem requires computability but claims no efficiency bound for either map. A promise-preserving map alone does not supply the target query oracle, its simulation, or an implementation of initialization and witness lifting under the source access interface. More generally, if an exact admissible initialization uses at most additional source queries and exact admissible output lifting uses at most on every branch, the same correctness guarantee holds with bounds and , respectively, for fixed nonnegative integers .
Facts & Assumptions
Given: The decision or search tasks and maps in the Statement, a target query solver , and the declared direct-access or exact-simulation condition.
Promise preserving reduction: a decision many-one reduction is total and polynomial-time, maps every source yes-instance into the target yes-set and every source no-instance into the target no-set, and has no obligation outside the source promise.
QA task and promise domain: a decision task requires the correct side on its promise pair, while a search task requires an output witness satisfying its relation on each promised input; neither task imposes correctness off its promise.
Quantum query algorithm: a quantum query algorithm has at most its declared number of target-oracle calls on each measurement branch.
Classical query algorithm: a classical query algorithm may choose each address adaptively from declared public data, earlier replies, and random bits, with no direct access to the hidden instance encoding.
Exact correctness for promise tasks: exact decision/search correctness has probability one on every promised instance under the normalized output law.
Worst-case bounded-error correctness: bounded-error decision/search correctness has probability at least on every promised instance, not on average over inputs.
Quantum query complexity: quantum query cost is the worst-case number of designated calls over promised inputs and branches.
Classical query complexity: classical query cost is the worst-case number of calls over promised inputs and random tapes.
Nonoracle quantum gate cost: elementary gates outside black-box calls are charged in a separate coordinate.
Classical bit-operation cost: Turing transitions, including reduction computation and processing reply bits, are a separate classical bit-cost coordinate.
Input encoding and size for algorithmic tasks: every instance has an injective binary encoding and input size is its encoded length.
Controlled Unitary Access: controlled access is the explicitly granted block operator and is not inferred from an ordinary call.
A total Boolean XOR oracle is unitary and involutive: for every total Boolean function, the coherent XOR oracle is involutive, so .
For each source-promised , direct access exposes the exact target query selected by , or each replacement circuit/procedure implements the same complete target query action and uses at most source queries on every branch.
For a search task, the total maps and are computable as in the Statement, and maps every valid target witness at to a valid source witness at .
The executable source-access protocol in the Statement supplies the exact target initialization and output lifting, and uses no source queries outside query replacements in the / case, or at most initialization and output-lifting queries in the additive variant. All its operations obey the declared public-data and hidden-input access restrictions.
Proof
In the decision case, implies , and implies , by [F1]. Thus every source-promised input is transformed to a target-promised input.
In the search case, implies by the Statement's instance-map hypothesis. Therefore the target solver's correctness guarantee applies to .
On a source-promised input , execute the initialization protocol [A3]. Its target public parameters and initial registers are exactly those for on , so the empty-target-query prefixes agree. No freely readable hidden encoding is used. For an explicitly public source input, the decision reduction terminates by [F1], or the search instance computation terminates by [A2], and its input preparation is charged separately. In the oracle-only case the exact initialization is supplied by [A3] under the actual source interface.
Assume the first target-query actions have produced the same classical history and, in the quantum case, the same state on all query and workspace registers. The between-query operations and their measurement branches are then identical. At the next call, direct access supplies the same action; exact simulation [A1] supplies the same full action. If it is controlled, [F12] fixes its block action and [A1] supplies that variant. If it is an inverse XOR query, [F13] identifies it with the ordinary query already supplied by [A1]. Hence the executions agree through query .
Steps 1.3–1.4 prove agreement after every one of the finite, at most , query calls; any final nonquery operations and output predicate are then the same. Therefore the output laws agree.
By steps 1.1–1.2, the target solver is applied only to promised target instances; by step 2.1 the output law is unchanged. Hence its exact success probability one or bounded-error success probability at least transfers to each source input. In the search case, the exact output-lifting protocol [A3] maps every successful target witness to the source witness required by [A2]; in the decision case, the output bit remains the correct side.
On any branch with target calls, direct access uses source calls for those calls, and exact simulation uses at most . In the zero-extra-query case [A3], these are all source oracle calls. In the additive variant, initialization and lifting add at most , giving or . Taking the worst case over promised inputs and branches yields each bound, including or ; for an empty source promise the cost is zero under [F7]–[F8].
Step 3.2 counts every source oracle invocation, including any used to obtain initialization data or lift a witness. Classical work on legitimately available binary data [F11], preparation and state transformations, simulation gates, reply processing and output writing retain the separate coordinates in [F9]–[F10]. Paying a bit or gate charge does not grant a read of a hidden encoding; access must satisfy [A3]. Thus neither a reduction map alone nor separate nonquery cost accounting certifies an uncharged target oracle or hidden-input computation.
5 · Examples, counterexamples and false statements
None yet.