Manuscript Offprint
arXiv:2608.30340Exact quantum splitting and the structure of finite algebras
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Berlekamp's algorithm factors a squarefree polynomial by deterministic linear algebra, reducing the problem to splitting an explicit commutative algebra into its simple factors. For large odd , the standard efficient splitting step is randomized, while known derandomizations are conditional on the Extended Riemann Hypothesis. We give an unconditional exact quantum implementation in a circuit model permitting single-qubit rotations through efficiently computable angles. The construction uses an unconditional counting argument. For a block containing irreducible factors, a quadratic-character test in odd characteristic and an absolute-trace test in characteristic 2 yield a nonconstant test element with probability , known exactly in advance and depending only on and , not on the unknown factorization. Exact amplitude amplification therefore converts each randomized test into a procedure succeeding with certainty after one amplification iteration. The resulting algorithm uses exactly quantum splitting rounds and quantum -operations and classical operations, requiring no primitive root, quadratic non-residue, or distinct-degree preprocessing. The method also splits arbitrary finite-dimensional separable commutative -algebras given by structure constants. Combined with R'onyai's classical structure theory, which computes the radical deterministically and reduces the remaining tasks deterministically to polynomial factorization, it yields the radical and the Wedderburn decomposition of into minimal two-sided ideals, with certainty, for any -dimensional associative -algebra given by structure constants, using quantum -operations.
1 Introduction
Factoring a polynomial over a finite field is one of the basic problems of computational algebra, with applications throughout cryptography and coding theory. The two classical approaches, Berlekamp's algorithm [3, 4] and the Cantor–Zassenhaus algorithm [7], both reduce the problem to a linear-algebra step (finding a distinguished subalgebra of ) followed by a splitting step that separates the factors from one another. The linear-algebra step is classical, deterministic, and efficient. The splitting step is where all the difficulty lies, and its status depends sharply on the field.
The same division of labour recurs, one level up, throughout the structure theory of finite associative algebras. Rónyai [31], building on Friedl and Rónyai [13], showed that for a finite-dimensional associative algebra A over presented by structure constants, the radical is computable in deterministic polynomial time, while the decomposition of the semisimple quotient into simple components, the construction of zero divisors, and the explicit isomorphism of a simple component with a full matrix algebra are all deterministic reductions to factoring polynomials over finite fields. Every one of these problems therefore inherits, verbatim, whatever the status of the splitting step happens to be: randomized in general, deterministic under the Extended Riemann Hypothesis in the cases where that is known, and, as we show here, exact in the quantum circuit model. This paper is organized around that observation. We first make the splitting step of Berlekamp's algorithm exact, and then follow Rónyai's reductions upward to obtain exact quantum algorithms for the structure of finite algebras.
What is known classically. When the characteristic is small, the splitting step is classically deterministic and efficient. Berlekamp's original algorithm [3] runs in time , because the absolute trace pushes the relevant coordinate values into the prime field , after which one exhausts over the possible constants. This is the Berlekamp trace algorithm, and for fixed small , in particular for , it settles the problem unconditionally. Deterministic algorithms are also available at cost polynomial in [33, 28].
The hard regime is therefore large q of odd characteristic. There, every known efficient classical splitting method is randomized. A random test element splits the current block with probability at least 1/2, and repeating the trial drives the failure probability down exponentially, but no zero-failure-probability method is known, nor is an unconditional deterministic one. As Gao observes [14], it remains open whether polynomial-time deterministic factorization exists over such fields even assuming the Extended Riemann Hypothesis. Conditional on GRH/ERH, a long line of work [30, 18, 12, 23, 22, 16] gives subexponential and, in structured cases, polynomial-time deterministic algorithms; these route through the construction of a primitive root or an r-th non-residue of [14].
In this paper, we give an exact quantum algorithm for the splitting step, one that succeeds with certainty upon measurement and that assumes no unproven number-theoretic hypothesis. Exact quantum algorithms, as opposed to bounded-error ones, are of interest for the reasons discussed in our earlier work on the exact quantum hidden subgroup problem [20, 21]. They are the natural counterparts of deterministic classical algorithms, and, being measurement-free until the final step, they compose without accumulating error inside larger unitary computations. That last property is what makes the passage to general finite algebras possible below, since a bounded-error splitting subroutine called times inside a classical wrapper would only ever yield a bounded-error outer algorithm. We follow the computational model for exact quantum algorithms of [20], fixed precisely in Section 2.3.
Before describing the construction it is worth being explicit about what kind of improvement is, and is not, being claimed. The purpose of the quantum procedure is not an asymptotic speedup over the expected running time of randomized classical splitting, which is already polynomial. It is to replace a randomized step by an exact one. The observation making this possible is that the success probability of the splitting test can be determined exactly from the field size q and the number s of irreducible factors in the current block, independently of the unknown factorization, which permits the direct use of exact amplitude amplification [6]. The substantive gain is confined to large odd characteristic, and we are careful throughout to claim nothing more. In small characteristic our procedure is an exact quantum analogue of an algorithm that is already classically deterministic and provides no new capability there; its interest in that regime is that the same mechanism covers it, so that the treatment is uniform over all finite fields. We return to this in Section 4.
No primitive root of and no distinguished quadratic non-residue is ever constructed. The exact success probability comes directly from the class cardinalities supplied by the counting lemma. This is a statement about what the construction needs, not about what is quantumly available: Draper [11] has shown that a quadratic non-residue modulo a prime can itself be produced exactly, in the larger class of Section 2.3, and [19] gives an exact primitive-root-finding algorithm. What it does mean is that the exactness of our procedure does not rest on any auxiliary exact subroutine.
(ii) Test maps and separable commutative algebras. Nothing in the construction is special to the Berlekamp subalgebra of a polynomial. The proof that a nonconstant test element reveals a genuine split uses only two facts: that the object being split embeds into by a ring isomorphism whose image contains the diagonal copy of , and that the test applied has a fixed, known partition of into fibers of known size. Section 5 isolates exactly this, defining a test map to be a short (straight-line, -cost) polynomial over with small image and no fiber occupying more than half of , of which the quadratic-character and absolute-trace tests are the two extremal instances. The same counting-and-amplification argument then splits an arbitrary finite-dimensional separable commutative -algebra , given by structure constants, into its primitive idempotents with probability exactly one, using quantum -operations; polynomial factorization is recovered as the special case .
We stress what is and is not new here. That this problem reduces to polynomial factorization is classical. It is the cutting procedure of Friedl and Rónyai [13, 31], which walks a basis of A, computes the minimal polynomial of each successive generator over the field generated so far, and factors it. The fixed-point subalgebra of the Frobenius map, in the abstract setting of a commutative semisimple algebra rather than of , is likewise already present in [31, Sec. 3, Remark 2]. Our contribution is that the procedure is exact, and that it reaches the primitive idempotents directly, through a test element and Lagrange interpolation in the algebra, with no passage through a generating element and its minimal polynomial and hence no factoring calls over the auxiliary extension fields that the cutting procedure builds along the way.
(iii) Extension to noncommutative algebra. This result extends to noncommutative algebra using the classical results on the theory of finite algebras by Rónyai. Let A be a finite-dimensional associative -algebra of dimension n given by structure constants. Then:
-
Rad(A) is computable classically and deterministically, with no factoring and no randomization, by Rónyai's trace characterization in positive characteristic [31, Thm. 2.7] (see also [9]). This is the exact analogue, at the level of an abstract algebra, of the reduction to the squarefree case;
-
for semisimple, the centre is cut out by a linear system, and is a separable commutative -algebra, again presented by structure constants;
-
the primitive idempotents of are precisely the central primitive idempotents of , and the minimal two-sided ideals are recovered as [31, Sec. 3].
Applying (ii) to therefore yields the Wedderburn decomposition of a semisimple algebra without any randomization. Thus, for an arbitrary finite-dimensional associative -algebra of dimension given by structure constants, the radical together with the decomposition of into minimal two-sided ideals is computable in , that is, with probability exactly one, using quantum -operations and polynomially many classical field operations.
Moreover, we also treat the two remaining problems of [31], namely finding zero divisors and constructing an explicit isomorphism for a simple component. These are genuinely deeper than the decomposition into simple components as they consume the constructive form of Wedderburn's theorem, the Noether–Skolem theorem, and the solution of a norm equation, but they too are deterministic reductions to polynomial factorization, so they too become exact once the factoring calls are answered exactly. We state these as corollaries and are explicit about the accounting they require, in particular about the number of oracle calls, the degrees of the polynomials involved, and the restriction to odd or in [31, Lemma 4.5] around which the even-degree case is routed.
Finally, the reduction runs in both directions. Rónyai shows that finding zero divisors in a finite algebra is in the same complexity class as factoring polynomials over finite fields, not merely reducible to it [31]. Consequently no exact quantum algorithm for the structure problems above can be substantially easier than an exact quantum algorithm for polynomial factorization, and the splitting primitive developed in Section 3 is the right object to make exact.
Table 1 places these contributions at a glance against the two classical splitting algorithms and the one existing dedicated quantum treatment of the problem. The fully detailed comparison is deferred to Table 2 in Section 4.
Table 1: Polynomial factorization approaches, at a glance.
| Method | Classical/Quantum | Exact | Randomized | Main feature |
|---|---|---|---|---|
| Berlekamp [3, 4] | Classical | No | Yes | Algebraic splitting |
| Cantor-Zassenhaus [7] | Classical | No | Yes | Equal-degree splitting |
| Doliskani [10] | Quantum | No | Yes | Asymptotic quantum speedup |
| This work | Quantum | Yes* | No | Exact algebraic splitting |
*exact in the quantum circuit model specified in Section 2.3.
Relation to our earlier work
The present paper generalizes a tool already present in [20]. Section 2.2 there uses exact amplitude amplification for the special case of success probability exactly 1/2, following the original construction of Brassard and Høyer [5]. We use the fully general version of that theorem, which removes the need to tailor a success probability to 1/2 artificially by discarding amplitude, as [20] and [27] do; whatever exact probability the counting lemma supplies is used directly.
By contrast, the abelian and solvable hidden-subgroup machinery of [20, 21], in particular its exact order-finding subroutine, is not used below, despite being the natural first attempt. Order finding on the black-box group hits a genuine obstruction. Any test built purely from group operations on a cyclic group is a function of element order alone, and so cannot distinguish two hidden factors whose corresponding group elements happen to have equal order, which is precisely why classical algorithms for this problem randomize in the first place. The construction given here instead uses the explicit ring structure of , polynomial evaluation, and at one classical post-processing step a polynomial gcd, which has no counterpart in a black-box group and sidesteps the obstruction entirely.
Organization
Section 2 recalls Berlekamp's classical reduction, the exact amplitude amplification theorem we rely on, and fixes the quantum circuit model in which our exactness claim is stated. Section 3 contains the main results: the exact success-probability lemma for both characteristics, the resulting exact splitting lemma, the reversible arithmetic needed to implement it, the phase oracle and its uncomputation, and the composition of splitting rounds into a complete factoring algorithm, together with its total complexity. Section 4 places the result relative to the classical literature (Section 4.1) and to previously known quantum approaches (Section 4.2). Section 5 generalizes the whole construction beyond polynomials, to arbitrary separable commutative -algebras presented by structure constants. First, we isolate the mechanism as a test map and treats arbitrary separable commutative -algebras presented by structure constants. For the noncommutative case, we follow Rónyai's reductions to obtain the radical, the Wedderburn decomposition, zero divisors and explicit isomorphisms. Section 6 concludes.
2 Preliminary
This section introduces the three ingredients used throughout the paper: Berlekamp's reduction of polynomial factorization to splitting the fixed-point algebra, exact amplitude amplification, and the quantum circuit model in which our exactness claim is formulated.
2.1 Berlekamp's algorithm and notation
Before fixing notation, it is worth recalling in one paragraph why factoring reduces to splitting an algebra in the first place, since everything else in the paper is built on this fact. If is the (unknown) irreducible factorization, the Chinese Remainder Theorem gives a ring isomorphism . Berlekamp's insight is that one specific piece of this decomposition, namely the subring fixed by the -power Frobenius map, can be computed without knowing the factorization at all, by ordinary linear algebra, and that this subring already carries enough information to recover the factorization once one can tell its coordinates apart. Making this precise, and fixing the notation used throughout the paper for it, is the content of the rest of this subsection.
Let be squarefree of degree (the general case reduces to this classically via ) and monic, with irreducible factorization , . Let and let , , be the -linear Frobenius map on . The map is well defined because is a ring endomorphism of fixing pointwise and hence descends to the quotient . The Berlekamp subalgebra is the subring of elements fixed by ,
computed concretely as the kernel of the -linear map on the -dimensional -vector space , i.e. by ordinary linear algebra on an explicit matrix, with no reference to the (unknown) factorization of .
By the Chinese Remainder Theorem, , via reduction modulo each . Under this isomorphism corresponds, coordinatewise, to the -power Frobenius automorphism of each field , whose fixed field is itself regardless of . A standard fact of finite field theory: the Frobenius generates the cyclic Galois group , and the fixed field of the full Galois group of a finite Galois extension is exactly the base field (see e.g. [26, Thm. 2.6]). Consequently corresponds, coordinatewise, to in every factor simultaneously, and the CRT isomorphism restricts to a ring isomorphism
with each (reduction modulo ) a surjective ring homomorphism. In particular : the dimension of the Berlekamp subalgebra alone already reveals the number of irreducible factors of , before any of them are known individually.
The interpretation worth keeping in mind throughout the paper is the following. Via , an element is exactly an -tuple of field elements , one value per irreducible factor. Two distinct factors are distinguished by precisely when , and in that case recovers a nontrivial proper divisor of containing but not . The entire difficulty of Berlekamp's algorithm therefore reduces to a single question: given only the abstract ring , known to be isomorphic to but without knowing which coordinate of corresponds to which factor, how does one efficiently produce elements of that are nonconstant, i.e. that take at least two distinct values among their coordinates? Section 3.1 answers this question with an exact quantum procedure. The remainder of this subsection only fixes the notation needed to state it.
Computing , the matrix of with respect to the monomial basis of , its null space, and a basis of , is classical, deterministic, and takes time by Gaussian elimination (see e.g. [37, §14.8] for a full complexity account of this step within Berlekamp's algorithm). Nothing in this paper touches that step. It is taken as a black box throughout.
Throughout, a block is a subset known to satisfy (initially , the single block containing every factor), with , , , , basis , and coordinate maps ( ) defined exactly as above but relative to in place of . A block is internal if , i.e. if it is still pending a split; the algorithm of Section 3.5 maintains a worklist of blocks and repeatedly refines an internal block into two smaller ones, exactly as one would refine a partition, until every block has , at which point is already irreducible.
Remark 2.1 (Computational model). Unlike the black-box group setting of [20], the present problem provides an explicit algebraic representation of the underlying finite commutative algebra. We exploit this additional structure throughout via polynomial evaluation, reversible polynomial arithmetic, and (at one classical post-processing step) polynomial gcd extraction, none of which has an analogue for a general black-box group. Everything available in the black-box setting remains available here as a special case.
2.2 Exact amplitude amplification
The single external tool the construction relies on is the following theorem of Brassard, Høyer, Mosca and Tapp, which upgrades ordinary (bounded-error) amplitude amplification to a zero-error procedure whenever the target success probability is known in advance rather than merely bounded below.
Fact 2.2 (Exact amplitude amplification; [6], Theorem 4). Let be a unitary (measurement-free) circuit and a Boolean predicate on (part of) its output register, and suppose the probability that measuring yields state with is known exactly, with . Then there is a circuit using applications of (worst case) that outputs with certainty state with .
Informally, writing for the components singled out by , a Grover-type operator , built from a reflection about the bad subspace together with a reflection about itself, generalizing the search operator of [15], rotates towards by a fixed angle per application, where the angle is determined by . After standard applications the state lies close to , but in general not exactly on it, so ordinary Grover-type search only amplifies success probability, it does not make it certain. What Fact 2.2 adds is a way to close that gap whenever a is known exactly. We attach a single auxiliary qubit, rotated once through an angle that is an explicit, efficiently computable (generally irrational) function of . This reduces exactly to a value reachable by an integer number of standard, fixed-phase Grover iterations. Only that one auxiliary rotation carries a non-finite gate parameter, every other gate in the construction is a standard, input-independent Grover iterate.
This mechanism already has precedent for special values of . Brassard and Høyer's original construction [5] handles the case exactly, giving an exact derandomization of Simon's algorithm, and Mosca and Zalka [27] handle , used to build an exact quantum Fourier transform (at the cost of three applications of the standard QFT). Fact 2.2 is the general form of this idea, valid for an arbitrary exactly-known rather than only or . This generality is what makes it usable here: what the theorem needs is not a success probability tuned to some fixed constant, but simply one known exactly in advance, whatever its value happens to be. Supplying such a probability is exactly the content of Lemma 3.2 below.
2.3 Computational model
We work in the quantum circuit model in which finite-field elements are represented by binary registers of qubits, and arithmetic operations in are implemented reversibly. Throughout, the complexity of the quantum algorithm is measured primarily in -operations, with the corresponding bit and elementary-gate costs determined separately by the chosen representation of (see [36]); we do not carry out that separate reduction here.
Our use of exact amplitude amplification follows the arbitrary-rotation circuit model underlying Fact 2.2: one-qubit rotations whose angles are efficiently computable from the input parameters are permitted as elementary gates. Exactness is a property of a circuit family, however, and is meaningless until one says both which gates are available and how the family is described, so we fix the two conditions separately.
The gate set is the one introduced by Adleman, DeMarrais and Huang [1], who index exact quantum polynomial time by the set of permitted gate coefficients: for , the class consists of the problems solved with probability exactly 1 by polynomial-size quantum circuits over the controlled one-qubit unitaries whose coefficients lie in . We take .
The uniformity condition is that of Nishimura and Ozawa [29]: a quantum circuit family is uniform when the circuit for a given input is constructible by a classical deterministic Turing machine in time polynomial in the circuit size, including that the numerical parameters of the gates be computable classically in time polynomial in the circuit size and a prescribed precision. Following [20], we distinguish three models, in increasing order of power:
(i) finitely based uniform circuit families;
(ii) infinitely based uniform circuit families;
(iii) circuit families in which the gate parameters are computed from the input rather than from the input size.
Write
for the class obtained by imposing the uniformity condition of [29] on . This is model (iii), and it is the class in which every exactness claim of this paper is stated; every procedure below that invokes Fact 2.2 succeeds with probability exactly one upon measurement, with all gate parameters computable in advance.
The distinction between the two classes is not idle, and the comparison with Draper [11] makes it concrete. Draper constructs a quadratic nonresidue modulo a prime exactly, and states the result in ; his rotation angle , with , is a function of the input prime, so his construction lives in model (iii) as ours does. Definition-wise, however, places no computability requirement on the gate coefficients at all, and is in that respect the more permissive of the two: unrestricted coefficients would allow parameters encoding uncomputable information, which is precisely why [1] confines attention to amplitude sets of polynomial-time computable numbers. Our claims are made in the smaller class , and are correspondingly stronger. What makes them available is that the angles we need are functions of and the current block size alone, both public data (Lemma 3.2).
The f-algorithm cost model. Section 5.3 draws on a body of classical results stated in a cost model that we record here, since our claims there are obtained by substituting an exact quantum procedure for its oracle. Following Rónyai [31], an f-algorithm is an algorithm that is deterministic apart from calls to an oracle that factors polynomials over finite fields into irreducible factors, a call being charged the length of its input. The device is what makes the classical structure theory of finite algebras quotable independently of the status of factoring: the algorithms of [13, 31] for the Wedderburn decomposition, for zero divisors and for explicit isomorphisms are f-algorithms, so all of their randomness is confined to the oracle, and instantiating that oracle with Berlekamp's Las Vegas [4] or deterministic [3] algorithm recovers the two classical regimes discussed in Section 4.1.
Charging a call its input length is convenient classically but is not available to us, since the quantity we must account for is the quantum cost of answering the call exactly. Whenever we invoke an f-algorithm below we therefore report two figures in place of that charge: the number of oracle calls the algorithm makes, and, for each call, the degree of the polynomial to be factored together with the field over which it is presented. The second is not a pedantic refinement. An oracle call over an extension costs in place of in the bounds of Section 3, and the extension degrees arising in a reduction are therefore part of its cost, not an implementation detail; avoiding such extensions altogether is one of the concrete advantages of the direct construction of Section 5 over the classical route.
3 Main results
This section contains the paper's technical core, and it is organized in three stages rather than as a flat list of results. Sections 3.1–3.2 establish that a single block can be split exactly. Particularly, Section 3.1 shows that the fraction of useful test elements, , is known exactly from q and the block size s alone, and 3.2 feeds this probability into Fact 2.2 to obtain a procedure that produces a nonconstant test element with certainty, using a single oracle call. Sections 3.3–3.4 then descend to the circuit level needed to actually realize that procedure: reversible ring arithmetic (3.3) and the phase oracle built from it (3.4). Sections 3.5–3.6 assemble repeated exact splits into a complete recursive factoring algorithm and total its cost over the whole splitting tree. Section 3.7 closes with the main theorem, stating correctness and complexity for the algorithm as a whole.
3.1 An exact, hidden-factorization-independent counting bound
Recall from Section 2.1 the notation for a block: with , , , and the local Berlekamp subalgebra, with fixed basis and coordinate maps (reduction modulo the individual factors , ). The goal of this subsection is to show that a uniformly random element of , tested appropriately, is nonconstant, i.e. distinguishes at least two of the factors indexed by , with a probability computable exactly in advance, from and alone.
For write . Since is a basis, is an -linear bijection . Composing it with the ring isomorphism gives an -linear bijection
Because each is a ring homomorphism, for any polynomial expression , which is what lets a test on be analyzed purely in terms of the (unknown) bijection .
Suppose we apply to each coordinate some fixed map and call the resulting test element bad when all coordinates receive the same value. Being bad means all coordinates of lie in a common fiber of . Now is a bijection, so is uniform on when is, and therefore the probability of this event is a count of tuples. It is determined by the sizes of the fibers of and by , and by nothing else. In particular it does not depend on which coordinate of corresponds to which irreducible factor, nor on the degrees , nor on anything else about the hidden factorization. We record this as a lemma, in the form in which it will be reused in Section 5.
Lemma 3.1 (Factorization-independent sampling). Let be any map, with fibers of sizes where . For a uniformly random tuple put . Then
Consequently, if for a bijection and is uniform on , the same two formulas hold. In particular the probability is computable from , and the fiber profile of alone. Moreover, writing
for the largest relative fiber size, we have, for every ,
with equality precisely when every nonempty fiber of F has size .
Proof. The tuple is constant with value precisely when for every , and there are such tuples . Summing over and dividing by gives the first identity while the second is its complement. For the last claim, a bijection carries the uniform distribution on to itself, so is uniform and the computation is unchanged.
For the bound, put , so that for every and , the fibers of partitioning . Since for every and ,
with equality exactly when for every with .
Everything specific to Berlekamp's setting is now confined to the choice of , and there are two natural choices, one for each characteristic. In odd characteristic take , the quadratic character, and set . In characteristic 2 take and set for . The fiber sizes of these two maps are classical, and substituting them into Lemma 3.1 gives the following.
Lemma 3.2 (Exact success probability). Let be a block with , and let
Then
Moreover
with if and only if and . It is known exactly before the irreducible factorization of is determined.
Proof. Both characteristics follow the same two steps: identify the fiber profile of the test map, then apply Lemma 3.1 to the tuple , which is uniform on because is a bijection. Since each is a ring homomorphism, for the relevant test map , and likewise for ; so (resp. ) is constant exactly when all coordinates of lie in a common fiber of .
Odd . Here , whose image is and whose fibers are , the nonzero squares , and the nonsquares , of respective sizes
Lemma 3.1 gives constancy probability , which is the stated formula. Since we have , so , and because . The bound of Lemma 3.1 therefore yields
for every , the last step because . The term contributed by the fiber is absorbed by this estimate rather than discarded: it is one of the summed in Lemma 3.1.
. Here is a nonzero -linear functional, hence surjective with both fibers of size , so and . Lemma 3.1 gives constancy probability , which is the stated formula, and the bound reads for , here with equality in the first inequality since both fibers have size exactly .
Finally, forces , i.e. , together with equality in , which fails for odd ; hence equality occurs only for , . That in both cases is immediate, the constancy probability being a sum of positive terms. In both cases the value of was computed from , and the fiber sizes of alone, none of which refers to the factorization of .
Remark 3.3 (No single test serves every ). The two characteristic cases are not an artefact of the presentation. Fixing the coarser partition “Tr = 0 vs. ” for a general odd gives and hence bad-fraction as , so that test degrades for large odd and is a genuine fix only for ; odd characteristic uses the quadratic-character test instead, which needs no such restriction. This is the elementary form of a tension analysed in general in Remark 5.4, between small image and balanced fibers.
3.2 The splitting oracle and the exact block-splitting lemma
Previously, Lemma 3.2 supplies an exactly known probability. This subsection turns that probability into an algorithm. We first package the nonconstant test as a reversible quantum oracle, the splitting oracle , so that “testing (resp. ) for nonconstancy” becomes a single well-defined unitary rather than an informal procedure. Feeding and the probability into Fact 2.2 then gives this subsection’s main result in Lemma 3.5, a procedure that produces a splitting element with certainty, using a single application of .
Write for the exactly known success probability of Lemma 3.2. Let be a quantum circuit preparing the uniform superposition over and computing .
Definition 3.4 (Splitting oracle). Let be a block with . The splitting oracle is the unitary implementing the Boolean predicate
acting as on the register prepared by together with a flag qubit. One application of includes the reversible computation of (resp. ) from , the reversible nonconstant test of Lemma 3.9, and the subsequent uncomputation of all temporary registers, and is implemented explicitly by the PHASEORACLE procedure of Section 3.4. This makes the phrase “one application of ,” used throughout the complexity statements below, unambiguous.
Lemma 3.5 (Exact block splitting). For every block with , there is a zero-error quantum procedure that, in the class of Section 2.3, outputs, with certainty, an element such that (resp. ) is not a constant polynomial. The procedure uses
applications of a reversible circuit , its inverse, and the splitting oracle of Definition 3.4, plus further elementary operations. Since , the number of amplitude-amplification iterations is not merely bounded by an absolute constant but is equal to 1, for every , every block and every (Remark 3.6).
Proof. By Lemma 3.2, the probability that measuring and evaluating on the resulting (resp. ) succeeds is exactly , and is known in advance from and alone. Fact 2.2 therefore applies directly with , as in Definition 3.4, and , yielding a procedure that succeeds with probability exactly one, using applications of , ; since , this is . The precise count is given in Remark 3.6.
Remark 3.6 (The constant is one). The above can be replaced by an exact figure, uniformly in the input. In the notation of Fact 2.2, write , so that standard Grover iterations carry the good amplitude to and the exact procedure uses iterations, the residual mismatch being absorbed by the single auxiliary rotation. By Lemma 3.2 we have for every and every , hence , hence
Every invocation of Lemma 3.5 therefore performs exactly one Grover iterate . Counting the initial state preparation, this is two applications of , one of and one of , together with the one auxiliary rotation of Fact 2.2. Both bounds on are needed here: prevents and prevents .
3.3 Reversible arithmetic
Throughout this subsection, complexity is measured in -operations; translating to bit complexity or elementary-gate counts requires fixing a representation of and is not carried out here (see [36]).
A single naive reduction step is not injective on registers of bounded degree. Recovering from requires the quotient , which a naive reduction discards. The fix is standard: write the quotient into a fresh ancilla,
which is a bijection (given the output, ). Since is monic no leading-coefficient inversion is needed here.
Proposition 3.7 (Reversible ring multiplication). Let , . There is a reversible circuit
for , using -multiplications and additions for the raw (unreduced) product, computed into a fresh ancilla, followed by one reduction step as above. All internal scratch (the raw product, the quotient) is uncomputed via the standard compute-uncompute pattern, leaving only the clean output.
Iterating this reduction step across rounds simulates the polynomial Euclidean algorithm reversibly, and so yields a reversible gcd circuit on ; the construction is routine apart from termination, which must be padded to a fixed worst-case depth so that all branches of a superposition finish together, and we record it in the Appendix. We do not use it: the nonconstancy predicate admits the much cheaper test of Lemma 3.9, and the only gcd the algorithm ever computes is classical, on a measured polynomial (Section 3.5).
The construction above should not be interpreted as a black-box group algorithm. Its efficiency relies essentially on the explicit representation of , including the reversible polynomial arithmetic of Proposition 3.7 and, at one classical post-processing step, a polynomial gcd extraction (Section 3.5). The comparison with the black-box setting of [20] in Section 2.1 is therefore only motivational: the explicit ring structure of provides additional information that is unavailable in a general black-box model.
3.4 The phase oracle
With the reversible arithmetic of Section 3.3 in hand, this subsection builds the splitting oracle of Definition 3.4 explicitly. We first pin down what “nonconstant” means concretely for an element of (Lemma 3.8), then give a reversible test for it that is far cheaper than a reversible gcd circuit (Appendix), a single pass over coefficients (Lemma 3.9), and assemble it, together with the power-ladder computation of or , into the PHASEORACLE procedure that implements , with its cost recorded in Lemma 3.10.
Lemma 3.8 (Constant-value characterization). Let . Then for every , for some fixed , if and only if equals the constant polynomial . Consequently, the bad event of Lemma 3.2 is exactly the event that (resp. ) is a constant polynomial.
Proof. Under the identification induced by , the constant polynomial maps to the diagonal tuple . Since is injective, this tuple has as its unique preimage in . Hence an element of agrees across all coordinates if and only if it is the constant polynomial with that common value. This proves the first claim.
It remains to check that , so that the characterization applies to them. For odd , is closed under multiplication (it is a subring of ), so from we get directly. For , we use that exponentiation commutes: for any positive integers and any . Since , i.e. , applying to each individual term of gives
so every summand of is already individually fixed by , no term needs to be related to any other. Since is additive (it is a ring homomorphism), a sum of -fixed elements is again -fixed:
Hence as well.
Thus in both characteristics the relevant test element lies in , the counting lemmas of Section 3.1 apply exactly to it, and the bad (constant) event coincides with the event analyzed there.
This is the same fact underlying the elementary observation that any non-first vector of the fixed basis is automatically non-constant (as alone spans the constants), now applied to and in place of a basis vector.
Lemma 3.9 (Reversible nonconstant test). Let . There is a reversible circuit
using coefficient-level nonzero tests, combined via the standard reversible decomposition of a multi-input Boolean OR, and no ancilla beyond the output flag. Compute and uncompute use the identical circuit run forward and backward, since the underlying Toffoli/CNOT construction is self-inverse. The same circuit serves both characteristics; only whether or is fed in differs.
Proof. By definition, is a constant polynomial, i.e. , if and only if . Hence the predicate is exactly the Boolean OR of the coefficient-nonzero predicates , . Each such predicate is computed reversibly from the corresponding coefficient register in -operations, and the resulting flags are combined into a single output flag by a standard reversible OR circuit built from Toffoli/CNOT gates, for a total of elementary tests.
Computing or from uses repeated squaring (odd ) or repeated Frobenius-squaring (characteristic 2), each instance of Proposition 3.7, following the same fresh-ancilla discipline used there (squaring in place is not injective, but squaring into a fresh register while retaining the previous value is).
Algorithm 1 POWERLADDER() — computes (odd ) reversibly
Input: register holding (read-only) Output: fresh register holding ; all scratch returned to
1: 2: for to do 3: allocate fresh ; compute 4: end for 5: allocate fresh ; 6: for to do 7: if then 8: ; allocate fresh ; compute 9: end if 10: end for 11: copy into a fresh output register OUT 12: uncompute steps 9 and 3, in reverse order, using the stored multiplicands 13: return OUT
TRACELADDER() () has the same shape: squaring is replaced by Frobenius-squaring (still ), and the conditional second loop by the unconditional sum (characteristic-2 addition is its own inverse, needing no separate uncompute pass beyond returning the ).
Algorithm 2 PHASEORACLE — applies to
1: 2: 3: apply to 4: uncompute 5: uncompute
TRACELADDER if Lemma 3.9 phase iff is non-constant re-run ISNONCONSTANT, self-inverse run POWERLADDER
Lemma 3.10 (Phase oracle cost). costs calls to (Proposition 3.7, each -operations) plus elementary gates for the flag: -operations total, with compute and uncompute contributing equal, not multiplicative, factors.
3.5 Composition across rounds
A successful application of Lemma 3.5 yields a with (resp. ) non-constant. Measuring it and computing classically for (resp. ) via the ordinary Euclidean algorithm, a one-time, non-reversible computation on a now-concrete polynomial, needing none of Section 3.3's reversibility machinery, yields a nontrivial proper divisor , hence a split . This composition of Lemma 3.5 with classical gcd extraction is recorded once and for all in the following lemma, which is what QUANTUMSPLIT below implements.
Lemma 3.11 (Exact quantum splitting). Let be a block with . In the class of Section 2.3, there is a quantum procedure that outputs a nontrivial proper partition with probability exactly one, using a single application of the splitting oracle (Definition 3.4), by Remark 3.6. The exact amplitude-amplification parameters it uses depend only on q and s, and are therefore computable independently of the hidden irreducible factorization of .
Proof. By Lemma 3.2, the success probability is known exactly and satisfies . By Lemma 3.5, exact amplitude amplification therefore transforms the uniform superposition over into a state supported entirely on the subspace, using a single application of (Remark 3.6), and a measurement of this state yields, with certainty, a for which (resp. ) is nonconstant. By Lemma 3.8, such a nonconstant test element takes at least two distinct values among the CRT coordinates . Hence for at least one candidate the classical polynomial (computed as in QUANTUMSPLIT, step 4) is a nontrivial proper divisor of , giving the partition with . Since depends only on and (Lemma 3.2), so does the rotation angle that Fact 2.2 attaches to this application, independently of which irreducible factors actually contains.
Recursing requires bases of without repeating the Fix( ) null-space computation of Section 2.1.
Lemma 3.12 (Basis pushdown). Let and let be reduction modulo . Then . Consequently, the reductions of any basis (indeed of any spanning set) of form a spanning set of , and a basis of can be obtained from it by classical Gaussian elimination.
Proof. If then , hence also since , so ; thus . Under the identifications and from Section 2.1, the reduction map corresponds exactly to the coordinate-forgetting map , which is surjective. Hence so is , giving . In particular the images of a spanning set of span , though they need not remain linearly independent, so a basis is recovered by Gaussian elimination on the reduced vectors.
A basis of is thus obtained from reduced modulo ( field operations) by extracting linearly independent vectors via Gaussian elimination ( field operations).
Algorithm 3 QUANTUMSPLIT( )
1: prepare ; compute
2: apply Fact 2.2 with , from PHASEORACLE,
3: measure ; compute classically
4: classically compute (or ) and, for each candidate ,
5: let be any resulting nontrivial proper divisor;
6: return
Algorithm 4 FACTOR(f)
1: compute Q, its null space, and a basis of B (classical, Section 2.1)
2: worklist ; output
3: while worklist do
4: remove from worklist
5: if then
6: output output
7: else
8:
9: compute bases of via Lemma 3.12
10: add and to worklist
11: end if
12: end while
13: return output
3.6 Complexity
Corollary 3.13 (Total quantum complexity). Let be squarefree of degree , with irreducible factors. Summing Lemma 3.10 over the amplitude-amplification iterations at each internal node of the recursive splitting tree, of which there is exactly one per node by Remark 3.6, the total quantum cost of FACTOR( ) is
-operations. Since for every block and the number of internal blocks is exactly (Theorem 3.14 below), this is
The corresponding classical bookkeeping consists of basis pushdown (Lemma 3.12) and gcd extraction, summed over the recursion, is field operations under the schoolbook arithmetic model of Section 3.3; a more detailed bound may be obtained, if desired, by summing directly over the splitting tree rather than bounding every by .
3.7 Main theorem
Theorem 3.14 (Exact quantum Berlekamp factorization). Let be monic and squarefree of degree , with its factorization into distinct monic irreducible polynomials. In the class of Section 2.3, that is, in uniform circuit families allowing single-qubit rotations through efficiently computable angles, outputs the complete irreducible factorization of with probability exactly one. The algorithm performs exactly successful invocations of QUANTUMSPLIT (one per internal node of the binary splitting tree with leaves, regardless of how unbalanced the splits are) each performing a single amplitude-amplification iteration and hence a single application of (Remark 3.6, Lemma 3.10), for a total quantum cost of -operations together with classical field operations for basis maintenance and gcd extraction (Corollary 3.13). Every gate parameter used by the exact amplitude-amplification procedure at each step depends only on and the size of the current block, and hence is computable in advance, independently of the unknown irreducible factorization.
Proof. The initial Berlekamp basis is computed deterministically by classical linear algebra (Section 2.1). Whenever a block has , Lemma 3.11 produces, with certainty, a genuine split using one application of , with amplitude-amplification parameters depending only on and . Lemma 3.12 then supplies bases of without recomputing the Frobenius null space. The recursion terminates exactly when every block has , at which point is already irreducible.
The recursive splitting process is represented by a binary tree with leaves (one per irreducible factor), and a binary tree with leaves has exactly internal nodes; hence exactly splitting calls occur. The cost bound is Corollary 3.13.
4 Comparison with classical and quantum approaches
4.1 Comparison with classical splitting
The classical status of the splitting step is not uniform across finite fields, and it is worth separating the regimes carefully, since the contribution of this paper is confined to one of them.
Small characteristic: already deterministic. Berlekamp's original algorithm [3] is deterministic and runs in time with . The mechanism is exactly the one we use in characteristic 2: the absolute trace maps each CRT coordinate into the prime field, and one then computes for each of the possible constants . Determinism is obtained by sweeping an -basis of rather than sampling. Since is -linear and surjective while the constants occupy only a one-dimensional subspace of the image, some basis element must have nonconstant trace.
Consequently, for and more generally for any fixed small unconditional deterministic polynomial-time splitting is classically known, and our characteristic-2 procedure provides no new capability. It is an exact quantum analogue of an already deterministic classical algorithm. What it does provide is uniformity: the same counting-plus-amplification mechanism covers both characteristics, and in characteristic 2 it uses one amplification round in place of a sweep over an -basis of of size . The gain is practical rather than asymptotic: fewer rounds in practice, and a single mechanism that covers every finite field uniformly instead of splitting into cases between characteristic 2 and the rest.
Large odd characteristic: the hard regime. This is where the present construction has content. For large of odd characteristic the trace trick is useless (exhausting over costs operations) and every known efficient classical method is randomized. Deterministic algorithms are known at cost polynomial in . Shoup [33] factors over deterministically in operations, and Narayanan [28] gives a deterministic equal-degree splitting algorithm in using Drinfeld modules with complex multiplication. Neither is polynomial in .
Whether a deterministic polynomial-time algorithm exists at all is a long-standing open problem, and a sharper statement than is sometimes made is available. As Gao records [14], it is open whether one exists even under the Extended Riemann Hypothesis. What ERH/GRH does buy is a substantial body of conditional results. Particularly, Rónyai [30] for a bounded number of irreducible factors, Huang [18], Evdokimov's subexponential algorithm [12], the m-scheme framework of Ivanyos, Karpinski and Saxena [23] and its successor [22], and Guo's recent P-scheme algorithm [16], which subsumes and improves Evdokimov's bound. As Gao notes in his analysis of Evdokimov's method [14], these algorithms do route through the construction of a primitive root or an r-th non-residue of , so the dependence of the classical derandomization literature on such auxiliary objects is real.
Against this background, our procedure is best understood as an exact quantum drop-in replacement for the randomized classical test in the large odd characteristic regime. It removes the randomization without assuming ERH, without constructing a primitive root or a non-residue, and without paying a factor. It is not an asymptotically faster algorithm in either the classical or the quantum setting.
4.2 Comparison with previous quantum approaches
Quantum algorithms bearing on polynomial factorization over finite fields are surprisingly few. The problem has no entry in the standard catalogue of quantum algorithms [24]. We discuss the two most relevant works, and then situate the present construction.
The pipeline, and what “the splitting step” means. Modern factorization algorithms are organized as a three-stage pipeline,
where squarefree factorization (SFF) removes repeated factors, distinct-degree factorization (DDF) separates the remaining factors into groups of equal degree, and equal-degree factorization (EDF) splits each such group into individual irreducibles. SFF is deterministic and cheap. DDF is the classical bottleneck in the Cantor–Zassenhaus organization. EDF is where randomization enters classically, and it is the stage this paper addresses. Berlekamp's algorithm is organized differently: it performs no DDF stage at all, and its splitting step separates arbitrary factors directly, so it plays the role of EDF without requiring the degree information that Cantor–Zassenhaus-style EDF assumes. Figure 1 shows which stage each quantum algorithm discussed below acts on.
It is useful to separate the works that might otherwise be confused with the present one:
- Distinct-degree factorization. Doliskani [10] is quantum and addresses DDF only; the classical baseline is [17].
• Equal-degree factorization and Berlekamp-type splitting. This is our stage. Classically it is [7, 38] (randomized) and [3] (deterministic in small characteristic); we are not aware of any prior quantum treatment.
• Quantum root finding. Grover-based root finding over gives at most a quadratic speedup over brute force, hence no polynomial-time algorithm, and is not comparable here.

Berlekamp: no DDF stage — splits arbitrary factors directly
Figure 1: Where each quantum contribution sits in the factorization pipeline. Doliskani [10] accelerates DDF and leaves EDF classical and randomized. The present work makes EDF exact and performs no DDF at all. The two therefore act on disjoint stages.
• Exact quantum search and exact amplitude amplification. The technique we use [5, 27, 6, 2], and its application to a different problem in the same algebraic neighbourhood by Draper [11].
We now discuss the two most relevant works in detail, and then situate the present construction.
Doliskani: quantum distinct-degree factorization. The one dedicated treatment we are aware of is that of Doliskani [10], which gives a randomized quantum factorization algorithm with average-case complexity bit operations, rising to on a negligible subset of inputs, thereby breaking the classical 3/2-exponent barrier of [17].
It is important to be precise about where the quantum step sits in that algorithm, because it is not where ours sits. Doliskani follows the Cantor–Zassenhaus pipeline of squarefree factorization (SFF), distinct-degree factorization (DDF) and equal-degree factorization (EDF), and the quantum ingredient is confined entirely to the DDF stage. The observation is that the degree of the splitting field of equals the order of the Frobenius automorphism in , so that DDF, which is the classical bottleneck, reduces to order finding, which is solved by a standard quantum period-finding routine. The SFF stage is classical, and the EDF stage, which is precisely the splitting step considered in this paper, remains the classical randomized procedure of von zur Gathen and Shoup [38].
The two contributions therefore act on disjoint stages of the same pipeline. The method in [10] accelerates distinct-degree factorization and leaves splitting randomized, while the present work derandomizes splitting and does not touch distinct-degree factorization. In principle the two are composable, although we do not carry this out here and note that it is not immediate: our algorithm is Berlekamp-based and performs no distinct-degree phase at all, whereas [10] is organized around one. We also note that the algorithm of [10] is randomized with expected running time rather than exact in the sense of Section 2.3. Its order-finding subroutine may report failure, and no step of it succeeds with probability exactly one in a bounded number of operations.
Draper: exact quantum construction of non-residues. Closer to our technique, though addressing a different problem, is Draper's observation [11] that a quadratic non-residue modulo a prime can be produced exactly, in deterministic polynomial time and without GRH, in the class , which is larger than the class in which we work (Section 2.3). The mechanism is recognisably of the same family as ours. The number of quadratic non-residues below , and their even/odd split, are known exactly in advance and hence this permits an exactly computable rotation angle, applied with opposite signs to the two parity classes so that the imaginary parts cancel and the amplitude mean lands where a single inversion annihilates every non-solution. Measurement then returns a uniformly random non-residue with probability one. Draper further observes that the same device yields a uniformly random element of any set of known cardinality equipped with a membership test.
This bears on our claims in two ways, and we state both plainly. First, it means that the absence of a primitive root or non-residue from our construction should not be read as removing an obstacle that is otherwise insurmountable quantumly. For prime fields at least, such an object is itself exactly constructible.
What our counting lemma does provide is that no auxiliary exact subroutine is needed at all, since the required probability is supplied directly by the class cardinalities. The exactness of Theorem 3.14 therefore does not rest on the exactness of anything else. Second, it is worth being clear about what [11] does not give. It operates over prime fields, via the Legendre and Jacobi symbols, rather than over general . Also, possession of a non-residue does not by itself split a block, since the classical derandomizations that consume such an object remain conditional and, in general, partial. The object counted in our Lemma 3.2 is not a field element but the CRT-coordinate tuple of a Berlekamp-subalgebra element, and the argument turns on the bijectivity of , which has no counterpart in [11].
Other related quantum work. Several quantum algorithms operate on the same algebraic objects without addressing factorization. Van Dam and Seroussi [35] estimate Gauss sums over in polynomial time, and van Dam, Hallgren and Ip [34], together with Russell and Shparlinski [32], treat hidden-shift and polynomial-reconstruction problems given a quadratic-character oracle on , the same character that drives our odd-characteristic test, applied to a different problem. Kedlaya [25] computes zeta functions of curves over finite fields. The survey of Childs and van Dam [8] covers this area generally. None of these addresses the splitting of the Berlekamp subalgebra. A separate line of work applies Grover search to root finding over , obtaining at most a quadratic speedup over brute force and hence no polynomial-time algorithm. Thus, it is not comparable to the present setting.
On the amplification side, the exact theorem of [6] that we invoke has since been extended to two-sided-error algorithms and to measurements in non-standard bases [2], under a condition of exactness analogous to the one supplied here by Lemma 3.2. We do not need that strength, but it indicates that the underlying device, exact knowledge of a success probability converted into certainty, has been developed independently of the present application.
Summary. To the best of our knowledge, no previous quantum algorithm for polynomial factorization over finite fields has been claimed to be exact in the sense of , or indeed of the larger class . The existing quantum approach [10] is randomized and targets a different stage of the pipeline, and the existing exact quantum construction in this algebraic neighbourhood [11] solves a different problem over prime fields. The distinguishing properties are collected in Table 2.
Table 2: Classical and quantum approaches to polynomial factorization over .
| Method | Exact | Quantum | Aux. object | DDF | Fact.-indep. |
|---|---|---|---|---|---|
| Berlekamp, large q [4] | No | No | No | No | Yes |
| Berlekamp, small char. [3] | Yes | No | No | No | Yes |
| Cantor-Zassenhaus [7] | No | No | No | Yes | Yes |
| Shoup [33], Narayanan [28] | Yes | No | No | Some | — |
| Evdokimov [12], Guo [16] | Yes | No | Yes | No | — |
| Doliskani [10] | No | Yes (DDF) | No | Yes | — |
| Draper [11] | Yes | Yes | constructs a non-residue | ||
| This work | Yes | Yes (splitting) | No | No | Yes |
Deterministic, but polynomial in ; efficient only in small characteristic. Deterministic, but polynomial in . Deterministic and subexponential (polynomial in structured cases), conditional on GRH/ERH. Exactness for this work is in the sense of (Section 2.3); [11] states its result in the larger class , which imposes no computability condition on the gate coefficients.
The three right-hand columns of Table 2 track properties that recur throughout the comparison above. “Aux. object” records whether a method needs some auxiliary number-theoretic ingredient (a primitive root of , or a distinguished quadratic (or higher) non-residue) constructed before splitting can proceed. “DDF” records whether the method first separates factors by degree, via distinct-degree factorization, before splitting within each resulting degree class. “Fact.-indep.” records whether the method’s parameters (the number of iterations it needs, or the success probability it relies on) can be computed from q and the current block size s alone, in advance, without any knowledge of which irreducible factors the block actually contains.
5 Beyond polynomials: splitting finite algebras
Nothing in the construction of Section 3 is special to the Berlekamp subalgebra of a polynomial. The proof that a nonconstant test element reveals a genuine split (Lemma 3.8) uses only the existence of an injective -algebra homomorphism whose image contains the diagonal copy of , and the counting bound (Lemma 3.2) uses only the bijectivity of the induced coordinate map together with the fiber sizes of a fixed partition of .
This section isolates that mechanism and follows it as far as it goes. Section 5.1 defines the class of tests the argument admits, of which the quadratic-character and absolute-trace tests of Section 3.1 are the two extremal instances. Section 5.2 applies it to an arbitrary finite-dimensional separable commutative -algebra presented by structure constants, with polynomial factorization recovered as the special case . Section 5.3 extends to the noncommutative case.
It is worth saying at the outset why the commutative case, which the organization of this paper presents as a generalization of the polynomial one, is in fact the object on which the whole structure theory of finite algebras turns. As Section 5.3 recalls, the passage from a general associative algebra to a commutative one costs a single linear system: the simple components of a semisimple A are recovered from the primitive idempotents of its centre, and the centre is a product of fields. The commutative case is therefore not a convenient intermediate stop between polynomials and algebras, but the point at which the difficulty of the whole family of problems is concentrated.
5.1 Test maps
The two tests of Section 3.1 are used there only through their fiber profiles, and the properties of them that the argument consumes are easy to name. Exactness needs the fibers to be known in advance and no fiber to be too large; efficiency needs the map to be cheap to evaluate reversibly, and its image to be small, since Section 5.2 will try one candidate value per element of the image.
Definition 5.1 (Test map). A polynomial is a test map if
(T1) F can be evaluated by additions and multiplications in any commutative -algebra (that is, F is given by a short straight-line program, not merely by a coefficient list);
(T2) its image is small, ; and
(T3) its fibers are balanced, in the sense that
The division of labour among the three conditions is worth stating once, since only one of them bears on exactness. Condition (T3) alone forces the success probability above 1/2 and hence supplies the hypothesis of Fact 2.2; (T1) bounds the cost of a single oracle call, exactly as the power ladder of Section 3.4 does for the two concrete tests; and (T2) bounds the cost of the extraction step of Lemma 5.7 below. Dropping (T1) and (T2) would leave a procedure that is still exact but no longer efficient: the identity map has all fibers of size 1 and so the best possible balance, but its image is all of and the extraction step would cost .
Lemma 5.2. Let be a test map with fibers of sizes , and let be uniformly distributed. Then
with equality in the middle inequality exactly when every nonempty fiber of F has size .
Proof. Immediate from Lemma 3.1, which was stated there for an arbitrary map and an arbitrary tuple of -values, with no reference to polynomials; the final inequality is (T3) together with .
Proposition 5.3 (The two families of test maps).
(a) (Power-residue tests.) Let be odd and let with . Then is a test map with , so , and fiber sizes 1 and copies of ; hence . The case is the quadratic-character test of Lemma 3.2.
(b) (Trace tests.) Let and let , . Then , that is , is a test map with , so , and all fibers of size ; hence . The case , is the absolute-trace test of Lemma 3.2.
Proof. (a) The map carries onto the group of -th roots of unity with all fibers of size , and sends 0 to 0; evaluation is multiplications by repeated squaring. (b) is a surjective -linear map, so its fibers are cosets of a hyperplane and have equal size ; evaluation is Frobenius applications and additions.
Remark 5.4 (Why no single test serves every ). Proposition 5.3 explains the obstruction announced in Remark 3.3. Trace tests have excellent balance, , but image of size , which is prohibitive when is large. Power-residue tests have small image, with available for every odd , but balance only . Coarsening a trace test to the two classes “Tr = 0” versus “Tr 0” repairs (T2) at the cost of destroying (T3): the large class then has density , so as . Characteristic two is the unique case in which a trace test satisfies both conditions at once, with and simultaneously. For odd one uses (a) with instead. The two characteristic cases of Section 3.1 are thus not an accident of the constructions but the two ways of resolving the tension between (T2) and (T3).
5.2 The commutative case
Setting. We now fix the algebraic setting, which is more general than anything used in Sections 2–3. An -algebra is an -vector space equipped with an -bilinear multiplication, so that is simultaneously a vector space and a ring with the two structures compatible. We take to be finite-dimensional, of dimension over , with a fixed basis , and (in this subsection) commutative. Bilinearity means that the multiplication is determined by the products of basis elements,
and the array of structure constants is how is presented to the algorithm. The product of two elements given in coordinates is recovered by bilinear extension at a cost of field operations for a generic, unstructured table. This is deliberately more agnostic than the polynomial case, where carries the extra structure that lets Proposition 3.7 multiply in only , and that gap accounts for the extra factor of between Corollary 3.13 and Theorem 5.8 below.
Let , , be the Frobenius endomorphism, an -algebra endomorphism since is a power of , and put . Recall that a two-sided ideal is nilpotent if for some . In a finite-dimensional algebra, the sum of two nilpotent ideals is again nilpotent, so there is a unique largest one, the radical . We call separable if , which over the perfect field is equivalent to as -algebras, being the number of primitive idempotents of . The general case reduces to this one classically and deterministically by passing to , the radical of a finite-dimensional algebra over a finite field being computable in deterministic polynomial time [31, Thm. 2.7] (see also [13, 9]). This is the exact analogue, at the level of an abstract algebra, of the reduction to the squarefree case in Section 2.1: for with , the image of in the local factor is a nonzero nilpotent element whenever , and collects exactly this repeated-factor part, so that is the squarefree quotient. We therefore assume separable throughout.
Lemma 5.5 (Abstract Berlekamp subalgebra). Let be separable, , and let be the -th projection. Then restricts to an isomorphism of -algebras
under which the constants correspond to the diagonal. In particular , and is a subring of containing .
Proof. The fixed field of the -power Frobenius inside is irrespective of , so the decomposition restricts to . It is a ring isomorphism because each is. The element has for every , which is the diagonal.
Lemma 5.5 is not new, and neither is the observation that it reduces the decomposition of a commutative semisimple algebra to factoring. The fixed-point subalgebra of the Frobenius map, in the abstract setting of a commutative semisimple algebra rather than of , is already used in [31, Sec. 3, Remark 2], where it is observed that the fixed points of form a direct sum of copies of the prime field, computable by linear algebra, and that this is essentially Berlekamp's reduction of factoring to root finding in . The decomposition itself is obtained in [13, 31] by the cutting procedure recalled in Remark 5.9 below. What is new here is that the procedure is exact, and that it reaches the primitive idempotents directly, without passing through a generating element and its minimal polynomial. The cost consequences of that difference are the subject of Remark 5.9.
Given a basis of , the matrix of is obtained by computing for by repeated squaring, at field operations in total, and as , by deterministic linear algebra. A block is now an idempotent-cut summand for an idempotent known to be a sum of primitive idempotents, with the number of primitive idempotents it contains, , and coordinate maps , , as above. A block is internal if .
Exact splitting. The splitting oracle of Definition 3.4 generalizes verbatim, with the test element for a test map in place of or , and with the multiplication of Proposition 3.7 replaced by multiplication via structure constants. The counting lemma generalizes with it.
Lemma 5.6 (Exact success probability, general form). Let be separable, let be a block with , let be an -basis of , and for put and for a test map with fiber sizes . Then , and
The quantity depends only on q, s and the fiber profile of F, and hence is known before any information about the primitive idempotents of A is available.
Proof. Since and is a subring of containing (Lemma 5.5), we have . This is the general form of the case analysis of Lemma 3.8, and it no longer requires separate arguments in the two characteristics.
By Lemma 5.5, the map , , is a composition of two -linear bijections, hence a bijection, so is uniform on when is. Since each is a ring homomorphism, , and since is injective on , the element lies in exactly when the values coincide, that is, when all coordinates of lie in a common fiber of . Lemma 5.2 applied to the uniform tuple gives the identity and the three inequalities.
Extraction. In the polynomial setting, a nonconstant test element w yields a nontrivial factor through , an operation that depends on the Euclidean structure of . For a general algebra no Euclidean algorithm is available, and we replace gcd extraction by Lagrange interpolation in the algebra itself. This is the point at which (T2) is paid for.
Lemma 5.7 (Idempotent extraction). Let be a block, a test map with image , and with for some and . For set
Then the are pairwise orthogonal idempotents with , and if and 0 otherwise. At least two of them are nonzero, so
is a nontrivial decomposition, computed with algebra multiplications and inversions in .
Proof. Since , every value lies in , and in fact in because with . Applying the ring homomorphism to the defining product gives
If every factor is 1; if with then the factor indexed by vanishes. Hence is the 0/1-indicator of , from which idempotence, orthogonality and follow coordinatewise, being injective on . Since , Lemma 5.5 gives that takes at least two distinct values on the coordinates of , so at least two indicator sets are nonempty and the decomposition is nontrivial.
Two remarks on the extraction. First, the decomposition produced is -fold rather than binary, so a single successful test may split a block into as many as parts at once. The number of splitting rounds needed to reach the primitive idempotents is therefore still at most . Second, only the candidate values in need be tried, which is precisely why (T2) was imposed: a test map with large image would make this step dominate.
The analogue of basis pushdown (Lemma 3.12) is immediate in this language. For an idempotent cutting out a sub-block , multiplication by carries onto , because under it is the coordinate-forgetting map , which is surjective; a basis of is recovered from the images of a basis of by Gaussian elimination, with no recomputation of .
Theorem 5.8 (Exact quantum splitting of separable commutative algebras). Let A be a separable commutative -algebra of dimension n, given by structure constants, with r primitive idempotents, and let F be a test map with image size m. In the class of Section 2.3, there is a quantum algorithm that outputs the complete set of primitive idempotents of A, equivalently the decomposition of A into simple components, with probability exactly one. It performs at most splitting rounds, each using a single application of the corresponding splitting oracle, for a total of
quantum -operations, together with classical field operations for idempotent extraction, basis maintenance, and the one-off computation of . All parameters supplied to exact amplitude amplification depend only on , the current block size, and the fiber profile of , and are therefore independent of the unknown idempotent decomposition.
Proof. Correctness is Lemma 5.6 together with Lemma 5.7. For a block with the probability that is nonconstant is exactly , known in advance, so Fact 2.2 applies and yields a nonconstant with certainty using applications of the oracle, indeed exactly one by Remark 3.6. Lemma 5.7 then converts it into a nontrivial idempotent decomposition. The reversible implementation is that of Section 3.4, with Proposition 3.7 replaced by multiplication via structure constants and the nonconstant test of Lemma 3.9 applied to coordinates , dim relative to a basis whose first vector is 1; condition (T1) guarantees that is computed in algebra multiplications.
For the count, each split refines the current partition of the primitive idempotents into at least two nonempty parts, so a tree whose leaves are the primitive idempotents has at most internal nodes. Multiplication of two elements of via structure constants costs field operations, so one test element costs and one round such. The stated totals follow, the classical term collecting multiplications per extraction, per basis pushdown, and for the initial Frobenius matrix.
For the structure-constant multiplication of Theorem 5.8 is replaced by polynomial multiplication modulo , at cost rather than (Proposition 3.7), and Lagrange extraction may be replaced by the cheaper . Substituting these recovers the bound of Corollary 3.13. The extra factor of in Theorem 5.8 is therefore the price of a generic presentation, not a loss in the mechanism.
Remark 5.9 (Comparison with the cutting procedure of [13, 31]). Theorem 5.8 solves a problem that is classically well studied, and it is worth being precise about what the direct construction buys, since the same theorem can be reached by a shorter route: the cutting procedure of Friedl and Rónyai is an f-algorithm in the sense of Section 2.3, so answering its factoring calls with the exact procedure of Section 3 already yields an exact algorithm. The difference is cost, and it lies in the extension fields that the cutting procedure builds.
That procedure walks a basis of , maintaining the invariant that is a field, of degree over . At step it computes the minimal polynomial of over , by forming and finding the first linear dependence, and then factors that polynomial over . Each factoring call is therefore a call over an extension of degree , and by the accounting convention of Section 2.3 it must be charged as such: a call handled by Theorem 3.14 costs operations in , each of which is operations in , so -operations, up to in the worst case. With up to steps this gives overall, against the of Theorem 5.8. Neither bound is optimized, and we do not claim the exponents are tight. The structural point survives optimization: the direct construction never builds a generating element, never leaves , and performs one splitting round per node of the decomposition tree rather than one factoring call per basis vector.
A second, smaller point concerns small characteristic. The variant of [31, Sec. 3, Remark 2] works over the prime field throughout and splits by sweeping an -basis of the fixed-point algebra, of size while our procedure uses one amplification round in its place. The two are in the same asymptotic class, and the gain is practical rather than asymptotic, but it is the concrete form of the uniformity claim made in Section 4.1: one mechanism covers every finite field.
5.3 The noncommutative case
Commutativity was used in Section 5.2 in an essential way: Lemma 5.5 decomposes A into fields, and both the counting argument and Lagrange extraction take place inside the commutative ring . It is therefore worth emphasizing that removing the hypothesis costs only a linear system, and no randomness at all. The reason is the classical structure theory of [13, 31], in which the decomposition of an associative algebra into simple components is reduced to the same problem for its centre.
Throughout this subsection A is a finite-dimensional associative -algebra of dimension , not assumed commutative, given by structure constants. We use three classical facts.
Fact 5.10 (Radical; [31], Thm. 2.7). A basis of is computable deterministically in time polynomial in n and , with no use of a factoring oracle and no randomization. See also [13, 9].
The mechanism is a trace characterization valid in positive characteristic, replacing Dickson's criterion , which fails when divides . One builds a descending chain with for all , and , each cut out by linear equations, so that rounds of Gaussian elimination suffice. This is the analogue for algebras of the squarefree reduction of Section 2.1, and it is already deterministic and needs no quantum treatment.
Fact 5.11 (Centre; [31], Sec. 3). Let be semisimple, its decomposition into minimal two-sided ideals, with . Then the centre is cut out by a linear system in the structure constants, is a separable commutative -algebra with , and satisfies . In particular the primitive idempotents of are the central primitive idempotents of , and .
The two facts compose with Theorem 5.8 to give the main result of this subsection.
Theorem 5.12 (Exact quantum Wedderburn decomposition). Let A be a finite-dimensional associative -algebra of dimension n, given by structure constants. In the class of Section 2.3 there is an algorithm that outputs, with probability exactly one, a basis of together with the decomposition of into its minimal two-sided ideals, using quantum -operations and polynomially many classical field operations. Every parameter supplied to exact amplitude amplification depends only on q and the current block size, and is therefore independent of the decomposition being computed.
Proof. Compute and pass to the semisimple quotient , of dimension , by Fact 5.10; this step is classical and deterministic. Compute by solving the linear system of Fact 5.11, and its structure constants with respect to a basis of ; this step is again classical and deterministic. By Fact 5.11, is a separable commutative -algebra of dimension , so Theorem 5.8 applies to it and returns its primitive idempotents with probability exactly one, at a cost of quantum -operations. Finally , each obtained by multiplications in .
For exactness of the composition, observe that the two classical steps are deterministic and that the quantum step succeeds with probability exactly one, so the output is correct with probability exactly one. Moreover, the classical steps are correct for any valid output of the quantum step, which matters because the splitting element it produces is not unique. Uniformity is inherited for the same reason: the enclosing computation is a deterministic polynomial-time procedure, so the composed circuit family is still constructible by a deterministic Turing machine in time polynomial in its size, and every rotation angle is still a function of q and a block size. The claim is therefore in EQP .
Zero divisors and explicit isomorphisms. Two further problems treated in [31] lie beyond the decomposition into simple components, and it is worth separating them from Theorem 5.12, since they are genuinely deeper. Given a simple component with , one may ask for a pair of zero divisors in , and, more, for an explicit isomorphism . Neither reduces to a commutative problem: the procedure of [31, Sec. 4] uses the constructive form of Wedderburn's theorem on finite division algebras, the Noether–Skolem theorem to produce an element with , and the solution of a norm equation norm( in a maximal subfield, from which is exhibited as a zero divisor. The explicit isomorphism is then obtained from a rank-one idempotent [31, Sec. 5.1].
What matters here is that these procedures are f-algorithms in the sense of Section 2.3: they are deterministic apart from calls to a factoring oracle. Answering those calls by Theorem 3.14 therefore makes them exact, by the same composition argument as in the proof of Theorem 5.12. We state this, but deliberately without a complexity bound, because a bound requires an accounting that [31] does not carry out and that we do not attempt here.
Corollary 5.13 (Exact zero divisors and explicit isomorphisms). Finding a pair of zero divisors in a finite-dimensional associative -algebra given by structure constants, and constructing an explicit isomorphism between a simple component and a full matrix algebra over a finite field, are in .
Three items make up the accounting that a quantitative version of Corollary 5.13 would require, and we record them so that the gap is explicit. First, the number of oracle calls: the loop of [31, Sec. 4] is executed at most dim A times, and each pass factors a minimal polynomial of degree at most dim A. Second, the fields over which those calls are made: as in Remark 5.9, a call over is not a call over , and the extension degrees arising must be tracked. Third, the auxiliary steps: solving the norm equation passes through at most quadratic equations in a maximal subfield, and these are factorizations of polynomials of the form , hence oracle calls in their own right rather than free operations. We also note that [31, Lemma 4.5] is proved for odd or , the even case being routed through a descent to a degree-two subfield in Step 5 of the procedure; any quantitative statement must respect that structure.
Remark 5.14 (Optimality of the primitive). The reduction runs in both directions. Rónyai shows that finding zero divisors in a finite algebra is in the same complexity class as factoring polynomials over finite fields, not merely reducible to it [31]. The easy direction is that a zero divisor in exhibits a proper factor of . Consequently no exact quantum algorithm for any of the structure problems of this subsection can be substantially easier than an exact quantum algorithm for polynomial factorization, and the splitting primitive of Section 3 is the right object to have made exact.
6 Conclusion
The contribution of this paper is a principle rather than a single algorithm. If a test applied to a random element of a decomposable commutative -algebra has a success probability that is known exactly in advance, and, crucially, known independently of the hidden decomposition being sought, then exact amplitude amplification converts the randomized test into a procedure that succeeds with certainty. The hypothesis is supplied by a counting argument (Lemma 3.1): when the coordinate map is a bijection, the probability that a test element fails to separate any two coordinates is determined by the fiber sizes of the test map and the block size alone. Definition 5.1 isolates the class of tests for which this is both exact and cheap.
Berlekamp's algorithm is the natural realization, and the one we develop in detail. A squarefree of degree with irreducible factors is factored with probability exactly one (Theorem 3.14) using exactly splitting calls, each performing a single amplification iteration, at a quantum cost of -operations beyond the one-off classical Berlekamp basis computation, with no primitive root, quadratic non-residue, or distinct-degree preprocessing at any point. Two qualifications should be carried along with that statement. The exactness is that of , model (iii) of Section 2.3, following [20, 21]. And the substantive gain over what is classically known is confined to large odd characteristic, where the classical splitting step is randomized and its only known derandomizations are conditional on ERH: the result is an exact quantum derandomization of that step, not an asymptotic speedup over classical factorization.
Beyond polynomials, the mechanism reaches the full structure theory of finite algebras over . Theorem 5.8 splits a separable commutative algebra given by structure constants into its primitive idempotents, Lagrange interpolation replacing the Euclidean gcd (Lemma 5.7), and Theorem 5.12 removes commutativity at the cost of one linear system, since the simple components of a semisimple algebra are recovered from the primitive idempotents of its centre. What this contributes is not a new decidability or complexity result, the problems are classically well studied and lie in randomized polynomial time, but exactness, reached without the randomized reduction through a generating element and without the extension towers that reduction builds (Remark 5.9). That the same holds for zero divisors and explicit isomorphisms (Corollary 5.13) is a consequence of Rónyai's reductions being deterministic: the only probabilistic ingredient anywhere in the classical pipeline is the factoring oracle. Since finding zero divisors is, conversely, no easier than factoring [31], the splitting step is the right primitive to have made exact.
References
[1] Leonard M. Adleman, Jonathan DeMarrais, and Ming-Deh A. Huang. Quantum computability. SIAM Journal on Computing, 26(5):1524–1540, 1997.
[2] Debajyoti Bera. Two-sided quantum amplitude amplification and exact-error algorithms, 2016. arXiv:1605.01828.
[3] Elwyn R. Berlekamp. Factoring polynomials over finite fields. Bell System Technical Journal, 46(8):1853–1859, 1967.
[4] Elwyn R. Berlekamp. Factoring polynomials over large finite fields. Mathematics of Computation, 24(111):713–735, 1970.
[5] Gilles Brassard and Peter Høyer. An exact quantum polynomial-time algorithm for Simon’s problem. In Proceedings of the 5th Israeli Symposium on Theory of Computing and Systems (ISTCS), pages 12–23, 1997.
[6] Gilles Brassard, Peter Høyer, Michele Mosca, and Alain Tapp. Quantum amplitude amplification and estimation. In Quantum Computation and Information, volume 305 of Contemporary Mathematics, pages 53–74. American Mathematical Society, 2002. arXiv:quant-ph/0005055.
[7] David G. Cantor and Hans Zassenhaus. A new algorithm for factoring polynomials over finite fields. Mathematics of Computation, 36(154):587–592, 1981.
[8] Andrew M. Childs and Wim van Dam. Quantum algorithms for algebraic problems. Reviews of Modern Physics, 82(1):1–52, 2010.
[9] Arjeh M. Cohen, Gábor Ivanyos, and David B. Wales. Finding the radical of an algebra of linear transformations. Journal of Pure and Applied Algebra, 117/118:177–193, 1997.
[10] Javad Doliskani. Toward an optimal quantum algorithm for polynomial factorization over finite fields, 2018. arXiv:1807.09675.
[11] Thomas G. Draper. Quantum computers can find quadratic nonresidues in deterministic polynomial time, 2021. arXiv:2106.03991.
[12] Sergei Evdokimov. Factorization of polynomials over finite fields in subexponential time under GRH. In Algorithmic Number Theory (ANTS-I), volume 877 of Lecture Notes in Computer Science, pages 209–219. Springer, 1994.
[13] Katalin Friedl and Lajos Rónyai. Polynomial time solutions of some problems in computational algebra. In Proceedings of the 17th Annual ACM Symposium on Theory of Computing (STOC), pages 153–162, 1985.
[14] Shuhong Gao. On the deterministic complexity of factoring polynomials. Journal of Symbolic Computation, 31(1–2):19–36, 2001.
[15] L.K. Grover. Quantum mechanics helps in searching for a needle in a haystack. Phys. Rev. Lett., 79(2):325–328, 1997.
[16] Zeyu Guo. Factoring polynomials over finite fields with linear Galois groups: an additive combinatorics approach. In 45th International Symposium on Mathematical Foundations of Computer Science (MFCS), LIPIcs, pages 42:1–42:15, 2020.
[17] Zeyu Guo, Anand Kumar Narayanan, and Chris Umans. Algebraic problems equivalent to beating exponent 3/2 for polynomial factorization over finite fields. In 41st International Symposium on Mathematical Foundations of Computer Science (MFCS), volume 58 of LIPIcs, pages 47:1–47:14, 2016.
[18] Ming-Deh A. Huang. Generalized Riemann hypothesis and factoring polynomials over finite fields. Journal of Algorithms, 12(3):464–481, 1991.
[19] Muhammad Imran. An exact quantum order finding algorithm and its applications. arXiv preprint arXiv:2205.04240, 2022.
[20] Muhammad Imran and Gábor Ivanyos. An exact quantum hidden subgroup algorithm and applications to solvable groups. Quantum Information and Computation, 22(9&10):770–789, 2022. arXiv:2202.04047.
[21] Muhammad Imran and Gábor Ivanyos. Zero sum subsequences and hidden subgroups. Quantum Information Processing, 23:14, 2024.
[22] Gábor Ivanyos, Marek Karpinski, Lajos Rónyai, and Nitin Saxena. Trading GRH for algebra: algorithms for factoring polynomials and related structures. Mathematics of Computation, 81(277):493–531, 2012.
[23] Gábor Ivanyos, Marek Karpinski, and Nitin Saxena. Schemes for deterministic polynomial factoring. In Proceedings of the International Symposium on Symbolic and Algebraic Computation (ISSAC), pages 191–198, 2009.
[24] Stephen P. Jordan. Quantum Algorithm Zoo. https://quantumalgorithmzoo.org/. Accessed 2026; polynomial factorization over finite fields has no entry.
[25] Kiran S. Kedlaya. Quantum computation of zeta functions of curves. Computational Complexity, 15(1):1–19, 2006.
[26] Rudolf Lidl and Harald Niederreiter. Finite Fields, volume 20 of Encyclopedia of Mathematics and its Applications. Cambridge University Press, 2 edition, 1997.
[27] Michele Mosca and Christof Zalka. Exact quantum Fourier transforms and discrete logarithm algorithms. International Journal of Quantum Information, 2(1):91–100, 2003.
[28] Anand Kumar Narayanan. Factoring polynomials over finite fields using Drinfeld modules with complex multiplication, 2016. arXiv:1606.00898.
[29] Harumichi Nishimura and Masanao Ozawa. Uniformity of quantum circuit families for error-free algorithms. Theoretical computer science, 332(1-3):487–496, 2005.
[30] Lajos Rónyai. Factoring polynomials over finite fields. Journal of Algorithms, 9(3):391–400, 1988.
[31] Lajos Rónyai. Computing the structure of finite algebras. Journal of Symbolic Computation, 9(3):355–373, 1990.
[32] Alexander Russell and Igor E. Shparlinski. Classical and quantum function reconstruction via character evaluation. Journal of Complexity, 20(2–3):404–422, 2004.
[33] Victor Shoup. On the deterministic complexity of factoring polynomials over finite fields. Information Processing Letters, 33:261–267, 1990.
[34] Wim van Dam, Sean Hallgren, and Lawrence Ip. Quantum algorithms for some hidden shift problems. SIAM Journal on Computing, 36(3):763–778, 2006.
[35] Wim van Dam and Gadiel Seroussi. Efficient quantum algorithms for estimating Gauss sums, 2002. arXiv:quant-ph/0207131.
[36] Vlatko Vedral, Adriano Barenco, and Artur Ekert. Quantum networks for elementary arithmetic operations, 1996. Cited as the standard reference for reversible modular arithmetic; not independently re-verified in this work.
[37] Joachim von zur Gathen and Jürgen Gerhard. Modern Computer Algebra. Cambridge University Press, 3 edition, 2013.
[38] Joachim von zur Gathen and Victor Shoup. Computing Frobenius maps and factoring polynomials. Computational Complexity, 2(3):187–224, 1992.