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.
Period, Hidden-Shift, and Number-Theoretic Algorithms
1 · Prerequisites
- Absolute and Conditional Convergence; Rearrangement; Products
- Algebraic Closure, Embeddings, and Separability
- Algebraic Extensions, Extension Degree, and Finite Fields
- Binary Operations, Monoids, Groups and Subgroups
- Boolean Circuits and Nonuniform Complexity
- Bounded Linear Operators and Quotient Spaces
- Chain Conditions, Semisimple Modules and the Wedderburn–Artin Theorem
- Characters and the Orthogonality Relations
- 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
- 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 Abelian Characters for Combinatorics
- Finite Abelian Fourier Analysis
- Finite Abelian Hidden-Subgroup Algorithms
- Finite Averaging and Character-Theory Prerequisites
- 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
- 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
- Maschke's Theorem, Complete Reducibility and the Structure of k[G]
- 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 Order Finding and Rational Reconstruction
- Qubits, Bloch Sphere, Pauli Algebra, and One-Qubit Gates
- Registers, Tensor Products, and Partial Trace
- Relations, Functions, and Quotients
- Resource Bounds and Machine Invariance
- Reversible Computation, Ancillas, and Coherent Oracles
- Rings, Subrings, Integral Domains and Fields
- Rⁿ as a Normed Space; Vector-Valued Functions
- Roots, Rational Powers, and Classical Inequalities
- Semidirect Products, Automorphism Groups and Split Extensions
- 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 Group Algebra and Representations of Finite Groups
- The Lebesgue Integral and the Convergence Theorems
- The Logarithm and General Powers
- 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
- Turing Machines, Configurations, and Computation
- Uniform Circuit Families, Promise Problems, and Complexity
- Vector Spaces, Linear Subspaces, Span and Direct Sums
2 · Summary
This page treats finite cyclic discrete logarithm with explicit encodings and costed operation interfaces, the finite abelian hidden-shift promise and its generalized-dihedral left-coset reduction, and Kuperberg's power-of-two dihedral sieve. It supplies the modular-inverse recurrence, cyclic power evaluation, Fourier-sample equations, and the local shortened-final-width list-size and error analysis. Oracle queries, ideal gates, circuit compilation, classical bit operations, and workspace are kept as separate resources. The sieve is proved only for powers of two; arbitrary-order and arbitrary finite-abelian extensions, elliptic-curve group laws, and number-field/Pell algorithms remain outside its claims.
3 · Logical flowchart
4 · Definitions, theorems and proofs
Extended-Euclidean modular inverse with bounded bit cost
Definition
Input an integer and the least residue . Set and . For , divide
and update to the least residue of modulo . Stop at the first index for which . Return the least residue if , and return NO_INVERSE otherwise. For , the first division has zero divisor under this indexing; handle it separately by returning NO_INVERSE.
The algorithm uses binary integer arithmetic. Its correctness and bit bound for are proved in Correctness and bit cost of the modular inverse recurrence.
Scope of number-field and elliptic-curve extensions
Scope
The required number-theoretic result on this page is finite cyclic discrete logarithm with an explicit element encoding and an explicit group-operation or coherent-function access profile. The page makes no generic polynomial-time claim for an abstract cyclic group. Each such claim needs a reversible encoding, operation circuits, and their gate and bit costs.
Elliptic-curve and number-field/Pell discussions are context only. They do not supply an elliptic-curve algorithm, a number-field algorithm, or a complexity bound here. Childs §7.1 gives the algebraic addition formulas and says an explicit check (for example, with Mathematica) can establish commutativity, closure, and associativity, but does not carry out that check. In Proos–Zalka §3, the authors state the elliptic-curve group result and refer to [14], J. Chahal's Topics in Number Theory, for a proof. Neither passage supplies a detailed local proof that this library can use as an established proof supplier. A future elliptic-curve branch needs local proofs of the nonsingular-cubic group law and associativity, explicit point and field encodings, reversible addition, subgroup-order hypotheses, and gate and bit costs. Number-field branches likewise need explicit representations, arithmetic, reduction, and classical output procedures.
Correctness and bit cost of the modular inverse recurrence
Statement
For and , Extended-Euclidean modular inverse with bounded bit cost returns NO_INVERSE exactly when is not a unit modulo , and otherwise returns the unique with . With , the algorithm uses bit operations.
Facts & Assumptions
Given: Integers , , Euclidean division, and binary schoolbook arithmetic.
Each division has unique quotient and remainder with (Division with remainder in : for and there are unique with and ).
The Euclidean remainder sequence terminates at (The Euclidean algorithm: for and the remainder descent from terminates, and the last nonzero remainder is ).
A residue class is a unit modulo exactly when its representative is coprime to (For , is a unit if and only if ).
The recurrence, initialization, and return rule are those of Extended-Euclidean modular inverse with bounded bit cost.
Proof
First handle : since , , so the algorithm returns NO_INVERSE, correctly. Suppose . The initialized coefficients satisfy and .
If and modulo , the division identity and update give
Replacing a coefficient by its least residue preserves this congruence. Induction proves for every generated index.
By [F1], each positive remainder is strictly smaller than its predecessor, so the divisions terminate. By [F2], the last nonzero remainder is . The algorithm returns an exactly when ; by [F3], this is exactly the unit case. If it returns, the invariant at the last nonzero index says , hence the returned least residue is an inverse. If , [F3] says no inverse exists, so NO_INVERSE is correct.
Let . There are divisions: in two consecutive Euclidean divisions the remainder falls below half its earlier positive value. Indeed, if this already holds; otherwise , so the next quotient is and . Thus at most two steps halve a positive remainder, which has at most bits.
Every quotient, remainder, and coefficient residue has bits; each Euclidean quotient is found by binary long division in bit operations. Each product and reduction modulo also costs by schoolbook multiplication and division. With iterations from step 3.1, the total is .
Dihedral hidden-state pair combination
Statement
Let , , and
for . On two ordered qubits define for . Apply to and projectively measure the second qubit in its computational basis. Each outcome has probability . After discarding the measured qubit, outcome leaves the first qubit in ; outcome leaves it in up to a global phase. The readout is implemented by the Lüders projective instrument of the stated computational-basis projections, so the conditional-state claims refer to its normalized branches.
Facts & Assumptions
Given: , , the two normalized states above, the specified ordered two-qubit basis, and the specified two-outcome measurement.
A finite projective measurement has outcome weights , and those weights are nonnegative and sum to one (Finite projective measurements, Projective measurement outcome weights are probabilities).
The ordered computational basis of a finite register is orthonormal, and the ordered tensor basis retains the factor order (The computational basis is orthonormal, Ordered tensor registers, their inner product, and wire permutations).
The Dirac rank-one operator acts by (Dirac Notation Conversion).
The circuit denotation composes the supplied chronological gate actions on the specified ordered wires (Finite circuit syntax and ordered wire labels, Denotational semantics of a finite layered circuit).
The matrix of a rank-one operator in ordered orthonormal bases is (Dirac Notation Coordinate Identity).
An endomorphism trace is the sum of its diagonal entries in an ordered basis (The basis-independent trace of an endomorphism of a finite-dimensional vector space).
For real , (, , and ).
The complex exponential satisfies (, and the complex exponential extends the real exponential).
A finite projective measurement's orthogonal projections form a POVM: each is nonnegative because gives , and their sum is the identity. Its positive square roots are the projections themselves. The Lüders maps are ; for , the conditional state is . The maps form an instrument by the Lüders-instrument theorem, and the displayed conditional-state formula is the projective conditional-state rule (Finite POVMs and their outcome law, Finite instruments and conditional states, The square-root Lüders maps form an instrument, A non-negative operator has a unique non-negative square root, Conditional state for a projective measurement, Non-negative and positive operators).
Discarding the second factor contracts its matching basis index by the partial-trace rule (Partial trace over a finite tensor factor).
Proof
Put and . By [F8], . Expanding the input gives . The map permutes the four orthonormal basis vectors by an involution, so it is unitary by [F2]. Its action sends this vector to , in accordance with the ordered circuit semantics [F4].
The second-qubit-zero projection leaves . Its squared norm is , since [F7] gives . By [F3], the pure-state density is the rank-one operator; [F5] gives its coordinate matrix and [F6] its trace, so the trace of the projected rank-one state is this squared norm. [F1] identifies it with the projective outcome weight. The Lüders conditional-state rule [F9] normalizes the joint branch; its product form and the partial trace [F10] leave first-qubit state .
The second-qubit-one projection leaves . Its squared norm is by [F7]. As in step 2.1, [F3], [F5], and [F6] identify that squared norm with the trace weight, and [F1] gives the projective outcome probability. The Lüders conditional-state rule [F9] normalizes this joint branch; [F10] discards the measured second qubit. Since , the normalized first-qubit vector is times ; the factor is a global phase. By [F7] and [F8], . Thus the residual ray is . This calculation includes and either zero label.
Fourier sample from a generalized-dihedral reflection coset state
Statement
Write additively, , and identify its generalized-dihedral group with under
Let and let a total encoded function be constant on each left coset of and distinct on different left cosets. Start in the uniform state on the group elements, evaluate the coherent XOR oracle for into a zero output register, discard that register, apply the positive-sign to the first coordinate, and measure that coordinate. The measured is uniform. Conditional on , the remaining qubit is, up to a global phase,
The coordinate readout uses the Lüders projective instrument for the projections . The stated conditional qubit is the post-measurement state after discarding the measured coordinate.
Facts & Assumptions
Given: , , the displayed finite group law, the stated left-coset hiding promise, and the exact finite-register and Fourier operations above.
The generalized dihedral group is the external semidirect product by the inversion action; its multiplication is , and this multiplication defines a group ( The generalized dihedral group for an abelian group , The external semidirect product , The semidirect-product multiplication makes a group).
A coherent XOR oracle acts on the ordered basis as (Coherent XOR function oracle).
Discarding the second factor is the partial trace, which contracts equal basis indices and sums them (Partial trace over a finite tensor factor).
The finite computational bases are orthonormal and ordered tensor factors retain their declared order (The computational basis is orthonormal, Finite registers and their ordered computational bases, Ordered tensor registers, their inner product, and wire permutations).
The cyclic Fourier transform has matrix action (Positive-sign cyclic quantum Fourier transform).
A projective-measurement outcome has weight (Finite projective measurements, Projective measurement outcome weights are probabilities).
A rank-one operator acts by (Dirac Notation Conversion).
The circuit denotation composes the declared finite gates in chronological order (Denotational semantics of a finite layered circuit).
The coordinate matrix of a rank-one Dirac operator is (Dirac Notation Coordinate Identity).
Endomorphism trace is the sum of diagonal entries in an ordered basis (The basis-independent trace of an endomorphism of a finite-dimensional vector space).
For real , (, , and ).
The complex exponential satisfies (, and the complex exponential extends the real exponential).
A finite projective measurement is implemented by the Lüders instrument of its projections: the outcome- branch is , and for its conditional state is (Finite POVMs and their outcome law, Finite instruments and conditional states, The square-root Lüders maps form an instrument, A non-negative operator has a unique non-negative square root, Conditional state for a projective measurement, Non-negative and positive operators). The are orthogonal projections summing to the identity, so the same projective-to-POVM and positive-square-root specialization applies to the coordinate-register PVM.
Proof
By [F1], , so has the two displayed elements. Right multiplication gives and . Hence the distinct left cosets are for : every group element occurs in one such pair, and the first coordinate of its unique representative identifies the pair.
The initial state has amplitude on each group basis vector. After the oracle call in the declared circuit order [F8], the output basis label is constant on each and distinct for different . By [F2]–[F4], tracing out the output retains exactly pairs of group labels in the same , so the group-register operator is , where . Each is normalized because its two distinct group basis vectors are orthonormal. The rank-one notation is the operator of [F7], with coordinate matrix and trace given by [F9]–[F10].
Applying [F5] to the first coordinate sends each coset vector to The factorization uses [F12]. Let be the transformed mixture from step 2.1. Under the Lüders branch [F13], Its trace is by [F9]–[F11], so every occurs with that probability. The normalized conditional state on the joint register is . Discarding the first coordinate contracts its matching basis index by [F3]; after reordering the factors if needed by [F4], the retained qubit density is . Hence the conditional qubit ray is , as claimed.
Finite cyclic discrete-logarithm problem and costed encoding
Definition
A finite cyclic discrete-logarithm instance consists of a cyclic group of known exact order and an element . Its answer is the unique integer satisfying . Uniqueness follows because exactly when .
For a quantum or bit-cost claim, the instance additionally declares an injective fixed-length encoding , with , and one of the following operation profiles:
- explicit reversible circuits for multiplication, equality, and any controlled multiplication used by the algorithm, with gate and clean-work costs; or
- named group-operation oracles with a separate query charge for each operation. A controlled call is available only if that controlled operation is explicitly supplied and charged.
The associated hidden-subgroup function is , . A direct coherent XOR oracle for its fixed-length encoding is a separate supplied interface; if it is supplied, one call costs one query. Group-operation oracles do not automatically supply this function oracle, a controlled call, an inverse call, a gate implementation, or a classical bit-cost bound. No efficient implementation is asserted for every abstract finite cyclic group.
Remarks
The problem definition does not require to be prime. For , the function is analyzed by the separate hidden-subgroup lemma on this page.
Clean reversible controlled multiplication by a cyclic constant
Statement
Let have order , let , and let valid fixed-length codes occupy a subset . Suppose total Boolean circuits are supplied for functions , where For each fixed control , the maps and are inverse permutations; the full controlled permutation preserves . Then reversible embedding supplies a clean-ancilla circuit that acts on a control bit and accumulator by
If the two Boolean circuits have at most non-input nodes and port uses each, the construction uses at most elementary gates and at most clean work wires. The gate charge counts each supplied , CNOT, and Toffoli as one gate; no cost for constructing the Boolean descriptions is inferred.
Facts & Assumptions
Given: A finite cyclic group and fixed element , valid codes , total Boolean functions whose fixed-control slices are inverse permutations with the displayed action, and their explicit Boolean circuit descriptions.
Finite cyclic discrete-logarithm problem and costed encoding: valid element codes are injective fixed-length bit strings, and operation circuits and costs are supplied as input data.
Reversible embedding of a Boolean circuit: a finite Boolean DAG can be evaluated into fresh work, its outputs XORed into a target, and its evaluation reversed.
Gate, workspace, and serial-depth costs of reversible embedding: the reversible embedding restores all clean work to zero and uses at most gates and work bits for an -bit output.
CNOT and Control-Target Order: CNOT on an ordered control and target bit maps to .
Clean and dirty ancillas: a clean work register must return exactly to its specified zero vector.
Denotational semantics of a finite layered circuit: a chronological finite gate list acts by the corresponding composed unitary, with later gates on the left.
The computational basis is orthonormal: distinct computational-basis words are orthonormal.
Proof
For a valid code , the inverse property gives and ; for invalid both maps fix , and for both fix . Thus, for each fixed control , the two supplied maps on the -bit data register are inverse permutations on every data word, and the complete controlled map preserves .
Apply [F2] to and with separate fresh -bit targets. By [F3], each XOR computation returns its internal work to zero and has at most gates and work bits.
Starting from control , data code , and a fresh target , compute into . Swap and bitwise using three CNOTs per bit; on each pair the sequence , so it swaps the registers. The accumulator now contains and contains the old .
Compute into the old- target by XOR. By step 1.1 this XORs with itself and clears to . The inverse computation also restores its internal work to zero by [F3]. The resulting data is , with every work and temporary target bit zero, which is the clean-ancilla identity of [F5].
The forward and inverse embeddings use at most gates in total; the three-CNOT swaps use more. The two Boolean embeddings use at most clean internal work bits and the swapped -bit target is also clean on return. Hence the total bounds are gates and clean work wires.
Kuperberg dihedral hidden-subgroup scope and resource claim
Statement
Let and . Let be a total encoded function that is constant on each left coset of and takes distinct values on different left cosets, accessed by a coherent XOR oracle either directly or through Hidden shift as generalized-dihedral hidden subgroup. Equivalently, exactly when , as required by Power-of-two dihedral hidden-subgroup sieve. Use the Lüders instruments specified there for the projective readouts. For the direct branch succeeds exactly with at most queries. For , put and . The locally specified shortened-final-width sieve has failure probability at most It uses at most named -oracle queries, ideal gates for sieve control and recursive coordinate maps, classical bit operations for label sorting and list processing, quantum workspace, and bits to store all active labels. Here is the output-register width and is additional workspace for the supplied or constructed implementation. The gate count excludes the implementation of the named interface itself. An explicit circuit using gates per call adds gates. If is constructed from only the two coherent XOR oracles for a hidden-shift pair, each call uses four oracle calls and adds ordinary gates for controlled output selection; add selector gates, and charge any explicit circuits implementing and separately.
Since , the named -query count, sieve gate count, and classical label-processing count are up to polynomial factors in . The total workspace and any oracle-implementation gate costs retain the explicit interface-dependent terms above. The theorem is confined to power-of-two cyclic orders and supplied exact interfaces. It proves no polynomial-time claim, no arbitrary- version, and no algorithm for arbitrary finite abelian hidden shift.
Facts & Assumptions
Given: An integer , , a total encoded function satisfying the stated exact left-coset hiding promise, the exact coherent function-oracle and circuit interfaces, and independent fresh registers for each sample as specified in Power-of-two dihedral hidden-subgroup sieve.
In coordinates the generalized-dihedral group law is ; for and , , and the subgroup has two elements ( The generalized dihedral group for an abelian group , with inversion action has order and the dihedral relations).
One coset sample yields an independent uniform label and conditional qubit (Fourier sample from a generalized-dihedral reflection coset state).
Combining a pair with CNOT and measuring the second qubit gives either sum or difference with probability ; outcome leaves the difference state up to global phase (Dihedral hidden-state pair combination).
For a sum of independent Bernoulli variables, the additive Chernoff/Hoeffding bound gives (Chernoff bound for independent bernoulli trials).
The exact positive-sign QFT circuit on an -bit register implements and has ideal gates (Exact binary QFT circuit correctness, Exact binary QFT circuit, QFT ideal and finite-set gate-cost models).
A named oracle query, its controlled or inverse versions, ordinary gates, wires, and classical costs are separate coordinates; no oracle action is free unless supplied (Coherent XOR function oracle, Circuit-family and computation cost model).
The algorithm fixes , , widths , consecutive pairing in current list order after bucket assignment from only lower label bits, and recursive coordinate maps and ; each child-oracle query uses one parent query and at most two CNOT map gates (Power-of-two dihedral hidden-subgroup sieve).
From coherent XOR oracles for , the hidden-shift reduction constructs each coherent -oracle call with four calls and reversible bit gates, without controlled access to either source oracle (Hidden shift as generalized-dihedral hidden subgroup).
The algorithm specifies Lüders projective instruments for all readouts. Their branches are the projected operators normalized by their positive outcome weights, and ordered tensor-register inner products multiply across disjoint factors (Finite instruments and conditional states, The square-root Lüders maps form an instrument, Conditional state for a projective measurement, Ordered tensor registers, their inner product, and wire permutations).
Proof
For , query and the parity-one elements. The left-coset promise gives a unique with , so the direct branch identifies ; querying the full group uses at most calls. Now suppose , so . At recursive exponent with , , hence . The widths are until possibly the final stage, whose positive remainder is at most ; therefore and at every stage.
For one recursive sieve set , , , , and . For , and . The geometric sums satisfy and : the first is ; for the second set , so the full sum through is , and because both factors are nonpositive. Expanding the recurrence and using gives for every stage index ; this is the lower bound needed for the subsequent pair count. For the terminal list, expansion through gives Writing , we have , since with both factors nonnegative; also . Since each product factor lies in , , so .
By [F2], each initial sample has a uniform label and its stated conditional state. If a current label is divisible by and two labels share a bucket, their quotients agree modulo , so their difference is divisible by . By [F3], every retained outcome-1 state has that difference label. Induction over stages proves every label in is divisible by and every final label in is divisible by its only possible residues modulo are and .
Assume . The bucket matching is maximal within at most buckets, each leaving at most one unmatched label, so the number of disjoint pairs satisfies , since . Conditional on the complete list of labels, the current qubit registers form a product of the states supplied by [F2]: this holds for the independently prepared initial samples and is preserved by the disjoint pair gates and Lüders branches. For the selected pairs, the joint Lüders branch at any outcome vector is the tensor product of the pairwise projected vectors. Each pairwise branch has squared norm by [F3]; by the product inner product in [F9], the joint branch probability is . Thus the outcomes are independent Bernoulli variables. If is the number of retained differences, [F4] and binomial symmetry give , because . Outside this event, . Thus the invariant fails at some stage with probability at most .
If all size invariants hold, , since by step 1.2 and gives . The highest label bit is never inspected in bucket assignment or tie-breaking. It is initially an independent fair bit by [F2]; each output pair's highest bit is the difference of its two parent high bits modulo two plus a fixed value determined by lower bits, hence remains fair. Disjoint pairs use disjoint parent samples, and retention is independent of these bits by [F3] and [F9]. Induction shows the final highest bits are independent fair bits conditional on the lower bits and retention decisions. Since each final label is 0 or by step 2.1, each is the target with probability , independently, and target absence has probability at most .
Put . The stage-failure bound from step 2.2 is at most . Its difference from is . From , . Also and imply , so the target-absence bound from step 3.1 satisfies . Thus target absence is covered by the slack, and the per-sieve failure is at most .
The target state is by [F2], so the Lüders measurement in the basis reveals parity exactly. The rotation has order , hence has order . For the even branch, substituting in the product law gives If , equality of the second coordinates and cancellation of modulo give and modulo , so is injective. It sends child generators to , hence its image is . It sends the child reflection coordinate to . For the odd branch, the product law gives The first coordinates agree because as an element of . Equality of images again gives equal parity coordinates and then , hence ; so is an injective homomorphism. It sends the child generators to , its image is , and it sends to . Thus each child oracle hides the child reflection subgroup on left cosets: equality under is ambient left-coset equality, and the group isomorphism identifies that coset relation inside . Each child oracle query costs one parent query plus at most the two CNOT address-copy gates specified in [F7]. The recursive slope is modulo , so the returned value is or respectively.
There are at most non-base recursive calls. Each uses coset samples and hence named queries; the direct terminal branch uses at most 64 more. If is compiled from , [F8] makes each call four calls. By step 4.1 each recursive call has failure at most ; a union bound over at most calls gives . With , the query bound is .
Each sample uses Hadamards and one exact -qubit QFT with ideal gates by [F5], plus one oracle call. Each pair uses one CNOT and one measurement. At most pairs occur per stage and at most stages per recursive call; summing over at most calls with gives sample and pair gates. A root-oracle query at recursion depth passes through at most coordinate maps, each using at most two CNOTs; over at most queries this adds gates, also within . Gates implementing the named interface itself are separate: an explicit circuit with at most gates per call contributes gates, while the hidden-shift wrapper contributes selector gates and four queries per call by [F8]. Any explicit circuits implementing and have their own separately charged gate costs.
Stable comparison sorting of at most labels of at most bits costs bit operations per stage; at most stages in each of at most calls give classical bit operations since . The active list uses at most classical bits. By the explicit discard before recursion in [F7], only one active list is retained at a time. A nested coordinate-map query uses at most clean address bits; one sample uses further query-register qubits and the supplied or constructed oracle workspace is . Total quantum workspace is . With and , the named-query count, internal sieve-gate count and classical list-processing count are up to polynomial factors in ; total workspace and oracle-implementation gate costs retain the interface-dependent terms stated above. These are ideal-gate/query/list-processing bounds; compiling exact controlled phases into a finite gate set requires a separate cost contract and is not asserted.
Fourier annihilator equation for cyclic discrete logarithm
Statement
Let have order , , and as in Cyclic discrete logarithm hides a rank-one subgroup. Characters of are labelled by as
Then
The map is a bijection from to . Consequently, any sample that is uniform on has a uniform first coordinate .
Facts & Assumptions
Given: The cyclic discrete-log instance and the rank-one subgroup above.
is the fiber subgroup of (Cyclic discrete logarithm hides a rank-one subgroup).
The annihilator is (Character annihilator of a subgroup).
Every character of the cyclic group is uniquely labelled by with value on ; characters of a direct product factor coordinatewise (A cyclic group of order n has exactly n additive characters, Characters of a finite product factor coordinatewise).
is a primitive th root of unity, so its integer powers equal exactly at exponents divisible by (The -th roots of a complex number and the distinct roots of unity for every ).
Proof
By [F1] and [F3], every character label is a unique pair and its value on the generator of is . By [F2], a character lies in exactly when it is trivial on that generator; [F4] makes this equivalent to .
For each , step 1.1 gives exactly one annihilator label, namely . Every label in has this form, so the displayed map is a bijection. A uniform distribution on a finite set is carried by a bijection to the uniform distribution on its image, hence the first coordinate is uniform. This is a counting statement conditional on a uniform annihilator sample; the quantum sample distribution is established separately.
Costed coherent evaluation of cyclic group powers
Definition
Inputs are a valid instance from Finite cyclic discrete-logarithm problem and costed encoding, exponent registers , and one of these access profiles:
- a supplied coherent XOR oracle for ; initialize a fresh output target to , invoke the oracle once, and return its output (the zero target need not be the encoding of the group identity); or
- explicit reversible group-operation circuits, or separately charged named controlled-multiplication operations with the same complete-register action, for each classically specified constant and its inverse. Initialize a fresh accumulator to , the code of the group identity. Precompute and for , where , by repeated squaring. For , use the bit to apply the clean controlled multiplication by to the accumulator, and use to apply the clean controlled multiplication by . The procedure is the circuit of Clean reversible controlled multiplication by a cyclic constant applied at each control bit.
In profile 2, return the accumulator as the function value. The exponent registers are unchanged, all work and temporary target wires are returned to their declared initial states, and each direct oracle invocation or group-operation invocation is charged under its separately declared access profile. If only an uncontrolled black-box group operation is supplied, return UNSUPPORTED_ACCESS: it does not provide a controlled call.
To supply the total coherent XOR oracle required by the hidden-subgroup sampler, profile 2 is wrapped as follows. Prepare its -bit accumulator from zero to with at most Pauli- gates, execute the controlled multiplications, copy the resulting -bit value by CNOT into an arbitrary target , then reverse the evaluation using the separately supplied inverse-constant controlled multiplications. Finally undo the initial gates. This implements on valid exponent codes and restores every auxiliary wire to zero. The supplied total controlled operations also define its action on invalid exponent codes; these values are the declared Boolean extension. The wrapper uses controlled multiplications and at most extra /CNOT gates; preparation, output copying, and inverse calls are charged.
Remarks
The two explicit-circuit loops use controlled multiplications per function evaluation. Their correctness and clean-work identity are proved in Correctness and clean-work cost of cyclic power evaluation. This algorithm makes no generic efficiency claim for abstract finite groups.
Correctness and clean-work cost of cyclic power evaluation
Statement
For every valid encoded cyclic-group input with and every , the explicit-circuit branch of Costed coherent evaluation of cyclic group powers writes the encoding of into the accumulator, leaves the exponent registers unchanged, and returns every clean work and temporary target register to zero. If and each controlled multiplication by a known constant has gate cost at most , the circuit uses controlled multiplications and gates per evaluation, in addition to the separately charged classical precomputation. The compute-XOR-uncompute wrapper in that algorithm implements the full target-XOR action on valid exponent codes, with its declared total extension elsewhere. If each forward and inverse-constant controlled multiplication costs at most , that wrapper uses such calls and at most additional /CNOT gates, hence gates, and restores its auxiliary registers to zero.
Facts & Assumptions
Given: A cyclic group of exact order , , valid exponent codes , and the explicit circuit branch of Costed coherent evaluation of cyclic group powers.
has exact order and , so every element of is a power of (Finite cyclic discrete-logarithm problem and costed encoding).
Every integer in has an -bit binary expansion with (Big-endian encoding of ordered bit strings).
Group powers satisfy and (Exponent laws in a group: and for all , and when and commute).
Each controlled multiplication by a known constant acts exactly on valid codes and restores its clean work to zero (Clean reversible controlled multiplication by a cyclic constant).
The algorithm processes every bit of and once, applying the corresponding controlled multiplications in its chronological circuit order (Costed coherent evaluation of cyclic group powers, Denotational semantics of a finite layered circuit).
Proof
Write and using [F2]. Repeated squaring with [F3] gives the classically precomputed constants and : the base constants are and , and squaring gives .
After processing the first bits of each exponent, the accumulator is . It is the identity at . At stage , [F4] multiplies it by exactly when and by exactly when . Since [F1] places both elements in the cyclic group generated by , their powers commute; [F3] therefore gives the same formula with the sums extended through . Induction proves the invariant through .
At , the binary sums are and , so the accumulator is . Each controlled multiplication in step 2.1 restores its internal work and temporary target by [F4], while no operation changes the exponent registers. Thus the stated output and clean-work identities hold.
There are exactly controlled multiplications for the bits of and for the bits of . Each costs at most gates, so their total is at most ; precomputing the constants is classical work and is charged separately. For the full XOR wrapper, prepare the identity code with at most flips, perform these calls, copy each output bit into the arbitrary target, and apply the inverse calls in reverse order. The exponent registers are unchanged and the copied target is not an input to the reversed computation, so its accumulator returns to the identity code and every internal work bit returns to zero. Undoing the identity-code flips clears the accumulator. There are controlled calls and at most extra elementary gates, yielding the stated wrapper cost and clean XOR action by linearity on the computational basis.
Finite cyclic discrete logarithm by Fourier sampling
Definition
Input a promised instance from Finite cyclic discrete-logarithm problem and costed encoding and a rational confidence target supplied as binary positive integers , together with supplied exact uniform-state preparation and product-QFT circuits for , including their full-register extensions and declared costs as required by One finite abelian hidden-subgroup Fourier sample. If the direct coherent oracle is unavailable, first check that the supplied interfaces support profile 2 of Costed coherent evaluation of cyclic group powers, including classical repeated squaring and the forward and inverse-constant controlled multiplications. If they do not, return UNSUPPORTED_ACCESS before sampling. Otherwise construct that profile's explicit compute-XOR-uncompute oracle and precompute its repeated-squaring constants once for all samples.
Let , computed as the bit length of . Let be the least integer with , found by testing using exact rational comparisons, and set .
Repeat the following times, with fresh registers and independent measurements:
- Use One finite abelian hidden-subgroup Fourier sample once on with hiding function , obtaining a character label .
- Use Extended-Euclidean modular inverse with bounded bit cost on . If it returns
NO_INVERSE, discard this sample and continue; otherwise its output is . - Set .
- Compute by binary repeated squaring using the supplied multiplication interface, then compare it with using the equality interface. Return only if they agree.
If no iteration returns a verified value, return FAIL. A direct coherent oracle for costs one query per sample only when explicitly supplied; on the supported fallback branch, charge the controlled group operations, gates, and classical precomputation of Costed coherent evaluation of cyclic group powers. The algorithm does not infer controlled access from an uncontrolled oracle.
Finite cyclic discrete-log correctness, success and costs
Statement
Let have known exact order , let , and let be supplied as binary positive integers . Write for the sum of their bit lengths. For an access profile of Finite cyclic discrete logarithm by Fourier sampling supplying either the direct coherent oracle or the complete supported power-evaluation fallback, every returned exponent is verified and equals the unique . If neither is supplied, the procedure returns UNSUPPORTED_ACCESS before sampling; the following sampling, success and cost guarantees concern the supported profiles. Each independent Fourier sample succeeds with probability . Put , let be the least integer with , and set . With samples, the probability of returning the exact answer is at least .
Let be the supplied group-element encoding width. A direct coherent function-oracle profile uses at most function queries and separately uses ordinary multiplication/equality operations for classical verification. If is implemented by controlled group multiplications, there are controlled-multiplication calls and the same order of ordinary multiplication/equality calls for verification. If the explicitly supplied reversible multiplication, equality, and both forward and inverse-constant controlled-multiplication circuits each cost at most gates and the supplied exact uniform preparation and product QFT cost ideal gates, the total ideal gate count is
If one classical multiplication or equality operation on the encoding costs at most bit operations and modular inverses use the schoolbook extended-Euclidean algorithm, the classical bit cost of confidence preprocessing, arithmetic and verification is
All query, gate, and classical bit bounds are conditional on the stated supplied interfaces. The exact binary QFT is counted in the ideal-gate model; no finite-set compilation cost or generic efficient group encoding is asserted.
Facts & Assumptions
Given: A cyclic discrete-log instance with , , confidence target supplied as binary positive integers of total bit length , and the exact sampling and operation interfaces specified above.
On a supported profile, the procedure performs at most independent exact finite-abelian Fourier samples until a candidate is verified, discards nonunit first coordinates, computes an inverse, verifies the candidate, and returns FAIL if none is verified (Finite cyclic discrete logarithm by Fourier sampling).
The sample law is uniform on the annihilator of the hidden subgroup (Fourier samples are uniform in the annihilator).
For the cyclic DLP subgroup, annihilator labels satisfy , and a uniform annihilator label has uniform (Fourier annihilator equation for cyclic discrete logarithm).
The unit group modulo has residue classes; a residue is a unit exactly when its gcd with is one, and (The unit group and Euler's totient for , For , is a unit if and only if , Elementary lower bound for the totient ratio).
If , Correctness and bit cost of the modular inverse recurrence returns the inverse of modulo using bit operations.
The group operation and gate/query costs are separate coordinates, and no oracle call or controlled operation is free unless explicitly supplied (Circuit-family and computation cost model, Finite cyclic discrete-logarithm problem and costed encoding).
The power-evaluation circuit returns with all clean work restored; its full XOR wrapper uses separately supplied forward/inverse-constant controlled multiplications and additional elementary gates (Correctness and clean-work cost of cyclic power evaluation).
Integer powers satisfy the product and exponent laws (Exponent laws in a group: and for all , and when and commute).
Proof
By [F2], each sample is uniform on . The bijection in [F3] makes uniform on and forces . Exactly of the residues are units by [F4], so the probability of a unit is .
If is a unit, [F5] supplies modulo . Then . The algorithm returns only after testing , so every returned residue is the required exponent; rejecting a failed equality cannot produce an incorrect output.
Since , , so . Each sample calls the finite-abelian sampler once, which uses one direct query by [F1], so this bounds direct function queries. By [F7], one explicit evaluation uses controlled group multiplications. Binary repeated squaring computes the verification power with at most ordinary multiplications: square successive powers of and multiply the accumulator by each power whose exponent bit is one; [F8] proves the resulting accumulator is . The constant precomputation takes further group operations once. Thus the explicit- implementation uses group-operation queries; with a direct oracle, step 1.2 shows that the first unit-coordinate sample verifies and terminates. Hence verification occurs at most once and needs classical group multiplications, which also satisfies the stated looser bound.
Put . Extend the independent sample list to draws for this probability calculation, even when the procedure stops earlier. The probability that all independent samples have nonunit first coordinate is . By [F4], . Since , we have . Therefore and . Whenever at least one sample has a unit coordinate, step 1.2 returns ; hence success probability is at least .
In the explicit circuit profile, each sample's full XOR function evaluation and verification use gates, while the supplied uniform preparation and product QFT use ideal gates. The modular inverse on -bit residues uses bit operations by [F5], and each classical group operation uses at most bits. Multiplying these per-sample costs by gives the sampling, arithmetic and verification terms in the displayed bounds. In the direct--oracle profile, verification and inverse steps have bit work per sample, while one query costs one query and has no implicit gate bound. Precomputation contributes only additional bit operations and is absorbed because and .
To compute , compare with for successive until the first successful comparison. Since and , ; all tested integers have bits. Binary shifts and comparisons therefore cost in total. Computing from and multiplying cost at most by schoolbook arithmetic, absorbed by since . Adding this preprocessing gives the stated classical bit bound. The access coordinates remain separate by [F6].
5 · Examples, counterexamples and false statements
None yet.
Sources
- Andrew M. Childs, Lecture Notes on Quantum Algorithms (17 April 2025)
- D. Proos and C. Zalka, Shor's discrete logarithm quantum algorithm for elliptic curves
- John Proos and Christof Zalka, Shor’s Discrete Logarithm Quantum Algorithm for Elliptic Curve Groups
- Greg Kuperberg, A Subexponential-Time Quantum Algorithm for the Dihedral Hidden Subgroup Problem
- Ronald de Wolf, Quantum Computing: Lecture Notes, arXiv:1907.09415v6
- Peter W. Shor, Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer
- John Preskill, Quantum Computation, Chapter 5: Classical and Quantum Circuits