Two-Qubit Quantum Gates to Reduce the Quantum Cost of Reversible Circuit

Similar documents
Synthesis of Fredkin-Toffoli Reversible Networks

Reversible Logic Synthesis with Output Permutation

Reversible Function Synthesis with Minimum Garbage Outputs

Templates for Positive and Negative Control Toffoli Networks

Synthesizing Reversible Circuits for Irreversible Functions

Quantified Synthesis of Reversible Logic

Optimized Reversible Programmable Logic Array (PLA)

A Shared-cube Approach to ESOP-based Synthesis of Reversible Logic

Integrated Synthesis of Linear Nearest Neighbor Ancilla-Free MCT Circuits

An Algorithm for Minimization of Quantum Cost

CHAPTER 2 AN ALGORITHM FOR OPTIMIZATION OF QUANTUM COST. 2.1 Introduction

Synthesis of Quantum Circuit for FULL ADDER Using KHAN Gate

Technology Mapping of Reversible Circuits to Clifford+T Quantum Circuits

FPGA-Based Circuit Model Emulation of Quantum Algorithms

Exploiting Reversibility in the Complete Simulation of Reversible Circuits

Exact SAT-based Toffoli Network Synthesis

Analysis of Multiplier Circuit Using Reversible Logic

Group Theory Based Synthesis of Binary Reversible Circuits

ENERGY loss is an important consideration in digital design.

Computer Science & Engineering Dept, West Bengal University of Technology 2 Information Technology Dept, Manipal University

Improved ESOP-based Synthesis of Reversible Logic

Quantum Cost efficient Reversible Multiplier

A Novel Design for carry skip adder using purity preserving reversible logic gates

Direct Design of Reversible Combinational and Sequential Circuits Using PSDRM Expressions

Design and Implementation of REA for Single Precision Floating Point Multiplier Using Reversible Logic

ISSN Vol.03, Issue.03, June-2015, Pages:

Extended Superposed Quantum State Initialization Using Disjoint Prime Implicants

On The Complexity of Quantum Circuit Manipulation

Synthesis of Reversible Circuits for Large Reversible Functions

Design and Optimization of Reversible BCD Adder/Subtractor Circuit for Quantum and Nanotechnology Based Systems

Equivalence Checking of Reversible Circuits

FPGA IMPLEMENTATION OF BASIC ADDER CIRCUITS USING REVERSIBLE LOGIC GATES

Technology Mapping and Optimization for Reversible and Quantum Circuits

Optimized design of BCD adder and Carry skip BCD adder using reversible logic gates

OPTIMIZED MULTIPLIER USING REVERSIBLE MULTI- CONTROL INPUT TOFFOLI GATES

Design of an Online Testable Ternary Circuit from the Truth Table

A Novel Reversible Gate and its Applications

Design of a Compact Reversible Random Access Memory

Department of ECE, Vignan Institute of Technology & Management,Berhampur(Odisha), India

Transistor Implementation of Reversible Comparator Circuit Using Low Power Technique

Design of a compact reversible binary coded decimal adder circuit

arxiv: v1 [quant-ph] 20 Jul 2009

SYNTHESIS AND TESTING OF REVERSIBLE TOFFOLI CIRCUITS. NOOR MUHAMMED NAYEEM Bachelor of Science, University of Dhaka, 2008

Design and Implementation of Combinational Circuits using Reversible Gates

Realization of 2:4 reversible decoder and its applications

An Optimized BCD Adder Using Reversible Logic Gates

Design of Reversible Code Converters Using Verilog HDL

Optimized Nanometric Fault Tolerant Reversible BCD Adder

DESIGN AND ANALYSIS OF A FULL ADDER USING VARIOUS REVERSIBLE GATES

Optimization of reversible sequential circuits

Design and Implementation of Nanometric Fault Tolerant Reversible BCD Adder

High Speed Time Efficient Reversible ALU Based Logic Gate Structure on Vertex Family

A New Approach for Designing of 3 to 8 Decoder and It s Applications Using Verilog HDL

Literature Review on Multiplier Accumulation Unit by Using Hybrid Adder

International Journal of Emerging Technologies in Computational and Applied Sciences (IJETCAS)

Design of Digital Adder Using Reversible Logic

Downloaded from

Design of Reversible Sequential Circuit Using Reversible Logic Synthesis

On Universality of Ternary Reversible Logic Gates

LNN Reversible Circuit Realization Using Fast Harmony Search Based Heuristic 1

Design of Reversible Synchronous Sequential Circuits

FULL ADDER/ SUBTRACTOR USING REVERSIBLE LOGIC

arxiv:quant-ph/ v1 24 Jul 2006

Database Manipulation Operations on Quantum Systems

arxiv: v2 [quant-ph] 27 Dec 2010

Design of Reversible Logic based Basic Combinational Circuits

Low Power and High Speed BCD Adder using Reversible Gates

A Systematic Algorithm for Quantum Boolean Circuits Construction

USING AUTOCORRELATION COEFFICIENT-BASED COST FUNCTIONS IN ESOP-BASED TOFFOLOI GATE CASCADE GENERATION

Variable Reordering for Reversible Wave Cascades - PRELIMINARY VERSION

DESIGN OF A COMPACT REVERSIBLE READ- ONLY-MEMORY WITH MOS TRANSISTORS

A Novel Synthesis Algorithm for Reversible Circuits

FPGA IMPLEMENTATION OF 4-BIT AND 8-BIT SQUARE CIRCUIT USING REVERSIBLE LOGIC

An Efficient Reversible Design of BCD Adder

PERFORMANCE ANALYSIS OF CLA CIRCUITS USING SAL AND REVERSIBLE LOGIC GATES FOR ULTRA LOW POWER APPLICATIONS

On the Analysis of Reversible Booth s Multiplier

Implementation of Reversible ALU using Kogge-Stone Adder

On the Difficulty of Inserting Trojans in Reversible Computing Architectures

Logic Synthesis for Quantum State Generation

arxiv:quant-ph/ v1 27 Sep 2005

Design of Reversible Comparators with Priority Encoding Using Verilog HDL

DESIGN OF PARITY PRESERVING LOGIC BASED FAULT TOLERANT REVERSIBLE ARITHMETIC LOGIC UNIT

Implementation of Optimized Reversible Sequential and Combinational Circuits for VLSI Applications

ENERGY EFFICIENT DESIGN OF REVERSIBLE POS AND SOP USING URG

A Novel Design of Reversible Universal Shift Register

Design and Implementation of Carry Adders Using Adiabatic and Reversible Logic Gates

arxiv: v1 [quant-ph] 12 Aug 2013

Power Optimization using Reversible Gates for Booth s Multiplier

An FPGA Implementation of Energy Efficient Code Converters Using Reversible Logic Gates

Quantum Cost Optimization for Reversible Carry Skip BCD Adder

Reversible Circuit Synthesis of Symmetric Functions Using a Simple Regular Structure

Reversible Circuit Using Reversible Gate

Technical Report: Considerations for Determining a Classification Scheme for Reversible Boolean Functions

Majority-Based Reversible Logic Gate

Design of 16 Bit Adder Subtractor with PFAG and TG Gates Using Verilog HDL

Power Minimization of Full Adder Using Reversible Logic

Design of Efficient Adder Circuits Using PROPOSED PARITY PRESERVING GATE (PPPG)

A More Effective Realization Of BCD Adder By Using A New Reversible Logic BBCDC

Circuit for Revisable Quantum Multiplier Implementation of Adders with Reversible Logic 1 KONDADASULA VEDA NAGA SAI SRI, 2 M.

Design of Universal Shift Register Using Reversible Logic

Transcription:

11 41st IEEE International Symposium on Multiple-Valued Logic Two-Qubit Quantum Gates to Reduce the Quantum Cost of Reversible Circuit Md. Mazder Rahman, Anindita Banerjee, Gerhard W. Dueck, and Anirban Pathak Faculty of Computer Science, University of New Brunswick, Canada Department of Physics and Material Science Engineering, Jaypee Institute of Information Technology, Noida, INDIA Abstract This paper presents a quantum gate library that consists of all possible two-qubit quantum gates which do not produce entangled states. The quantum cost of each two-qubit gate in the proposed library is one. Therefore, these gates can be used to reduce the quantum costs of reversible circuits. Experimental results show a significant reduction of quantum cost in benchmark circuits. The resulting circuits could be further optimized with existing tools, such as quantum template matching. Index Terms Revesible Logic, Logic Synthesis, Quantum Cost, Gate Library, Quantum Circuit. I. INTRODUCTION Scientists have gained interest in doing research on reversible logic for the last few years due to its potentially lossless energy property. Landauer s principle [1] states that logic computations that are not reversible, necessarily generate heat kt log for every bit of information that is lost, where k is Boltzmanns constant and T the temperature. For room temperature the amount of dissipating heat is small (i.e.,.9 1 1 Joule), but not negligible. Therefore, research on reversible logic plays a significant role in quantum computing, optical computing, nanotechnology, and low-power CMOS design for the development of much more powerful computers and computations. Different synthesis methods have been proposed, such as a transformation based algorithm [], [3], translating ESOP expression into Toffoli circuits [4] and others. Since synthesis of reversible circuits differs significantly from synthesis using traditional irreversible gates, new methods have been developed. Optimal results can only be obtained for small circuits. A transformation based algorithm [] gives near-optimal results for 3-input circuits as well as good results for larger problems without searching extensively. However, heuristic synthesis approaches often result in suboptimal circuits. Once a circuits has been obtained, further optimization techniques can be applied. Since there are different cost considerations such as garbage lines, gate count, and quantum cost, methods for specific cost reductions may be developed. Optimization approaches such as template matching [5], [6] focus on the reduction of the gate count or quantum cost of a Toffoli network. They are search methods that look for gate sequences that can be replaced by alternative cascades with lower cost. Synthesis of reversible circuits using a basic two-qubit quantum gates library has been proposed in [7] each gate has unit cost. It has been shown, that two -qubit elementary quantum gates that act on the same two qubit lines can be merged into a new quantum gate of cost one. It is also further referred to as a double gate of unit cost [8]. Similar work has been done by investigating the quantum blocks with lowest cost in quantum circuits [9], however the number of all possible low cost quantum blocks has not been enumerated in his work. In this paper, we proposed a new two-qubit quantum gates library in which each gate can be realized by the two-qubit function of unit cost. The cost of 1-qubit and -qubit quantum gate is one [1] and therefore, a valid sequence of 1-qubit and -qubit elementary quantum gates which are acting on the same qubit lines do not increase the quantum cost, and the resulting cost is still one. Since quantum circuits are inherently reversible, every reversible circuit can be decomposed into a quantum circuit [1]. We decompose reversible circuits with multiple control Toffoli (MCT) gates into quantum circuits and then find a sequence of quantum gates in the circuits that can form a valid two-qubit gate using moving rules. In this work, we have only considered the quantum implementation cost of reversible circuits rather than other cost metrics. However, the decomposition increases the number of extra garbage lines which can also increase the implementation costs of reversible circuits. The remaining part of this paper is organized as follows. Section II gives the background of reversible logic theory. Section III describes the details of the algorithm to build the library of all possible two-qubit quantum gates. Decomposition of reversible circuits into quantum circuits and optimization of quantum cost of reversible circuits are shown in Section IV and V respectively. We show the experimental result for benchmarks functions in Section VI. Finally, Section VII concludes the paper. II. BACKGROUND A logic function is said to be reversible if there is a oneto-one and onto mapping between input vectors and output vectors. Table I shows the truth table of a 3 3 reversible function. Reversible functions can be realized by reversible circuits as the cascades of reversible gates without allowing feedback and fan-out into the gates. Reversible gates such as Toffoli [11], Peres [1] and Fredkin [13] are conventionally used to synthesize reversible circuits. However, Toffoli based synthesis of 195-63X/11 $6. 11 IEEE DOI 1.119/ISMVL.11.56 86

xyz x o y o z o 111 1 1 1 1 11 11 1 11 1 11 11 111 11 Table I TRUTH TABLE OF A 3 3 REVERSIBLE FUNCTION. reversible circuits is prevalent. A generalized multiplecontrol Toffoli gate is defined as T OF n (C, T ) based on number of control lines n, which maps each pattern (x i1, x i,..., x ik ) to (x i1, x i,..., x j 1, x j x i1 x i... x j 1 x j+1... x ik, x j+1,..., x ik ), where C = {x i1, x i,..., x ik }, T = {x j } and C T = φ. C is referred to as the control set and T is referred to as the target. T OF and T OF 1 are referred to as NOT and CNOT respectively. According to the transformation based algorithm proposed in [5] the circuit in Figure realizes the reversible function whose truth table is shown in Table I. Figure 1. (a) Generalized Toffoli gate and (b) T OF. Figure. Reversible circuit that realizes the function shown in Table I. In synthesizing reversible circuits, one key concern is to obtain circuits with low quantum costs. The quantum cost of a circuit is defined by the total number of elementary quantum gates needed to realize the given function. It is stated that every elementary quantum gate requires a single operation of unit cost [1]. The quantum gate library includes the primitive gates NOT, CNOT, Controlled-V and Controlled-V + each has a unit cost. It has been shown, that Toffoli gates can be realized by a sequence of elementary quantum gates [1]. For example, the circuit shown in Figure is expanded to the sequence of elementary quantum gates as shown in Figure 3. The quantum cost (the number of elementary gates) of the circuit 16. However, we will show that this cost can be reduced with our proposed methods. Figure 3. Quantum circuit The logic operations of quantum circuits and the classical circuits are different. The basic information in quantum computing is represented as a qubit that is analogous to a line in classical logic circuits. An arbitrary qubit can be described as ( ) α ψ = α + β 1 = β where α and β are complex numbers which satisfy: α + β = 1. Similarly a generalized two qubit state can be described as a ψ = a + b 1 + c 1 + d 1 = b c. d This state is separable as tensor product of two states if and only if ad = bc (1) otherwise the state is entangled. This condition can be visualized easily if we consider the tensor product of two single qubit states denoted by α + β 1 and α + β 1. The product state is ( α β ) ( α β ) = αα αβ βα ββ that satisfies the condition of separability as αα ββ = αβ βα. The condition (1) is important for the present work as we restrict our two qubit gate library to include only those gates which do not produce an entangled output state. Consequently after construction of every new gate, by multiplication of two existing valid gates, we check whether the output states of the newly obtained gate is entangled or not (i.e. whether they violate the condition (1) or not). If condition (1) is violated for a gate for any allowed input states, then the gate is not valid and will not be added to the library. Moreover, the elementary quantum gates are represented by their unitary matrices [7] that may include complex elements. For example, the unitary matrix of two-qubit controlled V gate is represented as 1 1 M v = (1+i) (1 i) (1 i) (1+i) which will not produce an entangled state in output for any valid input state. Two two-qubit gates acting on the same two 87

qubit lines can be represented by two matrices A and B. These matrices can be multiplied to yield a new operation C = B A, which represents a two-qubit gate. This leads to the following definition. Definition 1: A two-qubit function can be defined as the mapping of f(x, y) (p, q), where x, y, p, q {, 1, V, V 1 } and, 1, V and V 1 are individual state vector in quantum computation. V and V 1 are defined by as follows (1 + i) ( V = 1 i ) (1 + i) ( V 1 = 1i ). III. BUILDING THE GATE LIBRARY It has been shown in [14], that any pair of the quantum gates (CNOT, controlled-v, and controlled-v + ) can be realized with unit cost as long as they operate on the same two qubits. An example is shown in Table 4. In this case, these gates can be merged into a new two-qubit gate (also called double gate) and the cost of resulting gate can be considered as one. Figure 4. Merging of two two-qubit gates results new gate of unit cost In addition, for optimal synthesis of reversible functions using quantum gates, there are four different signals:, 1, V, and V 1. The intermediate signals V and V 1 can not be applied to the control of the two-qubit gate, because the resulting output vector generates an entangled state that can not be separated into two individual qubit states [7]. Note, this restriction only applies to reversible circuits not quantum circuits. However, the resulting matrix of double gates is unitary and applying all possible inputs to the double gates in Figure 4 results four output vectors which can be considered as the output strings of, 1V, 1V 1 and 1. In contrast, applying V to both qubits in the double gate results in an entangled state (as the following matrix multiplication shows) because according to the condition (1) the resulting vector can not be separated into two different qubits states: 1 (1+i) 6 4 i (1+i) 1 1 (1 i) (1 i) i 3 7 5 6 4.5i.5.5.5i 3 7 6 5 = 4.5i.5.5i.75.5i 3 7 5. Reversible circuits map binary inputs to binary outputs, and the number of inputs and outputs are same. While we are using two-qubit quantum gates for realizing reversible circuits, there are only four combinations of binary inputs out of 16 possible inputs (internally, there are four possible values) to be applied to the two-qubit quantum gates. Therefore, it is necessary and sufficient that any sequence of 1-qubit and -qubit quantum gates maps at least four inputs (It will also be referred to as good outputs in the subsequent sections) into outputs that are not entangled. We use this restriction to define a valid twoqubit quantum gate for realizing reversible circuits. Observation 1: Any sequence of single qubit and two-qubit elementary quantum gates that are acting on the same two qubits in a circuit can be formed as a new two-qubit quantum gate. If the resulting gate produces at least four two-qubit state vectors, not including entangle state vectors, then the resulting gate is said to be a valid two-qubit quantum gate realizable by the two-qubit operation of unit cost. Building the two-qubit quantum gate library, we consider four different input signals, 1, V, and V 1 where the control inputs are only binary values. There are 16 possible combinations of state vectors can be found in regarding the single qubit NOT gate. For simplicity, we define all possible input vectors as the set of input strings I = {, 1, V, V 1, 1, 11, 1V, 1V 1, V, V 1, V V, V V 1, V 1, V 1 1, V 1 V, V 1 V 1 }. In this section, we enumerate the possible two-qubit quantum gates as well as build a two-qubit quantum gate library GL that includes all two-quit gates with no entanglement. There are 8 possible primitive quantum gates each with a distinct matrix. The set of elementary quantum gates is Q = {V (a, b), V (b, a), V + (a, b), V + (b, a), T (a, b), T (b, a), T (b), T (a)} where the first and second parameter of the two-qubit gates are the control and target respectively. According to Observation 1, we propose new two-qubit quantum gates that are formed by cascading one-qubit and two-qubit primitive quantum gates. The resulting gate is is added to GL, if it satisfies the following three constrains: 1) the resulting gate matrix is not the identity matrix, that is, the function of resulting gate is not the identity; ) the resulting gate matrix is not in GL; 3) applying all 16 possible inputs to the resulting gate results in at least four good outputs as stated in Observation 1. Since the intermediate signals V and V 1 are not applied to the gate control lines, which results in entangled state vectors. A. Algorithm Input: Input vectors for all possible two-qubit states for four input signals. Matrices for all 8 primitive quantum gates. Output: Gate library that contains the matrices of new two-qubit gates that are analogous to the new two-qubit quantum gates of unit cost. Good output vectors for all new gates. BEGIN: 1) GL = φ ) foreach i {1,,, m} 3) GL = GL QG M i 88

4) end 5) n = m 6) foreach j {1,,, n} 7)..foreach k {1,, m} 8)... R M = QG M k GLM j 9)...if(R M I) // check Identity 1)...if(R M / n GL M n ) //check match 11)... O v = φ 1)...foreach p {1,,, l} 13)... V o = R M IV P // apply input vectors 14)... if(v o l IV l ) 15)... O v = O v V o 16)...end if 17)...end 18)...if (NE(O v ) 4) // good outputs? 19)... n = n + 1 )... GL = GL R M // gate library update 1)...end if )...end if 3)...end if 4)..end 5) end END. In the above algorithm, lines through to 4 initialize the gate library GL with the matrices QG M for all m primitive gates QG m. The number of elements in GL is denoted by n that is updated in line 18 when a new gate is found. R M represents an arbitrary matrix can be the matrix of a new possible gate (g j )(QG k ) with the cascading of the gate g j in GL and k th primitive gate QG k. QG M k and GLM j in line 8 denote k th quantum primitive gate matrix and j th gate matrix in the library GL. The subsequent lines 9 and 1 check whether R M is the identity matrix or is matched with a matrix in the gate library. That is, if a match is found, then there is an equivalent gate in GL. The iteration in lines 1 to 17 are the analogy of applying all 16 possible inputs to the new gate and check whether the output vector is an entangled state or not. If the resulting gate produces a subset of possible input sets as outputs then the resulting gate is a new two-qubit quantum gate and the new gate matrix stored in the gate library (line ). There are 783 possible two-qubit quantum gates including the 8 elementary quantum gates. A partial result of two-qubit gates in computed library is shown in Table II. The following is one if the gates, which consists of a cascade of 6 elementary quantum gates. T Q = T (b)v + (b, a)t (a, b)v (b, a)t (b)t (b, a) The corresponding matrix is.5 +.5i.5.5i M g =.5 +.5i.5.5i.5i.5.5 +.5i. 1 Table II PARTIAL GATE LIBRARY. The following two-qubit gates T Q 1 and T Q are equivalent since their corresponding matrices are identical (shown as M Q1Q ). T Q 1 = T (a)t (a, b)v (b, a) T Q = T (a)t (a, b)v + (b, a)t (b, a) 3 1 6.5.5i.5 +.5i7 M Q1 Q = 4 1 5.5 +.5i.5.5i IV. DECOMPOSITION OF REVERSIBLE CIRCUITS INTO QUANTUM CIRCUITS Reversible circuits can be decomposed into quantum circuits since each reversible gate has its quantum implementation. In this paper we only consider the quantum implementation of MCT (multiple control Toffoli) gates. Different rules for decomposing MCT gates into quantum circuits have been proposed in [1]. The decomposition depends on the number 89

of control lines m of the MCT gate in question and the number of lines n in the reversible circuits. In addition, at least one working line is needed to decompose a T OF m gate into a quantum circuit, when n 3 and m = n 1. The quantum costs of reversible circuits vary with the number of available working lines. In general, more working lines will result in decompositions with less cost. We have here only considered the linear decomposition of T OF n gates in n-bit networks for decomposing any arbitrary reversible circuit with Multiple Control Toffoli gates into quantum circuit. Pairing Toffoli gates may result in fewer elementary quantum gates [15]. According to Lemma 6.1 in [1], the classical reversible primitive T OF gate has an implementation of quantum costs five, shown in Figure 5. Since the right most controlled-v gate can move anywhere in the circuit, different arrangements of quantum implementations of T OF are possible. Figure 5. Quantum realization of T OF. Figure 8. lines. Decomposition of T OF 5 into MCT circuit with two working If the circuit that is to be decomposed contains a T OF n, then one ancilla line must be added (since at least one working line is required for the decomposition). This should be determined before the decomposition starts, because it will make an extra working line available, and thus, potentially reduce the cost of other decompositions. Example 1: Consider the function Mod5 (taken from RevLib [16]). Its MCT realization is shown in Figure 9 and its decomposition into elementary quantum gates is shown in Figure 1. If a reversible circuit with n lines, where n 5, contains a T OF m gate where 3 n/, then T OF m can be decomposed as a network of 4(m ) T OF gates as shown in Figure 6. Figure 9. Reversible circuit Mod5. Figure 6. Decomposition of T OF 4 into MCT circuit. Moreover, if a reversible circuit with n lines, where n 5, contains a T OF m gate, where m n 3, then the T OF m gate can be decomposed into a network consisting of two T OF gates and two T OF m 1 gates as shown in Figure 7. Therefore, 5 elementary quantum gates are required to decompose T OF 4 with one working line. Figure 7. line. Decomposition of T OF 5 into MCT circuit with one working There are 4 elementary quantum gates required for decomposing T OF 4 with two working lines, as shown in Figure 8. Figure 1. Quantum circuit after decomposing the reversible circuit Mod5. V. QUANTUM COST REDUCTION OF REVERSIBLE CIRCUITS USING GENERALIZED TWO-QUBIT GATES In this section, we show how the new two-quit gates can be used to reduce the quantum cost of reversible circuits. The basic idea is to use the moving rule to create long sequences of two qubit gates that operate on the same two qubit lines. These gates can them be merged into a single one, reducing the cost. The moving rule states that two adjacent gates G 1 and G can be interchanged if the target of G 1 does not intersect with the control lines of G and vice-versa []. We illustrate this in the following example. Example : Consider the function Mod5. The implementation shown in Figure 1 has quantum cost 16. We can reorder the gates as shown in Figure 11. Gates 1 and form a -qubit quantum gate that can be realized by a two-qubit gate in the 9

proposed library. Similarly gates 9 and 14 form another twoqubit gate as well as gates 13 and 15 form a further one. The cost of the circuit is reduced by 4. That is, the total quantum cost of the resulting circuit is 1. It should be noted, that applying the moving rule to the first potential pair of gates, may result in sub-optimal quantum cost reductions. When a gate is moved towards another gate to form a longer sequence of two-qubit gates it may prevent other gates from moving in the other direction to form another sequence of two qubit gates. When several moves are possible, one may result in a better cost reduction. In our implementation the first move is taken without investigating alternative moves. new gates that were not already in the gate library. In other words the 783 gates produced are closed and complete under the allowed (valid) operations. Figure 1. Analysis of costs reduction. Figure 11. Quantum circuit with 1 two-qubit quantum gates. VI. EXPERIMENTAL RESULTS A program that builds the gate library with all possible twoqubit quantum gates has been written using MATLAB. The results shows that a new gate can be formed by cascading a maximum of 8 primitive quantum gates, and there are 783 twoqubit gates that produce distinct outputs with the constraints mentioned in Section III. We used RevKit-1. [17] tools for reversible circuit design to implement the decomposition algorithm. We used reversible circuits with MCT gates reported in RevLib [16] to verify the power of our algorithm. After the decomposition, the moving rule was used to optimize the quantum costs of reversible circuits. The results are shown in Table III. Columns 3 and 5 represents the number of lines in original circuits and extra working line needed to decompose the circuit into quantum circuit respectively. Column 4 shows the number of elementary quantum gates required for the quantum implementation of reversible circuits. Last column indicates the reduction of quantum costs in percentage for Benchmark functions reported in RevLib. The bar chart in Figure 1 shows that the costs reductions are from 1-1% for about 5% of the benchmarks in our experiment. Further, the line graph shows the distribution of the cost reductions (see Figure 13). In the best case, for benchmark ex-1 166, a cost reduction of 37.5% was achieved. VII. CONCLUSION We proposed a two-qubit quantum gate library that plays a significant role in reducing quantum costs of reversible circuits. Experimental result show that reductions in quantum cost of more than % has been observed in more than half of the circuits from RevLib. While building the gate library all possible cascades of elementary quantum gates have been considered even cascades with more than 8 gates. However, no cascades produced valid Figure 13. Analysis of costs reduction. REFERENCES [1] R. Landauer, Irreversibility and heat generation in the computing process, IBM J. Res., vol. 5, pp. 183 191, 1961. [] D. M. Miller, D. Maslov, and G. W. Dueck, A transformation based algorithm for reversible logic synthesis, in Design Automation Conference, June 3. [3] K. Iwama, Y. Kambayashi, and S. Yamashita, Transformation rules for designing CNOT-based quantum circuits, in Design Automation Conference, New Orleans, Louisiana, USA, June 1-14. [4] A. Mishchenko and M. Perkowski, Logic synthesis of reversible wave cascades, in International Workshop on Logic Synthesis, June. [5] D. Maslov, G. W. Dueck, and D. M. Miller, Toffoli network synthesis with templates, Transactions on Computer Aided Design, vol. 4, no. 6, pp. 87 817, 5. [6] D. Maslov, C. Young, G. W. Dueck, and D. M. Miller, Quantum circuit simplification using templates, in DATE - Design, Automation and Test in Europe, 5, pp. 18 113. [7] W. Hung, X. Song, G. Yang, J. Yang, and M. Perkowski, Optimal synthesis of multiple output Boolean functions using a set of quantum gates by symbolic reachability analysis, Transactions on Computer Aided Design, vol. 5, no. 9, pp. 165 1663, 6. [8] D. Große, R. Wille, G. W. Dueck, and R. Drechsler, Exact synthesis of elementary quantum gate circuits for reversible functions with don t cares, in International Symposium on Multiple Valued Logic, 8, pp. 14 19. [9] M. Lukac, Quantum logic synthesis and inductive machine learning, Ph.D. dissertation, Portland State University, 9. [1] A. Barenco, C. H. Bennett, R. Cleve, D. DiVinchenzo, N. Margolus, P. Shor, T. Sleator, J. Smolin, and H. Weinfurter, Elementary gates for quantum computation, The American Physical Society, vol. 5, pp. 3457 3467, 1995. 91

Benchmark Gates Lines QC(before) WL QC(after) Cost Red. (%) ex-1 166 4 3 8 5 37.5 3 17 13 6 3 14 9 35.71 4mod5-v 18 9 5 5 17 3. 3 17 15 1 3 1 7 3. 3 17 14 6 3 14 1 8.57 fredkin 5 7 3 7 5 8.57 alu-v1 9 7 5 15 11 6.67 alu-v 33 7 5 15 11 6.67 alu-v3 35 7 5 15 11 6.67 alu-v4 37 7 5 15 11 6.67 4gt11 8 1 5 16 1 5. mod5d 7 8 5 16 1 5. 4gt11 83 8 5 1 9 5. miller 1 8 3 8 6 5. miller 11 5 3 17 13 3.53 rd3-v1 68 5 4 13 1 3.8 decod4-v 43 6 4 18 14. decod4-v 4 9 4 9 7. decod4-v 44 9 4 9 7. decod4-v3 46 9 4 9 7. alu-v 7 6 5 14 11 1.43 alu-v3 34 7 5 19 15 1.5 alu-v1 8 7 5 15 1. fredkin 6 3 3 15 1. 4 49 16 16 4 74 1 6 18.9 4 49 17 1 4 3 6 18.75 mod5d1 63 7 5 11 9 18.18 sym9 146 8 1 18 89 17.59 rd73 14 1 76 63 17.11 sys6-v 111 1 7 6 16.67 4gt5 76 13 5 36 3 16.67 4mod5-v1 3 8 5 4 16.67 decod4-v 38 6 4 18 15 16.67 rd3-v 66 4 4 1 1 16.67 rd53 138. 1 8 44 37 15.91 hwb4 5 16 4 78 1 66 15.38 4mod5-v 19 5 5 13 11 15.38 4mod5-v1 4 5 5 13 11 15.38 rd84 14 8 15 11 95 15.18 41184 17 74 14 74 63 14.86 41184 17 46 14 9 77 14.44 decod4-enable 15 9 6 1 18 14.9 4gt11 84 3 5 7 6 14.9 decod4-v1 41 6 4 9 1 5 13.79 4gt13 9 3 5 19 13.64 aj-e11 168 1 4 37 1 3 13.51 aj-e11 165 13 4 5 1 45 13.46 4gt11-v1 85 4 5 8 7 1.5 decod4-v3 45 7 4 49 1 43 1.4 decod4-v1 4 9 4 9 8 11.11 4mod5-v 5 5 9 8 11.11 4mod5-v1 5 5 9 8 11.11 ham3 1 5 3 9 8 11.11 toffoli double 4 4 1 9 1. 4gt13 9 14 5 41 37 9.76 4mod7-v1 96 7 5 53 48 9.43 mini-alu 167 6 4 9 1 8 8.89 mod1 171 1 4 79 1 7 8.86 mod1 176 7 4 57 1 5 8.77 4gt13-v1 93 4 5 3 1 8.7 one-two-three-v 1 8 5 4 8.33 one-two-three-v3 11 8 5 4 8.33 add64 184 56 193 768 75 8. 4gt13 91 1 5 37 34 8.11 add3 183 18 97 384 353 8.7 alu-v4 36 7 5 38 35 7.89 c 181 116 35 368 339 7.88 add16 174 64 49 19 177 7.81 4mod7-v 94 6 5 5 48 7.69 4mod7-v 95 6 5 5 48 7.69 mod5mils 65 5 5 13 1 7.69 mod5mils 71 5 5 13 1 7.69 add8 17 3 5 96 89 7.9 rd53 133 1 7 184 171 7.7 one-two-three-v1 99 8 5 43 4 6.98 alu-v 6 6 5 9 7 6.9 decod4-enable 16 14 6 17 1 6.54 one-two-three-v 98 8 5 47 44 6.38 alu-v 31 13 5 143 134 6.9 rd53 137 16 7 86 81 5.81 mod5adder 18 15 6 111 15 5.41 mod5d 64 8 5 19 5. 4gt4-v 78 13 5 81 1 77 4.94 c 18 35 35 35 9 4.9 4gt1-v 86 14 5 86 1 8 4.65 hw 6 test 1 1 8 68 4.9 4gt1-v1 81 6 5 48 46 4.17 ham7 16 5 7 49 47 4.8 4gt4-v 79 9 5 77 1 74 3.9 alu-v 3 7 5 53 51 3.77 4gt1-v 87 1 5 8 1 79 3.66 4gt5 75 5 5 8 7 3.57 4gt4-v1 74 5 5 85 1 8 3.53 one-two-three-v 97 11 5 9 89 3.6 4gt1-v 88 5 5 6 1 6 3.3 cnt3-5 179 5 16 65 63 3.8 mod8-1 177 14 5 143 1 139.8 4gt4-v 7 6 5 8 1 8.44 4gt5 77 4 5 4 41.38 mod8-1 178 9 5 111 1 19 1.8 4gt4-v 8 5 5 58 1 57 1.7 4gt1-v1 89 5 5 73 1 7 1.37 add64 186 384 193 384 384 add3 185 19 97 19 19 add16 175 96 49 96 96 hwb4 5 11 4 3 3 toffoli double 3 7 4 7 7 peres 9 3 6 6 graycode6 47 5 6 5 5 graycode6 48 5 6 5 5 toffoli 1 5 3 5 5 toffoli 1 3 5 5 peres 8 4 3 4 4 Table III QUANTUM COST REDUCTION USING TWO-QUBIT QUANTUM GATE. [11] T. Toffoli, Reversible computing, Tech memo MIT/LCS/TM-151, MIT Lab for Comp. Sci, 198. [1] A. Peres, Reversible logic and quantum computers, Phys. Rev. A, vol. 3, no. 6, pp. 366 376, Dec 1985. [13] E. Fredkin and T. Toffoli, Conservative logic, International Journal of Theoretical Physics, vol. 1, pp. 19 53, 198. [14] A. Barenco, C. H. Bennett, R. Cleve, D. P. DiVinchenzo, N. Margolus, P. Shor, T. Sleator, J. A. Smolin, and H. Weinfurter, Elementary gates for quantum computation, The American Physical Society, vol. 5, pp. 3457 3467, 1995. [15] N. O. Scott and G. W. Dueck, Pairwise decomposition of Toffoli gates in a quantum circuit, in Proceedings of the 18th ACM Great Lakes symposium on VLSI, 8, pp. 31 36. [16] R. Wille, D. Große, L. Teuber, G. W. Dueck, and R. Drechsler, RevLib: An online resource for reversible functions and reversible circuits, in Workshop on Reversible Computation, July 1, RevLib is available at http://www.revlib.org. [17] M. Soeken, S. Frehse, R. Wille, and R. Drechsler, RevKit: a toolkit for reversible circuit design, in Proceedings of the International Symposium on Multiple-Valued Logic, 8, RevKit is available at http://www.revkit.org. 9