<<

arXiv:1606.04315v2 [quant-ph] 10 Dec 2016 o-ntr arxbtsmhwcoet ntr ma- unitary a i.e., to close unitary: somehow almost but be matrix are to non-unitary which a proven matrices is for amplification also version working amplitude a modified repeat slightly oblivious for as A [11] the named topic). of Ref. also the see of is (please overview 10] it broad [9, amplification contexts, algorithm amplitude different success untill In oblivious pro- the amplification 8]. as the [7, of named type to is This input cess the register. of system independently be system cir- the can ancilla quantum amplification the amplitude based on the done ancilla that based shown of ancilla is types it more cuits, certain or In two diffi- combine circuits. makes sequentially amplification to amplitude input cult stan- the the the However, small of using the [4–6]. dependence by cases, amplification remedied most amplitude In be dard can register. probability ancilla success with success the substantially of the diminish size [1–3]), the circuits measure- (e.g., these or in circuits ancilla probability quantum using by based the dynamics ment mechanics. in unitary emulated quantum of be standard scope can the dynamics non-unitary of described Although formalism gates, quantum the i.e. in operators, evolution time ∗ lokona ne akn mi:[email protected] email: Daskin. Anmer as known also unu optr ucinb sn h unitary the using by function computers Quantum .ITOUTO N BACKGROUND AND INTRODUCTION I. nAclaBsdQatmSmlto rmwr o Non-Unit for Framework Simulation Quantum Based Ancilla An fteapicto nywrswe h osdrdsse is system considered unitary. anc the a more when to or works two close only combine amplification sequentially the to indepen of us runs allows amplification This new amplitude A ister. oblivious circuits. amplitud the based the as ancilla known of more or dependence two combine input quentially the process, amplification fqbt osse nteacla lhuhteprobabilit the Although ancilla. the in consisted of n h dlt ftefia tt smsl ihadaon 0.9 matr implement around computers. efficiently and quantum to on high us products lead mostly ancill matrix may such is This two combining state implemented. that be final show p the and amplified analysis of final complexity the fidelity size, the simulations system the and Numerical of independent stat that presented. final show the is of fidelity ancill process the for an amplification bound using lower dista non-uni a by the a matrix, Measuring matrix unitary extend amplification. extended to amplitude the oblivious how employ the show maximi then We we is probability particular, matrix. success In the which amplification. in circuits quantum eateto optrEgneig sablMdnytUn Medeniyet Istanbul Engineering, Computer of Department h ucs rbblt na nil ae ici general circuit based ancilla an in probability success The nti ae,w rsn eea rmwr osmlt non simulate to framework general a present we paper, this In eateto hmsr,Dprmn fPyisadBrkNa Birck and Physics of Department Chemistry, of Department aa niomn n nryRsac nttt,HK,Doh HBKU, Institute, Research Energy and Environment Qatar udeUiest,Ws aaet,I,UAand USA IN, Lafayette, West University, Purdue ma Daskin Ammar ar Kais Sabre ( [12]. trix cie o ocmlt o-ntr arxt uni- a to matrix de- non-unitary is a it first, complete section, to next how the scribed In for readers. introduced unfamiliar this are the amplification in amplitude considered the circuits and paper based ancilla the subsections, products. matrix matrix infinite implement as efficiently represented to us functions circuits. lead based may ancilla it comput- two Therefore, quantum combining on sequentially mostly by matrices implement is ers non-unitary to state of possible final makes product This the a generally 0.95. of around fidelity are and the high probabilities and amplified 0.75 sys- final the around the of independent of size, that found matrices tem is random it and for sizes matrix. done different unitary are closest the simulations to obtained Numerical matrix state distance approximate the final the measuring the of by of process fidelity amplification the the from for bound present lower also We a maximized amplification. is amplitude ancilla probability oblivious the success the by the on where processed circuit type be based this can that matrices show we approximate addition, of ma- In this produced unitary. approximate the almost that to is way trix how a show in matrix we formation the matrix paper, unitary of this nu- size In is the matrix large. when a is cir- problem of difficult quantum root a based square merically ancilla the an finding However, on cuit. processed be then can I emta matrix, Hermitian A hsppri raie sflos ntefloigtwo following the In follows: as organized is paper This sa dniymti)t omauiaymti which matrix unitary a form to matrix) identity an is a eapie hog h amplitude the through amplified be can y ∗ c ftepoue arxt h closest the to matrix produced the of nce ydcessepnnilyi h number the in exponentially decreases ly bandfo h biiu amplitude oblivious the from obtained e o admmtie fdffrn sizes different of matrices random for ae icis arxpoutcan product matrix a circuits, based a etyo h nu otesse reg- system the to input the of dently eso fteapiueamplification amplitude the of version labsdcrut.Hwvr hstype this However, circuits. based illa e yuigteolvosamplitude oblivious the using by zed mlfiainmksdffiutt se- to difficult makes amplification e oaiiisaegnrlyaon 0.75 around generally are robabilities ntr rnnuiaybtsomehow but non-unitary or unitary vriy aio,Itnu,Turkey Istanbul, Kadikoy, iversity, uiaypoesso nil based ancilla on processes -unitary xfntosrpeetda infinite as represented functions ix aymti oa lotunitary almost an to matrix tary ae ici einaogwith along design circuit based a .Frhroe edsusthe discuss we Furthermore, 5. oehooyCenter, notechnology A ,Qatar a, a eue ln with along used be can , r Matrices ary √ I − A A Ancilla Based Quantum Circuits I INTRODUCTION AND BACKGROUND tary matrix and then how to approximate it. Then, the numerical examples and the circuit design used in the ex- | amples are shown. In Sec.III, the algorithmic complexity |0i H · · · • of the whole framework is analysed and its possible use {z . . . K . . . in the matrix product and matrix functions is discussed. Ancilla |0i H · · · • Finally, the paper is concluded with the summary of the } results. | · · · {z U0 UM−1

} · · · System A. Ancilla Based Quantum Circuits FIG. 1: The circuit representation of . U It is well-known that using an ancilla register eases the complexity in the implementation of quantum gates (e.g. see [13, 14]). A particular type of ancilla based circuits can be employed to emulate the action of A with U 1 can be described for the matrices represented as a sum the success probability : If we apply to the input M U of unitary matrices [12, 15]: Consider a unitary matrix, 0 in ; in the output, for the states in which the ancilla | i| i A, which is of dimension N = 2n and represented as a is equal to 0 , the circuit gives the action of A on the | i sum of unitary processes, Uis: system register, A in . Since A in is normalized by the coefficient 1 ,| thei probability toU see the ancilla in √M M 1 0 1 − is M . A = Ui. (1) | i M 1 − Xi=0 This can be also generalized to A = i=0 kiUi by using an operator K whose first row andP column are A quantum operation can be described as a matrix vector equal to the coefficients k0,...,kM 1 (Note that the co- − transformation: For instance, let in represent a general efficients are assumed to be normalized.): input state. The application of A|oni this input state can M 1 be described as A in . The result of this transformation m 1 =0− kiUi J1 | i = (H⊗ I)V (K I)= i . can be obtained on an ancillary based circuit consisting of U ⊗ ⊗ √M P J2 J3 an ancilla and a system registers by using Uis. One way of (4) doing this with an acilla register composed of m = logM K can be considered as a Householder transformation qubits can be described as follows: for the vector k = (k0,...,kM 1): i.e., K k = 0 and K 0 = k . Theh | circuit representing− is drawn| i in| Fig.i 1. First, all Uis are aligned on the system register com- | i | i U • posed of n qubits.

Then, the application of each Ui is controlled by • the ancilla register. Here, the control scheme is B. Amplitude Amplification determined from the binary representation of i in a way that Ui is applied when the ancilla is in i As derived from Eq.(4), the success probability of emu- | i state. Here, i is the ith vector in the standard lating the unitary matrix A by the circuit, , is 1 . The | i M basis. This circuit can be represented in matrix probability depends on the size of the ancillaU and de- form by a block diagonal matrix, V : creases exponentially in the number of qubits contained in the ancilla. This can be increased upto one by the U0 application of the amplitude amplification, which is the . V =  ..  . (2) main part of the famous Grover’s search algorithm [4] finding a solution encoded in a quantum state.  UM 1  −  The amplitude amplification is described as follows [5, 6, 16]: Let the state ψ be defined as the linear combi- The initial state of the ancilla register is assumed to nation of the standard basis| i resulted from the application • 0 be state. Then, it is put into the superposition of the operator B to an initial zero state: state| i by the application of a series of Hadamard m gates, H⊗ . Thus, the whole circuit in matrix form N 1 − becomes equal to the following: ψ = B 0 = bx x , (5) | i | i | i xX=0 1 M 1 m i=0− Ui J1 = (H⊗ I)V = , (3) x U ⊗ √M P J2 J3 where bx is the amplitude of the xth vector, , in the standard basis. Let also some states in ψ be considered| i | i where I is the identity matrix and J1,J2, and J3 as the “good” states represented by the set Xgood, and represent the other parts of . the remaining states be the “bad” states represented by U

2 B Amplitude Amplification II APPLICATION IN THE CASE A IS NON-UNITARY

Xbad: Since the good states are the ones where the ancilla reg- ister equal to zero, the normalized βgood reads the fol- | i ψ = bx x + bx x . (6) lowing: | i | i | i x XXgood x XXbad ∈ ∈ N 1 The re-normalizations of X and X form a new − good bad βgood = 0 βx x , (14) | i | i | i two dimensional basis set ψgood , ψbad . ψ can be xX=0 rewritten in this new basis{| with coefficientsi | i} represented| i by sin(θ) and cos(θ) with θ [0,π/2]: where x is the xth vector in the standard basis. ∈ | i It is shown that the amplitude amplification can be ψ = sin(θ) ψgood + cos(θ) ψbad . (7) | i | i | i done on the first register by using the following search Here, sin(θ)2 = P = b 2, and cos(θ)2 = iterate [7, 8, 12]. good x Xgood x ∈ | | P = b 2. P bad x Xbad x ∈ | | Q = S S, (15) In theP amplitude amplification algorithm, the ampli- −U U tude of ψgood is amplified by using the following search | i iterate: where S is considered in place of Uf and has the same effect as U0⊥ in the iteration: Q = Uψ⊥Uf . (8) m n S = I⊗ 2 0 0 I⊗ . (16) Here, when applied to ψ , Uf negates the sign of ψgood | i | i  − | i h | ⊗ and does nothing to ψbad : | i The main difference of this iteration from the standard Uf ψ = sin(θ) ψgood + cos(θ) ψbad . (9) | i − | i | i amplitude amplification is the independence from the in- put to the system register: does not include the input When ψ is known, U can be easily constructed in good f preparation operator whichU converts a zero state into the matrix| formi as follows: desired input.

Uf = I 2 ψgood ψgood . (10) Since the amplitude of the good states is 1/√M; Q − | i h | π is applied exactly 4 √M number of times to maximize The other operator in the search iterate is Uψ⊥ de- j k the amplitude of βgood . scribed in matrix form as: | i 1 U ⊥ =2 ψ ψ I = BU ⊥B− , (11) ψ | i h |− 0 II. APPLICATION IN THE CASE A IS where U0⊥ = (2 0 0 I) is the reflection about the axis | i h |− 1 NON-UNITARY orthogonal to 0 , and B− is the inverse of the matrix | i 1 B. When B is unitary, B− is equal to the conjugate transpose of B, B†. When A is non-unitary; the expected output from the It is easy to prove that when Q is applied k number of circuit can no longer be described by the fixed am- U times to ψ , the final state ends up in the following: plitudes given in Eq.(13) since it changes based on the | i input state to the system. This necessitates the inclu- k Q ψ = sin ((2k + 1)θ) ψgood + cos((2k + 1)θ) ψbad . sion of the input preparation in the operator U of the | i | i | i ψ⊥ (12) standard amplitude amplification: From the above equation, the highest probability for the 2 good states, sin ((2k + 1)θ) , can be obtained when (2k+ m m Uψ⊥ = (I⊗ Ain)U0⊥(I⊗ Ain)† †, (17) 1)θ π . This leads O( π ) as a bound for k. U ⊗ ⊗ U ≈ 2 4θ where Ain converts the zero state into the desired input state. To reach the maximum amplitude, in this case, Q 1. Application to U and Oblivious Amplitude Amplification π √ needs to be applied 4η M number of times, where η j k In the circuit given in Fig.1, the good and the bad is the norm of the expected output state produced from U UUin 0 . Since η is not known, one can apply quan- states are already known: the set of good states are those || | i || where the ancilla is in 0 state and the rest is the tum search algorithm [16]. In that case, the first register set of the bad states. Therefore,| i the iteration operator is partially measured: If it is zero, then the algorithm is used in the amplitude amplification can be determined. stopped. Otherwise, the iteration operator Q is applied Let β be the output state of . β can be written in again. terms of| i the combination of the goodU | andi the bad states: In the following subsections, we shall show how to ex- tend A to a unitary matrix in order to avoid input de- 1 √M 1 pendence in the amplitude amplification and successfully β = βgood + − βbad . (13) | i √M | i √M | i apply the oblivious amplitude amplification.

3 A Extending A toaUnitaryMatrix II APPLICATIONINTHECASE A IS NON-UNITARY

A. Extending A to a Unitary Matrix When the eigendecomposition of A is not available (be- cause of the computational complexity, this may be the It is known that every Hermitian positive definite ma- case when the system size of A is large), we shall try to trix has a unique Hermitian positive definite square root estimate U and process the estimated non-unitary on the which can be numerically computed via Schur decom- ancilla based circuit described in the previous section. position [17, 18]. Using the square root of (I A2), a non-unitary Hermitian matrix, A, can be extended− to a U unitary, U, as in the following form: 2. Estimation of A √I A2 U = − . (18) From now on, we assume that A is a real symmetric √I A2 A  matrix. Then, we normalize the matrix A as A = A with − − µ 2 It is not difficult to see that U is a unitary matrix: UU † = µ = maxi j Aij . This makes 2-norms of the columns n+1 U †U = I⊗ . This can be seen easier when U is written of theq matrixP less than or equal to 1. Then, instead of in the cosine-sine decomposition as: the matrix in Eq.(18), we construct the following matrix: 2 A √I A R 0 C S R† 0 AD U = 2 − = , √I A A   0 R S C  0 R† U = , (21) − D A − − (19) − where the eigendecomposition of A is described by A = where D is a diagonal matrix described by the diagonal 2 RCR†, and C and S are the diagonal matrices with the entries Dii = 1 j Aij . The matrix U is not a uni- diagonal elements cosine and sine of the eigenvalues of q − tary matrix; however,PA2 + D2 and so UU = U U = U 2 the matrix A. Note that this cosine-sine decomposition † † have diagonal elements equal to one. In addition, since can also be used to generate a for U in A is normalized with µ; ρ(A2) ρ(A) 1, where ρ(A) terms of single and two qubit gates [19–21]. is the spectral radius (the largest≤ eigenvalue)≤ of A. In particular cases such as ρ(A) < 1 or a diagonally dom- 2 1. Simulation of U inant A, the off-diagonal entries of A are likely to be small, and so one can expect the matrix U to be close to a unitary since A2 + D2 becomes close to an identity √ 2 Computation of I A requires the eigendecompo- matrix. sition of I A2. Since− the eigenvalues of √I A2 and − − We shall describe the closeness of U to a unitary matrix A are related as cosine and sine of some values, the via polar decomposition which is known to produce the eigendecomposition of A is enough to form the matrix closest unitary matrix to a given arbitrary matrix (e.g. √I A2. Eigendecomposition of a matrix can be found see [23]): In the polar decomposition, U = UH, while U through− numerical methods such as power iterations and is the closest unitary to U, H is an Hermitian positive QR method. For a Hermitian matrix whose size is rea- e e e definite matrix. We define the following as a measure of sonable for classical computers, obtaining a kind of ap- e proximate decomposition is feasible in general. However, the closeness of the estimated unitary U to U: when the system size is huge, this problem becomes a U U 2 H I 2 e very heavy computational task for the classical comput- c = || − || = || − || , (22) U 2 H 2 ers so that, in some cases, decomposition may be impos- || ||e e|| || sible (note that the computational complexity in terms where . represents the norm of ae matrix. Also note of the system size is generally O(N 3).)[22]. || || that a similar measure, U U , is used by Berry et al. Therefore, when the computation of the eigendecom- as an error bound in the|| modified− || version of the oblivious position of A is available; one can use the matrix A on amplitude amplification [12]. Toe bound the value of c, we quantum computers as follows: In the circuit for U, the will use the Frobenius norm: . F , which is also invariant initial state of the first qubit is always set to 0 . Thus, || || | i under unitary transformations. Thus, H F = U F = we apply U to an initial state input = 0 in , where in || || || || | i | i| i | i 2 represents the initial input desired to be applied to A. trace(UU †) = trace(H ) = √2N.e In addition, we This generates the following output vector: p q can represent the term He I F as follows: A in || − || output = 2 | i (20) 2e | i √I A in  H I F = trace(H 2H + I) − | i || − || q − To the above vector, if we apply the operator P = e = trace(He 2) tracee (2H)+ trace(I)) (23) ( 0 0 In), then the system collapses to the state A in . q − | i h |⊗ | i Therefore, at the end of circuit U input , the probability = 4N tracee (2H)= √e4N Φ. to see the first qubit in zero state,| determinesi the suc- q − − cess probability of the simulation done by the following From the generalized mean equality;e since the trace is process. the sum of eigenvalues, the following inequality holds:

4 B NumericalExamples II APPLICATIONINTHECASE A IS NON-UNITARY

1 1 2 parts: First, the ancilla register is put into the superpo- 2 trace(H) 2 trace(H ). As a consequence of N ≤ q N sition state, then the following matrix V similar to the this, Φ = etrace(2H) 4N ande so √4N Φ 2N. This one in Eq.(2) is used: makes c in terms of the≤ Frobenius norms− always≤ less than e u11 u12 u1N or equal to one. When Φ = 4N, c becomes zero and so ...··· •• • the matrix can be considered a unitary matrix. Note that . . . .  . . .. .  one can also try to maximize c for different choices of A. ...  •• • u21 u22 ... u2N  In the numerical examples, we shall compute c by us-  ...   ••. . . •.  ing 2-norms of the matrices instead of the Frobenious V =  . . .. .  ,  ...  norms: Since the error also depends on the input state,  •• •   .  the 2-norm obtained from the maximum eigenvalue likely  ..   uN1 uN2 ... uNN  gives a better approximation for the possible maximum  ...  error. Furthermore, we shall use the following as an esti-  ••. . . •.   . . .. .  mate lower bound for the fidelity of the output after the  . . .   ...  oblivious amplitude amplification algorithm: •• (25)• where uij s are the matrix elements of U, and each “ ” 2 • ef = 1 c . (24) represents a matrix element which plays no significant | − | role in the description. If this matrix is applied to a The estimated fidelity would be one for the unitary ma- quantum state in which the ancilla is in the superposition trices. And it would be small when the closeness between state, the desired output is obtained in the states where U and U is small. the system register is in 0 state: | i When U is non-unitary, it cannot be used directly on β0 quantume computers. Berry et al.[12] have proved that a  .  slightly modified version of the oblivious amplitude am- . M 1 plification works also for any arbitrary non-unitary ma-  βi  1 − x 1   trix which is close to a unitary matrix. Therefore, since V ( input )=  .  . (26) √M | i | i √M  .  the constructed matrix in Eq.21 is expected to be close to xX=0   a unitary matrix, the modified oblivious amplitude am- βN 1  −   .  plification can be used for the simulation of this matrix  .  in the ancilla based circuit. However, in the next sec-   tion, the numerical results for the randomly generated Obviously, when we swap the ancilla and the system reg- matrices show that one can use the oblivious amplitude ister, we obtain the same output as in Eq.(13) with the amplification given in Eq.(15) without modification for good states in Eq.(14) (Note that here M = N.). As a the matrices generated by (21). Note that the modified consequence, the same amplitude amplification given in version of the oblivious amplitude amplification would Eq.(15) can be applied to increase the probability upto give better results; however, it requires a projection op- one. erator. Having a non-unitary U does not change the circuit de- sign. However, it changes the success probability given in the above equation. When U is close to a unitary ma- B. Numerical Examples trix, we can apply the oblivious amplitude amplification in Eq.(15) (One can also use the modified version of the oblivious amplitude amplification given in Ref.[12]). In the numerical examples, we shall use the standard oblivious amplitude amplification given in Eq.(15) along with the circuit design method described in Ref.[15]. The 2. Numerical Examples circuit design method is only included for the complete- ness. One can also run simulations by generating random matrices in the form Eq.(21) and then writing each one In the numerical examples, the oblivious amplitude of them as a direct sum of M unitary matrices. amplification given in Eq.(15) is applied to the non- unitary matrices constructed in the form given in Eq.(21). The following method is used to generate ran- dom symmetric matrices: 1. General Circuit Designs An N N symmetric random matrix, A, with the • elements× in [ 1, 1] is generated. An ancilla-based quantum circuit design technique is − introduced in Ref. [15]. A 2n-qubit system is employed 2 to emulate a general n-qubit quantum operation,U U. The Then, A is normalized by µ = maxi j Aij . • q primary intuition of the technique is based on generating P Then, the diagonal matrix D is obtained: Dii = the matrix-vector product result of a quantum operation • 1 A2 . inside the new system. This intuition is conveyed in two − j ij q P 5 B Numerical Examples III DISCUSSION

Then, the matrices A and D are used to construct on the figures. As seen in the figure: the fidelities in all • 2N 2N matrix U. figures remain high for a few iterations, but then start × gradually decreasing while the probabilities are rising. In addition, we also generate random input state to U When the probabilities reach their maximums either at in the form: input = ( 0 in ), where in is a random | i | i⊗| i | i the kth iteration or before that; the fidelities go down to quantum state with real coefficients. around 0.95. We have run the simulations for 100 random cases with As a general observation, we can see that the numerical U of orders N = 16, N = 32, N = 64, and N = 128 (Note results presented in Fig.2, Fig.3, and Fig.4 remain mostly that the total system sizes with the ancilla register be- similar despite the change in the system size. This indi- comes (28 28), (210 210), (212 212) and (214 214), cates the independence of the results from the system respectively.).× For each× random× case, the estimated× fi- size. delity given in Eq.(24) has been computed as follows: First, to find the polar decomposition of U, the • singular value decomposition of U is computed: III. DISCUSSION U = V1EV2†, where E represents the singular val- ues and V1 and V2 are the right and left singular 3. The Total Circuit Complexity vectors.

Then, the closest unitary is computed from U = Quantum circuit design methods can be broadly cat- • V1V †. egorized into stochastic and non-stochastic approaches 2 e [24]. In terms of stochastic approaches, generally genetic Then, c given in Eq.(22) is computed by using the • and evolutionary algorithms are used to obtain a circuit 2-norms of the matrices. which minimizes an optimization function measuring the Finally, the estimated fidelity is computed from closeness of the found circuit to the given operator (e.g. • Eq.(24). [25]). Note that instead of designing a quantum circuit implementing a specific matrix, one can also consider the In the amplitude amplification process, the amplitudes quantum control approach using optimization to find a of the first N states-i.e., the states where the first regis- way to implement the operator directly, without gates( ter is in 0 -are used to compute the success probability. e.g. [26]). This can also be done for non-unitary pro- | i Furthermore, the estimated fidelity is compared with the cesses. On the other hand, non-stochastic deterministic real fidelity which is the inner product of the collapsed methods are generally based on matrix decomposition quantum state (the first N amplitudes) and the vector techniques: for instance, methods based on the Cartan (A in ). decomposition [27], the cosine-sine decomposition [21], | i In Fig.2, both U and in are generated randomly. And the QR decomposition [28] are presented. It is shown | i from the last iteration of the oblivious amplitude ampli- that a circuit for a general unitary matrix requires at 2n 2 fication (the state in which the success probability is the least (2 − 3n/4 1/4) number of two-qubit quantum highest), the fidelity and probability are computed for gates [21]. − − each case. As can be observed in the figure, the mean The combination of the circuits for each Ui forms a value of the observed fidelities is 0.9462 and the mean binary coded network controlled by the ancilla register. value of the observed success probabilities is 0.7666. These types of networks can be decomposed into single Furthermore, in Fig.3, the same matrix U is tested in and two qubit quantum gates by using a simple decom- the amplitude amplification with different input states in position technique described in Ref.[20]. The decompo- order to observe the effect of the change in the input state sitions of the networks for the circuit design in Ref. [15] on the fidelity and the validity of the estimated fidelity. yield a circuit with O(N 2 N) number of CNOT gates Fig.3 shows that the fidelity remains high and is always if M = N (For the complete− complexity analyses, please above the estimated fidelity (the mean of fidelities in all refer to Ref.[15].). Therefore, the quantum complexity of subfigures is 0.9426). Therefore, the proposed estimated the circuit is O(N 2 N). The amplitude amplifica- U − fidelity may provide a good lower bound for the fidelity. tion requires O(√N) repetitions which makes the total As in Fig.2, the mean value of the success probabilities complexity O(√MN 2 √MN). here also remain as 0.7601. − If each U can be efficiently simulatable: i.e. each In Fig.4, we also present the change of the fidelity and i requires only O(poly(n)) gates; the total circuit com- the probability in the iterations of the oblivious ampli- plexity for can be bounded by O(poly(n)M): Since tude amplification for random cases with the matrices there wouldU be O(poly(n)) number of quantum gates for of the same orders: N = 16, N = 32, N = 64, and each U , they are likely to compose O(poly(n)) num- N = 128. The required number of iterations for each i ber of binary coded networks. The decomposition of π √ case has been computed from k = 4 N . For N = 16, such networks produce, in total, O(poly(n)M) number N = 32, N = 64, and N = 128;j respectively,k k = 3, of quantum gates. On the other had, the amplitude k = 4, k = 6, and k = 8 drawn as dashed vertical lines amplification would require O(√M) repetitions yielding

6 A The Circuit Simulation of a Matrix Product III DISCUSSION

1 1

0.95 0.9 0.9

0.85 0.8 0.8

0.7 0.75

0.7 0.6 Probability & Fidelity Probability & Fidelity 0.65

0.6 0.5 Probability Probability Fidelity 0.55 Fidelity Estimated Fidelity Estimated Fidelity 0.4 0.5 0 20 40 60 80 100 0 20 40 60 80 100 16x16 Matrices 32x32 Matrices

(a) 16x16 Matrix (b) 32x32 Matrix

1 1

0.95 0.95

0.9 0.9

0.85 Probability 0.85 Fidelity 0.8 Estimated Fidelity 0.8 0.75 0.75 0.7 Probability & Fidelity Probability & Fidelity 0.7 0.65 Probability 0.6 Fidelity 0.65 Estimated Fidelity 0.55 0 20 40 60 80 100 0 20 40 60 80 100 64x64 Matrices 128x128 Matrices

(c) 64x64 Matrix (d) 64x64 Matrix

FIG. 2: The change of the fidelity, the probability, and the estimated lowest fidelity at the end of the amplitude amplification process for 100 random matrices of different sizes and random inputs.

r O(poly(n)M√M) number of CNOT and single quantum j=1 Wj by the following: gates. When M = N, this becomes O(poly(n)N√N). Q

r k Q j . (27) j U jY=1 A. The Circuit Simulation of a Matrix Product

Let 1 and 2 are the universal circuits for the unitary 2 U U Here, if each Uj requires O(N ) quantum gates, the matrices, respectively, W1 and W2. Then, the circuit for k k obtained circuit implementation for the matrix prod- the product W1W2 can be implemented as Q 2Q 1, 2 2 2U 1U uct requires O(r√MN ) quantum gates or O(√MN ) where j represents the universal circuit, Qj is in the for r << N. When Uj can be efficiently imple- U π form of Eq.(15) and k = 4 √M . This can be general- mentable, e.g. O(poly(n)), the matrix product requires ized to the product consistingj ofkr number of matrices, only O(poly(n)M√M) number of quantum gates.

7 A The Circuit Simulation of a Matrix Product III DISCUSSION

1 1

0.95 0.9

0.9 0.8

0.85 0.7 0.8

0.6 Probability & Fidelity 0.75 Probability & Fidelity

0.5 0.7 Probability Probability Fidelity Fidelity Estimated Fidelity Estimated Fidelity 0.65 0.4 0 20 40 60 80 100 0 20 40 60 80 100 Runs (16x16 Matrix) Runs (32x32 Matrix)

(a) 16x16 Matrix (b) 32x32 Matrix

1 1

0.95 0.95

0.9 0.9

0.85 0.85

0.8 0.8

0.75 0.75 Probability & Fidelity Probability & Fidelity 0.7 0.7 Probability Probability 0.65 Fidelity 0.65 Fidelity Estimated Fidelity Estimated Fidelity

0 20 40 60 80 100 0 20 40 60 80 100 Runs (64x64 Matrix) Runs (128x128 Matrix)

(c) 64x64 Matrix (d) 128x128 Matrix

FIG. 3: The change of the fidelity, the probability, and the estimated lowest fidelity at the end of the amplitude amplification process. In each run, the matrix U is unchanged but a different random input is used.

1. Non-Unitary Matrix Product B. Quantum Circuits for the Functions of a Matrix

Many trigonometric functions can be represented in When the standard amplitude amplification is em- the forms of infinite products (Please see the first chap- ployed; the amplitude amplification in the second cir- ter of Ref.[29]). Some of the infinite product formulas cuit requires the whole amplitude amplification process are also valid for matrices. For instance, formulas for the in the first circuit to be applied again in every iteration. n exponential and the cosines are as follows: Let A C⊗ , Because of this input dependence, this results in a recur- then the product formula for the exponential of this∈ ma- sion which makes the whole thing very inefficient. trix is defined as [30]:

However, when U is non-unitary but close to a unitary, one can apply the oblivious amplitude amplification. In k that case, the complexity of the matrix product becomes A A k e = lim 1+ = lim Wk . (28) the same as the unitary case. k  k  k →∞ →∞

8 B Quantum Circuits for the Functions of a Matrix III DISCUSSION

1 1

0.9 0.9

0.8 0.8

0.7 0.7

0.6 0.6

0.5 0.5

0.4 0.4

Probability & Fidelity 0.3 Probability & Fidelity 0.3

0.2 0.2

0.1 Probability 0.1 Probability Fidelity Fidelity 0 0 1 1.5 2 2.5 3 3.5 4 4.5 5 1 2 3 4 5 6 Number of Iterations (16x16 Matrix) Number of Iterations (32x32 Matrix)

(a) 16x16 Matrix (b) 32x32 Matrix

1 1

0.9 0.9

0.8 0.8

0.7 0.7

0.6 0.6

0.5 0.5

0.4 0.4

Probability & Fidelity 0.3 Probability & Fidelity 0.3

0.2 0.2

0.1 Probability 0.1 Probability Fidelity Fidelity 0 0 1 2 3 4 5 6 7 8 9 10 0 2 4 6 8 10 12 Number of Iterations (64x64 Matrix) Number of Iterations (128x128 Matrix)

(c) 64x64 Matrix (d) 128x128 Matrix

FIG. 4: The change of the fidelity and the probability in the amplitude amplification process for the random matrix π U given in Eq.21 of different sizes. In each figure, the vertical dashed line shows the value of k = 4 √N . j k

This can be simply proved by the binomial expansion: In a similar fashion, the cosine representation of A can be defined in the product form as:

k 2 A 1 k! ∞ 4A (I + )k = Aj . (29) cos(πA)= I k kj j!(k j)!  − (2j + 1)2  Xj=0 − jY=1 ∞ 2A 2A ∞ = I I + = Wj1Wj2 If we plug this into Eq.(28), then we attain the Taylor  − 2j +1  2j +1 expansion of the matrix exponential and complete the jY=1 jY=1 proof: (31) As in the matrix product case discussed in the previous k section, first each Wj in the product formulas is extended A k 1 k! j ∞ 1 j A lim (I+ ) = lim A = A = e . to the form of U given in Eq.(21) where Wj replaces A. k k k kj j!(k j)! j! →∞ →∞ Xj=0 − Xj=0 Then, we generate the circuit designs for each Wj by (30) either writing U as a sum of simple unitaryU| matrices or

9 B Quantum Circuits for the Functions of a Matrix IV CONCLUSION following the circuit design in Ref.[15] used in the numer- tion does not depend on the input to the system regis- ical examples. Then, the same product formula given in ter, using the proposed framework one can implement a Eq.(27) is applied. matrix product for non-unitary matrices by combining two ancilla based quantum circuits. This allows quan- tum computers to implement the approximation of the IV. CONCLUSION matrix functions represented as infinite matrix products. A non-unitary matrix can be written in terms of sums of In this paper, after extending a non-unitary matrix to a unitary matrices: when each unitary matrix in the sum- unitary matrix, we have described a method to approx- mation can be efficiently implementable, then one may imate this unitary extension. It is shown that in most also implement the non-unitary matrix efficiently. There- cases the approximation gives a non-unitary matrix suf- fore, one may also implement the matrix product and so ficiently close to a unitary matrix. Therefore, this matrix the approximations of matrix functions efficiently. We can be simulated on an acilla based circuit where the suc- have run numerical simulations for random matrices and cess probability is increased by the oblivious amplitude shown how the fidelities and the probabilities change in amplification. Since the oblivious amplitude amplifica- each random case.

[1] Hefeng Wang, Lian-Ao Wu, Yu-xi Liu, and Franco [13] Benjamin P. Lanyon, Marco Barbieri, Marcelo P. Nori, “Measurement-based quantum phase estimation al- Almeida, Thomas Jennewein, Timothy C. Ralph, gorithm for finding eigenvalues of non-unitary matrices,” Kevin J. Resch, Geoff J. Pryde, Jeremy L. O/’Brien, Phys. Rev. A 82, 062303 (2010). Alexei Gilchrist, and Andrew G. White, “Simplifying [2] Hiroaki Terashima and Masahito Ueda, “Nonunitary quantum logic using higher-dimensional Hilbert spaces,” quantum circuit,” International Journal of Quantum In- Nature Physics 5, 134–140 (2009). formation 3, 633–647 (2005). [14] T. D. Mackay, S. D. Bartlett, L. T. Stephenson, and [3] Anmer Daskin, Ananth Grama, and Sabre Kais, “A uni- B. C. Sanders, “Quantum walks in higher dimensions,” versal quantum circuit scheme for finding complex eigen- Journal of Physics A: Mathematical and Theoretical 35, values,” processing 13, 333–353 2745 (2002). (2014). [15] Anmer Daskin, Ananth Grama, Giorgos Kollias, and [4] Lov K Grover, “Quantum computers can search rapidly Sabre Kais, “Universal programmable quantum circuit by using almost any transformation,” Physical Review schemes to emulate an operator,” The Journal of chemi- Letters 80, 4329 (1998). cal physics 137, 234112 (2012). [5] Michele Mosca et al., “Quantum searching, counting [16] Phillip Kaye, Michele Mosca, and Raymond Laflamme, and amplitude amplification by eigenvector analysis,” in An introduction to (Oxford Univ. MFCS98 workshop on Randomized Algorithms (1998) pp. Press, UK, 2006). 90–100. [17] Ake˚ Bj¨orck and Sven Hammarling, “A schur method for [6] , Peter Hoyer, Michele Mosca, and Alain the square root of a matrix,” Linear algebra and its ap- Tapp, “Quantum amplitude amplification and estima- plications 52, 127–140 (1983). tion,” Contemporary Mathematics 305, 53–74 (2002). [18] Nicholas J Higham, “Computing real square roots of a [7] Adam Paetznick and Krysta M Svore, “Repeat-until- real matrix,” Linear Algebra and its applications 88, success: Non-deterministic decomposition of single-qubit 405–430 (1987). unitaries,” Quantum Information & Computation 14, [19] Robert R Tucci, “A rudimentary quantum compiler 1277–1301 (2014). (2cnd ed.),” arXiv preprint quant-ph/9902062 (1999). [8] Dominic W Berry, Andrew M Childs, Richard Cleve, [20] Mikko M¨ott¨onen, Juha J. Vartiainen, Ville Robin Kothari, and Rolando D Somma, “Exponential Bergholm, and Martti M. Salomaa, “Quan- improvement in precision for simulating sparse hamilto- tum circuits for general multiqubit gates,” nians,” in Proceedings of the 46th Annual ACM Sympo- Physical Review Letters 93, 130502 (2004). sium on Theory of Computing (ACM, 2014) pp. 283–292. [21] V. V. Shende, S. S. Bullock, and I. L. [9] Yuan Liang Lim, Almut Beige, and Leong Chuan Kwek, Markov, “Synthesis of quantum-logic circuits,” “Repeat-until-success linear optics distributed quantum IEEE Transactions on Computer-Aided Design of Integrated Circuits computing,” Phys. Rev. Lett. 95, 030505 (2005). [22] Beresford N Parlett, The symmetric eigenvalue problem, [10] Yuan Liang Lim, Sean D. Barrett, Almut Beige, Pieter Vol. 7 (SIAM, 1980). Kok, and Leong Chuan Kwek, “Repeat-until-success [23] Nicholas J Higham, Matrix nearness problems and appli- quantum computing using stationary and flying qubits,” cations (University of Manchester. Department of Math- Phys. Rev. A 73, 012304 (2006). ematics, 1988). [11] Robin Kothari, Efficient algorithms in quantum query [24] Anmer Daskin, Quantum circuit design methods and complexity, Ph.D. thesis, University of Waterloo (2014). applications, Ph.D. thesis, PURDUE UNIVERSITY [12] Dominic W. Berry, Andrew M. Childs, Richard Cleve, (2014). Robin Kothari, and Rolando D. Somma, “Simulating [25] Anmer Daskin and Sabre Kais, “Decomposition of uni- hamiltonian dynamics with a truncated taylor series,” tary matrices for finding quantum circuits: application Phys. Rev. Lett. 114, 090502 (2015). to molecular hamiltonians,” The Journal of chemical

10 IV CONCLUSION

physics 134, 144112 (2011). [28] George Cybenko, “Reducing quantum computations to [26] Vladimir M Stojanovi´c, A Fedorov, A Wallraff, and elementary unitary operations,” Computing in Science C Bruder, “Quantum-control approach to realizing a tof- & Engineering 3, 27–32 (2001). foli gate in circuit qed,” Physical Review B 85, 054504 [29] Daniel Zwillinger, Table of integrals, series, and products (2012). (Elsevier, 2014). [27] Byron Drury and Peter Love, “Constructive quan- [30] Dennis S Bernstein, Matrix mathematics: theory, facts, tum shannon decomposition from cartan involutions,” and formulas (Princeton University Press, 2009). Journal of Physics A: Mathematical and Theoretical 41, 395305 (2008).

11