1. Introduction
Recursive Fourier Sampling (RFS) [
1,
2], originally introduced by Bernstein and Vazirani in 1993, was one of the earliest computational problems for which there existed a quantum algorithm apparently demonstrating an advantage over any classical algorithm. It is not known which complexity class RFS belongs to, but in the oracle paradigm it has been shown to lie outside Merlin–Arthur (
MA) [
3], which contains the Non-Deterministic Polynomial Time (
NP) complexity class. Some further conjectures on which complexity class RFS may belong to are made in Ref. [
4]. In spite of this, RFS has received scant attention, possibly in part owing to the implicit way in which it is formulated.
In this work, we provide a small generalization of RFS using updated notation, connect our generalization and previous formulations, and prove that uncomputation is necessary in a quantum solution to each RFS subproblem; this was already implied by existing complexity bounds. Our formulation does more since it enables a direct comparison with classical reversible computing where (computational coordinate) garbage is uncomputed to enable reversibility. In RFS, the uncomputation of phase coordinate garbage enables the quantum advantage. The mechanism of phase kickback [
5,
6,
7] is an important quantum computational property that enables the quantum solution of RFS, in line with previous results [
7] on, for instance, the Bernstein–Vazirani algorithm (which is equal to RFS for recursion depth 1). Here, we extend this picture to a full phase space description.
This is done by reformulating the oracles employed by RFS into the terminology of
conjugate pair oracles that we define in this work; a conjugate pair oracle outputs a
conjugate pair of two phase space coordinates, one in the computational basis and one in the phase basis. Describing and thereby understanding quantum computation in terms of phase space coordinates [
8] has previously yielded a number of interesting results, such as the stabilizer formalism [
9,
10], several simple toy models, which nonetheless demonstrate a surprising number of quantum behaviors [
7,
11], and above all, quantum error-correcting codes [
12,
13,
14]. This means of description thus allows for a rich representation while remaining accessible, in the sense that we may more easily understand what is happening during our computations. As RFS lies outside
MA, our results lend credence to the conjecture [
7] that oracle-paradigm bounds for the quantum advantage may be imposed by limited communication capacity rather than limited computational capacity: Any advantage seems to stem from the quantum oracle outputting (communicating) additional data compared to a classical oracle.
Below, we assume familiarity with basic linear algebra and quantum computation; for a comprehensive introduction, see [
6]. We denote by
a bitstring of some fixed length
, and use “·” to denote the dot product modulo 2. The rest of this work is organized as follows. In
Section 2, we describe Fourier Sampling, how to perform it using classical and quantum machines and how it can be used to solve a certain decision problem; we also explain the quantum algorithm’s use of phase kickback. Here, we make use of standard notation. Next, in
Section 3, we describe Recursive Fourier Sampling, and how to perform it using classical and quantum machines. The presentation is more streamlined than in earlier works: A comparison to earlier presentations can be found in
Appendix A. Then, in
Section 4, we go on to describe the contributions of the present work by introducing the notion of conjugate pair oracles, use this notion to show that uncomputing phase coordinate garbage is the enabling mechanism behind the quantum solution of RFS, and provide a proof of why uncomputation cannot be avoided. We conclude by summarizing our main findings, briefly discuss the complexity of RFS, and point out some future avenues of research.
2. Fourier Sampling and Phase Kickback
Given a function
encoded into the coefficients of the quantum state
, the Quantum Fourier Transform (QFT) gives
A computational basis measurement outcome
X will then be a sample from the distribution
, known as Fourier Sampling, from the power spectrum of the function
. Samples essentially give the inverse image of the power spectrum, e.g., frequencies absent from
will occur with probability 0.
The bit-wise Quantum Fourier Transform mod 2 (the Hadamard transform) was used by Bernstein and Vazirani in 1993 [
1] to solve the following problem: given an oracle for the Boolean function
f promised to be linear, i.e.,
determine the unknown bitstring
s. The linear choice of
f is part of the original problem description. There is a version utilizing a non-linear (quadratic)
f [
15] but there exists no recursive variant of this problem.
A classical algorithm would need to call the corresponding classical reversible oracle
a total of
n times (see Algorithm 1), since it can extract at most one bit of information from each call, available in the target bit
y. Querying
f with the argument
where
is the bitstring with only the
jth bit set, the function output is
, the
jth bit of the bitstring
s.
Algorithm 1 Classical Fourier Sampling |
|
The promise (
2) tells us that if the initial bias
, the output target
y will have the value
s, since
.
An appropriate function for Fourier Sampling is
because the Hadamard transform of
is
, the Kronecker delta function, which equals 1 if
and 0 otherwise. If one can generate a quantum state containing
in its coefficients, Fourier Sampling will give
s (with probability 1). Quantum algorithms provide a way to accomplish this through a procedure known as phase kickback [
5,
7].
Phase kickback uses a quantum function oracle
that preserves phase information,
and elements of the phase basis in control and target registers, to move the function output from the target computational basis state in the right-hand side above, to the phase of the coefficients in the controlling register. Applying
to the phase basis elements gives
For Quantum Fourier Sampling, we use the Hadamard transform and bitwise addition modulo 2, and the Fourier variables are bitstrings
of length
n and bits
. Then, the Fourier Sampling promise of Equation (
2) gives
Bernstein and Vazirani [
1] write this as an algorithm that solves the Fourier Sampling problem in one call to the quantum oracle, see Algorithm 2.
Algorithm 2 Quantum Fourier Sampling |
- 1:
create ancilla qubit - 2:
apply to - 3:
apply to - 4:
apply to - 5:
discard ancilla
|
The promise (
6) tells us that if the initial bias
, measurement of the output
will give the outcome
s (with probability 1), and also that the ancilla is fixed to a known value in step 5 so can be safely discarded.
The problem as stated so far is a sampling problem: sample from a specific probability distribution (output
s with probability 1). In what follows, it will be useful to re-state the problem as a decision problem, that determines if a given bitstring
belongs to the language
. In the decision problem version of Fourier Sampling, we are given a Boolean function of two arguments, promised to obey
and another Boolean function
that gives the answer to the problem upon input of
(this latter function can be referred to as
). Given oracle access to
and
, we need to use classical or Quantum Fourier Sampling on the last argument of
to obtain
so that we can use
to determine if
belongs to
or not, to solve the decision problem.
Note that if
is linear in the second argument and independent of the first, then there exists an
so that
, and
. Such a decision problem can be solved in a single call to
; thus problems with a linear
(sometimes known as a parity function) are less interesting to study [
1].
3. Recursive Fourier Sampling
There are, to the best of our knowledge, three formulations of RFS. The original was introduced by Bernstein and Vazirani in 1993 [
1], further expanded on by the same authors in 1997 [
2], and presented in a slightly different manner by Vazirani in 2002 [
3]. In 2003, Aaronson [
16] re-formulated RFS somewhat, in part by removing the bitstring size limitations. Finally, in 2008 Johnson [
4] essentially combined elements of the two versions in another formulation. We shall make use of the definitions of Ref. [
3], but remove the bitstring size limitations in keeping with [
16], and add subscripts to function sequences for indexing the recursion level. A comparison of the notation for the different versions can be found in
Appendix A.
RFS is a decision problem: it uses a so-called Fourier Sampling tree
to decide whether a bitstring
belongs to a language
or not. A Fourier Sampling tree is a Boolean function sequence such that for
We say that the sequence
is
derived from the sequence
for
(and
specifies the Fourier Sampling tree
) if
Now, given oracles for
,
, and
, the challenge is to determine
, which in turn, tells us if
is in the language
or not. Note that oracle access to
, though not explicitly stated in [
3], is necessary to perform Quantum Fourier Sampling as described there.
A classical algorithm would need to solve this recursively, at each step using the corresponding classical reversible oracle
a total of
times, since it can only extract (at most) one bit of information from each call, available in the target bit
y. We here rewrite the explicit classical algorithm by McKague [
17] in our notation, see Algorithm 3.
Algorithm 3 Classical Recursive Fourier Sampling |
|
From the promise (
2), it follows that oracle access to
gives us
, so that
after the recursion for-loop. It then follows from the promise (
9) that oracle access to
with this value of
gives oracle access to
. That this holds for all
k follows by induction, in particular, we obtain oracle access to
so that we can calculate
[
17].
This algorithm needs
calls to
and
calls to
,
, so the algorithm has the complexity
, which in the case of equal lengths
is
[
16]; the corresponding lower bound is then
[
4], meaning we have a strict bound
. Calculating an exact bound for a problem given string lengths
is easily done via the formula above.
A quantum oracle would, also here, be assumed to preserve phase information
Let
denote the unitary that applies Hadamards on the qubits of
. Then, the Fourier Sampling promise of Equation (
8), with parameters
, gives
The assumption (
11) implies phase is preserved for a superposition of such input states. A quantum algorithm can now use such a quantum oracle and a different recursion [
17], see
Figure 1 and Algorithm 4.
Algorithm 4 Quantum Recursive Fourier Sampling |
Level:
Quantum oracles: and Controls: qubit strings , Bias/Target: single qubit
- 1:
create ancilla qubit string and qubit - 2:
apply to - 3:
apply to - 4:
apply to - 5:
apply to - 6:
apply to - 7:
apply to - 8:
apply to - 9:
discard ancillas
|
With the ancillas
, it follows from Equation (
12) that
after step 4. It then follows from the promise (
9) that oracle access to
through
with this state
gives oracle access to
, creating
. Then steps 6–8 reset
so that it can be safely discarded, usually motivated by the need to enable interference [
2,
16]; the actual underlying reason is to ensure that phase preservation of
gives phase preservation of
, we will return to this point below. That we have oracle access to
for all
k follows by induction, in particular, we obtain oracle access to
so that we can calculate
[
17]. c This algorithm needs
calls to
, so the algorithm has the complexity
, and the corresponding lower bound is
[
4,
16], meaning we have a strict bound
.
4. Conjugate Pair Oracles and Phase Coordinate Uncomputation
We are now almost in a position to define and use conjugate pair oracles. This will yield an alternative description of RFS, in turn, enabling a proof that uncomputation is necessary in RFS, which (together with the conjugate pair formalism) is the main contribution of this work. As a conjugate pair oracle acts on a conjugate pair, we begin by defining the latter, as a representation based on phase space coordinates [
8] and this idea allows for our results.
The Hadamard arrangement of the presented quantum algorithms is usually only seen as a convenient way to move
f from the target register into the phase of the coefficients of the control register, to enable Fourier Sampling from that register [
1]. The
bias input is converted into a negative phase
, which then enables the “phase kickback” of the function output into the phase of the control system, to enable the
output if
. However, this can be viewed in a different manner. The Fourier coordinate is a canonically conjugate phase space coordinate, often referred to as “the phase basis”.
In textbooks on quantum mechanics, one typically first encounters the canonically conjugate pair of position x and momentum p. The brackets are here meant to indicate “the canonically conjugate pair” of physical quantities, not the commutator between two Hermitian operators as is commonplace in quantum mechanics. In quantum computing, the appropriate conjugate pair is computational basis and phase basis, the pair of computational basis bitstring x and phase bitstring , of equal length. It is this which we take as our definition of a conjugate pair, two bitstrings of equal length; this is then the length of the conjugate pair.
In quantum mechanics, if the state of the studied system is an element of the computational basis, then
x is well-defined but
is not; if the state is an element of the phase basis, then
is well-defined but
x is not. This is a consequence of the uncertainty relation [
7]. Even partial knowledge of
forces the value of
x to be partially unknown, or really, partially unknowable, and vice versa. Therefore, we cannot access both entries of the conjugate pair
, we must choose one of them. In other words: for a conjugate pair (when used in quantum computation) we may have that the computational basis bitstring is well-defined, or that the phase bitstring is well-defined, or that neither is well-defined (but never that both are well-defined).
Creating a computational basis state can now be seen as writing a well-defined value x into the computational basis part of the conjugate pair , and measuring in the computational basis can be seen as reading off the x value. Likewise, creating a phase basis state can now be seen as writing a well-defined value into the phase basis part of the conjugate pair , and measuring in the phase basis can be seen as reading off the value.
The Hadamard operation or bitwise Fourier transform mod 2 moves a potential well-defined value from the computational basis part to the phase basis part of the state and vice versa; an appropriate notation for a system where
has length
n would be
Re-writing Quantum Fourier Sampling from this point of view, the first two steps of the algorithm write information into the phase basis, and the final two steps read information from the phase basis [
7]. The promise associated with a quantum oracle, that phase is preserved among the components of a superposition, now implies a simpler promise: that the oracle can calculate not one but two kinds of output. The standard function map
is still available, with the standard control and bias/target registers. However, a second function map is also available, the phase kickback map that we will denote
from the phase coordinate of the target/bias register to the phase coordinate of the control. The behavior of these two function maps can now be collected into a joint description: a
conjugate pair oracle of the form in the following theorem.
Theorem 1. Under the promise (4) of phase preservation of the quantum function oracle, we can write down the pair of maps in the computational basis and phase basis, respectively, as the conjugate pair oraclewhere is random withso that is a Fourier sample of f when , thus the notation with a checkmark (the Kronecker delta function equals 1 when t equals the all-zero vector, and the Fourier transform used is the Hadamard transform). Proof. The computational coordinate map immediately follows from the function map of the quantum oracle. The phase coordinate map is obtained from phase preservation (
4) and the identity
(skipping the steps already present in Equation (
6)), through
Therefore, the phase bit
of the target system is unchanged, while the phase bitstring
of the control is unchanged if
, otherwise shifted with a random Fourier sample distributed as indicated in Equation (
17). □
The above should be read as follows: if the input computational basis bitstrings are well-defined, the output computational basis bitstrings are well-defined so that can be deduced. Furthermore, if instead, the input phase basis bitstrings are well-defined, the output phase basis bitstrings are well-defined so that can be deduced. By our definition of a conjugate pair, it is clear that only one part of the conjugate pair oracle can be queried at any one time.
In Fourier sampling, the distribution of
is especially simple. There is an additional promise on the structure of
f in Equation (
2), which in conjunction with phase preservation, using Theorem 1, gives
with probability 1. Here, we must stress that the simplicity of this is a direct consequence of phase preservation (Theorem 1) and the additional promise of Equation (
2). We can now solve the Fourier Sampling problem by just accessing this function in the phase information, this gives us Algorithm 5.
Algorithm 5 Conjugate Pair Oracle Fourier Sampling |
- 1:
create ancilla of length 1 with - 2:
apply to - 3:
discard ancilla
|
Theorem 2. For a target conjugate pair where the phase bitstring , Algorithm 5 solves Fourier Sampling. The solution is available after the algorithm as the phase bitstring χ.
Proof. If the input bias conjugate pair
has well-defined phase
, it follows from Equation (
19) that the output conjugate pair
has well-defined phase
with probability 1. □
The output is a bitstring of length n, so querying the phase part of the oracle can provide n bits of information in one use. This is obviously impossible for a classical oracle that returns a Boolean output.
Quantum Recursive Fourier Sampling can also be re-written from this point of view, adding some complication because of the k arguments ; each phase coordinate will now be shifted with a separate . Theorem 1 generalizes in the following way.
Theorem 3. Under the promise (11) of phase preservation of the quantum function oracle, we can write down the pair of maps in the computational basis and phase basis, respectively, as the conjugate pair oraclewhere is random withHere, is the Fourier transform on the j:th argument of , so that is a Fourier sample on the j:th argument of f when . Proof. For each
j, use Theorem 1 on the conjugate pair oracle function
. Theorem 1 applies because this converts the phase preservation of Equation (
11) into that of Equation (
4). □
In RFS, we also have an additional promise on the structure of
in Equation (
8), but only for the last argument, and in conjunction with phase preservation, using Theorem 3, we obtain
with probability 1. Again, we must stress that the simplicity of this is a direct consequence of phase preservation (Theorem 3) and the additional promise of Equation (
8).
The other
are random and depend on
,
, but we have no specific promised distribution when
; this is simply not part of the problem description. Even so, we can solve Recursive Fourier Sampling by just accessing this function in the phase information of the
k:th control. Note that a random value
,
is added to each
,
during this process, which needs to be removed to preserve the value of
when calculating the next level. This gives us Algorithm 6.
Algorithm 6 Conjugate Pair Oracle Recursive Fourier Sampling |
Level:
Conjugate pair oracles: and Controls: conjugate pairs , Bias/Target: conjugate pair
- 1:
create ancillas with and with - 2:
apply to - 3:
apply to - 4:
apply to - 5:
apply to - 6:
apply to - 7:
discard ancillas
|
Theorem 4. For a target conjugate pair with phase bitstring , Algorithm 6 starting at level 1 solves Recursive Fourier Sampling. The solution is available after the algorithm as the phase bitstring .
Proof. At level
k, the proof has two parts: that oracle access to
and
give oracle access to
; and that the algorithm leaves the phase kick-back of
in the arguments untouched. First, the ancillas
have well-defined phases
, so it follows from Equation (
22) that
has well-defined phase
after applying
the first time in step 2. The Hadamard of step 3 moves this into a well-defined computational basis value. It then follows from the promise (
9) that oracle access to
with this conjugate pair
gives oracle access to
, including the phase kickback map. Second, the transformation in step 6 is the exact inverse of the transformation in step 2, so the second addition will remove precisely the values added in step 2, so that
,
only contains the phase kickback of
.
That we have oracle access to for all k follows by induction, in particular, we obtain oracle access to so that we can deduce from by using the well-defined input and bias . □
The crucial point here is that in this formulation of the problem and solution algorithm, although technically equivalent to the quantum formulation, steps 5 and 6 are no longer motivated by the somewhat unclear need to “uncompute ‘garbage’ [in the computational coordinate of the ancillary systems] left over by the first call, and thereby enable [proper] interference” [
2,
16]. Here, the motivation is much clearer: We need to uncompute the shift of
the phase coordinate of the controlling systems with indices
, i.e., uncompute
phase coordinate garbage, see
Figure 2. This enables a direct comparison with classical reversible computing where (computational coordinate) garbage is uncomputed to enable reversibility. In RFS, the uncomputation of phase coordinate garbage enables the quantum advantage.
Corollary 1. When using Algorithm 6 to solve Recursive Fourier Sampling, the uncomputation in step 6 is necessary to uncompute phase coordinate garbage added to , in step 2.
Proof. Step 2 of Algorithm 6 adds random values to the phase bitstrings of
,
according to Equation (
20). Step 6 is necessary to subtract values that are identical to the added values. □
The reason we need to perform uncomputation, to invert the addition of these additional phases, is that we are not guaranteed anything about the nature of
,
, by the problem formulation. Adding such a guarantee in the problem statement could give a further quantum advantage, although that would require maintaining the classical complexity of the problem under such an addition. One possible addition is promising linear
at every level, but as mentioned earlier, that would reduce the classical complexity considerably [
1].
5. Conclusions
In this work, the main contribution is the notion of conjugate pair oracles, which enables a reformulation of RFS, in turn, providing a stronger argument for why uncomputation is necessary than previously available. We also provide a small generalization of Recursive Fourier Sampling: our generalized RFS contains both the original formulation by Bernstein and Vazirani [
3] and the one by Aaronson [
16] as special cases.
Uncomputation is needed because the function oracle (quantum or conjugate pair, both with phase kickback) adds random phase shifts, i.e., computational garbage, to the controlling registers. Furthermore, we are not guaranteed anything about the value or distribution of these phase shifts by the problem formulation; the only guarantee we have concerns the phase shift of the last argument. Adding further guarantees in the problem statement of the behavior of the involved functions could give a further quantum advantage, although that would require maintaining the classical complexity of the problem under such an addition; we conjecture that such a modification is possible.
It should be noted here that the complexity bound on solving RFS, i.e., the exact bound
mentioned at the end of
Section 3 [
4,
16], already indicates that uncomputation is needed. However, phase kickback in the conjugate pair oracle paradigm presented here arguably gives a better understanding of the necessity of uncomputation of phase coordinate garbage within the Quantum RFS algorithm.
It has previously been established [
7] that at least some problems in
NP relative to an oracle (such as Simon’s algorithm [
2]) use phase kickback as their driving mechanism. We now have that RFS, which in a very real sense is “more difficult” than Simon’s algorithm given that RFS lies outside
MA relative to an oracle [
3], relies on this very same property of quantum systems as the enabling computational resource. That is, in the oracle paradigm, it is not so much a matter of computational power enabling an advantage, but rather one of communication: accessibility of the relevant information outside the oracle. As long as the correct phase information is accessible, we can (apparently) solve extremely hard problems more efficiently than otherwise. This strengthens the argument [
7] that phase kickback is an important property of quantum computational systems. Clearly, phase kickback is critical in enabling a quantum advantage in RFS.
This formalism gives a new understanding of the behavior of quantum algorithms such as Grover’s algorithm [
18] or Shor’s algorithm [
19], in that it allows the explicit tracking of the phase information in a quantum circuit [
7,
10]. It also points out a possible path towards proving a practically meaningful distinction between classical and quantum computation. Perhaps the difficulty in classically simulating quantum computation stems entirely from the difficulty in maintaining the correct phase map in a quantum computation. Investigating this venue more thoroughly may well lead to the unconditional separation theorem that the quantum information society is still striving for to this day.