Let . The modular-addition quantum oracle obeys
The three steps replace by , then , then . Thus a query to the inverse costs one forward query and two known unitary operators. The negation operator is a permutation matrix with .
Let . The positive-exponent quantum Fourier transform gives . Reindexing the cyclic shift operator gives
Thus is an eigenstate with eigenvalue , with this sign fixed by the printed quantum Fourier transform convention.
Prepare the first two qutrits in and the answer qutrit in . The modular-addition quantum oracle applies to the answer. Its eigenvalue produces quantum phase kickback, leaving
Apply to each input qutrit, then measure them in the computational basis. The result is
The preparation, inverse transforms and measurements are independent of , and there is exactly one use of . This is qutrit linear-function identification, the ternary version of Bernstein-Vazirani phase kickback.
Use the positive-sign quantum Fourier transform
Orthogonality of the finite-group characters makes a unitary operator. Here is the least positive period. The injectivity within one period implies : write , . Periodicity gives , and injectivity forces . Put .
Start with two available computational basis states . Apply to the first register and query the modular-addition quantum oracle:
Measure the second register. For some , the first register becomes the normalized coset state
The quantum Fourier transform of a periodic coset state is
Indeed, the inner geometric sum vanishes unless the Fourier label is a multiple of . Measuring that label gives for a uniformly random . Compute, by the Euclidean algorithm,
Thus exact period recovery from a Fourier sample succeeds whenever is coprime to , and
Here is the Euler totient function. The classical number-theory input is the totient lower bound from the Mertens product: for sufficiently large , for an absolute , with the finitely many small cases handled separately. For recovery is certain; for its probability is . The useful asymptotic probability statement is a lower bound, hence notation; it can be much larger for particular periods, for example a prime period.
There is one oracle query, two Fourier transforms and two measurements. The final greatest common divisor and division use polynomial time in . This meets the specified primitive-operation model without assuming that an arbitrary- Fourier gate is free in another gate model. If a constant success probability is wanted, repeat independently times and return the least common multiple of the candidates: each candidate divides , and one successful sample makes that least common multiple exactly .
Follow the printed examples by counting positive squares, so zero is not marked. For , the marked output set is
A one-to-one map from the finite set to itself is a permutation, so exactly inputs have outputs in . In the uniform quantum superposition , the initial good probability is therefore . For permutation-preimage quantum search, this known marked density under a permutation is .
Define the efficiently computable predicate to be one if and only if is a positive square. The assumed Boolean quantum oracle for , acting on and a ancilla, implements its diagonal sign operation . Compute the modular-addition quantum oracle into a zero output register, apply this sign operation, and uncompute:
This implements for , with the work registers clean. Only forward calls to were promised, but its inverse costs one such call: if on the second register, then
Indeed the output addition is changed into subtraction. Thus each marked reflection costs exactly two queries to ; all other operations used here are independent of the unknown .
Use the amplitude amplification theorem with , whose reflection is allowed by the assumptions. With , choose nearest to . Here for every , so a trial succeeds with probability at least . Also
Measure and use one additional query to evaluate and check . On failure, restart with fresh registers. Four independent trials have failure probability at most , so the required confidence and query bound are
This is an upper bound on quantum query complexity, not a claim that arbitrary reflections or every classical gate have constant cost. Including zero as a square would change to without changing the asymptotic bound. With the printed positive-square interpretation, has no valid output and no algorithm can satisfy the success requirement; the intended asymptotic task necessarily has .
Applying the two modular-addition quantum oracles consecutively adds to the answer register. Thus
Let . Applying , then , then gives
Therefore
using one query and two unitary operators independent of . This is modular-oracle inversion by negation.
To find an input of a permutation whose output lies in a known -element subset, compute the output, apply its marked-state phase oracle, and use uncomputation. A modular-addition quantum oracle costs two forward queries per marked reflection, because modular-oracle inversion by negation supplies its inverse. Amplitude amplification then uses queries for fixed success probability. Positive-square outputs have and hence query cost .
Quantum oracle 2026-10-25
A quantum oracle supplies coherent access to a function through a specified unitary operator. For a function with binary string output, the standard construction retains the input and adds the output into an answer quantum register by bitwise exclusive or. This operation is its own inverse, even when the function is not injective. A Boolean quantum oracle is the single-output-bit case; Simon's algorithm uses several answer qubits. Other encodings, such as a modular-addition quantum oracle or a phase gate encoding, require their own explicit query conventions.
A modular-addition quantum oracle for a linear function over the three-element finite field reveals its two coefficients in one query. Prepare the answer qutrit in , whose unit shift eigenvalue is . Quantum phase kickback produces a product of Fourier states labelled by the coefficients; inverse quantum Fourier transforms read both coefficients exactly.