Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

K.1 Actual counting distributions and phase sampling

Corollary K.1 (Finite Poisson Summation over an Additive Subgroup of ZMod m)LEAN ✓

Let with [NeZero m], let be an additive subgroup, and let be any complex-valued function. Then

Proof

Expanding ZMod.dft on the right-hand side and interchanging the finite sums over and gives

Since negation is a bijection on the subgroup , Proposition 15.5 reduces the inner sum to for and for . Multiplying by and using the cardinality identity cancels the prefactor to , leaving . The full proof is checked by the Lean kernel.

In the example with and period , the comb of positions has only cells, while the annihilator has frequencies, spaced apart.

Remark K.2 (Boundaries between finite Poisson summation, conditional candidates, and the full Shor algorithm)

Scope. To connect Corollary K.1 to Shor’s algorithm, first distinguish two boundaries, then derive the counting-register distribution from the actual input when the period need not divide the register size. The exact marginal, normalization, and pointwise bound are stated next with their frozen declarations; the derivation below explains those statements, while the full algorithmic claims remain in Remark 15.7.

  1. Finite Poisson summation is not the full Shor factoring theorem: Corollary K.1 is an algebraic identity on , not a formalization of Shor’s full success probability, continued-fraction recovery theorem, or polynomial gate complexity. Conditional candidate membership is supplied separately by Theorem K.11 and Theorem K.12; below, combining these with the actual marginal gives a single-run lower bound for the event that the candidate list contains the true order when . The full algorithmic boundaries remain in Remark 15.7.
  2. Exact divisibility () versus general non-divisibility (): When , a complete periodic comb is a coset of a subgroup of , so non-resonant frequencies vanish exactly by Proposition 15.5. When , the comb cut off at the register boundary does not support this use of the subgroup identity. One must calculate a finite geometric sum. After obtaining a probability bound near a peak, passing from a frequency approximation to candidates remains a separate number-theoretic task; the conditional theorems below settle its membership component. Combining them with the actual phase mixture then bounds the single-run event that the candidate list contains the true order. This leaves the literature boundary for concentration of a conditioned comb unchanged.
Theorem K.3 (Actual-input Shor counting marginal)LEAN ✓

For every parameter record (with modulus at least , a coprime natural base, target width whose dimension contains the modulus, and period ), every control width , and every ,

Here normSquared sums the squared moduli over every one of the physical target coordinates. The input is the record’s computational basis vector at coordinate ; the equality gives the marginal probability of the specified counting outcome after summing over the entire work register.

Proof

The frozen declaration expands the actual basis input into the orthonormal Fourier eigenstates of its modular orbit, applies the controlled powers and inverse Fourier transform, and uses orthogonality to remove the cross terms. The full proof is checked by the Lean kernel.

Theorem K.4 (Normalization of the actual Shor counting marginal)LEAN ✓

For every parameter record , writing , and every ,

This includes the edge case , where the control register has the single outcome .

Proof

Summing the actual-input mixture over all counting outcomes invokes the normalized arbitrary-phase kernels; the period factor cancels because the period is positive. The full proof is checked by the Lean kernel.

Theorem K.5 (Pointwise nearest-grid lower bound for the actual marginal)LEAN ✓

For every parameter record , writing , every , every , and every , assume

By definition, this assumption means

Then

This is a pointwise statement for the selected phase and grid label; distinct phases may select the same label, so it is not an aggregate-event probability.

Proof

The arbitrary-phase bound supplies for the selected eigenphase. The actual mixture has weight for that component, and all other squared norms are nonnegative. The full proof is checked by the Lean kernel.

Theorem K.6 (Circular nearest-grid bound for one phase)LEAN ✓

For every with , every real phase , and every , assume

By definition, this assumption means

We have

The integer shift makes this a circular condition, including both midpoint ties and the seam.

Proof

The proof shifts the phase by the supplied integer, evaluates the finite geometric sum, applies the sine bounds on the nearest interval, and squares the resulting amplitude estimate. The full proof is checked by the Lean kernel.

A nearest-grid lower bound concerns one bar. Controlling the total weight outside a window requires summing the tail. In the inverse-Fourier convention, write

The last line is exactly Lean’s UnitAddCircle norm: circular distance after reducing the error modulo integers, with values in . We use for the radius to distinguish it from the label reflection below.

Theorem K.7 (Circular-window tail for single-phase QPE)LEAN ✓

For every , every real phase , and every real radius , put . Then

The bad event includes labels at distance exactly . The phase need not lie in , and no nearest-grid, order, or coprimality hypothesis is required.

Proof

Subtract a nearest integer from each error to obtain absolute value at most . The geometric sum and a sine lower bound give at positive distance. Lift the labels to integers; reduction modulo proves that the lifts are distinct. Squaring and summing reduces the estimate to a finite reciprocal-square tail on each side of the center. Retain each side’s first term and bound the rest by a telescoping sum of reciprocal differences, yielding the stated constants. The full proof is checked by the Lean kernel.

Combining the tail with normalization of the single-phase kernel, partition all labels into the bad event and its strict good window to obtain the direct consequence

This applies the cited tail and normalization, without introducing another frozen declaration. The good-window inequality is strict: equality with the radius belongs to the bad event. At and , , the tail bound is , and the strict good window has mass at least , for every real phase. The theorem includes , negative phases, integer shifts, the seam, and midpoint ties. When , the bad event is empty. A bound larger than merely means that this estimate is loose at that scale.

The supplied proof comes from QudeLeap Team’s Lean-QuantumAlg, fixed revision, retaining its attribution and Apache 2.0 license. The single-shot estimate appears in Lin Lin, Lecture Notes on Quantum Algorithms for Scientific Computation, arXiv:2201.08309v1, §3.5, equations (3.48)–(3.50). This sums only the existing inverse-Fourier single-phase kernel. The candidate-event bound below instead combines the actual mixture, the nearest-grid estimate, and number-theoretic recovery. The tail bound alone supplies no concentration result for every conditioned comb, repeated-sampling law, or factor-extraction guarantee. With a positive final , first reflect the label by , as below, before using the same phase.

Remark K.8 (Actual-input derivation and the remaining Shor boundaries)

The following actual-input derivation explains the four statements about the marginal, normalization, and pointwise lower bounds. The later Theorem K.11 and Theorem K.12 give conditional continued-fraction candidate membership; we then use them to bound the probability that a single-run candidate list contains the true order. The boundaries for exact-order selection, repeated sampling, factor extraction, and full algorithmic complexity remain in Remark 15.7.

The actual input is . Let the modulus be and the natural-number base satisfy . The work register has qubits and dimension , with only required. Independently, the counting register has size for any natural number , including . Work basis labels are ; the padded modular permutation and its linear action are

Coprimality makes multiplication modulo a permutation, while the extra padding coordinates stay fixed. Set and write for . These basis vectors are distinct, and . The circuit starts in the basis vector : it requires neither prior knowledge of nor preparation of an unknown eigenstate. The order is a parameter used to analyze this actual modular cycle.

Where does the uniform phase mixture come from? On this cycle define the normalized Fourier vectors

The negative sign in the first line matches the positive sign in the second: shifting the orbit index from to extracts . Orthogonality follows by summing th roots of unity. Summing over then leaves only , yielding the last identity. This is a coherent decomposition of a pure state, without assuming an initially sampled classical phase. These vectors span the orbit subspace; they are not asserted to form an eigenbasis of the entire -dimensional work space.

Two factors of give in the amplitude. After uniform preparation of the counting register, the binary control bits apply powers . On branch , their product is . Thus the actual joint state before the Fourier transform is

First use the source’s inverse transform , whose matrix elements are . Let be the work vector at counting outcome after this transform. Then

The factor includes both the from uniform input preparation and the from the inverse Fourier transform. Neither may be omitted.

The actual probability sums over every work outcome. The unconditional counting-register marginal is

The left side includes all coordinates. Coordinates outside the orbit, including the padding, have zero amplitude for this input. On the right, the uniform weight follows from eliminating cross terms with . This is neither the probability for a single eigenphase nor the comb distribution conditioned on a particular work outcome. For any real phase , expanding the square and using orthogonality of th roots of unity gives a direct normalization check:

Here both range from to , so the inner sum is precisely when and is zero otherwise. At , , the controlled-power sequence is empty, , and the sole counting outcome still has actual probability . At , the orbit consists only of and the mixture has just the phase- component, so and every other counting outcome has probability zero. None of this uses , , or .

The chapter’s positive-exponent convention reflects the output. Let be ZMod.finEquiv, identifying labels by their least nonnegative representatives, and write , namely . For any coordinate function under this identification, the unnormalized negative-exponent ZMod.dft used in this section satisfies

Thus, if the final transform follows this chapter’s convention, the same work vector occurs at the reflected label: , hence . The phase label remains . An inverse-transform outcome near corresponds to for the positive transform; changing the Fourier sign cannot silently leave the peak label unchanged.

The nearest-grid lower bound is pointwise. Fix any and satisfying the circular nearest-grid condition

Either midpoint choice is allowed, including a tie across the seam. Put ; shifting the phase by an integer does not change . If , then . Otherwise, the finite geometric sum gives

The inequalities are for and . The denominator is strictly positive in this nonzero branch. Squaring gives separate bounds for a phase component and the actual marginal:

The quantifiers cover every , every phase index , and every satisfying the nearest-grid condition. Different can select the same , especially when . These pointwise bounds cannot simply be added as though they referred to distinct measurement events.

A small non-divisible example: . The modular cycle is , and the state before the transform is

At , , so the actual probability is . The phase kernels also give and , whose uniform mixture is . But conditioning on work outcome before the final Fourier transform leaves the counting state , giving probability at each of the four Fourier outcomes. Expanding every coordinate shows the full distinction:

Counting label Actual Conditional

Work outcomes have probabilities , respectively. Averaging their conditional distributions with these weights gives the actual marginal. Here and , yet all the formulas above apply. This example makes no claim about continued-fraction recovery or integer factorization.

Suppose the counting register reports only the parity of . Work outcome leaves the conditional counting state . After the inverse Fourier transform, the probabilities for are . The even probabilities sum to , and so do the odd probabilities. Work outcomes and each leave a single counting basis state, giving four equal Fourier probabilities and hence the same two parity probabilities. In this example, parity and the work outcome are independent.

Keep base 2 modulo 7, increase the counting space to eight positions, and report the counting outcome modulo 4. Residue zero collects counting outcomes 0 and 4. Work outcome 1 leaves an equal-amplitude superposition of exponents 0, 3, and 6. At Fourier position 0, their phases all have the same sign. At position 4, the signs are positive, negative, and positive. The squared moduli of the phase sums are 9 and 1. Dividing by the normalization factor 8×3 gives a total probability of 5/12. Work outcome 4 leaves only exponents 2 and 5. The squared moduli are 4 and 0, and dividing by 8×2 gives 1/4. The probability of this single residue differs by 1/6 between the two conditional distributions.

Each residue pairs two Fourier positions four apart. A cross term from an odd exponent difference changes sign between them and cancels. Exponents 2 and 5 therefore leave only diagonal terms, giving probability 1/4 to each residue. For exponents 0, 3, and 6, the cross term between 0 and 6 survives. It shifts the four residue probabilities by 1/6, 0, −1/6, and 0, respectively. The probability difference for an event is the sum of the differences for its residues. Only residue zero contributes a positive difference, so testing for zero attains the total variation distance of 1/6 between the two conditional distributions.

The frozen mathematical source is D5/S3/Quantum/ShorCountingMarginal.lean at the merged trureturing commit 0ee6636c21a9d8fb2bafd11c91a8fb6247154a25: its Parameters.shor_qpe_probability_mixture, shor_distribution_normalized, and shor_mixture_peak_lower_bound are cited above, and its QuantumPhaseEstimationGeneral.qpe_arbitrary_phase_lower_bound supplies the per-phase estimate. The source parameters modulus, base, width, dimension, period correspond to ; runQPE uses , and normSquared sums squared coordinate moduli over the entire work register. The transplant preserves the supplier’s Apache 2.0 notice and source reference in the Lean file. The literature basis for the surrounding algorithmic discussion is R. Cleve, A. Ekert, C. Macchiavello, and M. Mosca, Quantum Algorithms Revisited, arXiv:quant-ph/9708016, §§5–6, Eqs. (5.2)–(5.4) and (6.1)–(6.4).

The derivation above gives the actual-input marginal, its normalization, and a pointwise nearest-grid lower bound. Below we add , establish conditional candidate membership, and sum the same event within each phase component to obtain a single-run list-membership probability bound. An explicit independent-reset premise then yields an all-pairs least-common-multiple list-event bound for exactly two observations. Certification of each exact-order return, integer factorization, arbitrary correlated repetitions, and full gate complexity retain the boundaries in Remark 15.7. No guarantee for arbitrary non-power-of-two , every conditioned posterior comb, or hardware implementation follows here.