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 Order Finding and Rational Reconstruction
1 · Prerequisites
- Absolute and Conditional Convergence; Rearrangement; Products
- Algebraic Closure, Embeddings, and Separability
- Algebraic Extensions, Extension Degree, and Finite Fields
- Arc Length and Rectifiable Curves
- Binary Operations, Monoids, Groups and Subgroups
- Boolean Circuits and Nonuniform Complexity
- Bounded Linear Operators and Quotient Spaces
- Circuit Syntax, Denotational Semantics, and Measurement
- 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
- 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
- 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 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
- 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
- Inclusion–Exclusion, the Pigeonhole Principle and Double Counting
- 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
- pi: the Equivalent Characterizations
- 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
- Quantum Fourier-Transform Circuits
- Quantum Phase Estimation
- Qubits, Bloch Sphere, Pauli Algebra, and One-Qubit Gates
- Registers, Tensor Products, and Partial Trace
- Regular Continued Fractions and Diophantine Approximation
- 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
- 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 defines denominator-bounded rational reconstruction using normalized finite continued fractions and an exact integer window. It proves the finite-rational Legendre bridge needed for a rational phase sample, candidate uniqueness, and the reconstruction bit bound. The order-finding construction starts from the valid residue , whose modular-multiplication orbit has Fourier eigenphases ; phase estimation therefore yields a uniform mixture over indices, not a promise that is an eigenvector. A candidate denominator is retained only after the exact modular power test, and the algorithm returns the minimum retained value. The page gives an explicit clean reversible modular multiplier, its correctness and schoolbook resource bounds, then separates controlled-multiplier calls, black-box controlled- queries, gates, and classical bit work. The gate estimate uses ideal exact arbitrary-angle QFT gates; it claims no finite-alphabet compilation or uniform circuit family.
3 · Logical flowchart
4 · Definitions, theorems and proofs
Finite-rational Legendre criterion before the terminal convergent
Statement
Let and , with and reduced and . If , then is a convergent of the normalized finite regular continued fraction of . This is a finite-rational statement; it does not invoke the irrational-input Legendre theorem.
Facts & Assumptions
Given: Reduced with , and reduced with and .
A rational continued fraction terminates at its Euclidean quotient list, and normalized finite expansion chooses the representation whose last digit is at least unless the expansion is an integer (The continued-fraction algorithm terminates exactly on rational numbers, Normalized finite regular continued fractions are unique).
For convergents, and , and the finite-prefix formula is for the positive remaining tail (Convergents of a regular continued fraction, Convergents are given by the standard recurrences and tail formula, Complete-quotient tail formula).
Adjacent convergents satisfy (Determinant identity for consecutive convergents).
The complete quotient is at the last digit and otherwise ; the denominator recurrence is increasing after the possible initial equality (Complete quotients in the continued-fraction algorithm, Convergents of a regular continued fraction).
Reduced means coprime numerator and positive denominator, with gcd . If is coprime to and , then (Coprime integers: , If and then ; and if , and then ). Rational absolute value is multiplicative and satisfies the triangle inequality (Absolute value and the triangle inequality).
Proof
By [F1], write in normalized finite form. Since , is not an integer, so . Its terminal convergent equals by [F1] and [F2]. By [F3], any common divisor of divides , so this pair is coprime. Cross multiplication gives . Since , [F5] gives ; since , it also gives . Both denominators are positive, so they are equal: .
If , then is an integer and . Put and . The only possible such integers are and . The first is the zeroth convergent. If , then , hence ; the recurrence in [F2] gives . Thus is a convergent.
Suppose . Since , choose the largest with . Then ; the only repeated initial denominator can be , so and lies in (with when ). Put if , and otherwise let be the complete quotient after the prefix. By [F4], , and satisfies .
Put by [F3]. The integers and satisfy by expansion and ; hence . Cross multiplication using the tail formula [F2] gives . Since , it follows that . Finally and , so and .
The hypothesis makes the expression in step 3.1 less than . If , then , so . If , then because , so again . Both alternatives are impossible.
If , then is an integer. If , implies ; if , then and , while forces . Thus . Also implies , so . Hence , contradicting the strict hypothesis. Thus .
The alternatives , , and were excluded in steps 4.1–4.2, so . Then , hence and is the th convergent. The proof includes the terminal case because only was used, allowing equality at the terminal tail.
Uniqueness of denominator-bounded phase candidates
Statement
Let , be integers and . There is at most one reduced fraction with satisfying .
Facts & Assumptions
Given: Integers , , an integer with , and reduced fractions with positive denominators.
A fraction is reduced when its integer numerator and positive denominator are coprime; coprime means gcd equal to (Common divisor, and the greatest common divisor , with the convention , Coprime integers: ).
Rational subtraction is computed by cross multiplication: when (Arithmetic on the rationals).
Rational absolute value is multiplicative and satisfies (Absolute value and the triangle inequality).
Proof
For any fraction passing the test, division by the positive integer gives . Thus two passing fractions have distance at most by the triangle inequality.
If and are distinct reduced fractions, [F2] makes their difference a nonzero integer divided by , so its absolute value is at least . Since , , contradicting the bound from step 1.1. Therefore the two fractions coincide.
Elementary lower bound for the totient ratio
Statement
For every integer , , with .
Facts & Assumptions
Given: An integer and its distinct prime divisors.
If the distinct prime divisors of are , then ; the empty product is when (Euler's product formula for , stated through a finite injective list of its prime divisors).
A prime is an integer greater than with no positive divisors other than and itself, and every integer is a finite product of primes (Prime and composite integers: is prime when and its only positive divisors are and , The fundamental theorem of arithmetic: every integer is a product of primes, and the factorisation is unique up to order — if with every and prime, then and for some ).
Integer multiplication is associative and commutative, and means for some integer (The integers form a commutative ring, Divisibility in : when for some integer ).
Proof
If , then and [F1] gives , which is the claimed bound. Suppose .
For every , the increasing distinct primes satisfy : there are only integers strictly between and , so fewer than distinct primes can lie there. Therefore each factor in [F1] obeys . Multiplying positive factors gives .
Take a prime factor list for from [F2] and sort its distinct entries as , choosing for each value its first occurrence in that finite list. By associativity and commutativity in [F3], regrouping the list gives for a positive integer . Thus the distinct-prime product divides , and since every , . Therefore , so . This proves the assertion.
Denominator-bounded rational phase reconstruction
Definition
Let be integers with and . A measured phase label is represented by the unique integer with as in For , every class in has one representative with , so ; while is in bijection with . Write the normalized finite regular continued fraction of as and denote its convergents by . Every convergent is reduced by Determinant identity for consecutive convergents. A candidate is a convergent whose numerator and denominator are reduced, whose denominator satisfies , and which passes the exact integer test
The reconstruction result is the unique candidate if the candidate set is nonempty, and is FAIL otherwise. The candidate set includes the terminal convergent whenever it meets the same conditions. Uniqueness, and hence well-definedness of this value, follows from Uniqueness of denominator-bounded phase candidates under .
Rational reconstruction from a phase sample
Definition
Input. Integers , , and , with and the label from Quantum phase estimation when this routine is called from QPE.
Output. A reduced fraction with , or FAIL.
Instructions. Set , , and . Repeatedly divide by the positive integer , obtaining the unique quotient and remainder with and . Append ; if , stop, and otherwise set , increment , and repeat. For this immediately gives the one-digit expansion ; for every other input, The continued-fraction algorithm terminates exactly on rational numbers gives termination and the resulting normalized finite expansion is the one in Denominator-bounded rational phase reconstruction. Starting from , process the digits in order using and ; this lists all convergents including the terminal one by Convergents of a regular continued fraction. For each convergent, reject it if ; otherwise compute exactly and accept it precisely when this integer is at most . Return the first accepted candidate, or FAIL if none exists. The uniqueness result lem-qa-rational-reconstruction-candidate-uniqueness shows there cannot be two. The algorithm makes no floating-point comparison. Its deterministic bit bound is proved separately in thm-qa-rational-reconstruction-bit-cost, which also establishes that these instructions terminate.
Correctness of phase-sample rational reconstruction
Statement
Let integers , , , and satisfy , and let with and . Let be any nearest grid label to phase in circular distance, meaning . Then Rational reconstruction from a phase sample returns . For every phase label , there is at most one passing candidate with denominator at most .
Facts & Assumptions
Given: Reduced with , for an integer , and a nearest circular grid label .
Circular distance is ; for , a nearest label has distance at most (Circular phase distance modulo one).
The reconstruction routine tests the exact condition on normalized finite-CF convergents with (Rational reconstruction from a phase sample, Denominator-bounded rational phase reconstruction).
For reduced with , a reduced satisfying is a convergent of the normalized finite expansion (Finite-rational Legendre criterion before the terminal convergent).
At most one reduced fraction of denominator at most passes the exact reconstruction window when (Uniqueness of denominator-bounded phase candidates).
Proof
If , reducedness forces . The only nearest circular grid label is , so and its normalized finite expansion is with terminal convergent . This convergent has denominator and passes the exact test, so [F2] and [F4] return .
Suppose . The distance from to either endpoint is at least , by . Therefore a nearest circular label cannot cross an endpoint: if were on the other side of or , the circular distance would be at least the distance of from that endpoint, contradicting [F1]. Thus .
Reduce to with . If , its normalized finite expansion terminates at that fraction; its terminal convergent is , whose denominator is at most , and step 1.2 gives . Thus it passes [F2], and uniqueness [F4] makes the algorithm return it.
If , then is a positive integer, so . Combining with step 1.2 gives , because . Also gives . Applying [F3] with shows it is a convergent of .
The same linear error bound in step 1.2 gives . Therefore this convergent passes the exact test and denominator bound in [F2]. By [F4] it is the unique accepted candidate, so the algorithm returns . The two cases establish correctness and candidate uniqueness.
Reversible modular multiplication by a unit
Definition
Input. An integer , , a one-bit control , an -bit data register , and integers with and . The data encoding is valid when its unsigned value is less than .
Residue addition and multiplication are in with the class operations of The congruence class and the quotient set , Addition and multiplication on by and , and For every natural , is an abelian group, multiplication is a commutative monoid operation, and both distributive laws hold. The inverse condition says is a unit, equivalently by The unit group and Euler's totient for and For , is a unit if and only if . Kets use Dirac Notation Conversion; are ordered computational-basis registers with the unsigned encoding of Finite registers and their ordered computational bases and Big-endian encoding of ordered bit strings, tensor order as in Ordered tensor registers, their inner product, and wire permutations, and circuit denotation as in Denotational semantics of a finite layered circuit. “Clean work” means initialized and returned to zero under Clean and dirty ancillas.
Output. A reversible circuit on and clean work registers which implements the controlled map for and valid , and is the identity on invalid encodings and when .
Instructions. Define the total Boolean function on by Generate the following explicit NOT/AND/OR DAG for this function. Bit arrays in the instructions below are indexed from least significant bit ; the input and output port lists retain the repository's most-significant-first register order. Begin with the distinct input identifiers and two constant nodes . Every gate emission appends a fresh identifier in consecutive order, referencing only existing identifiers. A named bit below is an alias of its node identifier, never an additional gate. Expand every macro call immediately in the stated loop order.
- Define by emitting, in order, , , , and , returning . Define by looping : emit , , , , and . Return and . Define by first emitting in increasing and then calling ; return its difference bits and carry bit (the no-borrow bit).
- Define by emitting and, for , , , . It returns the selected bit array . Public constant arrays below refer to the shared nodes and are zero-padded to the displayed width.
- Initialize a -bit accumulator with zero aliases. For , form a -bit row : for , emit , where is the constant bit of ; all other row bits alias . Replace by the sum output of , ignoring the carry output.
- Initialize to zero aliases. For , form the -bit array by and for . Call , obtaining difference and carry . Set to the low bits of .
- Pad by a zero high bit, call , and let be its carry. Emit and . Set . The ordered output ports are . This completes the finite DAG and its topological order. Construct a second DAG by the identical recipe with constant in place of .
Compile each DAG to the clean-target XOR oracle of Coherent XOR function oracle using Reversible embedding of a Boolean circuit, whose exact gate-emission rules apply also to repeated-source ports. Allocate an -bit clean target, compute into it, swap the data and target registers with three CNOT gates per bit, then apply the compiled XOR computation for to the old-data target, using the new data as input. Each compiled XOR oracle is an involution by A total Boolean XOR oracle is unitary and involutive. Return the concatenated gate list with every compute-copy-uncompute stage included. Separate items thm-qa-modular-multiplication-circuit-correctness and thm-qa-modular-arithmetic-cost establish its basis action and gate/work bounds. No depth bound is part of this algorithm.
Correctness of the reversible modular multiplier
Statement
For , , and a unit with supplied inverse , the circuit of Reversible modular multiplication by a unit is unitary. On a computational-basis state it fixes the control bit, sends to if and , and fixes if or . All Boolean value, target, and scratch registers return to zero. Its action therefore extends coherently to superpositions.
Facts & Assumptions
Given: , a unit and inverse , a one-bit control and an -bit data register, and the construction in Reversible modular multiplication by a unit.
The circuit computes the total function into a clean target by an XOR oracle, swaps that target with , then computes on the new data to clear the old-data target (Reversible modular multiplication by a unit). Its gate list acts in the declared chronological order on the stated wires (Denotational semantics of a finite layered circuit).
Reversible embedding maps to for every basis input and target, restores clean work, and extends to superpositions; a clean register begins in its all-zero basis vector (Gate, workspace, and serial-depth costs of reversible embedding, Clean and dirty ancillas).
A coherent XOR oracle acts as and is a unitary involution for every total Boolean on the ordered computational-basis register (Coherent XOR function oracle, A total Boolean XOR oracle is unitary and involutive, Finite registers and their ordered computational bases).
A residue class is a unit exactly when its representative is coprime to ; multiplication by a unit has its stated inverse in (For , is a unit if and only if , For every natural , is an abelian group, multiplication is a commutative monoid operation, and both distributive laws hold).
Proof
The DAG's XOR formula is , which is modulo for each of the four input pairs. In its adder, : if both input bits are the carry is , if exactly one is the carry is , and if both are the carry is ; the displayed sum bit has the corresponding parity. Multiplying by and summing proves . Subtraction therefore represents ; its carry is exactly when , and its low bits are modulo . The selector's disjoint branches give for and for .
After the first product rows, the accumulator is . This holds initially and is preserved by step 1.1; no overflow occurs because every partial sum is at most . Thus the final product bits represent even for invalid input encodings. In the remainder loop, the invariant is that is the remainder modulo of the already scanned product prefix and . Appending bit gives . Subtraction and selection from step 1.1 give if and otherwise, so the next value lies in and is the new prefix remainder. It fits bits, making the discarded high bit zero, even when . Induction proves the final . The final no-borrow comparison gives exactly when , and selection by therefore computes precisely . The same argument applies to .
Fix . If or , the defining function and its inverse-function counterpart both return . If and , the first function returns and the inverse function returns , by [F4]. Thus in every case .
By [F2] and [F3], the first computation adds into a clean target and restores all value-computation work. A bitwise swap made from CNOTs acts as , so after the three CNOTs per bit the data register contains and the target contains the old .
Apply the clean XOR computation for to the new data and the target holding old . Step 3.1 says its output is exactly that old , so XOR changes the target to and restores its computation work by [F2]. Hence all temporary registers are clean and the data/control action is the claimed one.
On valid residue encodings, multiplication by is a bijection of the residue register because is its inverse; on invalid encodings and at control the map is the identity. It is therefore a permutation of the full finite computational basis. A basis permutation is unitary, and [F2] supplies the same action on arbitrary superpositions with clean work. This proves the statement.
Modular order finding with rational reconstruction
Definition
Input. An integer , the standard representative of a unit class modulo , and an integer specifying target failure probability .
The representative is the unique one in by For , every class in has one representative with , so ; while is in bijection with ; unit membership is equivalent to by The unit group and Euler's totient for and For , is a unit if and only if . The register ket uses Dirac Notation Conversion. The superposition output law for applying the QPE gate list to this non-eigenvector input is supplied by Phase estimation on a superposition of eigenspaces.
Output. An accepted candidate, or FAIL.
Instructions. Set , , , and . The inequality follows from . Compute the inverse constant by the following binary-integer loop. Initialize . While , use division with remainder to compute with and , compute the least residue , and simultaneously replace by . Division and least residues use Division with remainder in : for and there are unique with and and For , every class in has one representative with , so ; while is in bijection with ; use schoolbook binary arithmetic for every update. When the loop stops, return FAIL if ; otherwise set and . The inverse identity, termination, and preprocessing bit cost are established in Gate and bit cost of modular multiplication and powering. For , compute and . Then and for all .
Repeat independently for samples . Initialize the system register to the valid residue and apply the QPE phase-estimation circuit with phase-register length . Its controlled gate is implemented by the explicit controlled modular-multiplication circuit for from Reversible modular multiplication by a unit. This procedure uses the QPE gate list on ; it does not assert that is an eigenvector. Measure the phase register to obtain . Run Rational reconstruction from a phase sample with . If it returns FAIL, retain no denominator from this sample. If it returns , compute as follows: set , , ; while , if is odd set , then set and . Retain exactly when the final .
After all samples, return the smallest retained positive denominator; return FAIL if none was retained. A passing candidate is not called the order unless it is minimal. The exact criterion iff the order divides is If then iff is an integer multiple of , the powers are distinct, and has exactly elements; if has infinite order then only for . The separate item thm-qa-modular-order-finding-success proves the probability guarantee and the fact that every retained candidate is an order multiple.
Gate and bit cost of modular multiplication and powering
Statement
Let , , and let be the standard representative of a known unit modulo . In the explicit schoolbook Boolean construction of Reversible modular multiplication by a unit, each controlled multiplication by a known unit has a Boolean DAG with . Under the compiler of Gate, workspace, and serial-depth costs of reversible embedding, the complete clean circuit, including both XOR computations, swaps, and inverse cleanup, uses elementary gates and clean work bits. Repeated-squaring constants and their inverses for powers can be computed in deterministic multitape bit transitions. No depth bound is asserted.
Facts & Assumptions
Given: , a standard unit representative, the stated schoolbook arithmetic, the reversible circuit in Reversible modular multiplication by a unit, and the resource models in Circuit-family and computation cost model and Classical bit-operation cost.
The reversible compiler uses at most elementary gates and at most clean work bits for an -bit output Boolean DAG (Gate, workspace, and serial-depth costs of reversible embedding).
The multiplier computes a controlled constant product, a remainder, a validity condition, the inverse cleanup, and swaps; its correctness is established by Correctness of the reversible modular multiplier and its circuit stages are specified in Reversible modular multiplication by a unit.
Bit cost counts multitape Turing-machine transitions and charges classical arithmetic, address/input work, and output writing; it is separate from gate and query costs (Classical bit-operation cost, Circuit-family and computation cost model).
Division by a positive integer gives a unique quotient and smaller nonnegative remainder; the Euclidean descent from with terminates at (Division with remainder in : for and there are unique with and , The Euclidean algorithm: for and the remainder descent from terminates, and the last nonzero remainder is ).
The operations in are well-defined ring operations, so congruences are preserved by subtraction and multiplication (For every natural , is an abelian group, multiplication is a commutative monoid operation, and both distributive laws hold).
A residue class modulo is a unit exactly when its representative is coprime to (For , is a unit if and only if ).
Every residue class modulo positive has a unique standard representative with (For , every class in has one representative with , so ; while is in bijection with ).
Proof
In the explicit DAG of [F2], XOR emits four nodes, each adder bit emits two XORs and three carry nodes, hence nodes, and subtraction emits one additional NOT per bit, hence nodes at width . Selection emits nodes. The product uses partial-product AND nodes and adders of width , totaling nodes. Its remainder stages use nodes. The final comparison uses nodes, validity/control uses two more, final selection uses , and the two shared constant nodes complete the count. Thus suffices for all ; every gate has at most two input ports, so . The correctness supplier in [F2] proves that the row sums never overflow and that each remainder stage needs only one conditional subtraction; these are exactly the loops just counted.
For the inverse computation, initialize and, while , divide with , set to its least residue, and simultaneously update to . Initially and ; these two congruences are preserved because by [F5]. The remainder pair is exactly the Euclidean descent in [F4], so it terminates at by [F6]. The invariant then gives , and [F7] gives the returned inverse constant . For its cost, at every division ; the new remainder is : if , then , while if , then and . Thus every two successive positive remainder values shrink by at least a factor of two, giving iterations. The quotients and remainders have bits, and always lie in , so the signed intermediate has bits as well (its magnitude is at most ). Schoolbook division, multiplication, subtraction and reduction each take multitape transitions, including signed reduction by dividing the absolute value and, when needed, replacing a nonzero remainder by . Hence this explicit loop costs transitions. Set , and for the remaining powers compute and . Induction gives and ; each stage uses two schoolbook modular products, so all powers and inverses still cost transitions.
Step 1.1 counts the complete Boolean function DAG, including the validity comparison, control, and conditional output, and gives . Apply [F1] separately to the forward and inverse functions; the two compiled XOR maps and their clean work each cost . The swap uses CNOT gates. Adding these counts proves the claimed gate and clean-work bounds; [F2] ensures they implement the required map.
The resource definition [F3] keeps gate count, classical bit transitions, and oracle queries separate. The preceding counts establish only gate/work and stated classical arithmetic bounds; no circuit layering or depth estimate follows from them.
Bit cost of phase-sample rational reconstruction
Statement
Let , , , and be integers, and set . Under the multitape bit-transition model of Classical bit-operation cost, Rational reconstruction from a phase sample uses Euclidean divisions and deterministic bit transitions. No real-number arithmetic is used.
Facts & Assumptions
Given: Integers , , , , the reconstruction routine, and the bit-cost convention.
Rational continued fractions are computed by the Euclidean quotient algorithm; integer division has quotient and remainder with , and convergent denominators obey (Rational reconstruction from a phase sample, Finite and infinite regular continued fractions, Convergents of a regular continued fraction, Division with remainder in : for and there are unique with and ).
Bit cost counts transitions of a fixed finite-alphabet multitape machine and charges comparison, arithmetic, reading, and output work (Classical bit-operation cost).
Proof
Let be the convergent denominators, with and . The recurrence in [F1] gives whenever both indices exist. Since the terminal denominator is at most , every two quotient steps at least double a positive denominator, so the number of Euclidean divisions is at most .
The reduced denominator of is at most , so the recurrence in [F1] makes each convergent denominator at most its terminal denominator. Since , the normalized expansion starts with ; its initial convergents satisfy and , and the recurrence with positive later digits preserves . Thus all convergent numerators and denominators have bits. By the division algorithm in [F1], binary long division of two such integers can be performed by at most compare/subtract scans of at most bits, hence multitape transitions under [F2].
Updating a convergent numerator and denominator by [F1] uses a constant number of products and sums on -bit integers, hence transitions per update. Each convergent candidate also requires a constant number of products and , an absolute difference, a doubling, and a comparison with . Schoolbook multiplication and these scans each cost transitions. There are candidates by step 1.1, so total comparison work is ; writing the selected numerator and denominator costs only .
The routine normalizes the rational by exact Euclidean divisions and applies only the integer test from [F1]; all work is covered by the above bounds. Hence its deterministic multitape bit cost is and it performs no floating-point comparison.
Success probability and repetition for modular order finding
Statement
Let integer , and let be a unit modulo of order . Use Modular order finding with rational reconstruction with and . One independent phase sample yields denominator with probability at least After independent samples, where , the algorithm returns the exact order with probability at least . For any requested , taking gives success probability at least .
Facts & Assumptions
Given: , a unit class modulo , its order , and the circuit/sampling instructions in Modular order finding with rational reconstruction.
The unit classes form a finite group of size ; an element of a finite group has finite order dividing the group size. Standard representatives identify this group with a subset of (The unit group and Euler's totient for , The order of every element of a finite group divides the order of the group, For , every class in has one representative with , so ; while is in bijection with ).
On valid residues, and invalid -bit encodings are fixed by the multiplier circuit (Reversible modular multiplication by a unit, Correctness of the reversible modular multiplier).
The finite cyclic characters are orthogonal: if and otherwise (Orthogonality of the characters on ).
For each eigenphase, phase estimation on a superposition has the eigenspace-weighted outcome mixture; every nearest -grid label has probability at least (Phase estimation on a superposition of eigenspaces, Phase-estimation nearest-grid and tail bounds).
A coprime class modulo is counted among the units, and (For , is a unit if and only if , The unit group and Euler's totient for , Elementary lower bound for the totient ratio).
If has order , then exactly when (If then iff is an integer multiple of , the powers are distinct, and has exactly elements; if has infinite order then only for ).
For every integer , the circumscribed regular -gon has perimeter and satisfies (Inscribed regular-polygon perimeters increase to 2 pi, while circumscribed perimeters decrease to 2 pi).
The cofunction identity gives , and the Pythagorean identity gives (Cofunction, supplementary, quarter-turn, and reflection identities for the six trigonometric functions, Pythagorean and parity identities for all six trigonometric functions on their natural domains).
Sine is strictly increasing on , cosine is strictly decreasing on , , , and (Signs, monotonicity intervals, and ranges of sine and cosine, Quarter-turn values and shifts by pi/2 and pi, Pi as twice the smallest positive zero of cosine).
On its natural domain, (Tangent, cotangent, secant, and cosecant on their exact natural domains).
Distinct computational-basis vectors of a register are orthonormal (The computational basis is orthonormal).
Proof
By [F1], is a positive integer and : write with integer by divisibility in [F1]. The group contains its identity, so ; since , and thus . Consequently , while the group counts only standard residue representatives and so . The orbit , , consists of distinct valid computational-basis vectors, since equality of two residues would imply a smaller positive power of is .
The algorithm starts with and in standard representatives. Suppose and . Squaring the first identity gives , and the two loop updates give . Induction proves both identities for all ; every constant remains in and is a unit with the supplied inverse. On valid residues, repeated application of [F2] therefore gives ; on invalid encodings both this power and the multiplier are identity. Thus each controlled multiplier in the QPE gate list is the required controlled power on the full data register, with its work returned clean.
Define for . The shift action in [F2] gives , including the wrap from to . By [F11] and [F3] these are orthonormal unit vectors; the same character sum gives .
Apply the QPE circuit from [F4] to this decomposition. Its outcome law is the uniform mixture over , each phase being ; this uses the superposition law in [F4], rather than an eigenvector promise for . There are exactly indices with , counted by [F5].
For each coprime , [F4] gives probability at least to a nearest grid label. Here , , and by step 1.1, so the reconstruction correctness theorem applies and returns reduced denominator on that event. By [F6], ; hence the algorithm's exact verification retains this denominator. Summing the disjoint eigenspace-mixture probabilities gives one-sample success at least . By [F5] and , this is at least .
Every retained passes , so [F6] implies . If the exact denominator is ever retained, no retained candidate is smaller than and itself is present; the algorithm's minimum rule therefore returns .
First put . Since by [F9], . The cofunction law [F8] gives ; strict monotonicity and the endpoint values in [F9] show both are positive. Thus [F10] gives , and [F7] at gives , so . Now put and . The one-sample lower bound in step 4.1 and , together with , give . Independent resets make the samples independent, hence the probability that no successful sample occurs is at most . Since , and with integer the binomial expansion gives , we obtain . By step 5.1, the output is the exact order except on this event.
For arbitrary , choosing gives . Thus the stated guarantee follows without using an inexact floating-point threshold.
Separate order-finding query, gate, and bit costs
Statement
Let integer , , , and . With the explicit multiplier of Gate and bit cost of modular multiplication and powering and the ideal continuous exact-arbitrary-angle QFT cost model, the algorithm uses controlled modular-multiplier circuits, elementary gates, and schoolbook classical bit transitions. Equivalently these are , , and . With only controlled access, the query count is exactly for and ; this is not a polynomial query bound. No finite gate alphabet, uniform circuit family, or generator-time bound is asserted.
Facts & Assumptions
Given: The modular order-finding circuit and sample count, the QPE cost model, and the distinct gate/bit/query coordinates in Circuit-family and computation cost model and Classical bit-operation cost.
The algorithm uses phase bits, , independent samples, and one controlled modular multiplication for each of the QPE powers per sample (Modular order finding with rational reconstruction).
One phase-estimation run uses controlled- calls if only controlled- is supplied; exact ideal QFT gate count is (Phase-estimation query and gate costs).
Each controlled modular multiplier uses gates, while repeated-squaring constants and inverses cost classical bit transitions (Gate and bit cost of modular multiplication and powering).
Continued-fraction reconstruction costs bit transitions when , and the declared model charges classical arithmetic separately from oracle and gate operations (Bit cost of phase-sample rational reconstruction, Classical bit-operation cost, Circuit-family and computation cost model).
Proof
Since , its bit length is ; [F1] has and . There are exactly controlled modular-multiplier circuits.
By [F3], those arithmetic circuits contribute gates. Each QPE phase preparation and ideal inverse QFT contributes more gates per sample by [F2], for total , which is bounded by since . Thus the stated gate bound follows.
Precomputing all modular powers and inverses costs bits by [F3]. In each sample, reconstruction costs by [F4]. Testing a candidate by binary modular exponentiation uses modular products on -bit values, each with schoolbook transitions as in [F3], hence bits. Across samples this is , including preprocessing because and .
Under only controlled- access, [F2] charges exactly calls for each run, so is the total query count. Under compiled known modular arithmetic, the multiplier circuits have the separate cost in step 2.1. The cost coordinates in [F4] are independent, so this gate bound does not turn a black-box controlled- query into a polynomial-cost circuit.
For , when , since . This gives the equivalent logarithmic forms. The ideal QFT model uses exact continuous rotations, and none of [F1]–[F4] provides a finite-alphabet compilation or a uniform-family generator, so those claims are outside this theorem.
5 · Examples, counterexamples and false statements
None yet.
Sources
- Andrew M. Childs, Lecture Notes on Quantum Algorithms, §9
- Peter W. Shor, Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer
- Ronald de Wolf, Quantum Computing: Lecture Notes, arXiv:1907.09415v6
- John Preskill, Quantum Computation, Chapter 5: Classical and Quantum Circuits