Quantum algorithm for doubling the amplitude of the search problem's solution states

05/14/2021 ∙ by Mauro Mezzini, et al. ∙ 0

In this paper we present a quantum algorithm which increases the amplitude of the states corresponding to the solutions of the search problem by a factor of almost two.



There are no comments yet.


page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction and preliminaries

We denote the set of natural number excluding the 0 element by . If , then we say that is a computational state. We denote by the binary representation of where is the most significant bit of the binary representation of . Let also denote by . If , we denote by the sum . Furthermore, for any , , we denote by a natural number obtained from by considering only the least significant bits, that is, if the binary representation of is then the binary representation of is . The

gate for a single qubit is represented by the following matrix:


2 The effect of applying Hadamard, S and Hadamard gates to

In this section we want to determine the effect of applying the Hadamard, S and Hadamard gates on quantum state , that is, we want to determine a formula for


and we show that in the final superposition the amplitude of a sigle state depends by .

It is known [2] that given any computational state ,


Now we start with the following Lemma

Lemma 1.



By induction on being the base case with straightforward. So suppose that the statement holds for . Then

Now by Lemma 1 and equation (3), we have that

and applying the Hadamard to , by (3), we have that

and reordering the term of the sum we have that

So in order to compute the amplitudes of we need to compute the sum

for every . We will do this in the following two theorems. First of all we need the following Lemma.

Lemma 2.

Let and and let and be the binary representation, respectively, of and . We have that


We note that, on the left hand of the equation (4), for every element of the sum, we have that . Therefore . Based on this we have that

Furthermore for the same reason above, if and if then we have that and this prove the equation (4). ∎

Theorem 3.

Let , . If is even we have that


We prove the equation (5) on induction on being the base case with easily verifiable for all . So suppose the statement holds for all and for all . Then, for any we have


Now, by equation (4) and by induction hypothesys, we have that (7) is equal to


Likewise, in the term (8), for each is the sum, the bit is always set to 1, so we have that (8) is, by equation (4), equal to


Now by repeatedly applying equation (4) and the induction hypothesys we have that the sum in right hand of equation (10) is


So if we replace (12) in (10) and if we sum togheter (6), (9) and (10) we obtain


Now if we denote by we have that (13) is

and it is now easy to verify that

for every , and this proves the induction step. ∎

Theorem 4.


an odd natural,

and let , . Then


First of all we note that equation (14) holds if and . So in the following we suppose that . We have that

and, by Theorem 3, and by equation (4), we have


Let be the binary representation of . Suppose first that . Then equation (2) become


and the Theorem is therefore proved. So suppose that . Then equation (2) become


but observing that


we have that also in this case the Theorem is satisfied. ∎

As an example we have computed the amplitudes (disregarding the normalization factor) for and we report them on Table 1.

Table 1: Left the amplitudes of for . Right the amplitudes of for . In order to get the final amplitudes one should multiply them by a suitable normalization factor.

3 Doubling the amplitude of the search problem’s solution states

In this section we consider a quantum circuit for doubling the amplitude of solution’s states of the search problem. For a search problem we refer, in general, to the problem of finding a solution of some NP-complete problem. Like in the Groover algorithm we will use the intrinsic quantum mechanical parallelism and an oracle , specifically designed for the specific problem at hand, which return is is a solution of the problem and otherwise.

In particular, in order to present in the detail the results of this paper, we will use a quantum oracle for the Partition Problem (PP). In the PP we have a finite set of elements and a function . We want to find a subset such that . From now on we do not loss generality if we consider the set equal to the set of the first naturals, that is we always consider . Furthermore we note that if PP has a solution then is also a solution of the PP:

The partition problem (PP) is well known to be an NP-complete problem [1].

We describe, in the following, an application of the gates described in the previous section in a quantum circuit to deal with PP (see Figure 1). While the following results apply specifically to the PP they can be applied to any other search problem.

Denote by . Recall that PP problem has a solution only if is an integer. We use the two’s complements representation of requiring qubits. Then for each , we use qubits to encode . These qubits will remain constant in every phase of the circuit and therefore we will not consider them in the reasoning that follows. We use qubits to encode a subset of . If is the state of those qubits, then an element , , is included in the set if and only if . We will use qubits, denoted in the following by , to store the sum for the elements selected in . In this way for a solution of the PP. We also use a control qubit .

So we have four groups of bits: , , and the sets of qubits used to represent the constants for each element of . Note that the number of qubits of the circuit, , is polynomial in the size of a coincise specification of the PP.

At the beginning of the circuit we have the following superposition:

where is set to the two’s complement of and is set to . Then, we apply the Hadamard gate to the first qubits obtaining

Next, we uses each qubit to conditionally sum the element to . If there exist a solution to the PP then, in the final superposition of , the amplitude of the state will be not . The states for which is zero wil be referred as the solutions states of the PP. The control qubit will be set to zero exactly for those states for which . At this point we apply an uncomputational step in order to set . Now if we apply the gate to the first qubits we obtain, by Lemma 1

After this we apply again the Hadamard gate to the first qubits. This operation is controlled by the control qubit in a way that the Hadamard port is applied only to non solution states. For the sake of simplicity we suppose in the following, that the PP has only two solution whose numeric representation are and its bitwise complement . By equation (4), we obtain


Now we want to quantify the amplitude of the state and of equation (19). We consider only the state since the same arguments can be applied to state . The amplitude fr the state (in the following we disregard the normalization factor ) is given by the following formula


We may write the above sum as


We have that


Then, recalling that when is even and when is odd, we have two cases: is even and then


while if is odd


For simplicity of notation in the following we denote as simply . We have that if is even then, by Theorem 3, is


while if is odd, by Theorem 4, is


It is immediate to check that in the above equations (25) and (26) the term become trascurable, with respect to the other term in the equation, as become bigger. We conclude that the amplitude of the state is almost the same of the amplitude of state , thus effectively duplicating the chances of state at the end of the circuit. For example if and we have that

, so that the probability of getting

is, by (19), which is exactly the output of the quirk simulator.

Figure 1: The circuit exploliting gates.

4 Conclusion and future work

We presented here a quantum algorithm for doubling the amplitude of the state correspondig to the solution of the partition problem. This is interesting because if we would be able to iterate such a doubling we could provide a polynomial quantum algorithm for solving an NP-complete problem. Possible future works should focus on: generalizing the mathematical results to istance of search problems where there are more than 2 solutions, find out if this algorithm can be combined to the Goover algorithm in order to seed up the latter of a factor of where and, more important, to check if and how it is possibile to iterate the doubling of the amplitude in order to get some polynomial time algorithm for solving the search problem.


  • [1] R. Karp (1972) Reducibility among combinatorial problems. In Complexity of Computer Computations, R. Miller and J. Thatcher (Eds.), pp. 85–103. Cited by: §3.
  • [2] M. A. Nielsen and I. L. Chuang (2011) Quantum computation and quantum information: 10th anniversary edition. 10th edition, Cambridge University Press, USA. External Links: ISBN 1107002176 Cited by: §2.