Block-based quantum-logic synthesis
Mehdi Saeedi, Mona Arabzadeh, Morteza Saheb Zamani, Mehdi Sedighi
BBLOCK-BASED QUANTUM-LOGIC SYNTHESIS
Mehdi Saeedi, Mona Arabzadeh, Morteza Saheb Zamani, Mehdi SedighiQuantum Design Automation LabDepartment of Computer Engineering and Information TechnologyAmirkabir University of TechnologyTehran, Iran { msaeedi, m.arabzadeh, szamani, msedighi } @aut.ac.ir The first two authors contributed equally to this work.
Abstract
In this paper, the problem of constructing an efficient quantum circuit for the implementation ofan arbitrary quantum computation is addressed. To this end, a basic block based on the cosine-sinedecomposition method is suggested which contains l qubits. In addition, a previously proposed quantum-logic synthesis method based on quantum Shannon decomposition is recursively applied to reach unitarygates over l qubits. Then, the basic block is used and some optimizations are applied to remove redundantgates. It is shown that the exact value of l affects the number of one-qubit and CNOT gates in the proposedmethod. In comparison to the previous synthesis methods, the value of l is examined consequently toimprove either the number of CNOT gates or the total number of gates. The proposed approach is furtheranalyzed by considering the nearest neighbor limitation. According to our evaluation, the number ofCNOT gates is increased by at most a factor of if the nearest neighbor interaction is applied. The promise of exponential speed up of quantum algorithms [1–3] running on quantum computers has inten-sified the attempts for using quantum algorithms in real world problems. Besides that, the ability of quantumcomputation in simulating quantum-mechanical effects (QMEs) further increases its attraction. Classical com-putation has inherent limitations to simulate QMEs [4]. Due to the ability of quantum computation in solvingseveral applications efficiently [5], numerous efforts have been made to study various aspects of quantumcomputation and a set of quantum technologies has been proposed to build a scalable quantum computer [6].Aside from different technological characterizations, quantum computations provided by all of the proposedquantum technologies can be described in terms of linear operators (i.e., matrices) in Hilbert space. In thissense, any quantum computation involves evolution of an initial quantum state under a series of elementaryunitary transformations [7–10]. It has been shown that any unitary transformation can be exactly realizedif the set of single qubit operations plus CNOT are allowed as the elementary gates [9, 11]. As CNOT needsinteractions between two qubits which are usually much weaker than the interactions between a single qubitand classical control fields, producing fewer CNOT gates is more favorable generally. At the same time,reducing the number of one-qubit gates to improve the total synthesis cost is an active research field.Synthesis of an arbitrary unitary matrix from a universal set of gates including one-qubit operations andCNOTs has a rich history. Barenco et al. in 1995 [9] showed that the number of CNOT gates required toimplement an arbitrary unitary matrix over n qubits was O ( n n ). In [12], it was shown that applying theQR decomposition of matrix algebra could lead to the same result. In 1995, Knill reduced the number ofCNOT gates to O ( n n ) [13]. In 2004, Shende et al. found the highest known lower bound on the number ofCNOT gates as (cid:100) (4 n − n − (cid:101) [14]. The process of reducing the number of CNOT gates was continuedby Vartiainen et al. in [15] which led to O (4 n ) CNOT gates. Later, a decomposition method based on thecosine-sine matrix decomposition, called CSD, was proposed which produced 4 n − n +1 CNOT gates [16].1 a r X i v : . [ qu a n t - ph ] N ov n [17] uniformly controlled one-qubit gates were used by Bergholm et al. in CSD method which resulted in n − n − n + n − n − n − n + 1 CNOT gates. Next, M¨ott¨onen and Vartiainen in [19] reduced the number of CNOT gates to n − n + by improving the results of [18]. By using the idea of quantum Shannon decomposition (QSD)and some circuit identities, the authors of [20] reached the same number of CNOT gates. In [21], an algorithmwas proposed that translated a unitary matrix into a quantum circuit according to the KAK decompositionin Lie group theory. Their results showed that any matrix decomposition corresponding to type-AIII KAKdecompositions could be derived according to the given Cartan involution by applying the method of [21].Most recently, Drury and Love placed the QSD into a Lie algebraic context. Their results showed that QSDis an alternating series of Cartan decompositions [22].Besides the significant attempts made in improving the worst-case number of CNOT gates and one-qubitgates required to implement an arbitrary unitary matrix, efforts have been made to improve the number ofone-qubit gates and CNOTs for specific matrices with applications in the synthesis of an arbitrary matrix. Ithas been shown that three CNOT gates are necessary and sufficient to implement an arbitrary 2-qubit unitarymatrix in the worst case [23], [24], [25]. In addition, seven one-qubit gates are reported to be sufficient bythree CNOT gates for implementing an arbitrary 2-qubit unitary matrix [23]. In [26], a new quantum gate, B , was introduced and applied to synthesize a generic two-qubit operation. It has been shown that two Bgates with at most six single-qubit gates implement any arbitrary two-qubit quantum operation [26]. On theother hand, a decomposition algorithm which leads to 40 CNOT gates was proposed in [27] for an arbitraryquantum circuit with 3 qubits. Currently, it appears that the best known quantum circuit for a 3-qubitmatrix requires 20 CNOTs [20] whereas the lower bound is 14 [14]. The synthesis of an n -qubit Toffoli gatewas studied in [28] where the authors showed that an n -qubit Toffoli gate requires at least 2 n CNOT gatesand for n = 3, their CNOT-cost (i.e., 6) is optimal. On different directions, synthesis of a diagonal matrixand optimal realization of controlled unitary gates were studied in [29] and [30], respectively. The problem ofpreparing an arbitrary quantum state starting from a given state was discussed in some papers [17, 20, 31].In this paper, the synthesis of an arbitrary unitary matrix over n qubits is addressed. To this end, theQSD method is used to synthesize a given unitary transformation first. Then, by determining an appropriatedecomposition level, unstructured unitary matrices in the resulted decomposed circuit are replaced with blockssynthesized by CSD method equipped by some optimizations. We show that the decomposition level can beselected to trade off the number of CNOT gates against one-qubit gates in the proposed decomposition method.The remainder of the paper is organized as follows. In Section 2 basic concepts are explained. Theproposed synthesis approach is introduced in Section 3 followed by considering the number of CNOT andone-qubit gates resulted from the proposed approach in Section 4. The nearest neighbor implementation ofour synthesis method is evaluated in Section 5 and finally, Section 6 concludes the paper. In this section, the basic concepts and notations used in the rest of the paper are introduced and explained.
A quantum bit, qubit in short, like its classical counterpart can be realized by a physical system such as aphoton. In this paper, we treat a qubit as a mathematical object which represents a quantum state with twobasic states | (cid:105) and | (cid:105) . A qubit can get any linear combination of its basic states, called superposition, asshown in (1) where α and β are complex numbers. | ψ (cid:105) = α | (cid:105) + β | (cid:105) (1)Although a qubit can get any linear combination of its basic states, when a qubit is measured, its statecollapses into the basis | (cid:105) and | (cid:105) with the probability of | α | and | β | , respectively and we have | α | + | β | = 1.It is also common to denote the state of a single qubit by a 2 × α β ] T in Hilbert space H where2uperscript T stands for the transpose of a vector. A quantum system which contains n qubits is often calleda quantum register of size n in the context of quantum computation. More precisely, an n -qubit quantumregister can be described by an element | ψ (cid:105) = | ψ (cid:105) ⊗ | ψ (cid:105) ⊗ . . . ⊗ | ψ n (cid:105) in the tensor product Hilbert space H = H ⊗ H ⊗ · · · ⊗ H n . An n -qubit quantum gate is a device which performs a specific 2 n × n unitary operation on selected n qubitsin a specific period of time. A matrix U is unitary if U U † = I where U † is the conjugate transpose of U and I is the identity matrix. An arbitrary unitary gate over n qubits with a generic 2 n × n matrix is representedas U (2 n ) in this paper. Previously, various quantum gates with different functionalities have been introduced.For example, the θ rotation gates (0 ≤ θ ≤ π ) around the x , y and z axes acting on one qubit are defined as: R x ( θ ) = (cid:18) cos θ i sin θ i sin θ cos θ (cid:19) , R y ( θ ) = (cid:18) cos θ sin θ − sin θ cos θ (cid:19) , R z ( θ ) = (cid:18) e − iθ e iθ (cid:19) A square matrix is called diagonal if the entries outside the main diagonal are all zero. In other words,an n × n matrix ∆ = ( δ i,j ) is diagonal if δ i,j = 0, i (cid:54) = j, ≤ i, j ≤ n . For example, R z ( θ ) gate is a diagonal2 × n qubits is represented by a 2 n × n unitary diagonal matrix. Adiagonal gate over n qubits is denoted as ∆ n throughout this paper.A block matrix is a partition of a matrix into rectangular smaller matrices called blocks. A block diagonalmatrix is a block square matrix whose main diagonal blocks are square matrices. Hence, the blocks outsidethe main diagonal are zero matrices. A block diagonal matrix has the form shown in (2) where each U i (2 m )is a 2 m × m matrix. The inverse of a block diagonal matrix is also block diagonal which is composed ofthe inverse of each block. A quantum gate B sτ ( U (2 m )) over n qubits with m targets denoted by the set τ and s = n − m select qubits on the most significant qubits has a block diagonal matrix [20] represented by B ( U (2 m )) in this paper. In the case of only one target line (i.e., m = 1), the specific target line is showninstead of the set τ . From the quantum circuit point of view, for a gate B sτ ( U (2 m )) over n qubits with matrix B ( U (2 m )) shown in (2), the matrix of U i (2 m ) (1 ≤ i ≤ n − m ) is applied to the target qubits where the index i depends on the values of s = n − m select qubits [20]. In this paper, a select qubit in a circuit is denoted by (cid:50) as in [20]. B ( U (2 m )) = U (2 m ) 0 · · · U (2 m ) · · · · · · U n − m (2 m ) (2)The unitary matrix implemented by several gates acting on different qubits independently can be calculatedby the tensor product ⊗ of their matrices. Two or more quantum gates can be cascaded to construct a quantumcircuit. For a set of k gates g , g , ..., g k cascaded in a quantum circuit C in sequence, the matrix of C canbe calculated as M k M k − ...M where M i is the matrix of the i th gate (1 ≤ i ≤ k ).Quantum circuits are often synthesized using a “basic gate” library [9] which contains CNOT and one-qubit gates. In contrast, an “elementary gate” library was used in [29] which contains CNOT and one-qubitrotation gates. The gate CNOT acts on two qubits (control and target) where the state of the target qubit isinverted if the control qubit holds the state | (cid:105) . A CNOT gate with control c and target t is denoted as C c,t inthis paper. Since every gate in the elementary library is a basic gate and every basic gate can be decomposedinto at most three elementary gates (see Section 2.3), the Ω(gate count), O(gate count), and Θ(gate count) ineither gate library are identical. In this paper, the basic gate library is applied to synthesize a given unitarymatrix as discussed in Section 3. 3 .3 Quantum Circuit Decomposition Two quantum circuits are equivalent if matrix products of their gates are identical. In order to synthesize agiven unitary matrix, equivalent circuits may be applied to simplify the circuit. To do this, various quantumcircuit identities have been proposed in recent years (for examples see [32], [11], [33], [20]).An arbitrary one-qubit gate U (2) can be decomposed into R z and R y rotation gates (called ZYZ decom-position) as shown in (3) [9]. Hence, a one-qubit computation from the basic gate library can be implementedas a sequence of at most three gates from the elementary gate library. U (2) = R z ( α ) R y ( β ) R z ( λ ) (3)Cosine-sine decomposition [34] for a 2 n × n unitary matrix U can be expressed by (4) where L , L , R ,and R are unitary 2 n − × n − matrices and C and S are unitary 2 n − × n − diagonal matrices with realelements such that C + S = I n − ( I n − is the identity matrix over n − U = (cid:18) L L (cid:19)(cid:18) C S − S C (cid:19)(cid:18) R R (cid:19) (4)In the following, two quantum synthesis algorithms which are based on the cosine-sine decompositionmethod are described and used in the rest of the paper. In [16], a decomposition algorithm, called CSD, was proposed which uses the cosine-sine decomposition todecompose a generic U (2 n ). The CSD decomposition was further improved in [17] where the cosine-sinedecomposition is recursively applied on each block diagonal gate. This process is stopped when there areonly one-qubit block diagonal gates. More precisely, the CSD decomposition of a generic U (2 n ) matrix canbe expressed by (5) where γ ( i ) is the ruler function introduced in [35] ( γ ( i )+1 is the position of the leastsignificant nonzero bit in the binary representation of i ). U (2 n ) = B n − n ( U (2)) n − − (cid:89) i =1 B n − n − γ ( i ) ( R y ) B n − n ( U (2)) (5)Each block diagonal gate that appears in (5) can also be decomposed into a circuit which contains threeblock diagonal gates of smaller sizes and one CNOT gate [17]. Equation (6) shows the decomposition for a B n − n ( U (2)). B n − n ( U (2)) = B n − n ( U (2)) C ,n B n − n ( U (2)) B n − ( R z ) (6)Applying the recursive decompositions given in (6) leads to a circuit with 2 n − − n − one-qubit gates followed by a diagonal gate ∆ n where ∆ n can also be decomposed into 2 n − B ( U ) • ∆ • • = • • • • U U (cid:23)(cid:22)(cid:21)(cid:20)(cid:16)(cid:17)(cid:18)(cid:19) U (cid:23)(cid:22)(cid:21)(cid:20)(cid:16)(cid:17)(cid:18)(cid:19) U (cid:23)(cid:22)(cid:21)(cid:20)(cid:16)(cid:17)(cid:18)(cid:19) U (cid:23)(cid:22)(cid:21)(cid:20)(cid:16)(cid:17)(cid:18)(cid:19) U (cid:23)(cid:22)(cid:21)(cid:20)(cid:16)(cid:17)(cid:18)(cid:19) U (cid:23)(cid:22)(cid:21)(cid:20)(cid:16)(cid:17)(cid:18)(cid:19) U (cid:23)(cid:22)(cid:21)(cid:20)(cid:16)(cid:17)(cid:18)(cid:19) U Figure 1: Decomposition of a block diagonal gate of size 4 [17]. Each U is a generic U (2) gate.4n addition, the authors of [17] used the notation given in (7) and converted (5) to (8) by replacing (7) in(5) and merging each ∆ n with its next block diagonal gate. Note that the notation ∼ over a block diagonalgate means that this gate can be implemented up to a diagonal gate. Doing this could reduce the number ofgates resulted from the decomposition of a unitary gate. B n − n ( U (2)) = ∆ n ˜ B n − n ( U (2)) (7) U (2 n ) = ∆ n ˜ B n − n ( U (2)) n − − (cid:89) i =1 ˜ B n − n − γ ( i ) ( U (2)) ˜ B n − n ( U (2)) (8) Since the left and the right matrices in (4) are block diagonals, they can be represented as block diagonal gate B τ ( U (2 n − )). In addition, the middle matrix in (4) can be represented by B n − ( R y ). Therefore, (4) can berewritten as (9). U (2 n ) = B τ ( U (2 n − )) B n − ( R y ) B τ ( U (2 n − )) (9)The authors of [20] showed that each block diagonal gate B τ ( U (2 n − )) in (9) can be decomposed into twogeneric unitary matrices and a specific block diagonal matrix as illustrated in (10) and (11). B ( U (2 n − )) = (cid:18) U U (cid:19) (cid:18) D D † (cid:19) (cid:18) U U (cid:19) (10) B τ ( U (2 n − )) = U (2 n − ) B n − ( R z ) U (2 n − ) (11)By using (9) and (11), the method of [20] applies the quantum Shannon decomposition (QSD) shown in (12)to synthesize a given unitary matrix. The recursion is continued till U (4). Next, an optimal decompositionof U (4) with three CNOT gates [23] is used. U (2 n ) = U (2 n − ) B n − ( R z ) U (2 n − ) B n − ( R y ) U (2 n − ) B n − ( R z ) U (2 n − ) (12)The complete circuit diagram of (12) is shown in Fig. 2 where B n − ( R z ) and B n − ( R y ) gates are illustratedby dashed lines. In this paper, we use slash to denote that a given line may carry an arbitrary number ofqubits. In addition, for a circuit with n qubits, circuit lines are numbered from 1 (top) to n (bottom). U (2 n ) B n − ( R z ) B n − ( R y ) B n − ( R z ) U R z R y R z = / / U (2 n − ) U (2 n − ) U (2 n − ) U (2 n − ) (cid:95) (cid:95)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31) (cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:95) (cid:95) (cid:95) (cid:95)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31) (cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:95) (cid:95) (cid:95) (cid:95)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31) (cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:95) (cid:95) Figure 2: Applying QSD [23] on a U (2 n ) matrix In this section, a synthesis approach for quantum circuits is introduced. The proposed approach is based onthe CSD and QSD methods. 5 .1 The Basic Block
In this part, a basic block is introduced which is used in the proposed decomposition method. Consider ageneric unitary matrix over l qubits and the CSD method is used to synthesize it as discussed in Section 2.3.1.The resulted circuit without the last ∆ l gate is considered as the basic block in the proposed decompositionmethod. The proposed basic block is shown in (13) denoted as Q (2 l ). The complete equation for Q (2 l ) isgiven in (14). The CSD decomposition for U (2 ) and our basic block are illustrated in Fig. 3. The rightmostsequence of block diagonal R z gates corresponds to a single ∆ gate. U (2 l ) = ∆ l Q (2 l ) (13) Q (2 l ) = ˜ B l − l ( U (2)) l − − (cid:89) i =1 ˜ B l − l − γ ( i ) ( U (2)) ˜ B l − l ( U (2)) (14) Q (2 ) ∆ U (2 ) ˜ U (2) R z = ˜ U (2) ˜ U (2) R z ˜ U (2) ˜ U (2) ˜ U (2) ˜ U (2) R z (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31) (cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31) (cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:31)(cid:95) (cid:95) (cid:95) (cid:95) (cid:95) (cid:95) Figure 3: The proposed basic block for 3 qubits.
In this subsection, the proposed decomposition method is introduced. The following proposition is used inthe rest of this section to remove unnecessary gates.
Proposition 1 (∆ l ⊗ I n − l ) B n − ( R k ) = B n − ( R k )(∆ l ⊗ I n − l ) where l ≤ n − and k = z , y . As there is no overlap between the target line of B n − ( R k ) and ∆ l for l ≤ n − k = z , y , Proposition 1is held. Figure 4 illustrates the result of Proposition 1 on n qubits for ∆ n − . B n − ( R k ) B n − ( R k ) R k R k = n − / ∆ n − ∆ n − Figure 4: Application of Proposition 1 on n qubits.6econsider the QSD method shown in (12). It can be verified that the recursive application of (12) up to l qubits leads to (15) where each U (2 l ) is denoted as U to save space. U (2 n ) = U B ln − l ( R z ) U B ln − l ( R y ) U B ln − l ( R z ) U B l +1 n − l − ( R z ) ...B l +1 n − l − ( R y ) ...B l +1 n − l − ( R z ) ...B n − ( R z ) ...B n − ( R y ) ...B n − ( R z ) ...B l +1 n − l − ( R z ) ...B l +1 n − l − ( R y ) ...B l +1 n − l − ( R z ) U B ln − l ( R z ) U B ln − l ( R y ) U B ln − l ( R z ) U (15)Based on (13), each U (2 l ) in (15) can be replaced by ∆ l Q (2 l ). The result is given in (16) where each Q (2 l )is denoted as Q . U (2 n ) =∆ l QB ln − l ( R z )∆ l QB ln − l ( R y )∆ l QB ln − l ( R z )∆ l QB l +1 n − l − ( R z ) ...B l +1 n − l − ( R y ) ...B l +1 n − l − ( R z ) ...B n − ( R z ) ...B n − ( R y ) ...B n − ( R z ) ...B l +1 n − l − ( R z ) ...B l +1 n − l − ( R y ) ...B l +1 n − l − ( R z )∆ l QB ln − l ( R z )∆ l QB ln − l ( R y )∆ l QB ln − l ( R z )∆ l Q (16)Now, direct applying of Proposition 1 on (16) moves all ∆ l gates to the right side of block diagonal gates.Then, each ∆ l gate can be merged with its adjacent Q (2 l ) gate which leads to a U (2 l ) gate. The resulted U (2 l ) gate can also be replaced by ∆ l Q (2 l ). Continuing this process leads to (17). U (2 n ) =∆ l QB ln − l ( R z ) QB ln − l ( R y ) QB ln − l ( R z ) QB l +1 n − l − ( R z ) ...B l +1 n − l − ( R y ) ...B l +1 n − l − ( R z ) ...B n − ( R z ) ...B n − ( R y ) ...B n − ( R z ) ...B l +1 n − l − ( R z ) ...B l +1 n − l − ( R y ) ...B l +1 n − l − ( R z ) QB ln − l ( R z ) QB ln − l ( R y ) QB ln − l ( R z ) Q (17)Based on the above equations, the proposed block-based quantum decomposition (BQD) method is givenin (18) where each C¸ (2 i ) is denoted as (19). The circuit diagrams of (18) and (19) are illustrated in Fig. 5and Fig. 6, respectively. Figure 7 shows the result of BQD method for U (2 ) where l = 4. U (2 n ) = ∆ l C¸ (2 n − ) B n − ( R z )C¸ (2 n − ) B n − ( R y )C¸ (2 n − ) B n − ( R z )C¸ (2 n − ) (18)C¸ (2 i ) = (cid:26) C¸ (2 i − ) B i − ( R z )C¸ (2 i − ) B i − ( R y )C¸ (2 i − ) B i − ( R z )C¸ (2 i − ) l < i ≤ nQ (2 l ) i = l (19)Note that only one ∆ l exists after final decomposition stopped at level l . To determine l , i.e., decomposition U (2 n ) B n − ( R z ) B n − ( R y ) B n − ( R z ) U R z R y R z n − (cid:6) n (cid:7) − / = C¸ (2 n − ) C¸ (2 n − ) C¸ (2 n − ) C¸ (2 n − ) l = (cid:6) n (cid:7) / ∆ l Figure 5: The proposed decomposition method level , number of CNOT gates and one-qubit gates should be evaluated as done in the following subsections.7 ¸ (2 i ) B i − ( R z ) B i − ( R y ) B i − ( R z )C¸ R z R y R z = / / C¸ (2 i − ) C¸ (2 i − ) C¸ (2 i − ) C¸ (2 i − ) Figure 6: The circuit diagram of (19) B ( R z ) B ( R y ) B ( R z ) R z R y R z R z R y R z R z R y R z R z R y R z R z R y R z / Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q ∆ C¸ (2 ) C¸ (2 ) C¸ (2 ) C¸ (2 ) Figure 7: Decomposition of a U (2 ) using BQD method. Q (2 ) is denoted as Q . Equation (20) shows the recursion formula for the number of CNOT gates for the circuit of (19) where 2 i − is the number of CNOT gates for each R z gate [20]. In addition, the block diagonal R y gate in Fig. 6 can betransformed in the decomposition into a block diagonal U (2) rotation gate up to a diagonal gate. As a result,it can be implemented by one less CNOT compared with the block diagonal R z gate [19], [20]. C C¸ i = (cid:40) C C¸ i − + 3 × i − − l < i ≤ nC Q l i = l (20)Applying the recursion formula of (20) leads to (21). C C¸ i = 4 i − l ( C Q l + 3 × l − ) − × i − − n − l − l < i ≤ n (21)Now consider the proposed BQD method shown in (18). Equation (22) shows the number of CNOT gatesin the proposed method where 2 l − l [29]. C U n = C C¸ n + 2 l − Q (2 l ) ∆ l [17]. This comes from the fact that Q (2 l ) ∆ l canbe written as a sequence of ˜ B l − i ( U (2)) gates, where i ∈ { l, l + 1 , ..., n − , n } , followed by a chain of blockdiagonal R z gates (see Fig. 3). The single rotation gate in the chain can be absorbed into a U (2) gateappeared after the decomposition of ˜ B l − n ( U (2)) gate. Then, the sub-circuit I ⊗ U (2) C , I ⊗ U (2), resultedfrom the decomposition of ˜ B l − n ( U (2)) gate, followed by a B n − ( R z ) gate constructs a B n ( U (2)) gate, whichcan be implemented by two CNOT gates [20], one less than the number of CNOT gates required for theimplementation of I ⊗ U (2) C , I ⊗ U (2) B n − ( R z ) sub-circuit. Equation (23) shows the final result. C U n = 4 n − l ( C Q l + 3 × l − ) − × n − − n − l − + 2 l − Q (2 l ) (see (14)) can be computed by (24) where 2 l − Q (2 l ) each of which can be implemented by 2 l − − C Q l = (2 l − × (2 l − −
1) (24)Altogether, the number of CNOT gates for the proposed BQD method is shown in (25) for the decompo-sition level l . C U n = 4 n ( 23 × l + 12 ) − × n − + 2 l −
83 (25)
To count the number of one-qubit gates in the proposed decomposition method, an analysis similar to the oneperformed for CNOT cost can be used. Equation (26) shows the number of one-qubit gates for the proposedBQD method where 2 × n − l − is the number of one-qubit gates merged between B ( R y ) and B ( R z ) gatesat each recursion step. 2 l − l . Besides, l moregates can be eliminated at the last U (2 l ) gate decomposed using CSD method [19]. O U n = 4 n − l ( O Q l + 3 × l − ) − × n − − (2 × n − l −
13 ) + (2 l − − l (26)Number of one-qubit gates for Q (2 l ) is computed by (27). O Q l = (2 l − × (2 l − −
1) (27)Replacing (27) in (26) and doing some simplifications lead to (28) for decomposition level l . O U n = 4 n ( − × l + 12 l + 12 ) − × n − + 2 l − l −
13 (28)
In this section, the results of the proposed decomposition approach is presented. To this end, the effect ofthe decomposition level on the synthesis cost in the BQD method is discussed first. Table 1 and Table 2show the number of CNOT gates and one-qubit gates for 4 ≤ n and 3 ≤ l ≤ n up to n = 12, respectively.Additionally, the total number of gates in BQD method for each decomposition level is shown in Table 3.Note that the synthesis results for l = n in the proposed decomposition method (gray cells) are the same asthe ones produced by the improved CSD method (i.e., [17]). The results of the QSD method [20] are alsoshown in these tables.The results given in Table 1, Table 2 and Table 3 reveal the following facts regarding the behavior of theBQD method compared to the other approaches: • In terms of the number of CNOT gates, QSD and [19] work always better than BQD and BQD worksbetter than CSD. • In terms of the number of one-qubit gates, improved CSD is better than BQD and BQD is better thanQSD and [19] all the time. Similar result is obtained in terms of total number of gates. • As can be seen in Table 3, in l = n −
1, the total number of gates produced by BQD is one gate morethan the number of gates produced by improved CSD. However, in those cases, BQD produces fewerCNOT gates. Since CNOT cost is usually much more than the cost of one-qubit gates, BQD producesbetter circuits compared to the other methods as far as the total number of gates and technologicallimitations are concerned. The appropriate l is n − ≤ n ≤ Decomposition Circuit lines ( n )Level ( l ) 4 5 6 7 8 9 10 11 123
112 480
480 1976
Table 2: Number of one-qubit gates in the proposed BQD, improved CSD [17] (gray cells), and QSD [20]methods for 4 ≤ n ≤ Decomposition Circuit lines ( n )Level ( l ) 4 5 6 7 8 9 10 11 123
586 2426 9882 39898 160346 642906 2574682 103048584 131
537 2209 • While QSD and [19] lead to better CNOT cost compared to improved CSD and BQD, if one-qubit gatecount is also concerned, BQD produces about 5% more CNOT gates and about 28% fewer one-qubitgates compared to QSD on average. Altogether, the total number of gates is improved by about 16%in BQD compared to QSD on average. The best results in terms of the number of CNOT gates foreach n are boldfaced in all tables. In some cases, there are two different decompositions which have thesame number of CNOT gates and different numbers of one-qubit gates. In those cases, decompositionswith fewer one-qubit gates are selected. Percentages of improvement (BQD vs. QSD) for CNOT gates,one-qubit gates, and total gates are shown in Fig. 8 for this case.A comparison of the results produced by BQD and improved CSD reveals that for this case, BQD leadsto fewer CNOT gates with the penalty of more one-qubit gates. Percentages of improvement (BQD vs.improved CSD) for CNOT gates and one-qubit gates are almost equal (with a negative sign). However,fewer CNOT gates is more desirable as discussed. • Producing fewer CNOT gates leads to better quantum circuits considering the current technologicallimitations. To find the exact gate counts in the proposed method, we set derivation of (25), i.e., thenumber of CNOT gates for BQD method, with respect to l to zero which leads to l = n + log (4 / .According to the results given in Table 1 and Table 2, it can be verified that l = (cid:100) n/ (cid:101) leads to theachieved results. Therefore, the number of CNOT gates and one-qubit gates in the proposed BQDmethod can be calculated as (29) and (30), respectively.10able 3: Total number of gates in the proposed BQD, improved CSD [17] (gray cells), and QSD [20] methodsfor 4 ≤ n ≤ Decomposition Circuit lines ( n )Level ( l ) 4 5 6 7 8 9 10 11 123 Figure 8: Percentages of improvement for CNOT, one-qubit and total gates (BQD vs. QSD) C U n = n − n + n −(cid:100) n/ (cid:101) + 2 (cid:100) n/ (cid:101) − (29) O U n = n + 2 n −(cid:100) n/ (cid:101) − n − n −(cid:100) n/ (cid:101) + 2 (cid:100) n/ (cid:101) − (cid:6) n (cid:7) − (30)According to the above discussion, we select l = (cid:100) n/ (cid:101) in the proposed decomposition method. Table 4and Table 5 show the number of CNOT gates and one-qubit gates for different quantum synthesis methods.Considering the fact that number of CNOT gates in the best reported synthesis methods [19, 20] is awayfrom the lower bound by a factor of two, more improvement in the synthesis cost needs consideration of bothCNOT and one-qubit gates. Simultaneous reduction of CNOT and one-qubit gates has also been recentlypursued by other researchers [28]. While several impressive physical realizations have been proposed for quantum computers, all of these tech-nologies have serious intrinsic limitations which should be resolved in future [6]. Among the different techno-logical constraints, the limited interaction distance between qubits is one of the most common ones. Althougharbitrary-distance interaction between qubits is possible in quantum computer technologies with moving qubits(for example in a photon-based system [36]), some restrictions exist in other quantum technologies. Indeed,many physical quantum computer proposals only permit interactions between adjacent (nearest neighbor)qubits [37]. For example, liquid nuclear magnetic resonance (NMR) [38], and the original Kane model [39]were designed based on the interactions between linear nearest neighbor (LNN) qubits.11able 4: Comparison table for the number of CNOT gates in various quantum synthesis methods
Synthesis Circuit linesmethod 2 3 4 5 6 7 8 9 10 n [9], [12] - O ( n n )[13] - O ( n n )QR [15] - O (4 n )Original CSD [16] 8 48 224 960 3968 16128 65024 261120 1046528 4 n − n +1 Improved CSD [17] 4 26 118 494 2014 8126 32638 130814 523774 n − n − n − n + BQD - - 112 480 1976 8040 32456 130408 522920 Eq. (29)Lower Bound [14] 3 14 61 252 1020 4091 16378 65529 262137 (cid:6) (4 n − n − (cid:7) Table 5: Comparison table for the number of one-qubit gates
Synthesis Circuit linesmethod 2 3 4 5 6 7 8 9 10 n Improved CSD [17] 7 32 131 522 2073 8248 32887 131318 524789 n + n − n − n − n − BQD - - 138 537 2209 8528 33455 134415 531022 Eq. (30)
In this section, the worst-case cost of BQD synthesis method for nearest neighbor architecture is studied.To this end, the structure of the proposed basic block, the block diagonal and the diagonal gates under LNNconstraints should be evaluated. Reconsider the proposed basic block Q (2 l ) which has 2 l − l − s is between 1 and (cid:100) l (cid:101) [17]. C B l − t = l + 2 l − s (cid:40) l even l odd (31)A comparison between the number of CNOT gates required to implement a block diagonal gate withoutthe LNN constraint (i.e., 2 l − −
1) and with this constraint (i.e., O ( l )) reveals that the number of CNOTgates for a block diagonal gate is increased by a factor of in the LNN architectures.Equation (32) shows the number of adjacent CNOTs of a block diagonal gate with n − st line (without the last ∆ n gate) in the LNN architectures [17]. The block diagonal R y gates produced in the QSD method can also be implemented by the same number of adjacent CNOTs asdiscussed in Subsection 3.3. C B n − = n + 2 n − (cid:40) n even n odd (32)Equation (33) shows the number of adjacent CNOTs required for block diagonal R z gates [17] which havebeen produced during QSD decomposition. C R n − = n + 3 n − (cid:40) n even n odd (33)A comparison between the number of CNOT gates required to implement a block diagonal gate without theLNN constraint (i.e., 2 n − −
1) and with this constraint (i.e., O ( n )) reveals that the number of CNOTs fora block diagonal gate is increased by a factor of in the LNN architectures.On the other hand, the last diagonal gate can be considered as a cascade of block diagonal rotationswith i ∈ { , · · · , l − } controls and one target placed at the 1 st qubit [29]. Therefore, the nearest neighbor12mplementation of ∆ l can be computed as (34) where C ∆ l shows the number of CNOT gates in ∆ l for LNNarchitectures. Equation (34) reveals that C ∆ l is of O ( l ) for LNN architectures. C ∆ l = l + l − (cid:40) l − n even l − n odd (34)An exact evaluation of the above costs shows that applying LNN constraints increases CNOT count by atmost a factor of . In this paper, a decomposition approach for quantum-logic synthesis was proposed which is based on theprevious CSD and QSD methods. To do this, a basic block based on CSD method was constructed whichcontains l qubits. Next, the proposed circuit for a generic unitary gate over l qubits was used as a basic block topresent our quantum synthesis method. In doing so, the previously proposed QSD method for quantum-logicsynthesis was recursively applied to reach unitary gates over l qubits. Then, the proposed basic block was usedand further optimizations were applied to remove redundant gates. To evaluate the proposed method, numberof CNOT and one-qubit gates with and without the nearest neighbor constraint was analyzed. Accordingto our analysis, the decomposition level l can be selected to trade off the number of one-qubit gates againstCNOT gates. Since producing fewer CNOT gates is more desirable, the decomposition level is set to (cid:100) n/ (cid:101) in the proposed decomposition method.Due to the potential of the proposed decomposition method in consideration of the number of CNOT andone-qubit gates, it is our hope that the proposed synthesis method may lead to further improvement in thenumber of CNOT and one-qubit gates simultaneously in future. Acknowledgment
We would like to thank Mikko M¨ott¨onen for helpful discussions.
References [1] C. Elliott. Quantum cryptography.
IEEE Security Privacy , 2(4):57 – 61, July-August 2004.[2] P. W. Shor. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantumcomputer.
SIAM Journal on Computing , 26:1484–1509, 1997.[3] L. K. Grover. A fast quantum mechanical algorithm for database search.
ACM symposium on Theory ofcomputing , pages 212–219, 1996.[4] R. Feynman. Simulating physics with computers.
International Journal of Theoretical Physics , 21:467–488, 1982.[5] M. Mosca. Quantum algorithms.
Springer Encyclopedia of Complexity and Systems Science , pages7088–7118, 2009.[6] M. Ross and M. Oskin. Quantum computing.
Commun. ACM , 51(7):12–13, July 2008.[7] D. Deutsch. Quantum computational networks.
Proc. Roy. Soc. Lond. , A425(73), 1989.[8] D. P. DiVincenzo. Two-bit gates are universal for quantum computation.
APS Physical Review A ,50(1015), 1995. 139] A. Barenco et al. Elementary gates for quantum computation.
APS Physical Review A , 52:3457–3467,1995.[10] S. Lloyd. Almost any quantum logic gate is universal.
Physical Review Letters , 75(2):346–349, 1995.[11] M. Nielsen and I. Chuang.
Quantum computation and quantum information . Cambridge University Press,2000.[12] G. Cybenko. Reducing quantum computations to elementary unitary operations.
Computing in Scienceand Engg. , 3(2):27–32, 2001.[13] E. Knill.
Approximation by Quantum Circuits . LANL report LAUR-95-2225, 1995.[14] V. V. Shende, I. L. Markov, and S. S. Bullock. Minimal universal two-qubit quantum circuits.
APSPhysical Review A , 69:062321, 2004.[15] J. J. Vartiainen, M. M¨ott¨onen, and M. M. Salomaa. Efficient decomposition of quantum gates.
PhysicalReview Letters , 92:177902, 2004.[16] M. M¨ott¨onen, J. J. Vartiainen, V. Bergholm, and M. M. Salomaa. Quantum circuits for general multiqubitgates.
Physical Review Letters , 93(13):130502, 2004.[17] V. Bergholm, J. J. Vartiainen, M. M¨ott¨onen, and M. M. Salomaa. Quantum circuits with uniformlycontrolled one-qubit gates.
Physical Review A , 71:052330, 2005.[18] V. V. Shende, S. S. Bullock, and I. L. Markov. Synthesis of quantum logic circuits.
Proceedings of theAsia and South Pacific Design Automation Conference , pages 272–275, 2005.[19] M. M¨ott¨onen and J. J. Vartiainen.
Decompositions of general quantum gates . Ch. 7 in Trends in QuantumComputing Research, NOVA Publishers, 2006.[20] V. V. Shende, S. S. Bullock, and I. L. Markov. Synthesis of quantum-logic circuits.
IEEE Trans. onCAD , 25(6):1000–1010, June 2006.[21] Y. Nakajima, Y. Kawano, and H. Sekigawa. A new algorithm for producing quantum circuits using kakdecompositions.
Quantum Information and Computation , 6(1):67–80, 2006.[22] B. Drury and P. Love. Constructive quantum shannon decomposition from cartan involutions.
Journalof Physics A: Mathematical and Theoretical , 41(39):395305, 2008.[23] V. V. Shende, I. L. Markov, and S. S. Bullock. Smaller two-qubit circuits for quantum communicationand computation.
Design, Automation and Test in Europe , pages 980–985, 2004.[24] G. Vidal and C. M. Dawson. A universal quantum circuit for two-qubit transformations with three CNOTgates.
Physical Review A , 69:010301, 2004.[25] F. Vatan and C. Williams. Optimal quantum circuits for general two-qubit gates.
Physical Review A ,69:032315, 2004.[26] J. Zhang, J. Vala, S. Sastry, and K. B. Whaley. Minimum construction of two-qubit quantum operations.
Physical Review Letters , 93:020502, 2004.[27] F. Vatan and C. P. Williams. Realization of a general three-qubit quantum gate. e-print, quant-ph/0401178 , 2004.[28] V. V. Shende and I. L. Markov. On the CNOT-cost of Toffoli gates.
Quantum Information and Compu-tation , 9(5-6):461–486, May 2009. 1429] S. S. Bullock and I. L. Markov. Asymptotically optimal circuits for arbitrary n-qubit diagonal computa-tions.
Quantum Information and Computation , 4(1):27–47, 2004.[30] G. Song and A. Klappenecker. Optimal realizations of controlled unitary gates.
Quantum Informationand Computation , 3(2):139–155, 2003.[31] M. M¨ott¨onen, J. J. Vartiainen, V. Bergholm, and M. M. Salomaa. Transformation of quantum statesusing uniformly controlled rotations.
Quantum Information and Computation , 5(6):467–473, 2005.[32] R. R. Tucci. Qc paulinesia.
Los Alamos e-print, quant-ph/0407215 , 2004.[33] C. Lomont. Quantum circuit identities. e-print, quant-ph/0307111 , 2003.[34] C. C. Paige and M. Wei. History and generality of the CS decomposition.
Linear Algebra and Applications ,208:303–326, 1994.[35] R. K. Guy.
Unsolved Problems in Number Theory, 2nd ed.
Springer-Verlag, New York, 1994.[36] E. Knill, R. Laflamme, and G. J. Milburn. A scheme for efficient quantum computation with linearoptics.
Nature , 409:46–52, January 2001.[37] A. G. Fowler, S. J. Devitt, and L. C. L. Hollenberg. Implementation of shor’s algorithm on a linearnearest neighbour qubit array.
Quantum Information and Computation , 4(4):237–245, 2004.[38] M. Laforest et al. Using error correction to determine the noise model.
Physical Review A , 75, 2007.[39] B. Kane. A silicon-based nuclear spin quantum computer.