arxiv:1908.04171v1 [quant-ph] 12 aug 2019arxiv:1908.04171v1 [quant-ph] 12 aug 2019 low depth quantum...

13
Depth optimization of quantum search algorithm beyond Grover’s algorithm Kun Zhang 1 and Vladimir E. Korepin 2 1 Department of Chemistry, State University of New York at Stony Brook, Stony Brook, New York 11794, USA 2 C.N. Yang Institute for Theoretical Physics, State University of New York at Stony Brook, Stony Brook, New York 11794-3840, USA (Dated: January 1, 2020) Grover’s quantum search algorithm provides a quadratic speedup over classical algorithm. The computational complexity is based on the number of queries to the oracle. However, depth is a more modern metric for noisy intermediate scale quantum (NISQ) computers. We propose depth optimization method for quantum search algorithm. We show that Grover’s algorithm is not optimal in depth. We propose new quantum search algorithm which can be divided into several stages. Each stage has a new initialization, which is a rescaling of the database. This decreases errors. The multi-stage design is natural in parallel running the quantum search algorithm. I. INTRODUCTION Quantum algorithms realized by quantum computers are elaborately designed to outperform the best classical algo- rithms [1]. Many non-deterministic polynomial-time (NP) hard program still only have the exhaustive search way to solve [2]. One-way function (oracle) f (x) (f : {0, 1} n {0, 1}) can identify the solution state: if t is solution (target state), then f (t)=1, otherwise one way function outputs 0. Classical way to tackle the exhaustive search is by query- ing each state in solution space (with dimension N ) by the one-way function. In worst cases, the total number of query to oracle is N - 1. The principle of quantum superposition provides new way to perform the exhaustive search. Suppose that N =2 n , where n is number of qubits to represent the database. Grover’s algorithm can find one target state with or- acle complexity O( N ), which is quadratically outperforms the classical algorithm [3, 4]. The oracle in Grover’s algo- rithm is U f : U f |xi|yi = |xi|f (x) yi with x ∈{0, 1} n and y ∈{0, 1}. Quantum computers have been vastly developed in last ten years [58]. Still shallow depth algorithm can be realized on real quantum computers: the noisy intermediate-scale quan- tum (NISQ) era, see [9]. Width (number of physical qubits) represents the size of quantum computers. Algorithm’s depth (number of consecutive parallel gate operations) represents the real physical implantation time for the algorithm. Com- bined with width and depth, quantum volume gives metric for NISQ computers [10]. Coherence time is limited in NISQ computers. Discrete elementary gate set which can approxi- mate any unitary operations is called universal quantum gate set (SolovayKitaev theorem) [1]. Quantum computers are equipped with universal quantum gate set. Therefore, depth is counted from universal quantum gate operations. Quantum oracle U f is realized by quantum gates from uni- versal quantum gate set. It is reasonable to assume that quan- tum oracle can be efficiently implemented (in order to ef- ficiently implement Grover’s algorithm), such as the oracle depth scales polynomial with n [7]. Oracle complexity will be equivalent with depth complexity if quantum oracle is the only operations realized in Grover’s algorithm. However, it is not true. Another unitary operations called diffusion oper- ator is required in Grover’s algorithm [3, 4]. How to choose the diffusion operator is related with initial state preparation [11, 12]. The unstructured population space {0, 1} n can be prepared in equal superposition state on quantum computer: |s n i = H n |0i n (1) with single-qubit Hadamard gate H [1]. Note that the initial state |s n i can be efficiently prepared with depth 1 circuit. Dif- fusion operator may only have the constrain: state |s n i is the eigenvector with eigenvalue 1 [13, 14]. Grover’s algorithm is the only threat to post-quantum cryp- tography. Post-quantum cryptography standardization pro- posed by NIST in 2016 introduces depth bound. Recently, more studies focus on the resource estimation, such as width and depth, for Grover’s algorithm instead of traditional or- acle complexity [15, 16]. Grover’s algorithm is optimal in oracle complexity [17, 18]. However, no research addresses depth optimum of Grover’s algorithm. Surprisingly, the depth of diffusion operator can be reduced to one [19, 20]. How- ever, the algorithms will have 1/2 maximal successful prob- ability, and the expected depth is not efficient as the original Grover’s algorithm. Inspired from quantum partial search al- gorithm (QPSA) [2124], we introduce new depth optimiza- tion for quantum search algorithm. New algorithm can have lower depth compared with Grover’s algorithm. In order to further lower the depth, we can apply divided and conquer strategy (combined with depth optimization). Divided and conquer strategy means that the search algorithm is realized by several stages. Each stage can find partial address of the target state. And the initial state takes rescaled version of last stage initial state. The divided and conquer strategy naturally allows the parallel running of quantum search algorithm. If oracle takes much more depths than diffusion opera- tor depth, oracle complexity will be approximated equivalent with depth complexity. We can define the ratio between ora- cle depth and diffusion operator depth. Above a critical ratio, Grover’s algorithm is optimal in depth. Based on the depth op- timization method proposed in this paper, we will show that the critical ratio is proportional to O(n -1 2 n/2 ). If we divide the algorithm into two stages, the critical ratio is a constant. The paper is organized as follow. In Sec. II, we briefly review on quantum search algorithms. One is Grover’s orig- inal algorithm and the other is quantum partial search algo- rithm (QPSA). And we set notations. In Sec. III, we introduce the depth optimization method for quantum search algorithm. And we show how to combine the divided and conquer strat- arXiv:1908.04171v2 [quant-ph] 31 Dec 2019

Upload: others

Post on 01-Jan-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

Depth optimization of quantum search algorithm beyond Grover’s algorithm

Kun Zhang1 and Vladimir E. Korepin2

1Department of Chemistry, State University of New York at Stony Brook, Stony Brook, New York 11794, USA2C.N. Yang Institute for Theoretical Physics, State University of New York at Stony Brook, Stony Brook, New York 11794-3840, USA

(Dated: January 1, 2020)

Grover’s quantum search algorithm provides a quadratic speedup over classical algorithm. The computationalcomplexity is based on the number of queries to the oracle. However, depth is a more modern metric for noisyintermediate scale quantum (NISQ) computers. We propose depth optimization method for quantum searchalgorithm. We show that Grover’s algorithm is not optimal in depth. We propose new quantum search algorithmwhich can be divided into several stages. Each stage has a new initialization, which is a rescaling of the database.This decreases errors. The multi-stage design is natural in parallel running the quantum search algorithm.

I. INTRODUCTION

Quantum algorithms realized by quantum computers areelaborately designed to outperform the best classical algo-rithms [1]. Many non-deterministic polynomial-time (NP)hard program still only have the exhaustive search way tosolve [2]. One-way function (oracle) f(x) (f : {0, 1}n →{0, 1}) can identify the solution state: if t is solution (targetstate), then f(t) = 1, otherwise one way function outputs0. Classical way to tackle the exhaustive search is by query-ing each state in solution space (with dimension N ) by theone-way function. In worst cases, the total number of queryto oracle is N − 1. The principle of quantum superpositionprovides new way to perform the exhaustive search. Supposethat N = 2n, where n is number of qubits to represent thedatabase. Grover’s algorithm can find one target state with or-acle complexity O(

√N), which is quadratically outperforms

the classical algorithm [3, 4]. The oracle in Grover’s algo-rithm is Uf : Uf |x〉|y〉 = |x〉|f(x)⊕ y〉 with x ∈ {0, 1}n andy ∈ {0, 1}.

Quantum computers have been vastly developed in last tenyears [5–8]. Still shallow depth algorithm can be realized onreal quantum computers: the noisy intermediate-scale quan-tum (NISQ) era, see [9]. Width (number of physical qubits)represents the size of quantum computers. Algorithm’s depth(number of consecutive parallel gate operations) representsthe real physical implantation time for the algorithm. Com-bined with width and depth, quantum volume gives metric forNISQ computers [10]. Coherence time is limited in NISQcomputers. Discrete elementary gate set which can approxi-mate any unitary operations is called universal quantum gateset (SolovayKitaev theorem) [1]. Quantum computers areequipped with universal quantum gate set. Therefore, depthis counted from universal quantum gate operations.

Quantum oracle Uf is realized by quantum gates from uni-versal quantum gate set. It is reasonable to assume that quan-tum oracle can be efficiently implemented (in order to ef-ficiently implement Grover’s algorithm), such as the oracledepth scales polynomial with n [7]. Oracle complexity willbe equivalent with depth complexity if quantum oracle is theonly operations realized in Grover’s algorithm. However, itis not true. Another unitary operations called diffusion oper-ator is required in Grover’s algorithm [3, 4]. How to choosethe diffusion operator is related with initial state preparation

[11, 12]. The unstructured population space {0, 1}n can beprepared in equal superposition state on quantum computer:

|sn〉 = H⊗n|0〉⊗n (1)

with single-qubit Hadamard gate H [1]. Note that the initialstate |sn〉 can be efficiently prepared with depth 1 circuit. Dif-fusion operator may only have the constrain: state |sn〉 is theeigenvector with eigenvalue 1 [13, 14].

Grover’s algorithm is the only threat to post-quantum cryp-tography. Post-quantum cryptography standardization pro-posed by NIST in 2016 introduces depth bound. Recently,more studies focus on the resource estimation, such as widthand depth, for Grover’s algorithm instead of traditional or-acle complexity [15, 16]. Grover’s algorithm is optimal inoracle complexity [17, 18]. However, no research addressesdepth optimum of Grover’s algorithm. Surprisingly, the depthof diffusion operator can be reduced to one [19, 20]. How-ever, the algorithms will have 1/2 maximal successful prob-ability, and the expected depth is not efficient as the originalGrover’s algorithm. Inspired from quantum partial search al-gorithm (QPSA) [21–24], we introduce new depth optimiza-tion for quantum search algorithm. New algorithm can havelower depth compared with Grover’s algorithm. In order tofurther lower the depth, we can apply divided and conquerstrategy (combined with depth optimization). Divided andconquer strategy means that the search algorithm is realizedby several stages. Each stage can find partial address of thetarget state. And the initial state takes rescaled version of laststage initial state. The divided and conquer strategy naturallyallows the parallel running of quantum search algorithm.

If oracle takes much more depths than diffusion opera-tor depth, oracle complexity will be approximated equivalentwith depth complexity. We can define the ratio between ora-cle depth and diffusion operator depth. Above a critical ratio,Grover’s algorithm is optimal in depth. Based on the depth op-timization method proposed in this paper, we will show thatthe critical ratio is proportional to O(n−12n/2). If we dividethe algorithm into two stages, the critical ratio is a constant.

The paper is organized as follow. In Sec. II, we brieflyreview on quantum search algorithms. One is Grover’s orig-inal algorithm and the other is quantum partial search algo-rithm (QPSA). And we set notations. In Sec. III, we introducethe depth optimization method for quantum search algorithm.And we show how to combine the divided and conquer strat-

arX

iv:1

908.

0417

1v2

[qu

ant-

ph]

31

Dec

201

9

Page 2: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

2

egy with depth optimizations. In Sec. IV, we talk about thecritical ratios. Below the critical ratios, we can have searchalgorithm which has lower depth compared with Grover’s al-gorithm. Parallel running quantum search algorithm is brieflydiscussed in Sec. V. Sec. VI is conclusion and outlook. Weprovide three Appendices. Appendix A provides detailed ex-amples on n = 6 search algorithm with depth optimizations;Appendix B lists the numerical details provided in the maintext; Appendix C shows the numerical values for critical ra-tios.

II. REVIEW ON QUANTUM SEARCH ALGORITHMS

A. Grover’s Algorithm

Quantum oracle Uf flips the ancillary qubit if the targetstate |t〉 is feed in. Ancillary qubit can be prepared in super-position state H|1〉 = (|0〉 − |1〉)/

√2. Then the oracle gives

sign flip if acting on the target state:

Uf (112n ⊗H)|x〉 ⊗ |1〉 = (−1)f(x)(112n ⊗H)|x〉 ⊗ |1〉 (2)

Here 112n is identity operator on 2n dimensional Hilbert space.For convenience, we denote oracle Uf as

Ut = 112n − 2|t〉〈t| (3)

if the ancillary qubit H|1〉 is prepared. General phase flip canbe constructed: Ut,φ = 112n − (1− e−iφ)|t〉〈t| with complexunit i =

√−1. Generalized oracle Ut,φ has application in

sure success search algorithm [12, 25] and fixed point searchalgorithm (for unknown number of target state) [26]. Note thatoperator Ut,φ (φ 6= π) can be realized by two quantum oraclesUf [26]. In this paper, we do not consider the generalizedoracle Ut,φ for low depth consideration. We also concentrateon one target state case. The depth optimization method inSec. III can be easily generalized to multi-target case.

Oracle Ut reflects the state over the plane perpendicular tothe target state. The most efficient diffusion operator (unstruc-tured database search) is

Dn = 2|sn〉〈sn| − 112n (4)

Note that |sn〉 (1) is the equal superposition of all database.Operator Dn can be viewed as reflection the amplitude in theaverage. Diffusion operator Dn does not query oracle. There-fore the oracle complexity does not include the resource costby Dn. Diffusion operator Dn is single-qubit gates equiva-lent to generalized n-qubit Toffoli gate Λn−1(X) [1]. HereX is NOT gate (Pauli-X gate). The notation Λn−1(X) im-plies n − 1 control qubits NOT gate. When n = 3, Λ2(X)is Toffoli gate. When n = 2, Λ1(X) is CNOT gate. Howto realize Λn−1(X) gate on real quantum computer is highlynontrivial. It is well-known that n-qubit Λn−1(X) gate can beconstructed with linear n-depth or quadratic linear n2-depthfrom universal gate set (CNOT gate plus single-qubit gates)[27]. Recent works also show that n-qubit Λn−1(X) can berealized in log n-depth if n-qubit ancillary qubits are provided[28] or qutrit states are applied [29].

Ut

XH • HX

XH • HX

XH • HX

......

...

XH • HX

Z Z

Dn

(a) Gn = DnUt.

Ut

XH • HX

......

...

XH • HX

Z Z

Dm

(b) Gm = DmUt.

FIG. 1. Quantum circuits of global Grover operator Gn defined in(5) and local Grover operator defined in (8). The diffusion operatorDn (Dm) is single-qubit gates equivalent with n-qubit Toffoli gateΛn−1(X) gate (m-qubit Toffoli gate Λm−1(X)) [1]. Here X and Zare Pauli gates. And H is Hadamard gate. The subspace acted byDm can be chosen arbitrarily.

One query to oracle Ut defined in (3) combined with diffu-sion operator Dn defined in (4) is called Grover iteration orGrover operator:

Gn = DnUt (5)

See FIG. 1a for quantum circuit diagram of Gn. Diffusionoperator Dn reflects the average of whole database. Opera-tor Gn is also called global Grover iteration (global Groveroperator). One Grover operator Gn uses one query to oracleUf . Applying Gn iteratively on initial state |sn〉, the ampli-tude of target state will be amplified. After j Grover iteration,the success probability Pn(j) is

Pn(j) = |〈t|Gjn|sn〉|2 = sin2((2j + 1)θ) (6)

with sin θ = 1/√N . When j reaches to jmax = bπ

√N/4c,

probability of finding the target state approaches to 1. Max-imal iteration number jmax is square root of N . Clearly,Grover’s algorithm provides quadratic speed up comparedwith classical algorithm (in oracle complexity). The idea be-hind Grover’s algorithm can be generalized called amplitudeamplification algorithm [12].

The success probability (finding the target state) does notscale linearly with number of iterations. It suggests thatGrover’s algorithm becomes less efficient when j approachesto jmax. Previous works argued that the expected number ofiterations j/Pn(j) has the minimal at jexp = b0.583

√Nc,

which is smaller than jmax [17, 30]. When j is jexp, the suc-cess probability is around 0.845. In practice, iteration numberjexp has high probability to find target state. The measurementresult can be verified in classical way. If the result fails, runthe algorithm again. The expected number of oracles is mini-mized at jexp.

Page 3: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

3

B. Quantum Partial Search Algorithm

Quantum partial search algorithm (QPSA) was introducedby Grover and Radhakrishnan [21]. Since Grover’s algorithmis optimal (in oracle complexity), QPSA trades accuracy forspeed. Database of N items is divided into K blocks: N =bK. Here b is the number of items in each block. We canassume number b is also power of 2: b = 2m. And the numberof blocks is K = 2n−m. QPSA can find the block whichhas the target state. In other words, QPSA finds partial (n −m)-bits of target state (which is n-bits long). The optimizedQPSA can win over Grover’s algorithm a number scaling as√b [21–23]. Larger block size (less accuracy) gives faster

algorithm.Suppose that the address of target state |t〉 is divided into

|t〉 = |t1〉 ⊗ |t2〉. Here t1 is (n −m)-bits long and t2 is m-bits long. The task is to find t1 instead of whole t. Besidesdiffusion operator Dn (4), QPSA introduces a new diffusionoperator Dn,m:

Dn,m = 112n−m ⊗ (2|sm〉〈sm| − 112m) (7)

Diffusion operator Dn,m reflects around the average in block-size. Diffusion operator Dn,m can be viewed as rescaled ver-sion of Dn (4): the database with size 2n is rescaled into size2m. We can define a new Grover operator as

Gn,m = Dn,mUt (8)

See FIG. 1b for quantum circuit diagram of Gn,m. DiffusionoperatorDm reflects the average of block items. OperatorGmis also called local Grover iteration (local Grover operator).For simplicity, we shorten the notations as Dm ≡ Dn,m andGm ≡ Gn,m in the rest of paper.

QPSA is realized by iteratively applying operators Gm andGn on the initial state |sn〉. Then partial bit t1 can be foundwith high probability (computational basis measurement onfinal state). In QPSA, amplitudes of all non-target items intarget block are same; amplitudes of all items in non-targetblocks are same. Therefore, we can follow three amplitudesonly. Let us introduce basis:

|t〉 = |t1〉 ⊗ |t2〉, (9a)

|ntt〉 =1√b− 1

∑j 6=t2

|t1〉 ⊗ |j〉, (9b)

|u〉 =1√N − b

(√N |sn〉 − |t〉 −

√b− 1|ntt〉

)(9c)

State |ntt〉 is normalized sum of all non-target state in targetblock. State |u〉 is normalized sum of all items in non-targetblocks. At new basis, initial state |sn〉 (1) can be rewritten as

|sn〉 = sin γ sin θ2|t〉+ sin γ cos θ2|ntt〉+ cos γ|u〉 (10)

Angle θ2 is defined as sin θ2 = 1/√b. Angle γ is defined

as sin γ = 1/√K. Global Grover operator Gn defined in

(5) and local Grover operator Gm defined in (8) can be refor-mulated as elements in O(3) group [31]. Operators Gm and

Gn have highly non-trivial commutation relations [31]. Theorder is the key in QPSA. Extensive studies have suggestedthat the optimal sequence (in oracle complexity) isGnGj2mG

j1n

[24, 31]. Here we can minimize the number of oracle (min-imize j1 + j2 + 1) given by a threshold success probability.QPSA requires less number of oracles (the saved oracle num-ber scales as

√b) than Grover’s algorithm. QPSA can also

be generalized into multi-target cases [32, 33]. Interestingly,QPSA can be performed in a hierarchy way: every time QPSAfinds several bits of the target bits t [34].

III. DEPTH OPTIMIZATIONS

A. Minimal Expected Depth

Depth is defined as number of consecutive parallel gate op-erations. For example, the initial state |sn〉 can be paperedwith one depth circuit, see (1). Suppose diffusion operatorDn in (4) has depth d(Dn), which is same as depth of n-qubitgeneralized Toffoli gate Λn−1(X) [1]. Different search taskshave different oracle realizations. We denote the depth ratiobetween oracle Ut and diffusion operator Dn as α:

α =d(Ut)

d(Dn)(11)

It is an important parameter for depth optimization. For one-item search algorithm, the pratical minimal value for α is 1:α ≥ 1. The ratio α maybe different for same oracle withdifferent n. We fix n, then ratio α is a constant for one prob-lem. The design for low depth generalized Toffoli gate can bebenefit for oracle depth either [29].

Given by d(Dn) and α, Grover’s algorithm can be mappedto depth complexity directly. We define the minimal expecteddepth (MED) of Grover’s algorithm as:

dG(α) = minj

d(Gjn)

Pn(j)(12)

Here Pn(j) defined in (6) is the success probability of find-ing the target state (with j Grover iterations). The numer-ator denotes the depth d(Gjn) = (α + 1)jd(Dn). Aboveoptimization is same as the expected iteration number opti-mization j/Pn(j) [17, 30], up to a constant factor. Therefore,we can use jexp = b0.583

√Nc in MED. Note that we have

Pn(jexp) ≈ 0.845. Then we have

dG(α) ≈ 0.69× 2n/2(α+ 1)d(Dn) (13)

If the oracle can be constructed in polynomial depth d(Ut) =O(nk). Then the MED of Grover’s algorithm scales asO(nk2n/2) (assume that k > 1). Grover’s algorithm is op-timal in oracle complexity [17, 18]. The minimal expectediteration number jexp is optimal. The scale O(nk2n/2) is alsooptimal for depth complexity. However, we will show that thenumber dG(α) in (13) is not optimal (if α in (11) is not infinitelarge).

Page 4: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

4

B. Optimization Method

Local diffusion operator Dm defined in (7) has lower depththan global diffusion operator Dn in (4). The optimizationidea is replacing global diffusion operator by local diffusionoperator. The global Grover operator Gn defined in (5) doesnot commute with local Grover operatorGm in (8) [31]. Thenthe order of Gn and Gm is important. Suppose that we havethe sequence

Sn,m(j1, j2, . . . , jq) = Gjqn Gjq−1m · · ·Gj2n Gj1m (14)

Here {j1, j2, . . . , jq} are some non-negative integers. Wehave total

jtot =

q∑p=1

jp (15)

number of query to oracles. To remove the ambiguity in no-tation Sn,m(j1, j2, . . . , jq), we require that the last number jqis always the number of local Grover operators. For exam-ple, S6,4(1, 2) = G6G

24 and S6,4(1, 1, 0) = G4G6. Note that

Sn,m(j, 0) = Gjn is the original Grover algorithm. Since thesequence Sn,m(j, 0) = Gjn does not have any local Groveroperators, the number m is irrelevant. As convention, wechoose the notation Sn(j, 0) = Sn,m(j, 0). The sequenceSn,m(j1, j2, . . . , jq) can find the target state with probability:

Pn,m(j1, j2, . . . , jq) = |〈t|Sn,m(j1, j2, . . . , jq)|sn〉|2 (16)

Then we can define the expected depth of Sn,m(j1, j2, . . . , jq)algorithm. We want to minimize the expected depth, like forGrover’s algorithm (12). Define the new MED:

d1(α) = minm,j1,j2,...,jq

d(Sn,m(j1, j2, . . . , jq))

Pn,m(j1, j2, . . . , jq)(17)

The minimization goes through non-negative integers{j1, j2, . . . , jq}. We also optimize the number m (positiveinteger), which is m < n. The minimal value for m is 2. Thesubscript 1 defined in d1(α) suggests that we find the targetstate at one stage, i.e., no measurement within the algorithmuntil the end. In quantum circuit model, one-stage algorithmmeans only three steps: initialization, unitary operations andmeasurements. We can define multi-stage algorithms, whichhave several rounds of initialization, unitary operations andmeasurements. Later we will define the MED of multi-stagesearch algorithms.

Let us see one example. For n = 6, the Grover’s algorithmhas MED when j = 4:

P6(4) = |〈t|G46|s6〉|2 ≈ 0.816 (18)

The new sequence is

S6,4(1, 1, 2) = G4G6G24 (19)

And S6,4(1, 1, 2) gives the success probability

P6,4(1, 1, 2) = |〈t|S6,4(1, 1, 2)|s6〉|2 ≈ 0.755 (20)

Note that both sequences G46 and G4G6G

24 have four oracles.

According to [27], 6-qubit and 4-qubit Toffoli gates can bedecomposed into 64 and 16 depth circuits (with single- andtwo-qubit gates). We suppose that d(D6) = 64 and d(D4) =16. One can find: if the ratio α in (11) is α < 2.029, then newsequence G4G6G

24 has lower expected depth. More examples

(about n = 6 search algorithm) with quantum circuit diagramscan be found at Appendix A.

We can go back to Grover’s algorithm if the number of Gmis zero. We always have

d1(α) ≤ dG(α) (21)

The choice of subspace (acted by local diffusion operatorsDm

defined in (7)) can be arbitrary, such as qubits with high con-nectivity in real quantum computers. But all local diffusionoperators Dm should act on the same qubits. For example,the sequence S6,4(1, 1, 2) have three local Grover operators.The three local diffusion operators are acting on the same 4qubits. Making wrong choice of subspace can dramaticallyincrease the number of invariant amplitude subspace. Suchstrategy may have some advantages in search algorithm, but itis beyond in this paper.

The minimization results will depend on: the size ofdatabase (number n); the ratio between oracle depth d(Ut)and diffusion operator depth d(Dn) (the value of α definedin (11)); how d(Dn) scales with n (logarithmic, linear orquadratic linear with n). In numerical optimizations, we canset some constrains which rule out the possibility d1(α) <dG(α). For example, we can set the total number of Gn is lessthan b0.69

√Nc; if the number of Gn is j, then the number of

Gm should be less than b(0.69√N−j)(α+1)/αc. As exam-

ples, we find the optimal sequence for n = 4, 5, . . . , 10 withα = 1 (assuming O(n) depth of Λn−1(X) gate [27]). Theestimated depths are plotted in Fig. 2. Details about the cor-responding optimal sequences and success probabilities areprovided in Appendix B.

C. Depth Optimizations for Multi-stage Quantum SearchAlgorithms

In NISQ era, errors can be suppressed if a long algorithm isdivided into shorter pieces (by new initialization and measure-ments). Inspired by hierarchy QPSA [34], we propose depthoptimizations for multi-stage quantum search algorithm. Forsimplicity, we consider the two-stage quantum search algo-rithm firstly.

Suppose that the target state is divided into two-parts:

|t〉 = |t1〉 ⊗ |t2〉 (22)

Suppose that the bit length of t1 is m1 and the bit length of t2is m2. Note that we have m1 +m2 = n. After first stage, thesearch algorithm can find |t1〉 with high probability. Basedon the result on first stage, we can rescale the database. Aftersecond stage, the algorithm can find |t2〉with high probability.The algorithm has the following steps:

Step 1: Initialize the state to |sn〉 defined in (1).

Page 5: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

5

7 8 9 10n

(a)

0

5

1010

3 Dep

th

dG(1)d2(1)d1(1)

4 5 60.0

0.5

7 8 9 10n

(b)

1st2nd

4 5 60.0

0.5

FIG. 2. (a) Estimated dG(α) (MED of Grover’s algorithm defined in(12)), d1(α) defined in (17) and d2(α) defined in (26) with α = 1.Depth d(Dn) is counted based on the optimal results in [27]. Thecorresponding optimal sequences and success probabilities are listedin Appendix B. (b) Depth of the optimal sequence. The left (red) baris Grover’s algorithm. The right (green) bar is the optimal sequencefrom d1(1) defined in (17). Since d2(1) has two stages. The middlebottom bar is the depth of first stage circuit and the middle up bar isthe depth of second stage circuit.

Step 2: Perform the sequence

S(1)n,m2

(j1, j2, . . . , jq) = Gjqn Gjq−1m2· · ·Gj2n Gj1m2

(23)

on the initial state |sn〉. The local diffusion operatorDm2 (defined in Gm2 ) is acting on m2 qubits.

Step 3: Measure the qubits (computational basis measure-ments) which does not have the local diffusion opera-

tor Dm2 acting on. Suppose that we get the classicalresults: t′1 ∈ {0, 1}m1 . The probability that t′1 = t1 isdenoted as P (1)

n,m2(j1, j2, . . . , jq).

Step 4: Initialize the state to

|t′1〉 ⊗ |sm2〉

Here |sm2〉 is the rescaled initial state:

|sm2〉 = H⊗m2 |0〉⊗m2 (24)

Step 5: Perform the sequence

S(2)m2,m′

(j′1, j′2, . . . , j

′q) = G

j′qm2G

j′q−1

m′ · · ·Gj′2m2G

j′1m′ (25)

on the new initial state. We have m′ < m2. Thediffusion operator Dm2 (defined in Gm2 ) is acting on|sm2〉. And the diffusion operator Dm′ is acting onthe subspace of |sm2〉.

Step 6: Measure the qubits (computational basis measure-ments) which have the initial state |sm2

〉. Sup-pose that we get the classical results: t′2 ∈{0, 1}m2 . The probability that t′2 = t2 is denoted asP

(2)m2,m′

(j′1, j′2, . . . , j

′q).

Step 7: Verify the solution |t′〉 = |t′1〉 ⊗ |t′2〉 by classical ora-cle. If the solution is the target item, then stop; if not,back to Step 1.

Step 1-3 is the first stage: we find t1 with high proba-bility. Step 4-6 is the second stage: we find the remain-ing bits of target state. Step 7 is to verify. Differentsequences S

(1)n,m2(j1, j2, . . . , jq) and S

(2)m2,m′

(j′1, j′2, . . . , j

′q)

give different success probabilities P (1)n,m2(j1, j2, . . . , jq) and

P(2)m2,m′

(j′1, j′2, . . . , j

′q). We want to find the MED. The MED

of two-stages search algorithm is

d2(α) = minm2,m′,j1,...,jq,j′1,...,j

′q

d(S(1)n,m2(j1, j2, . . . , jq)) + d(S

(2)m2,m′

(j′1, j′2, . . . , j

′q))

P(1)n,m2(j1, j2, . . . , jq)P

(2)m2,m′

(j′1, j′2, . . . , j

′q)

(26)

We optimize the total expected depth. We do not optimize theexpected stage depth, because we can not verify the partial bitby neither classical nor quantum oracle. Note that m2 is thelength of t2. We can either fixm2 or optimize different choiceof m2. In definition d2(α), see (26), we optimize the choiceof m2. The second stage algorithm is rescaled version of fullsearch algorithm. Such two-stage quantum search algorithm(with depth optimizations) can be easily generalized to multi-stage quantum search algorithm.

As example, let us consider n = 4 two-stage search algo-rithm. Grover’s algorithm (one-stage search algorithm) has

success probability

P4(3) = |〈t|G34|s4〉|2 ≈ 0.961 (27)

In two-stage search algorithm, we divide the target state intotwo parts: |t〉 = |t1〉|t2〉. We choose the first stage sequence asS(1)4,2(1, 1) = G4G2. Then we measure the two qubits which

do not haveD2 (defined inG2) acting on. The probability thatthe measurement results reveal |t1〉 is

P(1)4,2 (4, 2) ≈ 0.953 (28)

Suppose that the measurement results are |t′1〉 after first stage.Then we rescale the initial state as |t′1〉 ⊗ |s2〉. We choose the

Page 6: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

6

second stage sequence as S(2)2 (1, 0) = G2. Recall that the

two-qubit Grover’s algorithm can find the target state in 100%probability with one Grover operator. Therefore, the secondstage success probability is

P(2)2 (2, 0) = 1 (29)

Then the total success probability is

P(1)4,2 (4, 2)P

(2)2 (2, 0) ≈ 0.953 (30)

The result is quiet closed to Grover’s algorithm with samenumber of oracles. But the depth in each stage is less thenGrover’s algorithm.

Another interesting example (two-stage n = 4 search al-gorithm) is that sequence S(1)

4,2(1, 2) gives probability 1 for

finding t1. Combined with second stage sequence S(2)2 (1, 0),

we find a new way for n = 4 exact search algorithm [35]. Weestimate d2(α) with α = 1 for n = 4, 5 . . . , 10 qubit searchalgorithm, see FIG 2. The corresponding optimal sequencesare listed in Appendix B. See Appendix A for more examples(with quantum circuit diagrams) on two-stage quantum searchalgorithms.

IV. CRITICAL RATIOS

A. The Critical Ratio for One-stage Algorithm

Grover’s algorithm is optimal in number of query to oracle[17, 18]. Grover’s algorithm is one-stage search algorithm:no measurement within the algorithm until the end. Whenα → ∞, we will expect d1(α) = dG(α) (no local diffusionoperators). Here d1(α) is defined in (17). And dG(α) de-fined in (12) is the MED of Grover’s algorithm. We define thecritical alpha αc,1 for one-stage search algorithm:

αc,1 = max{α|d1(α) < dG(α)} (31)

The subscript 1 in αc,1 means one-stage search algorithm. Be-low αc,1, depth of Grover’s algorithm is not optimal. Basedon the depth optimization method proposed in Sec. III B, wecan give estimation on αc,1:

Theorem 1. αc,1 = O(n−12n/2).

Proof. The MED d1(α) defined in (17) is search algorithmwith two different diffusion operators. One is local diffusionoperator Dm, see (7). The other is global diffusion opera-tor Dn, see (4). Local diffusion operator Dm is only actingon subspace of database. We can follow a three-dimensionalsubspace: target state |t〉 defined in (9a); normalized sum ofnon-target state in target block |ntt〉 defined in (9b); the nor-malized of rest states in database |u〉 defined in (9c). Thenotations are taken from QPSA, see Sec. II B and [22, 23].

Operators Gn and Gm only change relative amplitudes ofstates |t〉, |ntt〉 and |u〉. Therefore, operators Gn and Gmare elements of O(3) group [31]. It is interesting to see thatoperator Gm can be viewed as a rescaled version of Gn. Innew basis {|t〉, |ntt〉, |u〉}, sequence Sn,m(j) = Gjm (onlyhas local Grover operators Gm) has the representation

Sn,m(j) = Gjm =

cos(2jθ2) sin(2jθ2) 0

− sin(2jθ2) cos(2jθ2) 0

0 0 1

(32)

For example, the matrix element sin(2jθ2) is obtained from

sin(2jθ2) = 〈t|Sn,m(j)|ntt〉 (33)

The angle is defined as

sin θ2 = 1/√b, b = 2m (34)

We want to estimate the critical ratio αc,1. We consider thesequence:

Sn,n−1(1, 1, 1) = Gn−1GnGn−1 (35)

Here we choose m = n − 1. It means that the database isdivided into two blocks. At basis {|t〉, |ntt〉, |u〉} defined in(9a-9c), the sequence Sn,n−1(1, 1, 1) has the matrix represen-tation:

Sn,n−1(1, 1, 1) =

c2(c2 − 3s2) cs(3c2 − s2)(c2 − 3s2) s(3c2 − s2)

−cs(3c2 − s2)(c2 − 3s2) s2(s2 − 3c2) c(c2 − 3s2)

−s(3c2 − s2) c(c2 − 3s2) 0

(36)

with short notations c = cos θ2 and s = sin θ2. Note thatsin θ2 =

√2/N since we choose m = n − 1. The matrix

Sn,n−1(1, 1, 1) has the eigenvalues:

λ0 = −1, λ± = e±iγ (37)

with

tan γ =∆

1 + cos θ2, ∆ =

√3− 2 cos(6θ2)− cos2(6θ2)

(38)The corresponding normalized eigenvectors are denoted as

Page 7: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

7

|v0〉 (with eigenvalue λ0) and |v±〉 (with eigenvalue λ±).States |v0〉 and |v±〉 have the form:

|v0〉 =1

N0

(0, 1, cos θ2(1− 4 cos2 θ2)

)T, (39a)

|v±〉 =1

(∓i√

3 + cos 6θ22

, cos 3θ2, 1

)T(39b)

Notation T means transpose and N0 and N± are normaliza-tions. Note that eigenvector |v0〉 (with eigenvalues −1) is or-thogonal to the target state, i.e., 〈t|v0〉 = 0. We can viewoperator Sn,n−1(1, 1, 1) as rotation combined with reflection.Rotation is around axis perpendicular to |t〉. Rotation angle isγ. Reflection is around plane perpendicular to |t〉. IterationSn,n−1(1, 1, 1) on the initial state gives

〈t|S j̃n,n−1(1, 1, 1)|sn〉 =

λj̃+〈t|v+〉〈v+|sn〉+ λj̃−〈t|v−〉〈v−|sn〉 (40)

We have 〈t|v±〉 = ∓i/√

2. Because N = 2n is a large num-ber, the angle θ2 is a small number. We can expand:

γ = 3√

2θ2 +O(θ22), (41a)

〈v±|sn〉 =1√2

+O (θ2) (41b)

Substitute above relations into (40). After some algebra, wecan get the success probability for finding the target state

|〈t|S j̃n,n−1(1, 1, 1)|sn〉|2 = sin2(

3√

2j̃θ2

)+O(θ2) (42)

Because the sandwich sequence Sn,n−1(1, 1, 1) has three or-acles, we set j̃ = 3j. Then the probability difference betweenS j̃n,n−1(1, 1, 1) and Grover’s algorithm (with same number oforacles) is

|〈t|Gjn|sn〉|2 − |〈t|S j̃n,n−1(1, 1, 1)|sn〉|2 = δ > 0 (43)

Here δ is a small number:

δ = O(2−n/2) (44)

The Grover’s algorithm (with j Grover iterations) has successprobability Pn(j), see (6). Then the success probability forS j̃n,n−1(1, 1, 1) sequence (with j̃ = j/3 iterations) is Pn(j)−δ. If we want the new sequence S j̃n,n−1(1, 1, 1) to have lowerexpected depth than Grover’s algorithm, we can set:

3(α+ 1)d(Dn)

Pn(j)>

(3α+ 1)d(Dn) + 2d(Dn−1)

Pn(j)− δ (45)

The left hand side (times j/3) is the expect depth for Grover’salgorithm. The right hand side (times j̃ = j/3) is the ex-pect depth for S j̃n,n−1(1, 1, 1) algorithm. The above inequal-ity gives

α <2(d(Dn)− d(Dn−1))PG

3d(Dn)δ(46)

Diffusion operators Dn has the depth d(Dn) = O(n) ord(Dn) = O(n2) [27]. Then we have

αc = O(n−12n/2) (47)

This is the end of proof.

As examples, we numerically estimate αc,1 defined in (31)for n = 4, 5, . . . , 10 based on the linear depth of Dn, seeAppendix C and TABLE IV. Below the critical ratio αc,1, atleast two-third global diffusion operators Dn can be replacedby Dn−1 (to have lower expected depth). The saved depthscales as O(2n/2).

B. The Critical Ratio for Two-stage Algorithm

Similar with one-stage search algorithm, we can define crit-ical ratio for two-stage algorithm:

αc,2 = max{α|d2(α) < dG(α)} (48)

Here d2(α) is MED of two-stage search algorithm, defined in(26). The two-stage search algorithm has two measurements.After first measurement, we reinitialize the state in rescaleddatabase. Amplified amplitude of target state |t〉 is lost in thenew initialization. One can argue that

d2(α) > d1(α) (49)

And it implies that αc,2 < αc,1. Analytically, we can prove:

Theorem 2. limN→∞ αc,2 = 1 +√

3 ≈ 2.732.

Proof. Similar with proof of Theorem 1, we construct specialsequence. Then compare the expected depth of such sequencewith the expected depth of Grover’s algorithm. Since we con-sider two-stage search algorithm, we need two sequences fortwo stages. Firstly, we assume that the target state |t〉 has twoparts |t〉 = |t1〉⊗ |t2〉, same as (22). And the length of t2 is 2.For first stage, we consider the sequence:

S j̃n,2(1, 1) = (GnG2)j̃ (50)

In first stage (by sequence S j̃n,2(1, 1)), we find t1 with high

probability. The probability is denoted as P (1)n,2 . In second

stage, we have a rescaled two-qubit search algorithm. OneGrover operator G2 can find the target state with 100% prob-ability. Therefore, the second stage has the sequence:

S2(1, 0) = G2 (51)

The probability of finding t2 is P (2)2 = 1.

In basis {|t〉, |ntt〉, |u〉} defined in (9a-9c), the sequenceSn,2(1, 1) has the matrix representation:

Sn,2(1, 1) =1

2

cos 2γ√

3 sin 2γ√3 cos 2γ −1

√3 sin 2γ

−2 sin 2γ 0 2 cos 2γ

(52)

Page 8: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

8

with sin γ = 2/√N . We can easily find eigenvalues and

eigenvectors of Sn,2(1, 1). Then we can have matrix expres-sion for S j̃n,2(1, 1). Applying S j̃n,2(1, 1) on initial state |sn〉(10),

|〈u|S j̃n,2(1, 1)|sn〉|2 = cos2(√

3j̃γ) +O(γ) (53)

Note that |〈u|S j̃n,2(1, 1)|sn〉|2 is the probability of finding thestate in non-target block. In other words, we have

P(1)n,2 = 1− |〈u|S j̃n,2(1, 1)|sn〉|2 (54)

The second stage has probability 1 (two-qubit Grover’s algo-rithm has probability 1). Then P (1)

n,2 is also the probability offinding the target state.

The two stages designed above has total 2j̃ + 1 queries tooracle. In order to compare with Grover’s algorithm, we setj =

√3j̃ (j is the number of query to oracle in Grover’s al-

gorithm). Grover’s algorithm with j iterations has successprobability Pn(j) of finding the target state, see (6). Thenthe two-stage search algorithm (with sequences S j̃n,2(1, 1) andS2(1, 0)) can find the target state with probability Pn(j) + δ.Here δ is a small number in order δ = O(2−n/2). If we wantthe two-stage search algorithm has lower expected depth thanGrover’s algorithm, we need

(α+ 1)d(Dn)

Pn(j)>

(2α+ 1)d(Dn) + 3√3(Pn(j) + δ)

(55)

The left hand side (times j) is the expect depth for Grover’salgorithm (with j iterations). The right hand side (times j)gives the expect depth for the designed two-stage search al-gorithm. Note that the second-stage circuit only contributesorder O(2−n/2) to the critical value αc,2, therefore we canneglect it here. Then we can solve the inequality:

α > 1 +√

3− 3

d(Dn)+O

(2−n/2

)(56)

For large N , we have the critical ratio

limN→∞

αc,2 = 1 +√

3 ≈ 2.732 (57)

End of the proof.

Theorem 2 suggests that the two-stage search algorithmcan have lower expected depth than Grover’s algorithm, onlywhen the oracle can be realized as efficiently as global diffu-sion operator. The real advantage for two-stage algorithm isto mitigate the error accumulations for long circuit. For exam-ples, see FIG 2 and Appendix A and B. We numerically esti-mate the value αc,2 (n = 4, 5, . . . , 10) based on linear scaledepth of d(Dn), see Appendix C and TABLE IV.

V. PARALLEL RUNNING OF QUANTUM SEARCHALGORITHM

Now we discuss how to parallel run the quantum search al-gorithm on several quantum computers. The simplest idea is

running low success probability search algorithm on differ-ent quantum computers. Verify the result with classical oracleand continue the algorithm until one of the quantum computerfinds the target state [30]. First we can set a threshold successprobability. Then we find the optimal sequence which givesthe MED (the success probability is lower than the thresholdsuccess probability). We run such sequence on several quan-tum computers.

Another parallel running method is to combine the ran-dom guess with search algorithm, as mentioned in [23] forQPSA. For example, the target state is divided into two parts:|t〉 = |t1〉 ⊗ |t2〉, same as (22). One can randomly guess thebits t1. Then perform the search algorithm on bits t2. Eachquantum computer can pick up one guess. However, if morethan half of the bit is choosing randomly, the quadratic speedup is lost. Such strategy is more efficient if some bits havehigher probability (some prior information about target state).

If we want near-deterministic (the fail probability isO(2−n/2)) parallel running search algorithm, we can applymulti-stage search algorithm on different quantum comput-ers. Suppose the target state has length l(t) = n. The tar-get state is divided into p parts. And each part has equallyl(t)/p length. Then we can assign the search algorithm onp quantum computers. Each quantum computer finds onepart of the target state. Combining all the results from eachquantum computers, we can piece the whole solution t at onetime. The sequence running on each quantum computer canbe found by maximizing the number of local Grover operatorsGm defined in (8), based on some threshold success probabil-ity (O(1−2−n/2)). At most it requires n quantum computers.Each quantum computer finds one bit of target state. Howeverthe most efficient way to find one bit of target state is by run-ning random guess one bit search algorithm [23].

VI. CONCLUSION AND OUTLOOK

In this paper, we propose a new way to optimize the depthof quantum search algorithm. Quantum search algorithm canbe realized by global and local diffusion operators. The ratiobetween depth of oracle and depth of global diffusion operatoris important. The ratio is denoted as α, defined in (11). Theminimal practical value for α is 1 (in one target search algo-rithm). When α is below a threshold, we can design new al-gorithm (new sequence) which has lower expected depth thanGrover’s algorithm. We give examples on α = 1. In exam-ples, our new algorithm can have around 20% lower depththan Grover’s algorithm. We also study depth optimizationin multi-stage quantum search algorithm. In each stage, cir-cuit has lower depth than Grover’s algorithm. The multi-stagequantum search algorithm gives a natural way for parallel run-ning of the quantum search algorithm.

Ideas in this work can be easily generalized to the multi-target solution search [17]. However, the exact number of tar-get states is required in order to find the optimal sequence.In this paper, we only consider two kinds of diffusion op-erators (at each stage). Further improvement is possible ifmore diffusion operators are working together. It will be in-

Page 9: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

9

teresting to optimize the depth of amplitude amplification al-gorithm [11, 12]. Grover’s algorithm is only optimal in oraclemeasure. New search algorithm can have lower depth thanGrover’s algorithm.

ACKNOWLEDGMENTS

The authors are grateful to Professor Jin Wang and Mr.Yulun Wang. V.K. is supported by SUNY Center for Quan-tum Information Science at Long Island project numberCSP181035.

Appendix A: Examples on n = 6 search algorithm with depthoptimizations

Different problems have different oracles. For demonstra-tion, we can consider the simplest oracle. As mentioned in[7], oracle is single-qubit gates equivalent with n-qubit Tof-foli gate Λn−1(X). Suppose |t〉 = |000000〉 (n = 6). We canhave the oracle:

Ut =

X • X

X • X

X • X

X • X

X • X

X H H X

According to [27], Λ5(X) gate can be realized by depth 61 cir-cuits: d(Λ5(X)) = 61 (if the quantum computer can performany single-qubit gates and any two-qubit controlled gates). Inreal quantum computers, the depth d(Λ5(X)) may be muchlarger since not all qubits are connected. Nevertheless, wecan set

d(Ut) = d(Λ5(X)) + 2 = 63 (A1)

The global diffusion operator (n = 6) is also single-qubitgates equivalent to 6-qubit Toffoli gate Λ5(X) gate. We have

D6 =

H X • X H

H X • X H

H X • X H

H X • X H

H X • X H

Z Z

Therefore, we can set

d(D6) = d(Λ5(X)) + 2 = 63 (A2)

Therefore we have the ratio α = 1, see (11). The local diffu-sion operators are acting on subspace of 6 qubits. For exam-ple, theD4 diffusion operator has the quantum circuit diagram

D4 =

H X • X H

H X • X H

H X • X H

Z Z

And local diffusion operator is single-qubit gate equivalentwith CNOT gate:

D2 =H X • X H

Z Z

Accordingly, we have

d(D4) = d(Λ3(X)) + 2 = 15, (A3)d(D2) = d(Λ1(X)) + 2 = 3 (A4)

Near-term quantum (or NISQ) computers are subjected tolimited coherence time. We have to design low depth algo-rithm, or divide long circuit into shorter pieces. In n = 6search algorithm, Grover’s algorithm needs 6 iterations to givethe maximal probability finding the target state. In experi-ments, we do not need to run the quantum search algorithmuntil the maximal probability is reached. For low depth con-sideration, we shall give examples on search algorithm withone or two oracles. Even in such simple scenarios, we candesign better circuit by local diffusion operators.

1. One-oracle algorithm

• Grover’s algorithm. The one iteration Grover’s algo-rithm gives:

|0〉 H

Ut D6

|0〉 H

|0〉 H

|0〉 H

|0〉 H

|0〉 H

Measurements at end are computational basis measure-ments. The whole circuit has depth

d(G6) = 126 (A5)

We can incorporate the initial Hadamard gates into G6.The success probability of finding the target state is

P6(1) = |〈t|G6|s6〉|2 ≈ 0.1348 (A6)

Page 10: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

10

The result is better than classical algorithm. Optimalclassical search has success probability 3.15%: singlequery followed by a random guess if the query fails(1/64 + 1/63 ≈ 3.15%). To evaluate the efficiency,we can calculate the expected depth:

d(G6)

P6(1)≈ 935 (A7)

• Our optimized algorithm. In order to lower the depth,we can apply, for example, one iteration with local dif-fusion operator G4. The one iteration local Grover op-erator has the circuit:

|0〉 H

Ut

|0〉 H

|0〉 H

D4

|0〉 H

|0〉 H

|0〉 H

Note that S6,4(1) = G4 is still a 6-qubit gate, althoughD4 is a 4-qubit gate. Notation about S6,4(1), see (14).The whole circuit has depth

d(G4) = 78 (A8)

The depth is lower compared with G6. The successprobability finding the target state is

P6,4(1) = |〈t|S6,4(1)|s6〉|2 ≈ 0.1181 (A9)

The success probability decreases a little bit, but stilloutperforms the classical case. The expected depth is:

d(S6,4(1))

P6,4(1)≈ 660 (A10)

The circuit is 38% shorter than one G6 iteration.The expected depth is 29% lower. Local diffusion op-erator may decrease the success probability, but it savesdepth.

2. Two-oracle algorithm

We can apply same strategy for two-iteration search algo-rithm: design circuit with local diffusion operators and findthe optimal one with least expected depth. We can also designtwo-stage quantum search algorithm. And each stage we usetwo oracles.

• Grover’s algorithm. Two iterations Grover’s algorithmgives:

|0〉 H

G6 G6

|0〉 H

|0〉 H

|0〉 H

|0〉 H

|0〉 H

The whole circuit has depth

d(G26) = 252 (A11)

The success probability of finding the target state is

P6(2) = |〈t|G26|s6〉|2 ≈ 0.3439 (A12)

And the expected depth is

d(G26)

P6(2)≈ 733 (A13)

• Our two-stage search algorithm. We divide the targetstate into two parts: |t1〉 and |t2〉. Here t1 is two-bitlong and t2 is four-bit long. Accordingly, we can de-sign the search algorithm which has two stages: thefirst stage finds |t1〉 and the second stage finds |t2〉. Ineach stage, we only have two Grover operators (local orglobal Grover operators).

The first stage has the sequence S(1)6,4(1, 1, 0) = G4G6.

We have the circuit diagram:

|0〉 H

Ut D6 Ut

|0〉 H

|0〉 H

D4

|0〉 H

|0〉 H

|0〉 H

G6 G4

We only measure the qubit which does not haveD4 (de-fined in G4) performed. The probability of finding |t1〉is P (1)

6,4 (1, 1, 0):

P(1)6,4 (1, 1, 0) ≈ 0.5604 (A14)

The first stage circuit has depth

d(S(1)6,4(1, 1, 0)) = 204 (A15)

Page 11: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

11

TABLE I. Estimated MED of Grover’s algorithm, based on α = 1. Number α (defined in (11)) is the ratio between oracle depth and diffusionoperator depth. Diffusion operators Dn have depth d(Dn) = {16, 32, 64, 123, 163, 203, 243} with n = 4, 5, . . . , 10, which comes from thedecomposition of n-qubit Toffoli gate [27]. Single-run depth is the depth of optimal sequence (without considering the success probability).The MED dG(α = 1) is defined in Eq. (12). The notation Sn(j, 0) means Gj

n.

n Optimal sequence Success probability Single-run depth dG(1)

4 S4(1, 0) 0.473 30 63.475 S5(2, 0) 0.602 124 205.836 S6(4, 0) 0.816 504 617.367 S7(6, 0) 0.833 1464 1756.358 S8(9, 0) 0.861 2916 3388.039 S9(12, 0) 0.798 4848 6071.76

10 S10(18, 0) 0.838 8712 10397.28

TABLE II. MED of one-stage search algorithm optimized by local diffusion operators, based on α = 1. The MED d1(α = 1) is definedin Eq. (17). The depth of diffusion operator is d(Dn) = {8, 16, 32, 64, 123, 163, 203, 243} with n = 3, 4, . . . , 10. The sequence notationmeans Sn,m(j1, j2, . . . , jq) = G

jqn G

jq−1m · · ·Gj2

n Gj1m , see (14). And jq is always the number of local diffusion operator.

n Optimal sequence Success probability Single-run depth d1(1)

4 S4,3(1, 1) 0.821 52 63.325 S5,4(1, 1, 1) 0.849 154 181.486 S6,4(1, 1, 2) 0.755 360 476.977 S7,4(1, 1, 2, 1, 2) 0.887 1173 1322.758 S8,4(1, 1, 2, 1, 2, 1, 2) 0.875 2211 2527.439 S9,5(1, 1, 2, 1, 2, 1, 2, 1, 2) 0.831 3713 4470.20

10 S10,5(1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2) 0.847 6453 7614.56

TABLE III. MED of two-stage search algorithm, based on α = 1. The MED d2(α = 1) is defined in (26). The depth of diffusion operator isd(Dn) = {4, 8, 16, 32, 64, 123, 163, 203, 243} with n = 2, 3, 4, . . . , 10.

n Optimal sequence Success probability Single-run depth d2(1)

Stage 1 Stage 2 Stage 1 Stage 2 Stage 1 Stage 2

4 S4,2(1, 1) S2(1, 0) 0.953 1 48 18 69.255 S5,2(1, 1) S2(1, 0) 0.658 1 96 34 197.516 S6,2(1, 1, 1, 1) S2(1, 0) 0.791 1 384 66 569.227 S7,4(1, 4) S4(2, 0) 0.739 0.908 792 274 1587.098 S8,5(1, 4, 1, 2) S5,4(1, 1, 2) 0.882 0.998 1806 724 2876.409 S9,5(1, 4, 1, 3, 1, 3) S5,4(1, 1, 2) 0.906 0.998 3542 884 4898.88

10 S10,5(1, 4, 1, 3, 1, 3, 1, 3) S5,4(1, 1, 2) 0.810 0.998 5485 1044 8081.89

TABLE IV. Numerical values for critical ratios αc,1 in (31) and αc,2 in (48). The results are based on the linear scale depth of diffusionoperator d(Dn), see [27]. Theorem 1 shows that αc,1 scales asO(n−12n/2). Theorem 2 shows that αc,2 approaches to 1 +

√3 whenN = 2n

is very large.

n 4 5 6 7 8 9 10

αc,1 2.07 4.64 14.65 29.45 32.88 45.95 83.97αc,2 NA 1.21 1.53 1.76 2.00 2.17 2.28

Page 12: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

12

In first stage, suppose that the two classical measure-ment bits are b1 and b2 (b1, b2 ∈ {0, 1}). We can notverify the partial bits b1 and b2. Since P6,4(1, 1, 0) >1/2, the majority vote can be applied.

In second stage, we choose the sequence:

S(2)4 (2, 0) = G2

4 (A16)

And we have the circuit:

|0〉 Xb1

Ut Ut

|0〉 Xb2

|0〉 H

D4 D4

|0〉 H

|0〉 H

|0〉 H

G4 G4

The initial state is rescaled database. For example, thefirst stage we find |01〉 state, then we prepare the in-put |01〉 ⊗ H⊗4|0〉⊗4. The probability finding |t2〉 isP

(2)4 (2, 0):

P(2)4 (2, 0) ≈ 0.9084 (A17)

The second-stage circuit has depth

d(S(2)4 (2, 0)) = 156 (A18)

We have the expected depth

d(S(1)6,4(1, 1, 0)) + d(S

(2)4 (2, 0))

P(1)6,4 (1, 1, 0)P

(2)4 (2, 0)

≈ 707 (A19)

The expected depth is still 4.50% lower than twoiteration Grover’s algorithm. And first stage has19.05% shorter depth and second stage has 38.10%shorter depth. Besides, the two-stage strategy is sub-jected to half less errors from measurements.

Appendix B: Optimal sequences based on α = 1

We present detailed numerical results plotted in FIG. 2.Suppose that we have quantum computers equipped with ar-bitrary single-qubit gates and arbitrary controlled two-qubitgates. It is well-known that n-qubit Toffoli gate Λn−1(X)can be linearly decomposed into basic operators with one an-cilla qubit [27]. We set the depth of n-qubit Toffoli gateas d(Λn−1(X)) = {1, 5, 13, 29, 61, 120, 160, 200, 240} withn = 2, 3, . . . , 10, see [27]. Then the depth of diffusion opera-tor Dn (4) is:

d(Dn) = d(Λn−1(X)) + 2 (B1)See FIG. 1. The depth of oracleUt is characterized by the ratioα = d(Ut)/d(Dn). Ratio α is defined in (11). As an exam-ple, we set α = 1. The ratio α = 1 implies the simplest oracleconstruction, see [7]. We list the optimal strategy (with MED)of Grover’s algorithm (n = 4, 5, . . . , 10) in TABLE I. WhenN = 2n is large, the optimized iteration number in Grover’salgorithm converges to b0.583

√Nc. And the success proba-

bility converges to 0.844. The results are independent with α,see dG(α) (13).

We numerically find the optimal sequence (optimised bylocal diffusion operator). Similarly, we set α = 1. The MEDis given by d1(α = 1), see (17). The results are listed inTABLE II. We also numerically find the optimal sequence fortwo-stage search algorithm. The MED is given by d2(α =1), see (26). The results are listed in TABLE III. In general,different values α will give different optimal sequences. It isclearly that both the single-run depth (depth of the optimalsequence) and expected depth in TABLE II and III are smallerthan the Grover’s algorithm (TABLE I). In practice, once α isknown, one can guess the optimal sequence based on resultswith small n. For example, when n is large, the sequence isclosed to (assume that n is even)

Sn,n/2(1, 1, 2, · · · , 1, 2, 1, 2) = Gn/2GnG2n/2 · · ·GnG2

n/2

(B2)See TABLE II. The repetition number of GnG2

n/2 can befound either by numerical or analytical ways.

Appendix C: Examples on Critical Ratios

The ratio α defined in (11) is important parameter. Ifα → ∞, Grover’s algorithm is optimal in depth. Critical ra-tios αc,1 in (31) and αc,2 in (48) are threshold values. Be-low αc,1 (or αc,2), we can find lower expected depth thanGrover’s algorithm. Diffusion operator d(Dn) is single-qubitgate equivalent with n-qubit Toffoli gate Λn−1(X) gate. Wecan set d(Λn−1(X)) = {1, 5, 13, 29, 61, 120, 160, 200, 240}with n = 2, 3, . . . , 10, see [27]. Based on the depth optimiza-tion method defined in Sec. III B and III C, we find the criticalratios αc,1 and αc,2 in TABLE IV.

[1] M. A. Nielsen and I. L. Chuang, Quantum computation andquantum information (2010).

[2] C. H. Bennett, E. Bernstein, G. Brassard, and U. Vazirani,SIAM journal on Computing 26, 1510 (1997).

Page 13: arXiv:1908.04171v1 [quant-ph] 12 Aug 2019arXiv:1908.04171v1 [quant-ph] 12 Aug 2019 Low depth quantum search algorithm Kun Zhang1 and Vladimir E. Korepin2 1Department of Chemistry,

13

[3] L. K. Grover, Physical Review Letters 79, 325 (1997).[4] P. R. Giri and V. E. Korepin, Quantum Information Processing

16, 315 (2017).[5] R. Barends, J. Kelly, A. Megrant, A. Veitia, D. Sank, E. Jeffrey,

T. C. White, J. Mutus, A. G. Fowler, B. Campbell, et al., Nature508, 500 (2014).

[6] C. Ballance, T. Harty, N. Linke, M. Sepiol, and D. Lucas, Phys-ical Review Letters 117, 060504 (2016).

[7] C. Figgatt, D. Maslov, K. Landsman, N. M. Linke, S. Debnath,and C. Monroe, Nature Communications 8, 1918 (2017).

[8] F. Arute, K. Arya, R. Babbush, D. Bacon, J. C. Bardin,R. Barends, R. Biswas, S. Boixo, F. G. Brandao, D. A. Buell,et al., Nature 574, 505 (2019).

[9] J. Preskill, Quantum 2, 79 (2018).[10] A. W. Cross, L. S. Bishop, S. Sheldon, P. D. Nation, and J. M.

Gambetta, Physical Review A 100, 032328 (2019).[11] L. K. Grover, Physical Review Letters 80, 4329 (1998).[12] G. Brassard, P. Hoyer, M. Mosca, and A. Tapp, Contemporary

Mathematics 305, 53 (2002).[13] A. Tulsi, Physical Review A 86, 042331 (2012).[14] A. Tulsi, Physical Review A 91, 052307 (2015).[15] P. Kim, D. Han, and K. C. Jeong, Quantum Information Pro-

cessing 17, 339 (2018).[16] S. Jaques, M. Naehrig, M. Roetteler, and F. Virdia, arXiv

preprint arXiv:1910.01700 (2019).[17] M. Boyer, G. Brassard, P. Høyer, and A. Tapp, Fortschritte der

Physik: Progress of Physics 46, 493 (1998).[18] C. Zalka, Physical Review A 60, 2746 (1999).[19] G. Kato, Physical Review A 72, 032319 (2005).[20] Z. Jiang, E. G. Rieffel, and Z. Wang, Physical Review A 95,

062317 (2017).[21] L. K. Grover and J. Radhakrishnan, in Proceedings of the sev-

enteenth annual ACM symposium on Parallelism in algorithms

and architectures (ACM, 2005) pp. 186–194.[22] V. E. Korepin and L. K. Grover, Quantum Information Process-

ing 5, 5 (2006).[23] V. E. Korepin, Journal of Physics A: Mathematical and General

38, L731 (2005).[24] V. E. Korepin and J. Liao, Quantum Information Processing 5,

209 (2006).[25] M. E. Morales, T. Tlyachev, and J. Biamonte, Physical Review

A 98, 062333 (2018).[26] T. J. Yoder, G. H. Low, and I. L. Chuang, Physical Review Let-

ters 113, 210501 (2014).[27] A. Barenco, C. H. Bennett, R. Cleve, D. P. DiVincenzo, N. Mar-

golus, P. Shor, T. Sleator, J. A. Smolin, and H. Weinfurter, Phys-ical Review A 52, 3457 (1995).

[28] Y. He, M.-X. Luo, E. Zhang, H.-K. Wang, and X.-F. Wang, In-ternational Journal of Theoretical Physics 56, 2350 (2017).

[29] P. Gokhale, J. M. Baker, C. Duckering, N. C. Brown, K. R.Brown, and F. T. Chong, arXiv preprint arXiv:1905.10481(2019).

[30] R. M. Gingrich, C. P. Williams, and N. J. Cerf, Physical ReviewA 61, 052313 (2000).

[31] V. E. Korepin and B. C. Vallilo, Progress of theoretical physics116, 783 (2006).

[32] B.-S. Choi and V. E. Korepin, Quantum Information Processing6, 243 (2007).

[33] K. Zhang and V. Korepin, Quantum Information Processing 17,143 (2018).

[34] V. E. Korepin and Y. Xu, International Journal of ModernPhysics B 21, 5187 (2007).

[35] Z. Diao, Physical Review A 82, 044301 (2010).