Alphabeta Math
Pipeline-generated
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

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

AlgorithmAlgorithm: Literature-sourcedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

Extended-Euclidean modular inverse with bounded bit cost

Definition

Input an integer n≥2 and the least residue c∈{0,…,n−1}. Set (r−1,r0)=(n,c) and (s−1,s0)=(0,1). For i=0,1,…, divide

ri−1=airi+ri+1,0≤ri+1<ri,

and update si+1 to the least residue of si−1−aisi modulo n. Stop at the first index i for which ri+1=0. Return the least residue si if ri=1, and return NO_INVERSE otherwise. For c=0, 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 O(B3) bit bound for B=⌈log⁡2(n+1)⌉ are proved in Correctness and bit cost of the modular inverse recurrence.

RemarkRemark: AI-adaptedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

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.

TheoremStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Correctness and bit cost of the modular inverse recurrence

Statement

For n≥2 and 0≤c<n, Extended-Euclidean modular inverse with bounded bit cost returns NO_INVERSE exactly when c is not a unit modulo n, and otherwise returns the unique u∈{0,…,n−1} with cu≡1(modn). With B=⌈log⁡2(n+1)⌉, the algorithm uses O(B3) bit operations.

Facts & Assumptions

Given: Integers n≥2, 0≤c<n, Euclidean division, and binary schoolbook arithmetic.

[F1]

Each division has unique quotient and remainder ri−1=airi+ri+1 with 0≤ri+1<ri (Division with remainder in Z: for a∈Z and b>0 there are unique q,r∈Z with a=qb+r and 0≤r<b).

[F3]

A residue class is a unit modulo n exactly when its representative is coprime to n (For n≥1, [a]n is a unit if and only if gcd⁡(a,n)=1).

[F4]

The recurrence, initialization, and return rule are those of Extended-Euclidean modular inverse with bounded bit cost.

Proof

1.1givenF4algebra

First handle c=0: since n≥2, gcd⁡(n,0)=n≠1, so the algorithm returns NO_INVERSE, correctly. Suppose c>0. The initialized coefficients satisfy r−1≡s−1c(modn) and r0=c≡s0c(modn).

1.2F1F4step 1.1inductionalgebra

If ri−1≡si−1c and ri≡sic modulo n, the division identity and update give

ri+1=ri−1−airi≡(si−1−aisi)c≡si+1c(modn).

Replacing a coefficient by its least residue preserves this congruence. Induction proves ri≡sic(modn) for every generated index.

2.1F1F2F3step 1.2algebra

By [F1], each positive remainder is strictly smaller than its predecessor, so the divisions terminate. By [F2], the last nonzero remainder is d=gcd⁡(n,c). The algorithm returns an si exactly when d=1; by [F3], this is exactly the unit case. If it returns, the invariant at the last nonzero index says sic≡d=1(modn), hence the returned least residue is an inverse. If d≠1, [F3] says no inverse exists, so NO_INVERSE is correct.

3.1F1step 2.1algebra

Let B=⌈log⁡2(n+1)⌉. There are O(B) divisions: in two consecutive Euclidean divisions the remainder falls below half its earlier positive value. Indeed, if ri+1≤ri/2 this already holds; otherwise ri+1>ri/2, so the next quotient is 1 and ri+2=ri−ri+1<ri/2. Thus at most two steps halve a positive remainder, which has at most B bits.

4.1step 3.1algebra∎

Every quotient, remainder, and coefficient residue has O(B) bits; each Euclidean quotient is found by binary long division in O(B2) bit operations. Each product aisi and reduction modulo n also costs O(B2) by schoolbook multiplication and division. With O(B) iterations from step 3.1, the total is O(B3).

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Dihedral hidden-state pair combination

Statement

Let N≥2, s∈Z/NZ, and

∣ψk⟩:=∣0⟩+exp⁡(2πiks/N)∣1⟩2

for k∈Z/NZ. On two ordered qubits define C∣a,b⟩=∣a,b⊕a⟩ for a,b∈{0,1}. Apply C to ∣ψk⟩⊗∣ψℓ⟩ and projectively measure the second qubit in its computational basis. Each outcome has probability 1/2. After discarding the measured qubit, outcome 0 leaves the first qubit in ∣ψk+ℓ⟩; outcome 1 leaves it in ∣ψk−ℓ⟩ 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: N≥2, s,k,ℓ∈Z/NZ, the two normalized states above, the specified ordered two-qubit basis, and the specified two-outcome measurement.

[F1]

A finite projective measurement has outcome weights tr⁡(ρPb), and those weights are nonnegative and sum to one (Finite projective measurements, Projective measurement outcome weights are probabilities).

[F2]

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).

[F3]

The Dirac rank-one operator ∣x⟩⟨y∣ acts by z↦⟨z,y⟩rootx (Dirac Notation Conversion).

[F4]

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).

[F5]

The matrix of a rank-one operator ∣x⟩⟨y∣ in ordered orthonormal bases is [x][y]† (Dirac Notation Coordinate Identity).

[F6]

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).

[F8]

The complex exponential satisfies exp⁡(z+w)=exp⁡(z)exp⁡(w) (exp⁡(z+w)=exp⁡z exp⁡w, and the complex exponential extends the real exponential).

[F9]

A finite projective measurement's orthogonal projections form a POVM: each Pb is nonnegative because Pb=Pb∗=Pb2 gives ⟨Pbv,v⟩=⟨Pbv,Pbv⟩≥0, and their sum is the identity. Its positive square roots are the projections themselves. The Lüders maps are Ib(X)=PbXPb; for pb=tr⁡(ρPb)>0, the conditional state is ρb=PbρPb/pb. 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).

[F10]

Discarding the second factor contracts its matching basis index by the partial-trace rule (Partial trace over a finite tensor factor).

Proof

1.1givenF2F4F8algebra

Put α=exp⁡(2πiks/N) and β=exp⁡(2πiℓs/N). By [F8], αβ=exp⁡(2πi(k+ℓ)s/N). Expanding the input gives 12(∣00⟩+β∣01⟩+α∣10⟩+αβ∣11⟩). The map C permutes the four orthonormal basis vectors by an involution, so it is unitary by [F2]. Its action sends this vector to 12(∣00⟩+β∣01⟩+αβ∣10⟩+α∣11⟩), in accordance with the ordered circuit semantics [F4].

2.1givenF1F3F5F6F7F9F10step 1.1algebra

The second-qubit-zero projection leaves 12(∣0⟩+αβ∣1⟩)⊗∣0⟩. Its squared norm is (1+∣αβ∣2)/4=1/2, since [F7] gives ∣α∣=∣β∣=1. 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 ∣ψk+ℓ⟩.

3.1givenF1F3F5F6F7F8F9F10step 1.1algebra∎

The second-qubit-one projection leaves 12(β∣0⟩+α∣1⟩)⊗∣1⟩. Its squared norm is (∣β∣2+∣α∣2)/4=1/2 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 β≠0, the normalized first-qubit vector is β/∣β∣ times (∣0⟩+αβ‾∣1⟩)/2; the factor is a global phase. By [F7] and [F8], αβ‾=αβ−1=exp⁡(2πi(k−ℓ)s/N). Thus the residual ray is ∣ψk−ℓ⟩. This calculation includes k=ℓ and either zero label.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Fourier sample from a generalized-dihedral reflection coset state

Statement

Write A=Z/NZ additively, N≥2, and identify its generalized-dihedral group with A×Z/2Z under

(a,b)(a′,b′)=(a+(−1)ba′, b+b′ mod 2).

Let Hs={(0,0),(s,1)} and let a total encoded function F be constant on each left coset of Hs and distinct on different left cosets. Start in the uniform state on the 2N group elements, evaluate the coherent XOR oracle for F into a zero output register, discard that register, apply the positive-sign QFT⁡N to the first coordinate, and measure that coordinate. The measured k∈Z/NZ is uniform. Conditional on k, the remaining qubit is, up to a global phase,

∣ψk⟩=∣0⟩+exp⁡(2πiks/N)∣1⟩2.

The coordinate readout uses the Lüders projective instrument for the projections Πk=∣k⟩⟨k∣⊗I2. The stated conditional qubit is the post-measurement state after discarding the measured coordinate.

Facts & Assumptions

Given: N≥2, s∈Z/NZ, the displayed finite group law, the stated left-coset hiding promise, and the exact finite-register and Fourier operations above.

[F1]

The generalized dihedral group is the external semidirect product by the inversion action; its multiplication is (a,b)(a′,b′)=(a+(−1)ba′,b+b′), and this multiplication defines a group ( The generalized dihedral group Dih⁡(A)=A⋊C2 for an abelian group A, The external semidirect product N⋊αH, The semidirect-product multiplication makes N×H a group).

[F2]

A coherent XOR oracle acts on the ordered basis as ∣x,y⟩↦∣x,y⊕F(x)⟩ (Coherent XOR function oracle).

[F3]

Discarding the second factor is the partial trace, which contracts equal basis indices and sums them (Partial trace over a finite tensor factor).

[F4]

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).

[F5]

The cyclic Fourier transform has matrix action ∣a⟩↦N−1/2∑k=0N−1exp⁡(2πiak/N)∣k⟩ (Positive-sign cyclic quantum Fourier transform).

[F6]

A projective-measurement outcome has weight tr⁡(ρPk) (Finite projective measurements, Projective measurement outcome weights are probabilities).

[F7]

A rank-one operator ∣x⟩⟨y∣ acts by z↦⟨z,y⟩rootx (Dirac Notation Conversion).

[F8]

The circuit denotation composes the declared finite gates in chronological order (Denotational semantics of a finite layered circuit).

[F9]

The coordinate matrix of a rank-one Dirac operator is [x][y]† (Dirac Notation Coordinate Identity).

[F10]

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).

[F12]

The complex exponential satisfies exp⁡(z+w)=exp⁡(z)exp⁡(w) (exp⁡(z+w)=exp⁡z exp⁡w, and the complex exponential extends the real exponential).

[F13]

A finite projective measurement is implemented by the Lüders instrument of its projections: the outcome-k branch is Ik(ρ)=ΠkρΠk, and for pk=tr⁡(ρΠk)>0 its conditional state is ΠkρΠk/pk (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 Πk 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

1.1givenF1algebra

By [F1], (s,1)2=(s−s,0)=(0,0), so Hs has the two displayed elements. Right multiplication gives (a,0)(s,1)=(a+s,1) and (a,1)(s,1)=(a−s,0). Hence the distinct left cosets are Ca={(a,0),(a+s,1)} for a∈A: every group element occurs in one such pair, and the first coordinate of its unique ( ⋅ ,0) representative identifies the pair.

2.1givenF2F3F4F7F8F9F10step 1.1algebra

The initial state has amplitude (2N)−1/2 on each group basis vector. After the oracle call in the declared circuit order [F8], the output basis label is constant on each Ca and distinct for different a. By [F2]–[F4], tracing out the output retains exactly pairs of group labels in the same Ca, so the group-register operator is ρ=12N∑a∈A∑z,z′∈Ca∣z⟩⟨z′∣=1N∑a∈A∣Ca⟩⟨Ca∣, where ∣Ca⟩=(∣a,0⟩+∣a+s,1⟩)/2. Each ∣Ca⟩ 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].

3.1givenF3F4F5F6F9F10F11F12F13step 2.1algebra∎

Applying [F5] to the first coordinate sends each coset vector to ∣ϕa′⟩=1N∑k=0N−1exp⁡(2πiak/N)∣k⟩⊗∣ψk⟩. The factorization uses [F12]. Let ρ′=1N∑a∣ϕa′⟩⟨ϕa′∣ be the transformed mixture from step 2.1. Under the Lüders branch [F13], Πkρ′Πk=1N2∑a∈A∣k⟩⟨k∣⊗∣ψk⟩⟨ψk∣=1N∣k⟩⟨k∣⊗∣ψk⟩⟨ψk∣. Its trace is 1/N by [F9]–[F11], so every k occurs with that probability. The normalized conditional state on the joint register is ∣k⟩⟨k∣⊗∣ψk⟩⟨ψk∣. Discarding the first coordinate contracts its matching basis index by [F3]; after reordering the factors if needed by [F4], the retained qubit density is ∣ψk⟩⟨ψk∣. Hence the conditional qubit ray is ∣ψk⟩, as claimed.

DefinitionDefinition: Literature-sourcedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

Finite abelian hidden-shift promise

Definition

The input group is a finite abelian group A supplied in explicit invariant-factor coordinates A=Z/n1Z×⋯×Z/ndZ, with componentwise addition and the empty product allowed. The finite set S is supplied with an injective fixed-length bit encoding. The input functions f,g:A→S are injective and have coherent XOR oracles with explicitly declared access and costs.

The promise is that there is a unique s∈A such that

f(a)=g(a+s)for every a∈A.

The output is the coordinate encoding of s. The definition makes no claim that a group presented only by black-box operations comes with invariant-factor coordinates, efficient uniform preparations, efficient group operations, or an efficient implementation of either oracle.

DefinitionDefinition: Literature-sourcedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

Finite cyclic discrete-logarithm problem and costed encoding

Definition

A finite cyclic discrete-logarithm instance consists of a cyclic group G=⟨g⟩ of known exact order q≥2 and an element x∈G. Its answer is the unique integer a∈{0,…,q−1} satisfying ga=x. Uniqueness follows because gu=gv exactly when u≡v(modq).

For a quantum or bit-cost claim, the instance additionally declares an injective fixed-length encoding enc⁡:G→{0,1}w, with w≥⌈log⁡2q⌉, and one of the following operation profiles:

  1. explicit reversible circuits for multiplication, equality, and any controlled multiplication used by the algorithm, with gate and clean-work costs; or
  2. 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 f:Zq×Zq→G, f(u,v)=guxv. A direct coherent XOR oracle for its fixed-length encoding is a separate supplied interface; if it is supplied, one call costs one f 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 q to be prime. For x=ga, the function f is analyzed by the separate hidden-subgroup lemma on this page.

TheoremStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Hidden shift as generalized-dihedral hidden subgroup

Statement

Let A be a finite abelian group in explicit additive coordinates, and let f,g:A→S satisfy the hidden-shift promise of Finite abelian hidden-shift promise: both maps are injective and there is a unique s∈A such that f(a)=g(a+s) for every a. Write DA=A⋊Z2 with

(a,b)(a′,b′)=(a+(−1)ba′,b+b′ mod 2),

and define F(a,0)=f(a) and F(a,1)=g(a). Then F is constant exactly on the left cosets of the order-two subgroup Hs={(0,0),(s,1)}=⟨(s,1)⟩. The subgroup determines the shift uniquely: Hs=Ht implies s=t.

If a coherent XOR oracle for this F is directly supplied, one F-oracle query implements one value query. From only coherent XOR oracles for f and g, the F-XOR operation can be implemented with four calls total (two to compute the values into scratch registers and two to uncompute them), plus the controlled output XOR; no controlled call to either oracle is assumed. All gate, workspace, and named-oracle query costs remain separately charged.

Facts & Assumptions

Given: The finite abelian group A, injective fixed-length encodings of the finite set S, coherent XOR oracles for f,g, and the unique shift s satisfying f(a)=g(a+s).

[F2]

The hidden-shift promise gives injectivity of f,g and f(a)=g(a+s) for every a∈A (Finite abelian hidden-shift promise).

[F3]

A coherent function oracle adds the fixed-length output encoding by bitwise XOR and is its own inverse (Coherent XOR function oracle).

[F4]

CNOT and Toffoli implement reversible XOR and controlled conjunction on computational-basis bits (CNOT and Control-Target Order, Toffoli and Fredkin gates).

Proof

1.1givenF1algebra

By [F1], (s,1)2=(s−s,0)=(0,0), and (s,1)≠(0,0) because its second coordinate is 1. Thus Hs has the two stated elements. Right multiplication gives

(a,0)(s,1)=(a+s,1),(a+s,1)(s,1)=(a,0).

Consequently the left coset through (a,0) is exactly Ca={(a,0),(a+s,1)}. Every group element belongs to one such pair, and distinct a give distinct pairs because their parity-zero representatives differ.

2.1F2step 1.1algebra

On the pair Ca, [F2] gives F(a,0)=f(a)=g(a+s)=F(a+s,1). If two parity-zero values agree, injectivity of f makes their coordinates equal; if two parity-one values agree, injectivity of g does the same. If F(a,0)=F(b,1), then f(a)=g(b)=g(a+s), so injectivity of g yields b=a+s and the two inputs lie in Ca. Thus equality of F-values occurs exactly within one left coset.

2.2step 1.1algebra

The nonidentity element of Hs is (s,1), so equality Hs=Ht forces (s,1)=(t,1) and hence s=t.

3.1F3F4step 2.1algebra∎

A direct F-XOR oracle is exactly one value-query interface for the function just defined. Given only Of,Og, compute f(a) and g(a) into two fresh zero scratch registers with one call to each oracle. For each output bit, the selected value is (1−b)f(a)i⊕bg(a)i; CNOT and Toffoli gates from [F4] implement this reversible Boolean-controlled XOR into the target, leaving the input and scratch registers unchanged. Apply Og and then Of again to erase the scratch registers, since [F3] makes each XOR oracle self-inverse and the group input is unchanged. The target has acquired precisely F(a,b) and all scratch bits return to zero, using four calls total. This gives an explicit query account without postulating controlled access to Of or Og.

AlgorithmAlgorithm: Literature-sourcedProof: Not applicableOpen item page →

Power-of-two dihedral hidden-subgroup sieve

Definition

Input an integer n≥1, N=2n, and either (i) a coherent XOR oracle OF for a total encoded function F:DN→S that is constant on each left coset of the unknown reflection subgroup Hs=⟨yxs⟩ and takes distinct values on different left cosets, or (ii) a finite cyclic hidden-shift instance on A=Z/NZ together with its reflection oracle constructed by Hidden shift as generalized-dihedral hidden subgroup. Use coordinates (a,b)∈Z/NZ×Z/2Z with multiplication (a,b)(a′,b′)=(a+(−1)ba′,b+b′) and fix x=(−1,0) and y=(0,1); then yxs=(s,1). Charge each supplied or constructed oracle call according to its interface.

Every projective readout below is implemented by the Lüders instrument of its stated projections. Charge each supplied measurement or instrument implementation under its declared interface.

For n≤5, query all group elements (at most 2N≤64 values of F) and return the unique s for which F(0,0)=F(s,1). For n≥6, set m=⌈n−1⌉ once and retain this m through all recursive calls. The following procedure is run at modulus 2r, starting with r=n:

  1. If r≤5, use the direct-query base case. Otherwise set tr=⌈(r−1)/m⌉ and create a list L0 of M=3⋅23m independent coset samples: prepare the uniform group state with Hadamards on its r+1 coordinate bits, evaluate OF, discard the function-output register, apply the positive-sign QFT⁡2r to the cyclic coordinate and measure that coordinate. Store the measured label k and retain its conditional qubit ∣ψk⟩=(∣0⟩+e2πiks/2r∣1⟩)/2.

  2. For each j=0,…,tr−1, put wj=min⁡(m,r−1−mj). The current labels are divisible by 2mj. Bucket them by the wj bits of k/2mj immediately above those trailing zeroes, using only the lower r−1 bits of k. In each bucket, preserve current list order, pair consecutive entries, and leave the last entry unmatched if the bucket has odd size; this is a maximum-cardinality disjoint matching. For each pair, apply the CNOT pair combiner and measure its second qubit with the Lüders instrument. Retain only outcome 1; the retained state has label k−ℓ(mod2r). Discard unmatched states and outcome-0 states. The next list consists of the retained states.

  3. The widths sum to r−1, so every final label is 0 or 2r−1. If a state with label 2r−1 occurs, measure its qubit in the {∣+⟩,∣−⟩} basis. Outcome + means s is even; outcome − means s is odd. If the target label is absent, return FAIL.

  4. For even s, put r′=r−1, x′=x2, y′=y, and s′=s/2. Identify child coordinates with K0=⟨x2,y⟩ by ϕ0:Z/2r′Z×Z/2Z⟶Z/2rZ×Z/2Z,ϕ0(a′,b′)=(2a′,b′)(mod2r). Use the child oracle F0=F∘ϕ0 and run this procedure at modulus 2r′. A coherent F0 query is implemented by appending a fresh clean low address bit 0 to the r′ bits of a′, retaining b′, and making one parent OF call.

    For odd s, put r′=r−1, x′=x2, y′=yx, and s′=(s−1)/2. Identify child coordinates with K1=⟨x2,yx⟩ by ϕ1:Z/2r′Z×Z/2Z⟶Z/2rZ×Z/2Z,ϕ1(a′,b′)=(2a′+b′,b′)(mod2r). Use F1=F∘ϕ1 and recurse at modulus 2r′. To implement a coherent F1 query, append a fresh clean low address bit z=0, copy b′ to z by CNOT, make one parent OF call on the ambient address (a′,z,b′), and uncopy z by the same CNOT. Thus each child hiding-oracle query uses one parent F query; the odd embedding adds two ordinary CNOT gates per query, and the even embedding adds none beyond the clean address wire. Return 2s′ in the even branch and 2s′+1 in the odd branch.

    Before the recursive call, discard the current sample, pair, output, and label registers after recording the parity branch; carry only the classical branch result and recursion parameters. The child call reuses this workspace.

The exact sampling-state law and pair-combination identity are in Fourier sample from a generalized-dihedral reflection coset state and Dihedral hidden-state pair combination. The correctness, error, and resource claims for this locally specified shortened-final-width version are proved in Kuperberg dihedral hidden-subgroup scope and resource claim. The procedure is only specified for power-of-two cyclic orders; no arbitrary-N or arbitrary finite-abelian extension is asserted.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Clean reversible controlled multiplication by a cyclic constant

Statement

Let G=⟨g⟩ have order q≥2, let c∈G, and let valid fixed-length codes occupy a subset V⊆{0,1}w. Suppose total Boolean circuits are supplied for functions hc,hc−1:{0,1}×{0,1}w→{0,1}w, where hc(b,z)={z,b=0,enc⁡(uc),b=1, z=enc⁡(u)∈V,z,b=1, z∉V,. For each fixed control b, the maps z↦hc(b,z) and z↦hc−1(b,z) are inverse permutations; the full controlled permutation preserves b. Then reversible embedding supplies a clean-ancilla circuit that acts on a control bit and accumulator by

∣b,z,0work⟩⟼∣b,hc(b,z),0work⟩.

If the two Boolean circuits have at most S non-input nodes and E port uses each, the construction uses at most 12S+8E+5w elementary gates and at most 2(S+E)+w clean work wires. The gate charge counts each supplied X, 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 c, valid codes V, total Boolean functions hc,hc−1 whose fixed-control slices are inverse permutations with the displayed action, and their explicit Boolean circuit descriptions.

[F1]

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.

[F2]

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.

[F3]

Gate, workspace, and serial-depth costs of reversible embedding: the reversible embedding restores all clean work to zero and uses at most 6S+4E+m gates and S+E work bits for an m-bit output.

[F4]

CNOT and Control-Target Order: CNOT on an ordered control and target bit maps (a,b) to (a,b⊕a).

[F5]

Clean and dirty ancillas: a clean work register must return exactly to its specified zero vector.

[F6]

Denotational semantics of a finite layered circuit: a chronological finite gate list acts by the corresponding composed unitary, with later gates on the left.

[F7]

The computational basis is orthonormal: distinct computational-basis words are orthonormal.

Proof

1.1givenF1algebra

For a valid code z=enc⁡(u), the inverse property gives hc−1(1,hc(1,z))=z and hc(1,hc−1(1,z))=z; for invalid z both maps fix z, and for b=0 both fix z. Thus, for each fixed control b, the two supplied maps on the w-bit data register are inverse permutations on every data word, and the complete controlled map preserves b.

1.2F2F3

Apply [F2] to hc and hc−1 with separate fresh w-bit targets. By [F3], each XOR computation returns its internal work to zero and has at most 6S+4E+w gates and S+E work bits.

2.1step 1.2F4F6F7algebra

Starting from control b, data code z, and a fresh target t=0w, compute hc(b,z) into t. Swap z and t bitwise using three CNOTs per bit; on each pair (u,v) the sequence (u,v)↦(u,u⊕v)↦(v,u⊕v)↦(v,u), so it swaps the registers. The accumulator now contains hc(b,z) and t contains the old z.

2.2step 1.1step 1.2F3F5F6algebra

Compute hc−1(b,hc(b,z)) into the old-z target by XOR. By step 1.1 this XORs z with itself and clears t to 0w. The inverse computation also restores its internal work to zero by [F3]. The resulting data is hc(b,z), with every work and temporary target bit zero, which is the clean-ancilla identity of [F5].

3.1step 1.2step 2.2F3algebra∎

The forward and inverse embeddings use at most 12S+8E+2w gates in total; the three-CNOT swaps use 3w more. The two Boolean embeddings use at most 2(S+E) clean internal work bits and the swapped w-bit target is also clean on return. Hence the total bounds are 12S+8E+5w gates and 2(S+E)+w clean work wires.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Cyclic discrete logarithm hides a rank-one subgroup

Statement

Let G=⟨g⟩ have exact order q≥2, let x=ga, and define f:Zq×Zq→G by f(u,v)=guxv. Then

f(u,v)=f(u′,v′)⟺(u−u′,v−v′)∈H,H:=⟨(−a,1)⟩.

Thus the fibers of f are exactly the additive cosets of the rank-one subgroup H in the finite abelian group Zq2.

Facts & Assumptions

Given: A cyclic group G=⟨g⟩ of exact order q≥2, x=ga, and u,v,u′,v′∈Zq.

[F1]

The cyclic discrete-log instance has ord⁡(g)=q and x=ga for a unique a∈{0,…,q−1} (Finite cyclic discrete-logarithm problem and costed encoding).

[F2]

The additive hidden-subgroup promise defines a fiber by the relation that two inputs differ by an element of the subgroup (Finite abelian hidden-subgroup promise and output encoding).

Proof

1.1givenF1F3algebra

If f(u,v)=f(u′,v′), then cancellation and x=ga give gu−u′xv−v′=e, hence g(u−u′)+a(v−v′)=e. Since g has exact order q by [F1], this is equivalent to (u−u′)+a(v−v′)≡0(modq).

2.1F2step 1.1F3algebra∎

Put t=v−v′∈Zq. The congruence in step 1.1 is equivalent to u−u′=−at, so (u−u′,v−v′)=t(−a,1)∈H. Conversely, if the difference is t(−a,1), then (u−u′)+a(v−v′)=0 in Zq, and [F3] gives f(u,v)=f(u′,v′).

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Kuperberg dihedral hidden-subgroup scope and resource claim

Statement

Let n≥1 and N=2n. Let F:DN→S be a total encoded function that is constant on each left coset of Hs=⟨yxs⟩ 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, F(u)=F(v) exactly when uHs=vHs, as required by Power-of-two dihedral hidden-subgroup sieve. Use the Lüders instruments specified there for the projective readouts. For n≤5 the direct branch succeeds exactly with at most 64 F queries. For n≥6, put m=⌈n−1⌉ and M=3⋅23m. The locally specified shortened-final-width sieve has failure probability at most min⁡{1,nmexp⁡(−2m/3−1)}. It uses at most nM+64 named F-oracle queries, O(n3M) ideal gates for sieve control and recursive coordinate maps, O(n2m2M) classical bit operations for label sorting and list processing, O(M+n+wF+aF) quantum workspace, and O(nM) bits to store all active labels. Here wF is the output-register width and aF is additional workspace for the supplied or constructed F implementation. The O(n3M) gate count excludes the implementation of the named F interface itself. An explicit F circuit using GF(n) gates per call adds O((nM+64)GF(n)) gates. If F is constructed from only the two coherent XOR oracles for a hidden-shift pair, each call uses four f/g oracle calls and adds O(wF) ordinary gates for controlled output selection; add O((nM+64)wF) selector gates, and charge any explicit circuits implementing f and g separately.

Since m=Θ(n), the named F-query count, sieve gate count, and classical label-processing count are 2O(n)=2O(log⁡2N) up to polynomial factors in n. 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-N version, and no algorithm for arbitrary finite abelian hidden shift.

Facts & Assumptions

Given: An integer n≥1, N=2n, a total encoded function F:DN→S 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.

[F1]

In coordinates (a,b) the generalized-dihedral group law is (a+(−1)ba′,b+b′); for x=(−1,0) and y=(0,1), yxs=(s,1), and the subgroup has two elements ( The generalized dihedral group Dih⁡(A)=A⋊C2 for an abelian group A, Dih⁡(Cn)=Cn⋊C2 with inversion action has order 2n and the dihedral relations).

[F2]

One coset sample yields an independent uniform label k∈Z/2rZ and conditional qubit ∣ψk⟩=2−1/2(∣0⟩+e2πiks/2r∣1⟩) (Fourier sample from a generalized-dihedral reflection coset state).

[F3]

Combining a pair with CNOT and measuring the second qubit gives either sum or difference with probability 1/2; outcome 1 leaves the difference state ∣ψk−ℓ⟩ up to global phase (Dihedral hidden-state pair combination).

[F4]

For a sum B of P independent Bernoulli(1/2) variables, the additive Chernoff/Hoeffding bound gives Pr⁡(∣B−P/2∣≥u)≤2e−2u2/P (Chernoff bound for independent bernoulli trials).

[F5]

The exact positive-sign QFT circuit on an r-bit register implements QFT⁡2r and has O(r2) ideal gates (Exact binary QFT circuit correctness, Exact binary QFT circuit, QFT ideal and finite-set gate-cost models).

[F6]

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).

[F7]

The algorithm fixes m=⌈n−1⌉, M=3⋅23m, widths wj=min⁡(m,r−1−mj), consecutive pairing in current list order after bucket assignment from only lower r−1 label bits, and recursive coordinate maps ϕ0(a′,b′)=(2a′,b′) and ϕ1(a′,b′)=(2a′+b′,b′); each child-oracle query uses one parent F query and at most two CNOT map gates (Power-of-two dihedral hidden-subgroup sieve).

[F8]

From coherent XOR oracles for f,g, the hidden-shift reduction constructs each coherent F-oracle call with four calls and reversible bit gates, without controlled access to either source oracle (Hidden shift as generalized-dihedral hidden subgroup).

[F9]

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

1.1F1F7algebra

For n≤5, query F(0,0) and the parity-one elements. The left-coset promise gives a unique b=s with F(0,0)=F(s,1), so the direct branch identifies s; querying the full group uses at most 2N≤64 calls. Now suppose n≥6, so m≥3. At recursive exponent r≤n with r≥6, 1≤r−1≤n−1≤m2, hence 1≤tr=⌈(r−1)/m⌉≤m. The widths are m until possibly the final stage, whose positive remainder is at most m; therefore ∑j<trwj=r−1 and mj+wj≤r−1 at every stage.

1.2F7algebra

For one recursive sieve set Sj=23m−2j, ϵj=22j−2m, bj=2j−4m/3, C0=3, and Cj+1=(Cj−ϵj)(1−bj). For j≤m−1, 0≤ϵj<1 and 0<bj<1. The geometric sums satisfy ∑i=0jϵi<1/3 and ∑i=0j−1bi≤3/16: the first is 2−2m(4j+1−1)/3<1/3; for the second set z=2−m/3≤1/2, so the full sum through m−2 is z/2−z4, and 3/16−(z/2−z4)=(2z−1)(8z3+4z2+2z−3)/16≥0 because both factors are nonpositive. Expanding the recurrence and using ∏i(1−bi)≥1−∑ibi gives Cj−ϵj≥3∏i<j(1−bi)−∑i≤jϵi>39/16−1/3=101/48>2 for every stage index j≤tr−1; this is the lower bound needed for the subsequent pair count. For the terminal list, expansion through t=tr gives Ct=3∏i<t(1−bi)−∑j<tϵj∏i=jt−1(1−bi). Writing z=2−m/3≤1/2, we have ∑i<tbi≤∑i=0m−1bi=z−z4≤7/16, since 716−z+z4=(12−z)(78−z4−z22−z3)≥0 with both factors nonnegative; also ∑j<tϵj<1/3. Since each product factor lies in [0,1], ∏i<t(1−bi)≥1−∑i<tbi≥9/16, so Ct≥27/16−1/3=65/48>1.

2.1F2F3F7step 1.1inductionalgebra

By [F2], each initial sample has a uniform label and its stated conditional state. If a current label is divisible by 2mj and two labels share a bucket, their quotients agree modulo 2wj, so their difference is divisible by 2mj+wj. By [F3], every retained outcome-1 state has that difference label. Induction over stages proves every label in Lj is divisible by 2mj and every final label in Ltr is divisible by 2r−1; its only possible residues modulo 2r are 0 and 2r−1.

2.2F2F3F4F7F9step 1.2algebra

Assume ∣Lj∣≥CjSj. The bucket matching is maximal within at most 2wj buckets, each leaving at most one unmatched label, so the number Pj of disjoint pairs satisfies Pj≥(∣Lj∣−2wj)/2≥(Cj−ϵj)Sj/2>101Sj/96, since 2wj≤2m=ϵjSj. 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 Pj selected pairs, the joint Lüders branch at any outcome vector (b1,…,bPj) is the tensor product of the pairwise projected vectors. Each pairwise branch has squared norm 1/2 by [F3]; by the product inner product in [F9], the joint branch probability is 2−Pj. Thus the outcomes are independent Bernoulli(1/2) variables. If Bj is the number of retained differences, [F4] and binomial symmetry give Pr⁡(Bj<(1−bj)Pj/2)≤e−Pjbj2/2<exp⁡(−(101/192)2m/3), because Sjbj2=2m/3. Outside this event, ∣Lj+1∣=Bj≥(Cj−ϵj)(1−bj)Sj/4=Cj+1Sj+1. Thus the invariant fails at some stage with probability at most trexp⁡(−(101/192)2m/3).

3.1F2F3F7F9step 1.2step 2.1step 2.2algebrainduction

If all size invariants hold, ∣Ltr∣≥CtrStr>Str≥2m, since Ctr>1 by step 1.2 and tr≤m gives Str=23m−2tr≥2m. 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 2r−1 by step 2.1, each is the target with probability 1/2, independently, and target absence has probability at most 2−2m.

4.1F4step 2.2step 3.1algebra

Put X=2m/3≥2. The stage-failure bound from step 2.2 is at most me−(101/192)X. Its difference from me−X/2 is me−X/2(1−e−5X/192). From 1−e−z≥z/(1+z), m(1−e−5X/192)≥15/101>1/8. Also ln⁡2>1/2 and X≥2 imply ln⁡2 X3−X/2>(X3−X)/2≥3, so the target-absence bound from step 3.1 satisfies 2−2m=e−ln⁡2X3<e−X/2/8. Thus target absence is covered by the slack, and the per-sieve failure is at most me−X/2=mexp⁡(−2m/3−1).

4.2F1F2F7step 2.1step 3.1algebra

The target state is ∣ψ2r−1⟩=(∣0⟩+e2πis/2∣1⟩)/2=(∣0⟩+(−1)s∣1⟩)/2 by [F2], so the Lüders measurement in the {∣+⟩,∣−⟩} basis reveals parity exactly. The rotation x has order 2r, hence x2 has order 2r−1. For the even branch, substituting in the product law gives ϕ0((a′,b′)(a′′,b′′))=(2a′+2(−1)b′a′′, b′+b′′ mod 2)=ϕ0(a′,b′)ϕ0(a′′,b′′). If ϕ0(a′,b′)=ϕ0(a′′,b′′), equality of the second coordinates and cancellation of 2 modulo 2r give b′=b′′ and a′=a′′ modulo 2r−1, so ϕ0 is injective. It sends child generators (−1,0),(0,1) to x2,y, hence its image is K0. It sends the child reflection coordinate (u,1) to (2u,1)=(s,1). For the odd branch, the product law gives ϕ1((a′,b′)(a′′,b′′))=(2a′+2(−1)b′a′′+(b′+b′′ mod 2), b′+b′′ mod 2),ϕ1(a′,b′)ϕ1(a′′,b′′)=(2a′+b′+(−1)b′(2a′′+b′′), b′+b′′ mod 2). The first coordinates agree because b′+(−1)b′b′′=b′+b′′ mod 2 as an element of {0,1}. Equality of images again gives equal parity coordinates and then 2a′≡2a′′(mod2r), hence a′=a′′(mod2r−1); so ϕ1 is an injective homomorphism. It sends the child generators to x2,yx, its image is K1, and it sends (u,1) to (2u+1,1)=(s,1). Thus each child oracle Fi=F∘ϕi hides the child reflection subgroup on left cosets: equality under Fi is ambient left-coset equality, and the group isomorphism identifies that coset relation inside Ki. Each child oracle query costs one parent F query plus at most the two CNOT address-copy gates specified in [F7]. The recursive slope is u modulo 2r−1, so the returned value is s=2u or s=2u+1 respectively.

5.1F6F8step 1.1step 4.1step 4.2algebra

There are at most n non-base recursive calls. Each uses M coset samples and hence M named F queries; the direct terminal branch uses at most 64 more. If F is compiled from f,g, [F8] makes each F call four calls. By step 4.1 each recursive call has failure at most mexp⁡(−2m/3−1); a union bound over at most n calls gives min⁡{1,nme−2m/3−1}. With M=3⋅23m, the query bound is nM+64.

6.1F5F6F7F8step 5.1algebra

Each sample uses r+1 Hadamards and one exact r-qubit QFT with O(r2) ideal gates by [F5], plus one oracle call. Each pair uses one CNOT and one measurement. At most M/2 pairs occur per stage and at most m stages per recursive call; summing over at most n calls with r≤n gives O(nM(n2+m))=O(n3M) sample and pair gates. A root-oracle query at recursion depth d passes through at most d≤n coordinate maps, each using at most two CNOTs; over at most nM+64 queries this adds O(n2M) gates, also within O(n3M). Gates implementing the named F interface itself are separate: an explicit F circuit with at most GF(n) gates per call contributes O((nM+64)GF(n)) gates, while the hidden-shift wrapper contributes O((nM+64)wF) selector gates and four f/g queries per F call by [F8]. Any explicit circuits implementing f and g have their own separately charged gate costs.

7.1F6F7step 5.1step 6.1algebra∎

Stable comparison sorting of at most M labels of at most n bits costs O(Mnlog⁡M) bit operations per stage; at most m stages in each of at most n calls give O(n2mMlog⁡M)=O(n2m2M) classical bit operations since log⁡M=O(m). The active list uses at most Mn 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 n clean address bits; one sample uses O(n+wF) further query-register qubits and the supplied or constructed oracle workspace is aF. Total quantum workspace is O(M+n+wF+aF). With m=Θ(n) and M=3⋅23m, the named-query count, internal sieve-gate count and classical list-processing count are 2O(n)=2O(log⁡2N) up to polynomial factors in n; 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.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Fourier annihilator equation for cyclic discrete logarithm

Statement

Let G=⟨g⟩ have order q≥2, x=ga, and H=⟨(−a,1)⟩≤Zq2 as in Cyclic discrete logarithm hides a rank-one subgroup. Characters of Zq2 are labelled by (c,d)∈Zq2 as

χc,d(u,v)=exp⁡(2πi(cu+dv)/q).

Then

χc,d∈H⊥⟺d≡ac(modq).

The map c↦(c,ac) is a bijection from Zq to H⊥. Consequently, any sample that is uniform on H⊥ has a uniform first coordinate c.

Facts & Assumptions

Given: The cyclic discrete-log instance and the rank-one subgroup H above.

[F1]

H=⟨(−a,1)⟩ is the fiber subgroup of f(u,v)=guxv (Cyclic discrete logarithm hides a rank-one subgroup).

[F2]

The annihilator is H⊥={χ:χ(h)=1 for every h∈H} (Character annihilator of a subgroup).

[F3]

Every character of the cyclic group Zq is uniquely labelled by c∈Zq with value exp⁡(2πic/q) on 1; 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).

[F4]

exp⁡(2πi/q) is a primitive qth root of unity, so its integer powers equal 1 exactly at exponents divisible by q (The n-th roots of a complex number and the n distinct roots of unity for every n≥1).

Proof

1.1givenF1F2F3F4algebra

By [F1] and [F3], every character label is a unique pair (c,d) and its value on the generator (−a,1) of H is exp⁡(2πi(−ac+d)/q). By [F2], a character lies in H⊥ exactly when it is trivial on that generator; [F4] makes this equivalent to d−ac≡0(modq).

2.1step 1.1algebra∎

For each c∈Zq, step 1.1 gives exactly one annihilator label, namely (c,ac). Every label in H⊥ 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.

AlgorithmAlgorithm: Literature-sourcedProof: Not applicablejudge pass (gpt-6-luna)Open item page →

Costed coherent evaluation of cyclic group powers

Definition

Inputs are a valid instance from Finite cyclic discrete-logarithm problem and costed encoding, exponent registers u,v∈{0,…,q−1}, and one of these access profiles:

  1. a supplied coherent XOR oracle for f(u,v)=guxv; initialize a fresh output target to 0w, invoke the oracle once, and return its output (the zero target need not be the encoding of the group identity); or
  2. 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 enc⁡(e), the code of the group identity. Precompute gj=g2j and xj=x2j for 0≤j<L, where L=⌈log⁡2q⌉, by repeated squaring. For j=0,…,L−1, use the bit uj to apply the clean controlled multiplication by gj to the accumulator, and use vj to apply the clean controlled multiplication by xj. 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 w-bit accumulator from zero to enc⁡(e) with at most w Pauli-X gates, execute the 2L controlled multiplications, copy the resulting w-bit value by CNOT into an arbitrary target y, then reverse the evaluation using the separately supplied inverse-constant controlled multiplications. Finally undo the initial X gates. This implements ∣u,v,y⟩↦∣u,v,y⊕enc⁡(guxv)⟩ 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 4L controlled multiplications and at most 3w extra X/CNOT gates; preparation, output copying, and inverse calls are charged.

Remarks

The two explicit-circuit loops use 2L 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.

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Correctness and clean-work cost of cyclic power evaluation

Statement

For every valid encoded cyclic-group input (G,g,x,q) with q≥2 and every u,v∈{0,…,q−1}, the explicit-circuit branch of Costed coherent evaluation of cyclic group powers writes the encoding of guxv into the accumulator, leaves the exponent registers unchanged, and returns every clean work and temporary target register to zero. If L=⌈log⁡2q⌉ and each controlled multiplication by a known constant has gate cost at most CG, the circuit uses 2L controlled multiplications and O(LCG) 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 CG, that wrapper uses 4L such calls and at most 3w additional X/CNOT gates, hence O(LCG+w) gates, and restores its auxiliary registers to zero.

Facts & Assumptions

Given: A cyclic group G=⟨g⟩ of exact order q≥2, x∈G, valid exponent codes u,v, and the explicit circuit branch of Costed coherent evaluation of cyclic group powers.

[F1]

G=⟨g⟩ has exact order q and x∈G, so every element of G is a power of g (Finite cyclic discrete-logarithm problem and costed encoding).

[F2]

Every integer in {0,…,q−1} has an L-bit binary expansion with L=⌈log⁡2q⌉ (Big-endian encoding of ordered bit strings).

[F4]

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).

[F5]

The algorithm processes every bit of u and v 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

1.1givenF2F3algebra

Write u=∑j=0L−1uj2j and v=∑j=0L−1vj2j using [F2]. Repeated squaring with [F3] gives the classically precomputed constants gj=g2j and xj=x2j: the base constants are g0=g and x0=x, and squaring gj,xj gives gj+1,xj+1.

2.1givenF1F3F4F5step 1.1inductionalgebra

After processing the first j bits of each exponent, the accumulator is g∑i<jui2ix∑i<jvi2i. It is the identity at j=0. At stage j, [F4] multiplies it by gj exactly when uj=1 and by xj exactly when vj=1. Since [F1] places both elements in the cyclic group generated by g, their powers commute; [F3] therefore gives the same formula with the sums extended through i=j. Induction proves the invariant through j=L.

3.1F2F4F5step 2.1algebra

At j=L, the binary sums are u and v, so the accumulator is guxv. 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.

4.1F2F4F5step 2.1algebra∎

There are exactly L controlled multiplications for the bits of u and L for the bits of v. Each costs at most CG gates, so their total is at most 2LCG=O(LCG); precomputing the constants is classical work and is charged separately. For the full XOR wrapper, prepare the identity code with at most w flips, perform these 2L 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 4L controlled calls and at most 2w+w=3w extra elementary gates, yielding the stated wrapper cost and clean XOR action by linearity on the computational basis.

AlgorithmAlgorithm: Literature-sourcedProof: Not applicableOpen item page →

Finite cyclic discrete logarithm by Fourier sampling

Definition

Input a promised instance (G,g,x,q) from Finite cyclic discrete-logarithm problem and costed encoding and a rational confidence target δ=p/v supplied as binary positive integers p<v, together with supplied exact uniform-state preparation and product-QFT circuits for Zq2, including their full-register extensions and declared costs as required by One finite abelian hidden-subgroup Fourier sample. If the direct coherent f 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 L=⌈log⁡2q⌉, computed as the bit length of q−1. Let D be the least integer d≥0 with 2dδ≥1, found by testing d=0,1,… using exact rational comparisons, and set t=(1+L)D. Repeat the following t times, with fresh registers and independent measurements:

  1. Use One finite abelian hidden-subgroup Fourier sample once on Zq×Zq with hiding function f(u,v)=guxv, obtaining a character label (c,d).
  2. Use Extended-Euclidean modular inverse with bounded bit cost on (q,c). If it returns NO_INVERSE, discard this sample and continue; otherwise its output is c−1(modq).
  3. Set a~=d c−1(modq).
  4. Compute ga~ by binary repeated squaring using the supplied multiplication interface, then compare it with x using the equality interface. Return a~ only if they agree.

If no iteration returns a verified value, return FAIL. A direct coherent oracle for f costs one f 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.

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Finite cyclic discrete-log correctness, success and costs

Statement

Let G=⟨g⟩ have known exact order q≥2, let x=ga, and let δ=p/v be supplied as binary positive integers p<v. Write K for the sum of their bit lengths. For an access profile of Finite cyclic discrete logarithm by Fourier sampling supplying either the direct coherent f oracle or the complete supported power-evaluation fallback, every returned exponent is verified and equals the unique a∈{0,…,q−1}. 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 φ(q)/q≥1/(1+log⁡2q). Put L=⌈log⁡2q⌉, let D be the least integer d≥0 with 2dδ≥1, and set t=(1+L)D. With t samples, the probability of returning the exact answer is at least 1−δ.

Let w be the supplied group-element encoding width. A direct coherent function-oracle profile uses at most O(L(1+ln⁡(1/δ))) function queries and separately uses O(L(1+ln⁡(1/δ))) ordinary multiplication/equality operations for classical verification. If f is implemented by controlled group multiplications, there are O(L2(1+ln⁡(1/δ))) 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 CG gates and the supplied exact uniform preparation and product QFT cost O(L2) ideal gates, the total ideal gate count is

O ⁣((L2CG+Lw+L3)(1+ln⁡(1/δ))).

If one classical multiplication or equality operation on the encoding costs at most TG bit operations and modular inverses use the schoolbook extended-Euclidean algorithm, the classical bit cost of confidence preprocessing, arithmetic and verification is

O ⁣(K2+(L2TG+L4)(1+ln⁡(1/δ))).

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 q≥2, x=ga, confidence target δ=p/v supplied as binary positive integers p<v of total bit length K, and the exact sampling and operation interfaces specified above.

[F1]

On a supported profile, the procedure performs at most t 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).

[F2]

The sample law is uniform on the annihilator of the hidden subgroup (Fourier samples are uniform in the annihilator).

[F3]

For the cyclic DLP subgroup, annihilator labels satisfy d≡ac(modq), and a uniform annihilator label has uniform c∈Zq (Fourier annihilator equation for cyclic discrete logarithm).

[F4]

The unit group modulo q has φ(q) residue classes; a residue is a unit exactly when its gcd with q is one, and φ(q)/q≥1/(1+log⁡2q) (The unit group (Z/n)× and Euler's totient φ(n)=∣(Z/n)×∣ for n≥1, For n≥1, [a]n is a unit if and only if gcd⁡(a,n)=1, Elementary lower bound for the totient ratio).

[F5]

If gcd⁡(c,q)=1, Correctness and bit cost of the modular inverse recurrence returns the inverse of c modulo q using O(L3) bit operations.

[F6]

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).

[F7]

The power-evaluation circuit returns guxv with all clean work restored; its full XOR wrapper uses O(L) separately supplied forward/inverse-constant controlled multiplications and O(w) additional elementary gates (Correctness and clean-work cost of cyclic power evaluation).

Proof

1.1F2F3F4

By [F2], each sample is uniform on H⊥. The bijection in [F3] makes c uniform on Zq and forces d≡ac(modq). Exactly φ(q) of the q residues are units by [F4], so the probability of a unit is φ(q)/q.

1.2F1F3F5algebra

If c is a unit, [F5] supplies c−1 modulo q. Then dc−1≡acc−1≡a(modq). The algorithm returns only after testing ga~=x, so every returned residue is the required exponent; rejecting a failed equality cannot produce an incorrect output.

2.1givenF1F6F7F8algebra

Since L≥1, D≤log⁡2(1/δ)+1<2ln⁡(1/δ)+1, so t=(1+L)D≤4L(1+ln⁡(1/δ)). Each sample calls the finite-abelian sampler once, which uses one direct f query by [F1], so this bounds direct function queries. By [F7], one explicit f evaluation uses O(L) controlled group multiplications. Binary repeated squaring computes the verification power with at most 2L ordinary multiplications: square successive powers of g and multiply the accumulator by each power whose exponent bit is one; [F8] proves the resulting accumulator is ga~. The constant precomputation takes O(L) further group operations once. Thus the explicit-f implementation uses O(L2(1+ln⁡(1/δ))) group-operation queries; with a direct f oracle, step 1.2 shows that the first unit-coordinate sample verifies and terminates. Hence verification occurs at most once and needs O(L) classical group multiplications, which also satisfies the stated looser O(L(1+ln⁡(1/δ))) bound.

2.2F1F4step 1.1algebra

Put p=φ(q)/q. Extend the independent sample list to t draws for this probability calculation, even when the procedure stops earlier. The probability that all t independent samples have nonunit first coordinate is (1−p)t≤e−pt. By [F4], p≥(1+log⁡2q)−1. Since D≥log⁡2(1/δ)>ln⁡(1/δ), we have t=(1+L)D≥(1+log⁡2q)ln⁡(1/δ). Therefore pt≥ln⁡(1/δ) and (1−p)t≤δ. Whenever at least one sample has a unit coordinate, step 1.2 returns a; hence success probability is at least 1−δ.

3.1F1F5F6F7F8step 2.1algebra

In the explicit circuit profile, each sample's full XOR function evaluation and verification use O(LCG+w) gates, while the supplied uniform preparation and product QFT use O(L2) ideal gates. The modular inverse on O(L)-bit residues uses O(L3) bit operations by [F5], and each classical group operation uses at most TG bits. Multiplying these per-sample costs by t=O(L(1+ln⁡(1/δ))) gives the sampling, arithmetic and verification terms in the displayed bounds. In the direct-f-oracle profile, verification and inverse steps have O(LTG+L3) bit work per sample, while one f query costs one query and has no implicit gate bound. Precomputation contributes only O(LTG) additional bit operations and is absorbed because L≥1 and 1+ln⁡(1/δ)≥1.

4.1givenF1F6step 3.1algebra∎

To compute D, compare 2dp with v for successive d until the first successful comparison. Since p≥1 and v<2K, D≤K; all tested integers have O(K) bits. Binary shifts and comparisons therefore cost O(K2) in total. Computing L from q−1 and multiplying (1+L)D cost at most O((L+K)2) by schoolbook arithmetic, absorbed by O(K2+L4) since L≥1. 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