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.
Put and prepare control qubits in and the target in the supplied eigenstate . Apply a Hadamard gate to every control qubit. Let denote the integer encoded in that quantum register.
For every , apply a controlled unitary gate with control and the same target. The quantum phase kickback yields
Applying to the controls therefore produces exactly. A computational-basis measurement returns with certainty, and the algorithm outputs
This is exact quantum phase estimation; exactness uses the finite dyadic phase promise, not a rounding argument.
Only a controlled-U gate is supplied as a primitive. Its repetitions implement controlled-, so the total number of black-box uses is . Access to powers as unit-cost primitives would be a different quantum query complexity model. This distinction is the cost of exact phase estimation on a dyadic spectrum.
This is the Deutsch-Jozsa test with an arbitrary uniform-state unitary, and does not require to be a power of two. Choose a known unitary operator such that . Prepare the target qubit in . One Boolean-oracle call gives quantum phase kickback:
Apply to the index register. The amplitude on is
It equals or for the two constant strings, and equals zero for a balanced string. Consequently a single query decides the promised problem exactly: measure the index register and report constant for outcome zero, balanced for any other outcome. This is the Deutsch-Jozsa algorithm with the available exact state-preparation operation.
Maintain a known list of the still-active indices, initially all positions. On a list of even size , perform the three-step construction with replacing . A known reversible relabeling prepares and queries the corresponding original indices, so quantum phase kickback still needs only one call to . The full unitary extension for that current size is independent of the remaining unknown values. It is allowed even when is not a power of two.
If the measurement gives , its amplitude is the imbalance divided by . A balanced active string has zero such amplitude, so an observed zero pair certifies that the active string is unbalanced. Return unbalanced immediately. No probability-of-error estimate is needed: an impossible outcome never occurs in the balanced case.
Otherwise the measured pair corresponds to two opposite bits. Delete those two indices and repeat. Each deletion removes exactly one zero and one one, preserving the difference between their counts. Thus the active string is balanced if and only if the original one is balanced. If all indices are removed, return balanced. This is opposite-pair elimination for exact quantum balance testing; it never requires determining which member of a deleted pair is zero.
Each query either terminates with a valid imbalance certificate or reduces the active length by two. After at most opposite-pair outcomes the active list is empty. The result is certain on every input, with worst-case query count
The same argument includes the last step: equal bits give with certainty, while opposite bits give the sole nonzero pair with certainty. There is no additional final query. The measurement probabilities are normalized because .
Prepare an additional qubit in by applying and then the Hadamard gate to . Apply to the data register. The Boolean quantum oracle then produces quantum phase kickback:
A final Walsh-Hadamard transform gives an amplitude for equal to
To see this identity, the sum factors over the bits; any position at which and differ contributes . This is Bernstein-Vazirani phase kickback, and its output is
There is exactly one oracle query, fixed quantum gates, and no probabilistic intermediate step. The ancilla qubit can be left in or reset to using its known inverse preparation. The construction includes the case .
Let and use an -qubit phase register. Begin with and apply to the phase register, creating . Controlled powers implement
For phase qubit , counted from the most significant bit, the controlled power is . It can be built from calls to the supplied controlled- gate. By quantum phase kickback, the phase-register state is
Apply the inverse quantum Fourier transform to obtain the exact quantum phase estimation mapping
A computational basis measurement of the first register determines with certainty, hence and the eigenvalue . Exactness follows from the promised dyadic phase; no approximation or continued-fraction reconstruction is needed.
With only controlled- available as a query, the repeated-power construction uses oracle calls. The other Fourier-transform circuitry has polynomial size in in the ideal phase-gate model. The cost of exact phase estimation on a dyadic spectrum is therefore not polynomial in in this primitive-query model unless powered queries have additional implementations. The task does not require such a polynomial bound.
Prepare an ancillary qubit in
It can be prepared from by an operation followed by a Hadamard gate, independently of . One call to the Boolean quantum oracle then gives quantum phase kickback:
The data state receives a minus sign precisely on the basis vectors spanning , while the ancilla remains unchanged and unentangled. One oracle call realizes the reflection. By linearity it is the marked-state phase oracle
with one oracle call. The ancillary preparation and its optional inverse use only fixed operations, so no additional knowledge of is needed.
Use exact quantum phase estimation with control qubits initially and one target quantum register prepared in the given eigenvector . Apply Hadamard gates to the control qubits. If control bit has significance , apply a controlled unitary gate from that qubit to the target. The target stays in , while quantum phase kickback produces
Since , this is . The inverse quantum Fourier transform on the control quantum register therefore gives . The quantum measurement in the computational basis returns with certainty, so
The quantum circuit below reads left to right. The upper wires are control qubits, with least significant; the vertical ellipsis represents the intervening control wires and powers. The inverse quantum Fourier transform acts on the entire control quantum register, including any bit-order permutations.
Figure 1.
Quantum phase estimation and spectral filtering
.
A supplied controlled- can implement controlled- by repetitions with the same control. Hence this exact quantum circuit uses calls to the supplied controlled-, unless controlled powers are additionally available cheaply. The cost of exact phase estimation on a dyadic spectrum is not automatically polynomial in ; the question asks for an exact algorithm, not that stronger complexity guarantee. Exactness also uses the promised dyadic eigenphase, ideal gates, and the supplied inverse quantum Fourier transform.
Apply a Pauli X gate and then a Hadamard gate to the third qubit, and apply Hadamard gates to the first two. This prepares
One application of the Boolean quantum oracle now gives, by quantum phase kickback,
The answer qubit is unentangled and may be ignored. If all three qubits must be restored to the displayed register form, applying and then to the answer qubit maps back to . Thus the first register is exactly after one use of .
When ,
One Grover search algorithm iteration therefore gives
The selective sign change is implemented with one application of the Boolean quantum oracle: prepare its answer qubit in and use quantum phase kickback, obtaining on each . The remaining operations , , and the final computational-basis measurement are independent of . Measurement of returns some with probability one, so exactly one query to suffices.
One classical query at any chosen returns only . Every possible slope is compatible with that answer by choosing , so no one-query classical algorithm can determine with certainty.
For the quantum algorithm, let and prepare
Part (b) shows that the single query applies quantum phase kickback:
The unknown intercept contributes only a global phase. Applying to the first register produces , whose computational-basis measurement determines with certainty after one query.
Use the available unitaries to prepare
in the first register and
in the answer qubit. The quantum phase kickback identity gives
Choose a unitary with , apply to the first register, and measure it. Its amplitude at is
This equals or for a constant string and zero for a balanced string. Thus outcome means constant, while every other outcome means balanced, with certainty after one oracle query. This is the Deutsch-Jozsa test with an arbitrary uniform-state unitary.
The known circuit from part (b) lets us apply without querying the faulty oracle. Their composition satisfies
Because , only the last answer qubit is flipped in the exceptional case.
Prepare the answer register as
Since , quantum phase kickback gives, for an arbitrary search-register state,
The answer register is unchanged and factors out. The induced operation on the first register is therefore
This is the marked-state phase oracle from a single faulty identity-oracle query.