Derandomization of quantum algorithm for triangle finding
Abstract
Derandomization is the process of taking a randomized algorithm and turning it into a deterministic algorithm, which has attracted great attention in classical computing. In quantum computing, it is challenging and intriguing to derandomize quantum algorithms, due to the inherent randomness of quantum mechanics. The significance of derandomizing quantum algorithms lies not only in theoretically proving that the success probability can essentially be 1 without sacrificing quantum speedups, but also in experimentally improving the success rate when the algorithm is implemented on a real quantum computer.
In this paper, we focus on derandomizing quanmtum algorithms for the triangle sum problem (including the famous triangle finding problem as a special case), which asks to find a triangle in an edge-weighted graph with vertices, such that its edges sum up to a given weight. We show that when the graph is promised to contain at most one target triangle, there exists a deterministic quantum algorithm that either finds the triangle if it exists or outputs “no triangle” if none exists. It makes queries to the edge weight matrix oracle, and thus has the same complexity with the state-of-art bounded-error quantum algorithm. To achieve this derandomization, we make full use several techniques: nested quantum walks with quantum data structure, deterministic quantum search with adjustable parameters, and dimensional reduction of quantum walk search on Johnson graph.
1 Introduction
Randomized algorithms play an important role in computer science, as they can be significantly efficient in some choice of computational resource for a lot of basic computational problems, such as time for primality testing [1, 2, 3], space for undirected s-t connectivity [4] and circuit depth for perfect matching [5]. Since the polynomial-time deterministic algorithm for primality testing [6] was proposed in 2004, the study of derandomization, i.e. the question of whether it’s possible to come up with efficient deterministic versions of randomized algorithms, has been attracting attention from the academic community, see for instance, Refs. [7, 8, 9, 10, 11]. Indeed, a lot of exciting works have been dedicated to derandomizing concrete randomized algorithms, including the aforementioned primality testing [6], undirected s-t connectivity [12] and perfect matching [13]. There are also entire books on derandomization, see for instance, Refs. [14, 15, 16].
Because of the inherent randomness of quantum mechanics, most of the existing quantum algorithms are randomized, i.e., have a probability of failure [17, 18, 19]. Derandomizing quantum algorithms seems difficult, with only few quantum algorithms having been successfully derandomized (succeed with certainty), such as deterministic quantum search [20, 21, 22, 23, 24] and deterministic quantum algorithms for Simon’s problem [25] (and its generalization [26]), element distinctness problem [27] and the welded tree problem [28]. The significance of derandomizing quantum algorithms lies not only in theoretically proving that the success probability can essentially be 1 without sacrificing quantum speedups, but also in experimentally improving the success rate when the algorithm is implemented on a real quantum computer. Thus, it is intriguing to find more quantum algorithms that allows derandomization. In this paper we will focus on derandomizing quantum algorithms for triangle finding and its generalization, an important and extensively studied problem in quantum computing.
1.1 Triangle finding and its generalization
The triangle finding problem has been extensively studied in quantum computing. It aims to find a triangle in an unknown graph with vertices, making as few queries as possible to its adjacency matrix given as a black box. Compared to the classical query complexity of , the quantum query complexity of the problem has gradually improved from the trivial using Grover search on triples of the graph’s vertices, to the state-of-the-art using extended learning graph [29].
The first improvement over was given by Buhrman et al. [30] for sparse graph with edges, as they presented a quantum algorithm for the triangle finding problem with query complexity using amplitude amplification. Using combinatorial ideas and amplitude amplification, Szegedy [31] (see also [32]) showed how to solve the problem with query complexity , where hides logarithmic factors. Magniez et al. [32] then utilized quantum walk search on Johnson graphs, which was originally used to construct an optimal quantum algorithm for the element distinctness problem [33], to obtain a more efficient algorithm with queries. Belovs [34] introduced the learning graph framework and, as the first application of this framework, used it to improve the quantum query complexity of triangle finding to . Lee et al. [35] then further improved the query complexity to , again using learning graph. Finally, Le Gall [36] gave a quantum algorithm, which utilizes combinatorial structure of the problem, quantum walk search on Johnson graph, and variable time quantum search. The logarithmic factors in was later removed using extended learning graphs by Carette et al. [29].
As can be seen from the above progress, each improvement in the query complexity of triangle finding problem has brought deeper insight into the problem or stimulating new algorithmic technique (See [37] for a more detailed review). However, the gap between and is still open. At the same time, all the above quantum algorithms are bounded-error, that is, have a probability of failure.
In the above process, Belovs and Rosmanis [38] found that the algorithm by Lee et al. [35] based on non-adaptive learning graph can in fact solve a more general problem — the triangle sum problem, in which the underlying graph is now edge-weighted and the goal is to find a target triangle whose edges sum to a given value. They also showed that the algorithm is almost optimal by giving a matching lower bound of . Jeffery et al. [39] then proposed a new nested quantum walk with quantum data structures, which is based on the MNRS framework [40], and as an application they adapted Lee et al.’s algorithm [35] to a quantum-walk-based algorithm. However, in order to reduce errors when nesting the bounded-error subroutines, the algorithm makes queries with additional log factors.
1.2 Our contribution
In this paper, we propose a deterministic quantum algorithm for the triangle sum problem (and thus also for the famous triangle finding problem), based on derandomization of the quantum-walk-based algorithm by Jeffery et al. [39]. Our algorithm has the same query complexity with the state-of-the-art bounded-error quantum algorithm by Lee et al. [35], but we require an additional promise that the graph has at most one target triangle. Apart from nested quantum walks with quantum data structures [39], our algorithm also utilizes deterministic quantum search with adjustable parameters [24] (see Section 2.3 and especially Lemma 3), and a technique to reduce the dimension of invariant subspaces of quantum walk search on Johnson graph (see Section 2.2 and especially Lemma 1), which has also found application in designing a deterministic quantum algorithm for the element distinctness problem [27]. We think our algorithm has the following significance:
-
1.
It’s the first deterministic quantum algorithm for the triangle sum (and also triangle finding) problem making queries, and provides a new example of deranomization of quantum algorithms.
-
2.
It shows the usefulness of the techniques being utilized, and it’s likely that more applications will be found.
Formal statement of the triangle sum problem. Consider an undirected and weighted simple graph with vertices, specified by its edge weight matrix , where is a positive integer and . The edge weight matrix can be accessed through a quantum black box (oracle) whose effect on the computational basis is as follows:
(1) |
where encodes an edge of to be queried, and is the corresponding weight. Suppose the value is stored in qubits, then denotes bit-wise XOR and .
Definition 1 (the triangle sum problem).
Given , find three vertices in the graph such that
(2) |
making as few queries to the oracle as possible.
The triangle sum promised problem has an additional promise that if such a target triangle exists in , there is only one.
In this paper we obtain the following result.
Theorem 1.
There is a deterministic quantum algorithm that solves the triangle sum promised problem with certainty and making queries.
Specifically, the algorithm outputs the target triangle if it exists and claims there’s none if no such triangle exists.
Corollary 1.
There is a deterministic quantum algorithm for triangle finding which makes queries.
Proof.
Triangle finding is a special case of the triangle sum problem, which can be seen by setting and restricting to . Thus, quantum algorithm solving the triangle sum problem also solves triangle finding. ∎
Note that the addition in Eq. (2) is modulo , which is crucial in proving the lower bound of the triangle sum problem [38]. Intuitively, ‘addition modulo ’ makes it impossible for an algorithm to rule out potential triangle, say in , when the queried edge weights and already sum up to greater than or either of them is zero. A more formal description of this property can be found in [41, 38] referred to as the orthogonal array condition or the orthogonality property.
1.3 Paper organization
The rest of the paper is organized as follows. In Section 2 we introduce some important techniques that will be used later: two forms of quantum walk search on Johnson graph dubbed “edge-walk” and “vertex-walk”, a technique to reduce the dimension of the invariant subspace of quantum vertex-walk on Johnson graph, and deterministic quantum search with adjustable parameters. In Section 3, we first sketch the procedure of our algorithm which contains four layers of subroutines in Section 3.1, and then show that each layer of subroutine can be derandomized in Section 3.2, thus obtaining a deterministic quantum algorithm for the triangle sum promised problem. The details of the quantum walk search on Johnson graph used in three of the four layers, i.e. how to implement the setup, update, checking operations and what is the probability of reaching the target state, are presented in Section 4. We conclude this paper with some related problems in Section 5.
2 Preliminaries
In this section, we present some techniques and results that will be used latter in our deterministic quantum algorithm for the triangle sum promised problem. We will use two forms of quantum walks search on Johnson graph with subtle differences. The first one described in Section 2.1 stems from the nested quantum walk [39], and we call it “quantum edge-walk on Johnson graph”, since its basis state can be seen as an edge of a Johnson graph. The second one described in Section 2.2 originates from Ambainis’ quantum walks for the element distinctness problem [33], and we call it “quantum vertex-walk on Johnson graph”, since in its basis state , can be seen as a vertex of a Johnson graph and as a coin used to update .
In Section 2.2 we will also introduce a technique (Lemma 1) to reduce the dimension of the invariant subspace of quantum vertex-walk on Johnson graph, when certain conditions (Condition 1) are satisfied. In order to achieve certainty of success, we will also need deterministic quantum search (with adjustable parameters) as described in Section 2.3.
2.1 Quantum edge-walk search on Johnson graph
A Johnson graph has vertices. Each vertex is a subset of size , and two vertices are connected by an edge if and only if . We denote by the vertex set of .
The quantum edge-walk on has state space . The data associated with relies on the input of the problem to be solved, and we check if a vertex is marked based on whether satisfies certain condition. The goal of quantum walk search on is to obtain a marked vertex with constant probability, starting from an initial state and using update operations that comply with the graph’s edges (i.e. to walk on the graph). Specifically, the quantum edge-walk on consists of the following three operations.
Setup. Denote by the Setup operation that transforms the all zero state to the initial state:
(3) |
where is an equal superposition of all the edges in :
(4) |
where means is adjacent to in , or equivalently .
Update. One step of quantum walk, denoted by the update operation , consists of three unitary operators:
(5) |
where ‘Coin’ acting on is the Grover diffusion of vertices adjacent to :
(6) | ||||
(7) |
and
(8) | |||
(9) |
Checking. The checking subroutine adds phase shift to , if the associated data satisfies certain condition.
The whole process of quantum walk search on can be formulated in the following equation
(10) |
The process is similar to Grover’s algorithm, as can be seen as a reflection through the initial state and as a reflection through the marked states. It should be noted that the we used in this paper is replaced with phase estimation and selected phase shift in [39, 40]. Finally, by choosing an appropriate and measuring in the first register, we will obtain a marked vertex with constant probability.
2.2 Quantum vertex-walk search on Johnson graph
The quantum vertex-walk search on Johnson graph has state space .
Setup. The initial state is
(11) |
Update. One step of quantum walk consists of two unitary operators: . The first operator acts on , and can be seen as choosing a random to be moved into :
(12) | ||||
(13) |
The second operator can be seen as choosing a random being removed from and at the same time moving into . To update simultaneously, acts on all registers, but we only define its effect on register for simplicity:
(14) | ||||
(15) |
Note that we enhance the original update operation from [33] with general phase shift instead of , in order to achieve dimensional reduction of the walk’s invariant subspace.
Checking. The checking subroutine adds relative phase shift to a marked state , based on whether the associated data satisfies certain condition.
In fact, can be implemented by , if there is a checking subroutine that flips an auxiliary qubit initialized with , when the basis state is marked.
5-dimensional invrariant subspace . Suppose the Checking subroutine satisfies the following condition:
Condition 1.
There is a special subset with , such that for a certain , the checking subroutine marks a basis state satisfying and .
Then the quantum vetex-walk search on can be reduced to a -dimensional invariant subspace spanned by:
(16) |
where is the equal superposition of basis states in . In basis , the initial state takes the following form:
(17) |
and the target state is .
Because can also be seen as the set of satisfying and , the size of can be calculated in two ways. For , we have:
(18) |
and for , we have:
(19) |
This is depicted in Fig. 1 by the two equivalent ways (from left or from right) of calculating the weight of the middle line marked by with dashed box.

From Fig. 1 and the definition of and , it can be seen that takes the following form in :
(20) | ||||
(31) |
where are non-negative matrices, and denotes the entry wise square of .
Reducing the dimension further to 2. We can now state the following Lemma 1 due to Lemmas 1 and 2 in Ref. [27].
Lemma 1.
By setting the parameters in and appropriately, becomes a phase shift of the initial state in :
(32) |
Furthermore, the angle is known and when .
Thus the invariant subspace of quantum vertex-walk search on , formulated in the following equation:
(33) |
further reduces to -dimensional spanned by and the target state .
2.3 Deterministic quantum search with adjustable parameters
Suppose there is a quantum process (unitary operation) that transforms the all zero state to , which contains a set of target basis states . Denote by the projection onto . If the success probability of measuring that leads to a target state, i.e. is known beforehand. Then we can transform to with certainty, by iterating the generalized Grover’s operation for times:
(34) | ||||
(35) | ||||
(36) |
If the two parameters are user-controllable, there are at least three schemes to achieve deterministic quantum search [20, 21, 22]. But the following lemma due to Long [22] is most concise.
Lemma 2 ([22]).
Suppose parameter satisfies the equation “”, and integer , then
(37) |
The lower bound of number of iterations is
(38) |
If one of the parameters, for example , is uncontrollable but fixed and known, we can apply the following lemma from [24, Theorem 2].
Lemma 3.
Suppose is arbitrarily given, and , then there always exits a pair of parameters such that
(39) |
The lower bound of is
(40) |
where the notation “” means to add with an appropriate integer multiples of , such that .
3 Deterministic quantum algorithm for the triangle sum promised problem
Since our algorithm for the promised problem of triangle sum (Definition 1) is based on the derandomization of Jeffery et al.’s algorithm [39], it also has layers of subroutines as described in Section 3.1. We show the derandomization of each layer in Section 3.2, and thus obtain a deterministic quantum algorithm and complete the proof of Theorem 1.
3.1 Outline and query complexity
Recall that in the triangle sum problem, we are trying to find a triangle whose edges sum up to a given weight modulo in an edge-weighted graph with vertices, by querying its edge weight matrix as few times as possible (through oracle in Eq. (1)).
Our algorithm has layers of subroutines: layers are quantum walk search on Johnson graph, and layer is a Grover search. Each layer implements the Check operation of its upper layer. Intuitively, layer , , and as a whole, find one by one, three vertices in the target triangle .
Denote by the setup, update, checking operation in the -th layer, the query complexity of implementing the respective operations from the oracle are denoted by . We also denote by the proportion of marked vertices in , where is the Johnson graph in the -th layer. For two subsets and of graph ’s vertex set , denote by the sub-matrix of the edge weight matrix with rows indexed by and columns indexed by .
The 4 layers of subroutines are listed below.
-
1.
A quantum edge-walk search on Johnson graph . We set so that the total query complexity is as shown by Eq. (52) (See [39] for why setting , and below). A basis state is marked if and . The query complexity is (with big omitted)
(41) (42) where the value of and will be explained below. The checking operation which checks if is marked, is implemented in layer 2 (see also Section 3.2).
-
2.
A quantum vertex-walk search on Johnson graph , where , and we set . A basis state , where and , is marked if , and . To avoid the intolerable Setup cost to construct , nested quantum walks with quantum data structure [39] are used. That is, the data associated with in layer 1 is the partial initial state (but is not initialized) of layer 2:
(43) where the data stores in a matrix of registers. Therefore, to maintain this data structure, the setup cost in layer 1 is , and so as to implement based on (see Lemma 5). Also, , and so as to implement . Thus, the query complexity of this layer is
(44) (45) The checking operation which checks if is marked, is implemented in layer 3.
-
3.
A Grover search on to find the last vertex , assuming and . The query complexity of this layer is
(46) The checking operation which checks if is the last vertex , is implemented in layer 4.
-
4.
A quantum vertex-walk search on the product Johnson graph with vertex set . We set . Vertices and are adjacent if for . The data associated with is . Assuming , and , vertex is marked if . The query complexity of this layer is
(47) (48) The checking operation flips an auxiliary qubit if there exists such that . Since are already stored in the data structures, requires no oracle query.
We can now calculate the total query complexity as follows:
(49) | ||||
(50) | ||||
(51) | ||||
(52) |
3.2 Proof of Theorem 1
The condition that are mutually disjoint, and the promise that there’s at most one target triangle, enable us to implement the checking operation , and then with 100% success probability successively as shown below.
Implementing with 100% success probability. We consider implemented in layer 4 first, whose checking operation does not rely on other layer. The input state of this layer is , and the quantum walk basis state is with . From the definition of the checking operation , we can see that only when the input state satisfies , and , dose not degenerates to the identity operator . In this special case, the quantum walk process can be reduced to a -dimensional invariant subspace as shown in Section 4.1. Setting and , the success amplitude by Lemma 4, where the target state is an equal superposition of with (assuming ), and can be computed exactly beforehand. Thus combined with Lemma 2, we can obtain with certainty. Denote by the above process that on input state , implements . Then applying once more we can flip an auxiliary qubit with certainty. Thus implements with 100% success probability, and it acts nontrivially when , and .
Implementing with 100% success probability. The input state of layer 3 is , and the search space is . Thus combined with the effect of shown above, we can see that only when the input state satisfies , and , does . In this special case, suppose , then the only target is . Therefore, using the deterministic quantum search shown by Lemma 2, we can obtain . Denote by the above process that on input state , implements . Then applying once more we can flip an auxiliary qubit with certainty, and thus implements with 100% success probability, which acts nontrivially when , and .
Implementing with 100% success probability. Recall that we want to act nontrivially on when and . We will implement from , which acts nontrivially on when . The implementation of from is described in Section 4.3, which requires queries. Since , we have . We now describe how to implement . The input state is , and the quantum walk basis state is with , . From the effect of shown above, we can see that only when the input state satisfies , does . In this special case, , and thus the quantum walk search process satisfies Condition 1 with and . Therefore, the walk can be reduced to a 2-dimensional invariant subspace by Lemma 1, and then by Lemma 3 we can obtain with certainty the target state , which is an equal superposition of with and . See Section 4.2 for more details. Denote by the above process that on input state , implements . Then applying once more we can flip an auxiliary qubit with certainty, and thus implements with 100% success probability.
Remark 1.
It’s worth noting that in the implementation of in layer 2, we cannot use Lemma 2 to obtain with certainty the target state like in the implementation of in layer 4. This is because in the implementation of the phase shift operator in Lemma 2, we would otherwise need to query times to construct in , which is intolerable since would then be multiplied by of layer 1, making the query complexity exceed .
Derandomizing layer 1 and finishing the proof of Theorem 1. As shown above, acts nontrivially only when basis state satisfies and . Therefore, the quantum walk search on can be reduced to a -dimensional invariant subspace, as shown in Section 4.3. Also, by setting and , the success amplitude as shown by Lemma 6, and can be computed exactly beforehand. Thus combined with Lemma 2, we can obtain with certainty the target state , which is an equal superposition of satisfying .
We can now apply the deterministic (quantum walk) search of layers 2,3,4 successively and then measure all the registers. This will lead to satisfying , and . Thus from the associated data we can find the target with certainty. If there’s no such that , we claim that the graph does not contain the target triangle.
4 Details of quantum walk search in different layer
In the following subsections, we will fill in the missing details of the three aforementioned quantum walk search on Johnson graphs: (i) edge-walk on of layer 1, (ii) vertex-walk on of layer 2, and (iii) vertex-walk on the product Johnson graph of layer 4. We start with the layer 4 whose checking operation does not rely on other layer.
4.1 Layer 4
Suppose the input state of this layer satisfies , the target state of quantum vertex-walk search on is an equal superposition of such that .
Setup. The initial state is
(53) |
We first construct an equal superposition of s.t. and based on , and then query the oracle for times to construct the associated data based on , and finally construct an equal superposition of s.t. based on .
Update. A step of quantum walk consists of query operations and diffusion operations:
(54) |
with working registers:
(55) |
The first diffusion operation acts on registers , and can be seen as choosing a random to be moved into :
(56) | ||||
(57) |
The sum is over , , and for other we define to act trivially on . The query operation calls the oracle (Eq. (1)) on registers for . The second diffusion operation acts on all registers except , and can be seen as choosing a random being removed from and at the same time moving into , while updating the associated data simultaneously:
(58) | ||||
(59) | ||||
(60) |
In , suppose the vertical juxtaposition , then for s.t. , its associated data is a corresponding permutation of : we exchange row and in , and then sort the first rows in the ascending order. Thus, if is a sub-matrix of the edge weight matrix , then is still a sub-matrix of with rows indexed by and columns indexed by .
Checking. The checking operation flips an auxiliary qubit if there exists such that , based on the data constructed in layer 4, and constructed in layer 1. Thus no additional query is needed. Using the phase kick-back effect: , where is the Pauli-X matrix and , we can add phase shift to the marked states.
Invariant subspace. Denote by the equal superposition of states in . The basis states of the quantum walk’s invariant subspace is illustrated in Fig. 2.

It can be seen form Fig. 2 that a step of quantum walk takes the following matrix form in .
(61) |
where non-negative matrices and satisfy:
(62) |
From the number of basis states in (or weights of the lines in Fig. 2), it’s easy to see the initial state takes the following form in after simplification:
(63) |
and the overlap with the target state is .
Lemma 4.
Setting and , the success amplitude satisfies .
Proof.
Similar to [42, Lemma 2], it can be shown that has two eigenvectors with corresponding eigenvalues such that
(64) | ||||
(65) |
Similar to [42, Lemma 3], it can be shown that when and adds relative phase shift to the only target basis state in , has two eigenvectors with corresponding eigenvalues such that
(66) | ||||
(67) |
where . Consider . Let , and be the projection onto the other eigenvectors of . Then , and . Therefore,
(68) | ||||
(69) | ||||
(70) |
Setting we have which completes the proof. ∎
4.2 Layer 2
Suppose the input state (see Eq. (43) for ) of this layer satisfies , the target state of quantum edge-walk search on is an equal superposition of such that .
Setup. The initial state is
(71) |
where . We only need to construct an equal superposition of based on , which requires no query.
Update. A step of quantum walk consists of query operations and diffusion operations:
(72) |
with working registers:
(73) |
The first diffusion operation acts on registers , and can be seen as choosing a random to be moved in to :
(74) | ||||
(75) | ||||
(76) |
The query operation calls the oracle (Eq. (1)) for times to update the data associated with . The second diffusion operation acts on all registers, and can be seen as choosing a random being removed from and at the same time moving into , while updating the associated data simultaneously:
(77) | ||||
(78) | ||||
(79) |
In , suppose the horizontal juxtaposition equals , then for s.t. , its associated data is an appropriate permutation of the columns of . This is similar to defined in Eq. (60).
Checking. The checking operator adds phase shift to states which satisfies , and .
Assume , then . Therefore, the quantum vertex-walk search on satisfies Condition 1 with and , and we can obtain the same -dimensional invariant subspace as shown by Fig. 1 in Section 2.2, but now , , , and . Since the target state is now , the proportion of marked states becomes
(80) | ||||
(81) |
Thus by combing Lemma 1 (where now ) and Lemma 3 (let and ), we can obtain with certainty, and the query complexity is , same as Eq. (45).
4.3 Layer 1
The goal of this layer is to construct an equal superposition of such that and . The quantum edge-walk search on is the same as in Section 2.1. We first describe how to implement the update operator in the following lemma.
Lemma 5.
The ‘Data’ operator that transform the data to based on requires queries.
Proof.
The transformation consists of the following two steps:
(82) | ||||
(83) |
Specifically, let and , which can be calculated from . Consider some . If , then keeps unchanged; if , then implements and also update the data simultaneously: it clears the data in column , and then writes back , and finally permutes the columns so that the indexes remain the ascending order. Therefore, requires queries.
Operator does not need to deal with separate cases, and is simpler to implement. It updates to in row , and then permutes the rows so that the indexes remain the ascending order. Therefore, requires queries. The above process is illustrated in Fig. 3.

∎
Checking. The checking operator adds phase shift to such that and . Suppose implemented in layer 2 flips an auxiliary qubit based on if , then can be implemented with costs as shown below:
1. apply to and store the result on initialized to ; 2. update the data to using Lemma 5; 3. apply to and store the result on initialized to ; 4. use phase kick-back to add phase shift if ; 5. clear the register , and recover by applying the inverse of the first 3 steps.
Invariant subspace. Denote by the equal superposition of states satisfying and . The basis states of the quantum walk’s invariant subspace is illustrated in Fig. 4.

It can be seen from Fig. 4 and the definition of a step of quantum walk which consists of ‘Coin’ and ‘Swap’ operators as shown in Section 2.1, that takes the following matrix form in :
(84) |
where , and non-negative matrix satisfies
(85) |
The initial state takes the following form in :
(86) |
It can be seen that the overlap between and the target state is .
Lemma 6.
Setting and , the success amplitude satisfies .
Proof.
Similar to [42, Lemma 2], it can be shown that has two eigenvectors with eigenvalues such that
(87) | ||||
(88) |
where . To make , we set to be the nearest integer to . Note that adds phase shift to the only target basis state in . Thus, similar to [42, Lemma 3], it can be shown that has two eigenvectors with eigenvalues such that
(89) | ||||
(90) |
Consider . Let , and be the projection onto the other eigenvectors of . Then , and . Therefore,
(91) | ||||
(92) | ||||
(93) |
Setting , we have , which completes the proof. ∎
5 Discussions
In this paper, we have shown that there is a deterministic quantum algorithm for the triangle sum promised problem (i.e. the graph contains at most one target triangle) based on derandomization of a nested-quantum-walk-based algorithm by Jeffery et al. Our algorithm achieves the same queries with the state-of-the-art bounded error quantum algorithm, utilizing several non-trivial techniques. It may be worth further considering the following problems.
-
1.
Will the lower bound of remains unchanged for the triangle sum promised problem considered in this paper?
-
2.
Is it still possible to design a deterministic quantum algorithm when the graph is promised to contain none or target triangles?
-
3.
Is it possible to derandomize the state-of-the-art -query quantum algorithm for triangle finding [29] when given an additional promise?
References
- [1] Gary L. Miller. “Riemann’s hypothesis and tests for primality”. Journal of Computer and System Sciences 13, 300–317 (1976).
- [2] Michael O Rabin. “Probabilistic algorithm for testing primality”. Journal of Number Theory 12, 128–138 (1980).
- [3] R. Solovay and V. Strassen. “A fast monte-carlo test for primality”. SIAM Journal on Computing 6, 84–85 (1977).
- [4] Romas Aleliunas, Richard M. Karp, Richard J. Lipton, Laszlo Lovasz, and Charles Rackoff. “Random walks, universal traversal sequences, and the complexity of maze problems”. In 20th Annual Symposium on Foundations of Computer Science (sfcs 1979). Pages 218–223. (1979).
- [5] R. M. Karp, E. Upfal, and A. Wigderson. “Constructing a perfect matching is in random nc”. Combinatorica 6, 35–48 (1986).
- [6] Manindra Agrawal, Neeraj Kayal, and Nitin Saxena. “Primes is in p”. Annals of Mathematics 160, 781–793 (2004). url: http://www.jstor.org/stable/3597229.
- [7] Valentine Kabanets. “Derandomization: A brief overview”. Current Trends in Theoretical Computer Science 1, 165–188 (2002).
- [8] Russell Impagliazzo. “Can every randomized algorithm be derandomized?”. In Proceedings of the Thirty-Eighth Annual ACM Symposium on Theory of Computing. Page 373–374. STOC ’06New York, NY, USA (2006). Association for Computing Machinery.
- [9] Zeyu Guo, Mrinal Kumar, Ramprasad Saptharishi, and Noam Solomon. “Derandomization from algebraic hardness: Treading the borders”. In 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS). Pages 147–157. (2019).
- [10] Lijie Chen and Roei Tell. “Simple and fast derandomization from very hard functions: Eliminating randomness at almost no cost”. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing. Page 283–291. STOC 2021New York, NY, USA (2021). Association for Computing Machinery.
- [11] Dean Doron and Roei Tell. “Derandomization with Minimal Memory Footprint”. In Amnon Ta-Shma, editor, 38th Computational Complexity Conference (CCC 2023). Volume 264 of Leibniz International Proceedings in Informatics (LIPIcs), pages 11:1–11:15. Dagstuhl, Germany (2023). Schloss Dagstuhl – Leibniz-Zentrum für Informatik.
- [12] Omer Reingold. “Undirected connectivity in log-space”. J. ACM55 (2008).
- [13] Ola Svensson and Jakub Tarnawski. “The matching problem in general graphs is in quasi-nc”. In 2017 IEEE 58th Annual Symposium on Foundations of Computer Science (FOCS). Pages 696–707. (2017).
- [14] Michael Luby and Avi Wigderson. “Pairwise independence and derandomization”. Foundations and Trends in Theoretical Computer Science 1, 237–301 (2006).
- [15] Salil P. Vadhan. “Pseudorandomness”. Foundations and Trends in Theoretical Computer Science 7, 1–336 (2012).
- [16] Roei Tell. “Quantified derandomization: How to find water in the ocean”. Foundations and Trends in Theoretical Computer Science 15, 1–125 (2022).
- [17] Peter W. Shor. “Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer”. SIAM Journal on Computing 26, 1484–1509 (1997).
- [18] Lov K. Grover. “A fast quantum mechanical algorithm for database search”. In Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing. Page 212–219. STOC ’96New York, NY, USA (1996). Association for Computing Machinery.
- [19] Ashley Montanaro. “Quantum algorithms: an overview”. npj Quantum Information 2, 15023 (2016).
- [20] Gilles Brassard, Peter Hoyer, Michele Mosca, and Alain Tapp. “Quantum amplitude amplification and estimation”. Contemporary Mathematics 305, 53–74 (2002). url: arxiv.org/abs/quant-ph/0005055.
- [21] Peter Hoyer. “On arbitrary phases in quantum amplitude amplification”. Physical Review A62 (2000).
- [22] G. L. Long. “Grover algorithm with zero theoretical failure rate”. Phys. Rev. A 64, 022307 (2001).
- [23] Tanay Roy, Liang Jiang, and David I. Schuster. “Deterministic grover search with a restricted oracle”. Phys. Rev. Res. 4, L022013 (2022).
- [24] Guanzhong Li and Lvzhou Li. “Deterministic quantum search with adjustable parameters: Implementations and applications”. Information and Computation 292, 105042 (2023).
- [25] G. Brassard and P. Hoyer. “An exact quantum polynomial-time algorithm for simon’s problem”. In Proceedings of the Fifth Israeli Symposium on Theory of Computing and Systems. Pages 12–23. (1997).
- [26] Zekun Ye, Yunqi Huang, Lvzhou Li, and Yuyi Wang. “Query complexity of generalized simon’s problem”. Information and Computation 281, 104790 (2021).
- [27] Guanzhong Li and Lvzhou Li. “Optimal exact quantum algorithm for the promised element distinctness problem” (2022). arXiv:2211.05443.
- [28] Guanzhong Li, Jingquan Luo, and Lvzhou Li. “Recover the original simplicity: concise and deterministic quantum algorithm for the welded tree problem” (2023). arXiv:2304.08395.
- [29] Titouan Carette, Mathieu Lauriere, and Frederic Magniez. “Extended Learning Graphs for Triangle Finding”. In Heribert Vollmer and Brigitte Vallee, editors, 34th Symposium on Theoretical Aspects of Computer Science (STACS 2017). Volume 66 of Leibniz International Proceedings in Informatics (LIPIcs), pages 20:1–20:14. Dagstuhl, Germany (2017). Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik.
- [30] Harry Buhrman, Christoph Dürr, Mark Heiligman, Peter Høyer, Frédéric Magniez, Miklos Santha, and Ronald de Wolf. “Quantum algorithms for element distinctness”. SIAM Journal on Computing 34, 1324–1330 (2005).
- [31] Mario Szegedy. “On the quantum query complexity of detecting triangles in graphs” (2003). arXiv:quant-ph/0310107.
- [32] Frédéric Magniez, Miklos Santha, and Mario Szegedy. “Quantum algorithms for the triangle problem”. SIAM J. Comput. 37, 413–424 (2007).
- [33] Andris Ambainis. “Quantum walk algorithm for element distinctness”. SIAM J. Comput. 37, 210–239 (2007).
- [34] Aleksandrs Belovs. “Span programs for functions with constant-sized 1-certificates: Extended abstract”. In Proceedings of the Forty-Fourth Annual ACM Symposium on Theory of Computing. Page 77–84. STOC ’12New York, NY, USA (2012). Association for Computing Machinery.
- [35] Troy Lee, Frédéric Magniez, and Miklos Santha. “Improved quantum query algorithms for triangle finding and associativity testing”. In Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms. Page 1486–1502. SODA ’13USA (2013). Society for Industrial and Applied Mathematics. url: dl.acm.org/doi/10.5555/2627817.2627924.
- [36] Francois Le Gall. “Improved quantum algorithm for triangle finding via combinatorial arguments”. In 2014 IEEE 55th Annual Symposium on Foundations of Computer Science. Pages 216–225. (2014).
- [37] Stacey Jeffery and Peter Richter. “Quantum algorithm for finding triangles”. Pages 1–6. Springer Berlin Heidelberg. Berlin, Heidelberg (2014).
- [38] Aleksandrs Belovs and Ansis Rosmanis. “On the power of non-adaptive learning graphs”. In 2013 IEEE Conference on Computational Complexity. Pages 44–55. (2013).
- [39] Stacey Jeffery, Robin Kothari, and Frédéric Magniez. “Nested quantum walks with quantum data structures”. In Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms. Page 1474–1485. SODA ’13USA (2013). Society for Industrial and Applied Mathematics.
- [40] Frederic Magniez, Ashwin Nayak, Jeremie Roland, and Miklos Santha. “Search via quantum walk”. In Proceedings of the Thirty-Ninth Annual ACM Symposium on Theory of Computing. Page 575–584. STOC ’07New York, NY, USA (2007). Association for Computing Machinery.
- [41] Aleksandrs Belovs and Robert Spalek. “Adversary lower bound for the k-sum problem” (2012). arXiv:1206.6528.
- [42] Andrew M Childs and Jason M Eisenberg. “Quantum algorithms for subset finding”. Quantum Information & Computation 5, 593–604 (2005). url: dl.acm.org/doi/abs/10.5555/2011656.2011663.