Combinatorial and rotational quantum abstract detecting systems

Quantumabstractdetectingsystems(QADS)wereintroducedasacommonframework forthestudyanddesignofdetectingalgorithmsinaquantumcomputingsetting.In thispaper,weintroducenewfamiliesofsuchQADS,knownascombinatorialand rotational,which,respectively,generalizedetectingsystemsbasedonsinglequbit controlledgatesandonGrover’salgorithm.Westudythealgorithmicclosureofeach familyandprovethatsomeoftheseQADSareequivalent(inthesenseofhavingthe samedetectionrate)toothersconstructedfromtensorproductofcontrolledoperators andtheirsquareroots.WealsoapplythecombinatorialQADSconstructiontoa problemofeigenvaluedecision,andtoaproblemofphaseestimation.


Introduction
Quantum abstract detecting systems were introduced in [4] as a common framework for the study and design of detection algorithms in a quantum computing setting. Namely, given a black-box oracle for a Boolean function f , the QADS construct an initial state and an operator that can be used to detect if the function is identically zero or not. For instance, if O denotes a quantum oracle evaluating f , then the QADS related to Grover's algorithm [7] constructs a uniform superposition initial state |ϕ 0 and a quantum operator U = G O, product of the quantum oracle and the diffusion operator G. Such an operator can be used to evolve the quantum system from the initial state, so that measurement of the resulting state U t |ϕ 0 gives always |ϕ 0 when f is zero, whereas when f is not zero, it gives the initial state with small probability. These facts can be used to determine whether f is zero or not, i.e., to detect the existence of an element x such that f (x) = 1.
In general, a QADS is any (classical deterministic) algorithm that takes, from a set of inputs M, a Boolean function (given by a circuit) f : {0, 1} k → {0, 1} and outputs a unitary transformation U = U f on a Hilbert space H whose dimension only depends on k, together with a state |ϕ 0 ∈ H (that only depends on k too) such that The transformation U is called detecting operator, and |ϕ 0 is known as the initial state.
QADS related to other well-known quantum computing search methodologies, such as quantum walks [12,14,16,18] or the quantum abstract search [3] and even other nonsearch techniques (like Deutsch-Jozsa algorithm [5]) have been considered [4]. In all these cases, the detection scheme is similar to the one for Grover's QADS: The detection scheme is readily described by the following circuit: There are two main advantages for the introduction of the QADS methodology. The first one is that it helps to systematically analyze the effectiveness of the detection procedures under study. Namely, the actual usefulness of a particular QADS can be analyzed in terms of a trade-off between the precomputation cost of the QADS (efficient constructibility), and the number of iterations required to achieve a bounded success probability in Algorithm 1. A QADS is called efficiently constructible if for any input circuit f ∈ M of size n, the output pair initial state/unitary transformation can be computed in O(poly(n)) time and, as a consequence, their circuits are of O(poly(n)) width, depth and number of gates. On the other hand, if (|ϕ 0 , U = U ( f )) is the output of a QADS on input f ∈ M, then for a given 0 < δ ≤ 1, a function T : N → N is a δ-quantum detecting time for the QADS, if for all nonzero f ∈ M of input size k So, for instance, the QADS of Grover search provides efficient constructibility and a , which is optimal among the class of quantum algorithms that do not look into the oracle. In general, the following result can be proved: Main Theorem] The detection scheme of Algorithm 1 always provides a correct output on input zero (i.e., when no marked elements do exist), and so the probability of error is fully attributed to nonzero inputs. Namely, such a probability is equal to Therefore, if a QADS is both efficiently constructible and has δ−detecting time, then the detection scheme can be run in O(poly(n)) precomputation time, and the detection problem can be solved by a one-side error quantum algorithm with error at most 1−δ.
The second advantage is that the methodology allows to construct new QADS from given ones, which might yield better detecting probabilities. These transformations are members of the algorithmic closure of QADS. Most of these closure procedures are quite natural, such as extending the number of qubits used, inverting the detecting operator, multiplication of detecting operators with the same initial state, conjugation by a unitary operator, or controlling of a detecting operator with a qubit. The description of some of them as quantum circuits and operators is given in Table 1.
In this paper, we introduce new families of QADS, known as combinatorial and rotational, which, respectively, generalize detecting systems based on single qubit controlled gates and on Grover's algorithm. We study the algorithmic closure of each family and prove that some of these QADS are equivalent (in the sense of having the same detection rate) to others constructed from tensor product of controlled operators and their square roots.
The structure of the paper is as follows. In Sect. 2, we introduce combinatorial QAD-Sand study their algorithmic closure. Rotational QADS are introduced and studied in Sect. 3, including their algorithmic closure. Applications of the combinatorial QADS construction to an eigenvalue decision problem and to a phase estimation problem are given in Sect. 4. Finally, some conclusions and intended future work are collected in Sect. 5. Detailed proofs of the results presented in the paper can be found in Appendix.

m-Combinatorial QADS
In this section, we introduce m-combinatorial QADSas a generalization of QADS based on single qubit controlled gates. We also study their properties, in particular their efficient constructibility, detecting times, and algorithmic closure. First, let us introduce the definition of combinatorial QADS.

Definition 1
If U f is the detecting operator of a QADS Q, |ϕ 0 is its initial state, and m is a nonnegative integer, we define the m−combinatorial QADS obtained from Q as the QADS whose initial state is |0 ⊗m |ϕ 0 , and whose detecting operator is given by where c i U f is the unitary operator that applies U f to the second register if the ith qubit of the first register is |1 and applies the identity if that qubit is |0 (i.e., it is the operator U f controlled by the ith qubit of the first register).
Observe that when m = 1, we recover the controlled QADS of [4] (7th entry in Table 1 above). The following result, whose proof can be found in appendix, guarantees that the m−combinatorial QADS is indeed a QADS, and that it is efficiently constructible provided the original QADS is.

Proposition 1
If we have a QADS Q providing an output U f , |ϕ 0 on input f , then for all m ≥ 1 the algorithm that returns the operator depicted in circuit Fig. 1 and the state |0 ⊗m |ϕ 0 is also a QADS. What is more, if the original QADS is efficiently constructible, so is the new QADS, for fixed m.
The reason that justifies the name "combinatorial" for this type of QADS is given in the following result, where the amplitude of the state C(m, U f )|0 ⊗m |ϕ 0 related to the state |0 ⊗m |ϕ 0 is given.

Proposition 2
The amplitude of the state C(m, U f )|0 ⊗m |ϕ 0 related to the basis state |0 ⊗m |ϕ 0 is In appendix, a concrete and complete description of the state C(m, U f )|0 ⊗m |ϕ 0 is given (Proposition 7). Such an expression can be useful, for instance, for providing algebraic proofs of some of the results related to the algorithmic closure of combinatorial QADS that we introduce next. The proofs below are based on circuit depiction of the QADS operators, which are less cumbersome. (More details are given in appendix.) In these results, we determine some procedures which leave the subclass of combinatorial QADS algorithmically closed.

Proposition 3
The extension, powers, and roots of an m−combinatorial QADS are also m−combinatorial QADS.

Graphical sketch of proof
1. Extension: It is straightforward to see that the following circuit 2. Powers and roots: Since H 2 = I , and U f commutes with itself, we have the following equivalency for n f copies of the m−combinatorial detecting operator: Some other operations in the algorithmic closure of QADS might not leave the subclass of combinatorial QADS closed. This is, for instance, the case of the product of two combinatorial QADSwhen the corresponding detecting operators do not commute. Next, we provide a result relating the detecting times of the combinatorial and the original QADS. Its proof can be found in appendix.

Proposition 4
Let Q be a QADS, and letQ be the corresponding m-combinatorial QADS. Suppose S : N → N is aδ-detecting time forQ, and let z l := ϕ 0 |U l f |ϕ 0 for any l ∈ N. Assume that, for all w ∈ N, there exist a w ∈ R, α w ∈ 0, π 2 such that (1−δ)2 2m cos 2 α w ( 2m m ) ≤ 1 − δ, with δ > 0, and such that for all l = 0, . . . , m · S(k), The conditions on the previous result are satisfied, for instance, for a family of QADS known as rotational, that we introduce in the next section.

Rotational QADS
In some well-studied searching procedures, the iterating operator acts only on a smalldimensional invariant subspace, leaving the remaining directions unchanged. This is the case, for instance, of the operator of Szegedy's quantum walk with queries on the complete graph [14], which acts on an invariant three-dimensional space when only one vertex is marked, and on an invariant four-dimensional space when multiple marked vertices are considered. Of course, this is also the case of the operator of Grover's search, which acts as a rotation in a two-dimensional invariant subspace and leaves the orthogonal directions unaltered [7]. In this section, we consider QADS in which the detecting operator U f behaves in this way, acting as a rotation in a twodimensional invariant subspace. Such an operator can be described by a matrix in SO (2). As in the case of the combinatorial QADS, we study their properties, such as an explicit expression of the final amplitude, and their algorithmic closure. We also consider combinatorial QADS derived from rotational QADS, concluding some interesting equivalences.
The definition of a rotational QADS is as follows.
Definition 2 If U f is the detecting operator of a QADS Q with initial state |ϕ 0 , we shall say that it is a rotational QADSif there exist α ∈ [0, 2π ), orthonormal states |ϕ 1 , |ϕ 2 , and β 1 , β 2 ∈ R, such that As said before, the QADS associated with Grover's search is a rotational QADS. The detecting operator U f of a rotational QADS can be straightforwardly described by a matrix cos α − sin α sin α cos α ∈ SO (2), since the coordinate matrix of U f with respect to an orthonormal basis whose first two elements are In the following result, we obtain the amplitude of the state U f |ϕ 0 . Its proof can be found in Appendix, together with a generalized version for QADS that can be described by an arbitrary matrix in the orthogonal group O(n) (Proposition 8).
Proposition 5 Given a rotational QADS with output (|ϕ 0 , U f ), the state after k hits of the detecting operator on the initial state is In particular, the amplitude of such a final state, related to the initial state |ϕ 0 , is cos kα.
Analogously as in the case of combinatorial QADS, we consider different procedures that allow to derive new rotational QADS from others. The proof, again, can be found in Appendix.

Proposition 6
The powers, roots, and inversion of a rotational QADSare also rotational QADS. Also, if two rotational QADS share the same initial state, then their product is also a rotational QADS.
Like in the case of combinatorial QADS, some other operations in the algorithmic closure of QADS might not leave the subclass of rotational QADS closed. This is, for instance, the case of the extension of a rotational QADS, or the product of two rotational QADSwhen they do not share the same initial state.
Next, we want to study the m−combinatorial QADS of a rotational QADS. In particular, we study the amplitude of the final state, related to the initial state, which is connected to the detection rate when a single hit of the detecting operator is used. As a consequence of Proposition 9 of Appendix, we conclude some interesting equivalences of detecting operators from different QADS in the algorithmic closure related to the square root QADS.
Theorem 2 If Q is a rotation QADS, m ∈ Z + , and we consider the corresponding m−combinatorial QADS, then the amplitude of the initial state after one hit of the detecting operator, i.e., of C(m, U f )|0 m |ϕ 0 , related to the initial state |0 m |ϕ 0 , is As a consequence, the m−combinatorial QADS of a rotational QADS is equivalent, in terms of detection rate when one single hit of the detecting operator is taken, to the tensor product of m copies of its square root QADS, tensored with the mth power of its square root QADS.
In particular, when m is even, it is equivalent to the tensor product of m 2 copies of its controlled QADS, tensored with its m 2 th power.
On the other hand, when m is odd, it is equivalent to the tensor product of m−1 2 copies of its controlled QADS plus one copy of its square roots, tensored with a product of exactly the same operators.
Let us finish this section with the previously mentioned result on the detecting time of a family of QADS. Its proof can be also found in Appendix.

Decision on eigenvalues
Although the QADS methodology was initially introduced as a common framework to deal with the detection problem, it can also be adapted to other problems. Consider, for instance, the situation in which we are given a quantum state |ϕ 0 and an unitary operator U , under the promise that |ϕ 0 is one of its eigenvectors, and we want to check whether the associated eigenvalue is e iα or not. Namely, Thus, the probability of measuring |0 m |ϕ 0 is Therefore, we can think of the following procedure to decide whether α = β. The observations above prove the following result.

Theorem 3 Algorithm 2 is always correct when it outputs N O. So, the probability of error is fully attributed to a Y E S answer. Namely, such a probability is equal to
Therefore, if the QADS is efficiently constructible, then the eigenvalue decision problem can be solved in O(poly(n)) precomputation time of a one-side error quantum algorithm with error at most θ , which decreases exponentially with m. The probability of success of the algorithm is 1 − θ .

Generalized Hadamard test
Another application of the QADS methodology is on phase estimation. Consider again that we are given a quantum state |ϕ 0 and an unitary operator U , under the promise that |ϕ 0 is one of its eigenvectors with associated eigenvalue is e iα . The aim is to estimate α.
Of course, this problem can be solved with the well-known quantum phase estimation (QPE) algorithm [10, Section 5.2]. However, as pointed out in [11] "the size and shallowness of the QPE circuit is important since, in the absence of error correction or error mitigation, one expects entropy build-up during computation." In fact, it has been shown in [8] that, when implemented on current quantum hardware, the accuracy of the QPE algorithm is "severely constrained by NISQ's physical characteristics such as coherence time and error rates." For these reasons, some authors have proposed replacing the QPE algorithm with less demanding methods that make implementing quantum algorithms that rely on it easier in practice (see, for instance, [1,6,9,13,15,17]).
A simpler algorithm that sometimes is used for the phase estimation problem instead of QPE is the Hadamard test. It consists in the quantum circuit of Fig. 1 with m = 1, with a final measurement of the controlling qubit [2]. The probability of measuring the quantum state |ϕ 0 is cos β 2 2 . Running the test S H OT S times provides an approximation P of such a probability, from which β can be estimated. Namely, α = arccos (2P − 1).
If we follow a similar procedure with m > 1 (i.e., with another combinatorial QADS), we obtain a generalization of the Hadamard test. In this case, the probability , and running the test S H OT S times provides an approximation P of such a probability, from which β can be estimated as α = arccos 2 m √ P − 1 . We have tested this "m−Hadamard test" with different values of m, and 10 equispaced angles in [0, π), with a number of S H OT S equal to 10 4 . We run the experiment 10 3 times to get an estimation of the phase, measuring the mean absolute error of such an estimation. The results are collected in Fig. 2. For convenience, the interval [0, π) has been split in two subintervals [0, π 2 ) and [ π 2 , π). Observe the different scale of the two figures. When the phase is "small" (namely in the first subinterval), m bigger yields a smaller mean absolute error, and the opposite occurs for bigger phases. This can be easily explained by the effect of the mth root, since in the first case the cosines are closer to one, whereas in the second one, cosines are closer to zero.
Another way of visualizing this fact is with the average error for the five phases in the first interval, and for the five phases in the second interval (in both cases for m = 1, . . . , 5), as depicted in Fig. 3. We can see that increasing m is better for the estimation of angles in the first subinterval, but it is worse for those in the second subinterval. Therefore, we can conclude that unless the phase is promised to be in the first half of the interval [0, π), the m−Hadamard test with m > 1 cannot be directly used.

Dichotomy search
An alternative for phase estimation is a dichotomy search based on the decision of eigenvalues procedure of the previous subsection. The idea is, as in the original dichotomy search, to iteratively split the interval [0, π) in halves, deciding in each iteration to which half the phase belongs to. The decision is based on comparing the phase against the angles that define each subinterval. So, in the first iteration, the phase is compared against 0 and π , in the second one, against 0 and π 2 or against π 2 and π , and so on. For this decision, we also use Theorem 3, choosing the "left" or "right" We have tested this dichotomy test with different values of m, and 10 equispaced angles in [0, π), with 10 iterations, and a number of S H OT S equal to 10 3 in each iteration. We run the experiment 10 3 times to get an estimation of the phase, measuring the mean absolute error of such an estimation, and the overall average error for different values of m. The results are collected in Fig. 4. It can be noticed that this method provides uniformly better results when m increases. However, the error is still bigger than the error provided by the standard Hadamard test.

Hybrid methodology
As a consequence, we propose a hybrid approach which takes the advantages of each of the methods presented above. First, we use the dichotomy search to "locate" the phase, and then, we get an actual estimation by using the Hadamard test. We have experimented with this hybrid methodology with different values of m, and 10 equispaced angles in [0, π), with 2 iterations of the dichotomy search, with a number of The results are collected in Fig. 5. As in the case of the dichotomy search, this methodology provides uniformly better results when m increases. Moreover, the overall error when m > 1 beat those of the standard Hadamard test.

Conclusions and future work
In this paper, we explore the QADS framework introduced in [4] for dealing with detection problems in a quantum computation setting. Namely, we study two specific classes of QADS. The first one is that of combinatorial QADSthat generalize the wellknown controlled operators. We have determined their efficient constructibility, the expression of the state after application of the detecting operator, and their algorithm closure as a subclass of QADS. As an application, we have considered the problem of deciding whether, for a given pair operator-eigenvector, the corresponding eigenvalue is one given or not. The second family is that of rotational QADS, which include as a particular case the QADS from Grover's search. We have studied the expression of the state after application of the detecting operator on the initial state, the algorithmic closure of this subclass of QADS, and also we have considered their combinatorial QADS. Interestingly, we have derived some nice equivalences for these QADS, in terms of tensor products and products of square roots of the original QADS. As future projects, we want to study other families of QADS that include measurements, or QADS that resemble the combinatorial ones with different controlled operators (functional QADS).

Proof of Proposition 2
Applying H ⊗m ⊗ I to the state |0 ⊗m |ϕ 0 , we get Using the controlled versions of the U f operator, we get where |x| is the Hamming weight of x, i.e., if x is described by exactly |x| ones and m − |x| zeroes, then the controlled operators c i U f will contribute with exactly |x| hits of U f . Therefore, as desired.
Proposition 7 Given a QADS with output (|ϕ 0 , U f ), and a natural number m, the state of the corresponding m−combinatorial QADS, after one hit of the detecting operator on the initial state, is: Proof From the proof of Proposition 2, we get the state |x U |x| f |ϕ 0 after applying H ⊗m ⊗ I to the initial state |0 ⊗m |ϕ 0 , and then the controlled gates on the operators U f . Now, we apply H ⊗m ⊗ I to get where |x = α|0 + β|1 . Also, notice that when U and V commute, As a consequence, when the β i j are real, the amplitude of such a final state, related to the initial state |ϕ 0 , is Proof Since U f admits a coordinate matrix in the orthogonal group O(n), there must exists an orthonormal basis {|ϕ 1 1 , |ϕ 1 2 . . . , |ϕ l 1 , |ϕ l 2 , |ϕ 2l+1 , . . . , |ϕ n } such that the coordinate matrix of U f with respect to such a basis is the block diagonal matrix where * ∈ {+, −}, depending on whether U f is a rotation or a reflection. (3) is a direct consequence of Propositions 2, 5, and 9 . On the other hand, for the equivalences the following facts are used:

Remark 1
Note that the last equivalence of the proof holds because the QADS is rotational. In general, such an equivalence is not true. For instance, take U f as the gate N OT .

Proof of Corollary 1
For all w ∈ N, let us consider any possible input f of size w. For all 0 ≤ l ≤ T (w) = m · S(w), we have that z l = cos(lθ w ) > 0, because 0 ≤ lθ w ≤ m · S(w)θ w ≤ mΔ < π 2 . Consequently, for all 0 ≤ l ≤ T (w), arg (z l ) ∈ [0 − α w , 0 + α w ], with α w as close to zero as desired. In particular, we can take α w such that (1−δ)2 2m cos 2 α w ( 2m m ) and cos 2 α w can be made as close as needed to 1. The result now follows from Proposition 4.