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.
Quantum Sampling, Expectation, and Monte Carlo
1 · Prerequisites
- Absolute and Conditional Convergence; Rearrangement; Products
- Algebraic Closure, Embeddings, and Separability
- Algebraic Extensions, Extension Degree, and Finite Fields
- Amplitude Amplification
- Amplitude Estimation and Counting
- 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
- Complex Power Series and Analytic Functions
- Complexification, Realification and Real Structures
- Composition Series, the Jordan–Hölder Theorem and Solvable Groups
- Computational Problems, Promises, and Cost Models
- 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
- Equivalent Forms of Completeness
- Filters and Ultrafilters
- Finite Counting, Factorials and Binomial Coefficients
- Finite Dimensional Normed Spaces and Riesz Lemma
- Finite Fields and Cyclotomic Extensions
- Finite Fourier Analysis and the Fast Fourier Transform
- 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
- Further Trigonometric Identities and Inverse Functions
- 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
- Independence Borel Cantelli and Zero One Laws
- 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
- Measurable Functions and Simple Approximation
- Measurements, POVMs, and Instruments
- Measures and Their Basic Properties
- 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
- Pointwise Extended-Real Function Products
- Polynomial Rings, the Division Algorithm and Roots
- Power Series and Real-Analytic Functions
- Primes, Euclid's Lemma and the Fundamental Theorem of Arithmetic
- Probability Spaces Random Variables and Expectation
- Product Measures and the Fubini Tonelli Theorems
- Properties of the Integral and the Working FTC
- Pure and Mixed States, Ensembles, and Schmidt Decomposition
- Quantum Fourier-Transform Circuits
- Quantum Phase Estimation
- 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 Arithmetic and Oracle Conversion
- 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
- Sigma Algebras and Borel Sets
- 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 Lebesgue Integral and the Convergence Theorems
- The Logarithm and General Powers
- The Lᵖ Spaces Holder Minkowski and Riesz Fischer
- 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
- Topological Spaces and Continuity
- Topology of ℝ
- Triangularisation, Generalised Eigenspaces and Jordan Canonical Form
- Trigonometric and Oscillatory Examples in One Variable
- 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 a finite probability law, an exactly encoded bounded observable, and the success event for estimating its expectation. It specifies the coherent sampler as a supplied unitary interface with explicit inverse, controlled access, value computation, rotations, and cost, then proves its measurement law. The classical sample mean has variance at most and the corresponding Chebyshev failure bound. The quantum bounded-mean estimator reduces the rescaled expectation to a good-state probability and consumes QA13 amplitude estimation. The variance-aware estimator uses a finite coarse centering step, positive/negative decomposition, dyadic bins, an explicit omitted-tail bound, one-sided concentration for the finite medians, certified rational logarithm cutoffs, and separately counted state copies and reflections. A uniform Boolean indicator is the counting special case; coherent preparation and ordinary sampling costs remain distinct.
3 · Logical flowchart
4 · Definitions, theorems and proofs
Finite expectation-estimation task
Definition
A finite expectation-estimation task consists of a nonempty finite set , a probability law with , and an exactly encoded real-valued function , where are finite rationals. Its target is
For rational parameters and , an estimator is a randomized or quantum procedure that outputs a real number satisfying The task specifies the target law and success event only. A particular procedure must state how it accesses samples or coherent state preparation and must charge those resources separately.
A value that approximates an underlying real-valued observable to error defines a different task with target ; any claim about must add the encoding error to its error budget.
One-sided concentration bound for independent median trials
Statement
Let be an integer, let be independent Bernoulli random variables on a finite probability space with , and put . For every , Consequently, let be odd and let be independent finite-valued real estimates on a finite probability space. If is an interval and for every , then their median (the middle order statistic) lies in except with probability at most
Facts & Assumptions
Given: A finite probability space, an integer , and an independent Bernoulli family with means . For the median consequence, also the independent finite-valued estimates , the interval , and for each .
Bernoulli random variables and binomial random variables as sums of independent Bernoulli trials: a Bernoulli variable takes values with probabilities .
Independent random elements: mutual independence means the generated event sigma-algebras factor on finite intersections.
Expectation factors over a finite product of mutually independent random variables: expectations of finite products of independent finite-valued real variables factor.
Markov's inequality on a finite probability space: for nonnegative and , .
The real exponential function and the number by a power series fixes and ; The exponential is positive and satisfies gives ; The exponential addition formula gives ; The exponential function is strictly increasing makes order preserving; and The natural logarithm as the inverse of the exponential function defines as its inverse.
The exponential function is smooth and , The natural logarithm has derivative 1/x and equals the integral from 1 to x of 1/t, The chain rule, in one line from Carathéodory: if is differentiable at and is differentiable at , then is differentiable at with , and Sums, scalar multiples, products and quotients: , , , and when give the derivative rules for the positive exponential, logarithm, sums, products, and quotients used below.
The mean value theorem, as the case of Cauchy's: for continuous on with and differentiable on there is with : if a function is continuous on and differentiable on , then its endpoint increment is its derivative at some interior point times .
Expectation of a real random variable on a finite probability space: the expectation of a finite-valued variable is the finite weighted sum of its values, including the Bernoulli formula.
Linearity, monotonicity, and the modulus bound for expectation: expectation is linear for the finite-valued real random variables below.
A function differentiable at is continuous at : a function differentiable at a point is continuous there.
Expectation agrees with the published finite weighted sum identifies general expectations of finite random variables on this probability space with the finite weighted sums in [F8].
Proof
For one Bernoulli variable , [F1] and [F8] give . Define by its two possible values and [F5], and put . Set . Differentiating by [F6] gives and , including and .
At the desired bound is equality. For , put on . By step 1.1, . The functions and are continuous by [F10], so the hypotheses of [F7] apply. For any , [F7] applied to on gives for some ; since , this shows . Applying [F7] to on then gives for some . As , . Therefore for every .
By [F11], the general expectations in [F3] and [F9] agree with the finite weighted sums in [F8]. Thus [F8]–[F9] give and . For , put . Since each is finite-valued, every event defined by is a union of level sets of , so ; the independence in [F2] therefore makes the independent. The exponential addition law [F5] and finite product factorization [F3] now give by step 2.1.
For , choose and apply [F4] to the nonnegative variable at threshold . Step 3.1 gives . For , the probability is at most one, equal to the stated bound.
Let indicate the event . Each is Bernoulli with mean at most by [F1], [F8], and the interval-success hypothesis. Each is a function of the finite-valued , so every event defined by is a union of level sets of ; hence and [F2] makes the independent. By [F11], [F9] applies to the same finite weighted-sum expectations as [F8], so . If the odd median is outside , at least estimates lie on one side of and fail, so and . Apply step 4.1 with this to get the stated median bound.
Rational natural-logarithm enclosure search
Definition
Input. Rational numbers and . Output. A positive integer and a rational interval .
Compute and initialize . At each iteration compute, by exact rational arithmetic, If , return and . Otherwise replace by and repeat. Each comparison is an exact rational comparison. Arithmetic and integer bit costs are charged separately; no running-time bound is part of this definition.
A terminating rational enclosure for the natural logarithm
Statement
For a rational , put . For each integer , define the rational partial sum and remainder bound Then and For every rational tolerance , the algorithm Rational natural-logarithm enclosure search terminates using rational comparisons. It returns the certified interval , whose width is at most and which contains .
Facts & Assumptions
Given: A rational , an integer , and, for the termination claim, a rational tolerance .
The natural logarithm as the inverse of the exponential function defines as the inverse of on ; The real exponential function and the number by a power series gives .
The exponential is positive and satisfies : and for every real .
The chain rule, in one line from Carathéodory: if is differentiable at and is differentiable at , then is differentiable at with and Sums, scalar multiples, products and quotients: , , , and when give the chain and quotient rules on the open interval where and are nonzero.
For a natural the function is differentiable everywhere with derivative ; for it is the constant , with derivative ; for a natural the function is differentiable at every with derivative ; consequently every polynomial function is differentiable at every real, with the derivative computed term by term differentiates every finite polynomial term by term.
A continuous function on is Riemann integrable, by Heine-Cantor and Riemann's criterion and The second fundamental theorem: if is differentiable on with and is integrable, then : a continuous function on a compact interval is integrable, and the integral of a continuous derivative is the endpoint increment.
If on and both are integrable then ; and compares integrals of integrable functions under a pointwise inequality.
For the sequence is null, and for the sequence diverges to : if , then as the integer increases.
Rational natural-logarithm enclosure search starts at , tests the rational bound , increments upon failure, and returns upon success.
Proof
Since , we have and . Hence , so the denominator in is positive; direct algebra gives .
Fix with . On , set . The quotient and chain rules [F3]–[F4] give and .
Put . By [F5], . The finite telescoping identity therefore gives and .
If then directly. If , the derivative difference in step 2.1 is continuous on . Applying [F6] to gives the exact remainder .
If , the remainder and the stated upper bound are both zero. For , at every we have and , so . By [F7] and [F6], , where the last equality follows by applying [F6] to the polynomial antiderivative.
If , set ; step 1.1 gives and , so step 4.1 is the required bound. If , set . Then for . By [F1]–[F2], , while . Thus the absolute error is the same as in the nonnegative case. These cases also include , where the partial sum and logarithm are both zero.
If , then for every . Otherwise put . By [F8], , while ; hence . Given , some integer therefore satisfies the rational comparison . By [F9], the search reaches such an after finitely many rational tests. Step 5.1 certifies the returned interval, and its width is the stated one.
Finite termination of the dyadic estimator parameter searches
Statement
Let and be rational and let be an integer. Each of the following exact rational searches terminates:
- increase an integer until ;
- after fixing , increase an integer until .
The first successful exponent is the least one satisfying its comparison. The second returns the least power of two with .
Facts & Assumptions
Given: Positive rationals and integer .
Every complete ordered field is Archimedean: for every real there is a natural number with .
Bernoulli's inequality : if and is natural, then .
Proof
Apply [F1] to and obtain a natural . Then [F2] at gives , so . Thus the first search has a successful exponent no larger than .
After is fixed, apply [F1] to and obtain a natural . By [F2] at exponent , , hence . Thus the second search has a successful exponent no larger than .
Each tested comparison is between rationals and is decided by finite integer arithmetic. Since step 1.1 or step 1.2 supplies a successful exponent, incrementing from zero reaches one after finitely many tests; returning at the first successful test returns the least such exponent.
Classical bounded-sample mean baseline
Statement
Let be a finite real random variable taking values in a finite interval with , and let be independent copies of , with . For and , Consequently, for every , The procedure uses exactly independent samples. If each draw and data load costs and , their total is ; arithmetic for the encoded values is an additional separately charged cost. When , every sample equals and the failure probability is zero.
Facts & Assumptions
Given: A finite law, a finite random variable with , and independent copies with the same law as .
Finite expectation-estimation task defines the target as the finite weighted expectation .
Independent random elements: random variables are independent when their generated sigma-algebras are independent.
Expectation factors over a finite product of mutually independent random variables: expectations factor for finite families of independent finite-valued real random variables.
Moments, variance, and covariance on a probability space defines variance by and covariance by .
Variance and covariance identities for random variables: and variance is bilinear as covariance.
Variance of a finite sum as the sum of all variances and covariances gives the variance of a finite sum as the sum of variances and twice the sum of pairwise covariances.
Linearity, monotonicity, and the modulus bound for expectation gives linearity of expectation for integrable random variables.
Expectation of a nonnegative or integrable random variable defines expectation by integration and the positive-negative decomposition. The nonnegative integral agrees with the simple integral on simple functions and The integral of a nonnegative simple function evaluate a nonnegative simple function by its finite sum of values times level-set probabilities on any probability space.
Proof
For any finite-valued real random variable on its given probability space, its positive and negative parts are nonnegative simple functions. By [F10], both have finite integrals, and subtraction gives . Thus all finite-valued variables below are integrable and square-integrable, and their general expectations equal their finite-law weighted sums, even when the underlying space is infinite. Since every has the law of , [F1], [F2], and [F10] identify with the same finite weighted sum . By [F8], .
If , [F3]–[F4] give for the general expectations; [F10] identifies each with the corresponding finite weighted sum. By [F5]–[F6], .
Apply [F7] to the finite sum; [F10] identifies the expectations defining all variances and covariances with their finite weighted sums. Since each has the law of , .
Put . Pointwise, , so [F2] and [F10] give for the finite weighted-sum expectation. Expanding the square and using [F5], [F8], and [F10] yields ; hence . This also covers , when both sides are zero.
Substituting step 1.4 into step 1.3 proves the stated variance bound.
For , [F10] identifies the expectation and variance of the finite random variable with those used by [F9]. Thus [F9] applied to and step 1.1 bounds the probability of by . The event with strict inequality is a subset, so step 2.1 gives the displayed failure bound.
Exactly independent draws are taken by hypothesis; summing their declared draw and load costs gives . The additions and one division used for the mean are encoded arithmetic operations and remain separate costs.
Uniform counting is finite indicator expectation
Statement
Let be a finite nonempty set with for each , let , and define for and otherwise. Then the expectation task for has target
Facts & Assumptions
Given: The finite nonempty set , its uniform probability law, and the indicator function of a subset .
Finite expectation-estimation task: the target is the weighted finite sum .
Finite probability spaces, outcome weights, events, and event probabilities: an event probability is the sum of the weights of its outcomes.
Expectation of a real random variable on a finite probability space: expectation is the finite weighted sum over outcomes.
Proof
For the uniform law, for every . By [F1], .
The summand is exactly for and zero otherwise. The sum therefore has equal terms, so . By [F2]–[F3] this is also .
Coherent finite sampler and observable value
Definition
Let be a finite nonempty set with probability law , , and let the value register contain an exact finite encoding of a real function , where are finite rationals. A coherent finite sampler for is an explicitly supplied finite-dimensional unitary on ordered sample, value, and work registers such that where the sample labels are distinct computational-basis vectors and each work state has norm one. Zero-probability labels may occur and need no special branch. The registers and their order use Finite registers and their ordered computational bases and Ordered tensor registers, their inner product, and wire permutations; each output is a pure state in the sense of Pure state and ray. The separate item Measurement law of a coherent sampler verifies the induced measurement law.
The access contract lists the actual circuits or oracle interfaces for , , controlled and controlled , value decoding, reversible arithmetic, any coherent predicate and controlled rotation, and the reflections used by the chosen estimator. Their availability is explicit under Controlled Unitary Access and Inverse Unitary Access. A forward unitary alone does not grant an inverse or a controlled call.
The resource record follows Circuit-family and computation cost model: charge state preparation, inverse and controlled access, data loading, value comparison and arithmetic, controlled-rotation synthesis and precision, good-state and initial-state reflections, gates, width, ancillas, and classical postprocessing separately. The state-preparation circuit and its costs are inputs; a state description is not a free QRAM or preparation oracle.
Measurement law of a coherent sampler
Statement
For a coherent sampler with output state as in Coherent finite sampler and observable value, projective measurement of the sample register returns with probability . If the value register is measured too, the pair has the same probability. The work register is not required to be measured, and work states for different labels need not be orthogonal.
Facts & Assumptions
Given: The coherent sampler, its finite product registers, and the projective computational-basis measurement of the sample register.
Coherent finite sampler and observable value: the output is the displayed finite sum with , , and unit work vectors.
Finite registers and their ordered computational bases and The computational basis is orthonormal: distinct sample labels are orthogonal computational-basis vectors.
Ordered tensor registers, their inner product, and wire permutations: the product register has the factorwise inner product and its ordered computational product basis.
Finite projective measurements: a projective measurement assigns weight to its projection .
A unit-vector outer product is a density operator: for a unit vector , is a density operator.
Dirac Notation Conversion and Dirac Notation Coordinate Identity: has matrix in an ordered orthonormal basis.
The basis-independent trace of an endomorphism of a finite-dimensional vector space: trace is the sum of diagonal entries in any basis.
For and , : for compatible finite-dimensional maps.
Proof
Since is unitary and is a unit vector, has norm one. Thus [F5] supplies the density operator required by [F4].
For each sample label , let . The distinct orthonormal sample labels in [F2] make these mutually orthogonal projections. If the labels do not exhaust the sample basis, include the residual projection ; it satisfies by [F1], so its measurement probability is zero. By [F3], the projection of is , so .
By cyclicity [F8], . The rank-one map here is ; [F6]–[F7] make its trace . Since is an orthogonal projection, self-adjointness gives . Thus by step 1.2. The measurement definition [F4] therefore assigns probability .
Measuring value as well refines the event by a computational-basis value outcome. The sample component is orthogonal to every other sample label, and its value register is the single basis vector ; summing over work outcomes leaves squared norm . Distinct work states are not used to separate sample labels.
Quantum counting as an expectation special case
Definition
Input. A Boolean domain with , a predicate , a phase-register size for an integer (so ), and the uniform coherent access and controlled membership reflection required by Quantum counting by uniform-state amplitude estimation. Let .
Use the unchanged QA13 counting estimator Quantum counting by uniform-state amplitude estimation with this and its supplied access model, and return its exact algebraic fraction estimate for the expectation task. Its real-valued count estimate may also be reported, with count and expectation outputs explicitly distinguished. Do not round to an integer unless that additional postprocessing and its cost are explicitly requested. By Uniform counting is finite indicator expectation, this is the QA29 expectation task for the uniform law and observable ; the applicable count guarantee is Quantum counting error and boundary cases, whose phase-size hypothesis is met. Divide its count-error radius by for the expectation-error radius, with the same success event and probability. This item defines no second amplitude-estimation or counting routine.
Amplitude-estimation expectation estimator
Definition
Input. A finite expectation-estimation task with an exact encoded observable , a coherent sampler for its law, rational target , and rational failure probability . For , require . The supplied access model must include every forward, inverse, controlled, value, predicate, and reflection operation that the chosen QA13 amplitude-estimation circuit invokes.
If , return . Otherwise compute the exact affine value Append a good flag to the coherent sampler. Reversibly compute in the declared value workspace, apply the supplied one-qubit rotation controlled by the sample/value registers, and uncompute all scratch used only for . Let denote the resulting state-preparation unitary, including and the controlled rotation; let project onto flag . Run the unchanged median-confidence estimator Median confidence amplification for amplitude estimation on with amplitude tolerance and failure probability , and call its estimate . Return
For , the exact-return branch has no quantum call. When , the input is a costed finite circuit/oracle description. Charge each use of , , controlled versions, the good and initial-state reflections, value decoding, reversible arithmetic and uncomputation, the controlled rotation and its precision, phase estimation, state preparation, gates, width, ancillas, and classical output processing according to Circuit-family and computation cost model. No operation is free because it is described by the law or observable .
Variance-aware quantum Monte Carlo
Definition
Input. A coherent finite sampler whose decoded real output has finite range, a known rational upper bound with , rational target , and rational desired failure probability . All sample, value, inverse, controlled, predicate, and rotation circuits are explicit inputs with separately recorded costs. Measurement law of a coherent sampler identifies the distribution of each measured output with the sampler law. Every observable supplied to is computed on fresh executions of using its explicitly supplied, costed value, predicate, rotation, inverse, and controlled operations. For an observable depending on a previously measured classical value, the input supplies the corresponding circuits for each admissible value and charges their selection or computation; the measured value is held fixed while those circuits are used.
If , measure one fresh output and return it. Otherwise set and reserve for the ideal estimator. Define the following finite routine for any nonnegative finite-valued output and rational parameters with and :
- Let be the least nonnegative integer with , and let be the least power of two, with an integer, for which . Their exact rational searches terminate by Finite termination of the dyadic estimator parameter searches. Moreover because ; since and , Square roots exist: a unique with ; the positives are and Squaring is monotone on the nonnegatives give , hence .
- For , define . For , define . Each lies in .
- Since , the target satisfies and . For each , run Amplitude-estimation expectation estimator on over with target and failure probability . This selects phase-register size exactly under the current QA13 interface. Call the result and form .
- Repeat this whole binned procedure an odd number of fresh independent circuit executions, as required by Quantum query algorithm, where is the least odd positive integer at least . Here is the upper endpoint of the certified logarithm interval for from A terminating rational enclosure for the natural logarithm, computed with interval width at most . Return the median. This defines for .
For one outer trial, measure one fresh sampler output and set . Holding this coarse value fixed, let be the normalized output of a new sampler execution independent of the coarse measurement and define Run separately on and with and , using fresh sampler executions independent of the coarse measurement and of the other call, conditional on the fixed . If the results are , return . Count the coarse state preparation and all fresh preparations used by both calls in the total preparation count; every controlled or inverse call remains separately charged. Let be the upper endpoint of the certified logarithm interval for from A terminating rational enclosure for the natural logarithm, computed with interval width at most . Repeat the outer trial an odd number of fresh independent circuit executions, as required by Quantum query algorithm, where is the least odd positive integer at least , and output the median.
Here is the natural logarithm from The natural logarithm as the inverse of the exponential function. For each logarithm input or , its rational subroutine runs Rational natural-logarithm enclosure search on ; A terminating rational enclosure for the natural logarithm certifies tail at most and interval width at most ; every ceiling uses the interval's upper endpoint. The procedure is a finite sequence of operations in the supplied exact-access model, and the accuracy theorem assumes exact value, predicate, rotation, and reflection operations. It makes no guarantee for approximate replacements: any finite-gate implementation needs a separate certified error analysis that transfers both output accuracy and success probability, with compilation, gate, precision, bit, and ancilla costs recorded. No state reflection or value-loading operation is free.
Quantum bounded-expectation guarantee and query cost
Statement
Let be exactly encoded with , let be the coherent sampler of Coherent finite sampler and observable value, and let . If , the algorithm Amplitude-estimation expectation estimator returns exactly. If , then for rational and it returns with with probability at least . Writing and for its QA13 phase-register size, the median output also obeys with probability at least in either declared QA13 access mode. For , in repeated controlled- access it uses exactly controlled-Grover calls, where and are the current QA13 median-interface parameters. In this mode its controlled-sampler/reflection query count is for all , and when . If , the algorithm returns exactly with no quantum query.
For , in supplied controlled-power access it instead uses exactly controlled-power queries, where ; sum their separately declared costs over all runs. No constituent-call expansion is inferred for a supplied power.
The query bound is an oracle statement. Every controlled or inverse sampler call, good-state reflection, initial-state reflection, rotation, arithmetic operation, state preparation, and classical order-statistic computation retains its separately supplied cost.
Facts & Assumptions
Given: The finite coherent sampler, exact finite value encoding, the bounded interval , the parameters in the Statement, and either declared QA13 access mode. The controlled-sampler/reflection bound assumes repeated controlled- access.
Coherent finite sampler and observable value supplies with unit work vectors; Measurement law of a coherent sampler proves sample outcome probability .
Amplitude-estimation expectation estimator computes , rotates a flag with good probability , runs the QA13 median estimator, and returns .
Amplitude-estimation additive error and success probability: for a single QFT estimate and , with probability at least .
Median confidence amplification for amplitude estimation chooses the least power of two for target and the least positive odd satisfying , then returns the median of fresh runs.
Explicit median confidence guarantee for amplitude estimation states that this median has additive error at most with probability at least .
In repeated controlled- access, Median amplitude-estimation query cost gives exactly controlled- calls and its stated logarithmic query bounds. The median threshold also gives .
Chernoff bound for independent bernoulli trials gives for a sum of independent Bernoulli indicators.
Rational bounds for pi used in finite schedules gives and .
The natural logarithm as the inverse of the exponential function defines the natural logarithm, and The natural logarithm has derivative 1/x and equals the integral from 1 to x of 1/t gives , hence .
Controlled Unitary Access and Inverse Unitary Access keep controlled and inverse calls explicit; Circuit-family and computation cost model separates oracle, gate, width, precision, and classical bit costs. Quantum query algorithm specifies fresh independent executions.
Order, continuity, range, and the product, quotient, and reciprocal laws for the natural logarithm gives strict increase, and for positive inputs. Iterating the product identity gives for a positive integer . The natural logarithm as the inverse of the exponential function gives .
Amplitude-estimation query and precision complexity gives exactly supplied controlled-power queries per QFT run at , with their separately declared costs.
Proof
Since , the interval promise gives . By [F1]–[F2], the good-flag probability after the controlled rotation is .
For one QAE run, [F3] gives the stated probability-error radius with success at least . Since fresh runs in [F4] are independent, if the median is outside , at least of their failure indicators are one.
Suppose . In repeated controlled- access, [F4] and [F6] give exactly controlled-Grover calls, , and the stated logarithmic query bounds. Substitute . In supplied controlled-power access, [F4] and [F12] give runs of power queries, hence exactly such queries with their declared costs summed. Neither access choice changes the ideal QFT output law in [F3]. The separate input-access costs in [F10] are not converted into gates without the supplied implementations.
Set . By [F8], each failure indicator has mean at most . If is their sum, the median-failure event entails . Applying [F7] to this containing event bounds its probability by , where and .
Put . Taking logarithms of the positive threshold in [F4] and applying the product law repeatedly as in [F11] gives . Because by [F9], , and gives . By [F11], and , so strict increase implies . Therefore the median error radius is at most with probability at least . The same event implies error at most whenever and , because , , and .
For the algorithm choose . By [F2], . The median guarantee [F5] gives the requested additive error; step 3.1 supplies the stronger radius, and multiplication by gives the Statement.
If , the value is constant for every , so by the probability normalization and the exact-return branch has zero error and zero quantum calls.
Dyadic positive-mean estimator under an L2 bound
Statement
Let be a nonnegative finite-valued output of a coherent sampler, , and let be rational with and . Let be the subroutine defined in Variance-aware quantum Monte Carlo. Its output satisfies with probability at least . For , its calls use prepared output-state copies and uses of the supplied state reflection when its binned QAE calls use repeated controlled- access. The accuracy and prepared-copy bounds also hold in supplied controlled-power access; in that mode sum the separately declared power-query costs rather than infer this reflection count. All input access, band comparison, value arithmetic, controlled rotation, and finite-precision costs remain separately charged.
Facts & Assumptions
Given: The finite-valued nonnegative sampler output , rational with , , and the subroutine in Variance-aware quantum Monte Carlo. For the state-reflection count use the repeated controlled- implementation of its binned QAE calls; accuracy and the prepared-copy bound permit either access mode.
Variance-aware quantum Monte Carlo defines , , the bands and , their scaled observables, and the median repetitions.
Quantum bounded-expectation guarantee and query cost: for an observable of mean , a phase register gives error radius at the stated confidence, and each QAE run uses controlled-Grover calls in repeated controlled- access, or separately priced supplied-power queries when .
Amplitude-estimation expectation estimator lets the call in [F2] select exactly the chosen by setting target .
One-sided concentration bound for independent median trials: a median of independent trials with failure probability at most fails with probability at most ; Quantum query algorithm specifies fresh independent executions.
Coherent finite sampler and observable value requires the sampler and inverse, value, comparator, rotation, and reflection implementations to be supplied and charged separately.
Holder's inequality for random variables with exponents gives .
Expectation of a real random variable on a finite probability space: expectation is the finite weighted sum for the sampler law; in particular .
The natural logarithm as the inverse of the exponential function fixes the natural logarithm used to choose the finite repetition count.
Rational bounds for pi used in finite schedules gives ; Square roots exist: a unique with ; the positives are and Squaring is monotone on the nonnegatives give from , and for nonnegative , implies .
A terminating rational enclosure for the natural logarithm returns an interval of width at most containing for every positive rational ; its upper endpoint satisfies , and its loop terminates.
Expectation agrees with the published finite weighted sum identifies the general expectations used in [F6] with the finite weighted sums in [F7].
Proof
The intervals are disjoint and cover . Write for the scaled band output in [F1], , and . By [F7] and finite-sum additivity, Since on the tail, .
By [F2]–[F3], the th estimate has error at most except with probability . A union bound over bands makes all estimates satisfy these bounds with probability at least . On that event, the deterministic estimation error is at most
The least-dyadic choice in [F1] gives , since this positive threshold exceeds . Each binned call has median repetitions. In repeated controlled- access it has controlled-Grover calls per repetition by [F1]–[F3]; each includes one supplied state reflection. There are bins. The outer repetitions are because [F10] makes . Each repetition prepares one fresh state in either access mode. Therefore the total state-copy count is , and in repeated access the total reflection count is . In supplied-power access each repetition instead makes power queries, whose actual declared prices are summed; no reflection expansion is assumed.
By [F11], the general expectations in the Hölder application [F6] equal their finite weighted-sum values in [F7]. For the lowest band, [F6] with and gives , since by [F7]; hence . For , on its band, so . Finite Cauchy–Schwarz on the band terms gives , because the bands are disjoint. Thus .
The parameter choice in [F1] gives with , so [F9] implies ; also because , and minimality gives , hence . Thus . By [F9], and . Thus the first error term in step 1.2 is less than , and the second less than . Together with from step 1.1, their sum is at most , since for .
A single binned execution succeeds with probability at least by step 1.2, hence at least , and has the stated error by step 3.1. For its median over independent executions, a failure requires at least half the runs to fail; their failure probability is at most , so the deviation from its mean is at least . By [F4] and the chosen , this probability is at most : the algorithm uses and [F10] gives . This proves the confidence claim.
The reflection count is an oracle coordinate only. By [F5], sampler preparation/inverse, controlled access, data loading, band comparison, value arithmetic, and rotation compilation are additional declared costs.
Variance-aware quantum Monte Carlo guarantee
Statement
Let be the finite-valued real output of a coherent sampler with for a known rational , and let rational . For each rational , the algorithm Variance-aware quantum Monte Carlo returns with with probability at least . If , it returns the exact mean after one output preparation. For , put and . In the exact coherent-access model, its resource counts are output-state preparations and uses of the supplied state reflection in repeated controlled- access, up to universal constants. Accuracy and the preparation bound hold in either declared access mode; in supplied controlled-power access sum the separately declared power costs instead of applying this reflection bound. Each state reflection is implemented through the supplied sampler and its inverse; these bounds do not turn variance alone into coherent access. A finite-gate approximation needs a separate certified error analysis before it can inherit this theorem.
Facts & Assumptions
Given: The finite coherent sampler, variance promise , rational parameters and , and the exact finite procedure in Variance-aware quantum Monte Carlo.
Moments, variance, and covariance on a probability space defines for square-integrable real .
Chebyshev's inequality for random variables bounds by .
Linearity, monotonicity, and the modulus bound for expectation gives linearity for the finite integrable variables used below.
Dyadic positive-mean estimator under an L2 bound: for nonnegative finite-valued , returns with with probability at least , and has the prepared-copy bound in either access mode and the state-reflection bound in repeated controlled- access proved there.
Variance-aware quantum Monte Carlo sets , draws a coarse sample, then uses fresh sampler executions for the positive and negative parts of with the coarse value fixed, and takes the prescribed outer median.
One-sided concentration bound for independent median trials proves the one-sided additive tail bound for independent Bernoulli failures; Quantum query algorithm specifies fresh independent executions.
The natural logarithm as the inverse of the exponential function defines the natural logarithm used in the confidence schedule and the positive-cutoff resource bounds.
Expectation of a real random variable on a finite probability space: for a finite law, expectation is its finite weighted sum, so a sum of nonnegative terms can equal zero only if each positive-weight term is zero.
A terminating rational enclosure for the natural logarithm returns an interval of width at most containing for each positive rational ; its upper endpoint satisfies and is computed by a terminating rational loop.
Measurement law of a coherent sampler identifies each measured output with the finite sampler law.
Expectation agrees with the published finite weighted sum identifies the general expectations in [F1]–[F3] with the finite weighted sums in [F8].
Amplitude-estimation expectation estimator forms the amplitude-estimation state preparation by appending the observable-controlled rotation to the supplied sampler. Amplitude estimation and counting input/output contract defines the Grover iterate from that complete state-preparation unitary, so its initial-state reflection is about the value-rotated preparation.
Proof
Suppose . By [F10], the fresh measured output has the finite sampler law; [F11] identifies the general expectation in [F1] with its finite weighted sum. Then . By [F8], this finite expectation is a sum of nonnegative terms, so every outcome of positive probability has . A fresh measurement therefore returns the mean with probability one.
Now suppose and write , . By [F10]–[F11], the measured coarse value and the general moments have the finite laws and expectations used in [F1]–[F2]. Scaling gives . In one trial the algorithm observes from the same law as ; [F2] gives .
Condition on the fixed coarse value and let denote the normalized fresh output specified by [F5]. On the event , the centered value satisfies The identity follows by writing and using the conditional mean to remove the cross term; the fresh draw is independent of . By [F10]–[F11], these conditional expectations are finite weighted sums for the conditional sampler law. Since , both positive parts also have conditional norm less than one.
Here and . Condition on any good coarse value . On the good coarse-sample event, [F4] applied to both fresh conditional outputs with yields except with conditional probability at most . By finite-sum linearity, identified with general linearity by [F11] and [F3], . Thus the normalized trial estimate differs from by less than . Multiplying by gives error less than in the exact coherent-access model.
The coarse-sample failure probability is at most , and conditional on any good coarse value the two positive-estimation failures together have probability at most . A union bound therefore gives each outer trial success probability at least .
The outer trials use fresh independent preparations and measurements. If their odd count is , a failed median requires at least trial failures. [F6] bounds that probability by because each trial fails with probability at most ; the algorithm sets with by [F9], so this is at most . This proves the accuracy guarantee.
Let . Then and for . By [F4], one positive estimate uses copies in either access mode and state reflections in repeated controlled- access at confidence . Each outer trial uses two such estimates and one coarse sample; [F9] gives . This yields the stated preparation bound in either mode and the reflection bound in repeated access; supplied-power implementations retain their separate declared power costs from [F4].
In each binned amplitude-estimation call, the initial-state reflection is for the complete state preparation, including the observable-controlled rotation, by [F12]. The coarse centering measurement is a separate preparation of the unrotated sampler ; alone is not a bin reflection unless that complete preparation is exactly . Sampler, inverse, controlled, rotation, value-computation, and reflection implementations remain explicitly supplied and charged. The proof counts copies and state reflections separately and infers no gate or query implementation from the variance promise.
Coherent query-to-circuit cost translation
Statement
For a QA29 execution, group its complete value-rotated sampler preparations into the distinct supplied unitaries , and let be the number of fresh standalone preparations of and the number of controlled Grover rounds using it. Also let range over the supplied unrotated sampler preparations used for coarse measurements, with such fresh preparations. If each controlled Grover round for is the explicit product of one controlled call, one controlled call, one controlled initial-state reflection, one controlled good-state reflection, and its control phase, then the exact primitive-call cost is where every is the declared cost of that operation. The preparation counts exclude the controlled and occurrences inside Grover rounds, which are already included in the terms. With a single , no unrotated coarse preparations, and , this reduces to the homogeneous formula . Value decoding, band comparisons, reversible arithmetic, controlled rotations, uncomputation, phase estimation, ancilla workspace, circuit description, and classical output/median computations add their own declared gate, width, bit, or oracle costs. If a complete reflection is instead supplied as a named oracle, charge that oracle's declared cost separately and do not also expand it into its components. No bare query bound becomes a gate bound without these implementations.
Facts & Assumptions
Given: The finite circuit and access model for Coherent finite sampler and observable value, the QA29 bounded-mean and variance-aware procedures, and the cost coordinates in Circuit-family and computation cost model.
Coherent finite sampler and observable value requires explicit forward, inverse, controlled, data, value, rotation, and reflection access.
Controlled Unitary Access: controlled access is a separately declared operation and does not follow from ordinary access.
Inverse Unitary Access: inverse access and its charge are recorded separately from forward access.
Circuit-family and computation cost model keeps named queries, ordinary gates, circuit description, width, ancillas, precision, and classical computation as separate coordinates.
QFT-based amplitude estimation and Amplitude estimation and counting input/output contract specify the Grover-iterate factors and separately declared controlled accesses. Quantum bounded-expectation guarantee and query cost counts the exact median rounds for bounded expectation in repeated controlled- access; Variance-aware quantum Monte Carlo guarantee counts copies in either mode and state-reflection uses in repeated access. Their supplied controlled-power alternatives retain separate declared prices.
Proof
For each , [F1]–[F3] show that one controlled Grover round contains exactly its five declared components. Repeating that product times contributes calls to each corresponding component cost. The standalone preparations contribute , and the separate coarse sampler preparations contribute . Summing these disjoint operation occurrences gives the displayed exact primitive-call cost.
The remaining classical and quantum operations form finite subcircuits appended to or interleaved with those rounds. By [F4], their gate, width, ancilla, bit, and description costs are added in the corresponding coordinates, not absorbed into a unit-cost query. If the full reflection is a supplied oracle, the declared alternative counts that one oracle call rather than both implementations.
Under the Statement’s explicit component-product hypothesis, applying the same occurrence-by-occurrence accounting to the repeated-access counts in [F5] proves the query-to-circuit translation for both QA29 estimators, including their distinct value-rotated preparations and any unrotated coarse samples. In supplied controlled-power mode, sum the actual power-query prices from [F5] instead of expanding them as component rounds; the standalone and coarse preparations are still charged. Since no operation is omitted or assigned zero cost, the conclusion makes no gate-cost claim without a supplied implementation.
5 · Examples, counterexamples and false statements
None yet.
Sources
- Ashley Montanaro, Quantum speedup of Monte Carlo methods, Sections 1–2
- C. M. Grinstead and J. L. Snell, Introduction to Probability, 2nd ed., Sections 1.2 and 6.1
- Ashley Montanaro, Quantum speedup of Monte Carlo methods, Lemma 1 and Theorems 3 and 5
- Andrew M. Childs, Lecture Notes on Quantum Algorithms, Section 19.3
- J. Lebl, Basic Analysis I, Section 5.4.1 (analytic logarithm interface)
- MIT OpenCourseWare 18.100B Real Analysis, Spring 2025 full lecture notes
- J. Lebl, Basic Analysis I, Logarithm and Exponential
- J. Lebl, Basic Analysis I
- T. Tao, Analysis I, 3rd ed.
- Ashley Montanaro, Quantum speedup of Monte Carlo methods, Section 1
- J. Matoušek and J. Vondrák, The Probabilistic Method, Lemma 5.1.3
- Gilles Brassard, Peter Høyer, Michele Mosca, and Alain Tapp, Quantum Amplitude Amplification and Estimation, Section 4
- Ashley Montanaro, Quantum speedup of Monte Carlo methods, Sections 2–3
- John Watrous, The Theory of Quantum Information, Chapter 2
- John Watrous, The Theory of Quantum Information, Sections 2.1–2.3
- John Preskill, Quantum Computation, Chapter 3: Foundations II: Measurement and Evolution
- Ashley Montanaro, Quantum speedup of Monte Carlo methods, Theorem 3
- Ashley Montanaro, Quantum speedup of Monte Carlo methods, Algorithms 1–3 and Theorems 3 and 5
- Gilles Brassard, Peter Høyer, Michele Mosca, and Alain Tapp, Quantum Amplitude Amplification and Estimation, Theorem 12
- Ashley Montanaro, Quantum speedup of Monte Carlo methods, Algorithm 2 and Lemma 4
- Ashley Montanaro, Quantum speedup of Monte Carlo methods, Algorithm 3 and Theorem 5
- Ashley Montanaro, Quantum speedup of Monte Carlo methods, Theorems 3 and 5