An Extended approach for Mapping Reversible ... - Science Direct

0 downloads 0 Views 425KB Size Report
Procedia Computer Science 125 (2018) 832–839 ... of the scientific committee of the 6th International Conference on Smart Computing and Communications.
Available online at www.sciencedirect.com Available online at www.sciencedirect.com Available online at www.sciencedirect.com

Available online at www.sciencedirect.com

ScienceDirect Procedia Computer Science 12500 (2018) 832–839 Procedia Computer Science (2018) 000–000 Procedia Computer Science 00 (2018) 000–000 Procedia Computer Science 00 (2018) 000–000

www.elsevier.com/locate/procedia

www.elsevier.com/locate/procedia 6th International Conference on Smart Computing & Communications 2017 www.elsevier.com/locate/procedia 6th International Conference on Smart Computing & Communications 2017 6th International Conference on Smart Computing & Communications 2017

An Extended approach for Mapping Reversible Circuits to Quantum An for Reversible Circuits An Extended Extended approach approach for Mapping Mapping Reversible Circuits to to Quantum Quantum Circuits using NCV-|v 1  library Circuits using NCV-|v 1 Circuits using NCV-|v  library library ∗ Mousum Handique , Aayush 1 Sonkar Mousum Handique∗, Aayush Sonkar

∗ Department of Computer Science Engineering, TrigunaSonkar Sen School of Technology, Mousum Handique , Aayush Department of Computer Science Engineering, Triguna Sen India School of Technology, Assam University, Silchar-788011, Assam, Department of Computer Science Engineering, Triguna Sen School of Technology, Assam University, Silchar-788011, Assam, India Assam University, Silchar-788011, Assam, India

Abstract Abstract Abstract In recent years, quantum computing has gained a lot of importance due to its property of increasing computational power expoIn recent years, quantumliterature, computing hasobserved gained athat lot of due to its has property of increasing computational power exponentially. In the current it has theimportance quantum computing potential to solve many complex problems with In recent years, quantum computing has gained a lot of importance due to its property of increasing computational power exponentially. In the based currentonliterature, it has observed that in thecontrast quantum computingimplementation has potential toofsolve manytechnology, complex problems with less complexity the theoretical analysis. But to hardware quantum it expands in nentially. In the current literature, it has observed that the quantum computing has potential to solve many complex problems with less complexity based onthere the theoretical analysis.between But in contrast to computing hardware implementation of quantum More technology, it expands in a linear way. Moreover, is a close relation quantum and reversible computing. precisely, quantum less complexity based on the theoretical analysis. But in contrast to hardware implementation of quantum technology, it expands in acomputing linear way. Moreover,are there is a close between quantum and reversible computing. precisely,reversible quantum operations reversible. In relation this paper, we propose ancomputing extended approach of mapping flow More for describing a linear way. Moreover, there is a close relation between quantum computing and reversible computing. More precisely, quantum computing operations arequantum reversible. In thisHere, paper, propose extendedcircuits approach mapping for describing reversible circuits to its equivalent circuits. wewe consider theanreversible of of n-inputs andflow n-outputs with NCT and GT computing operations are reversible. In this paper, we propose an extended approach of mapping flow for describing reversible circuits to its equivalent circuits.circuits Here, we the 1reversible circuits we of n-inputs n-outputs withresults NCT in and GT  library. Finally, provide and our experimental terms library, which is mappedquantum to the quantum withconsider the NCV-|v circuits to its equivalent quantum circuits. Here, we consider the reversible circuits of n-inputs and n-outputs with NCT and GT library, which is mapped to thethe quantum circuits with NCV-|v of quantum costs for mapping reversible circuits to the quantum circuits. 1  library. Finally, we provide our experimental results in terms library, which is mapped to the quantum circuits with the NCV-|v1  library. Finally, we provide our experimental results in terms of quantum costs for mapping the reversible circuits to quantum circuits. of quantum costs for mapping the reversible circuits to quantum circuits. c 2018 The Authors. Published by Elsevier B.V.  c 2018 The  The under Authors. Published by by Elsevier Peer-review responsibility of Elsevier the scientific © Authors. Published B.V.committee of the 6th International Conference on Smart Computing and Commuc 2018 The Authors. Published by Elsevier B.V.  Peer-review responsibility of of the the scientific scientificcommittee committeeof ofthe the6th 6thInternational InternationalConference Conferenceon onSmart SmartComputing Computingand andCommunications. under responsibility Peer-review under responsibility of the scientific committee of the 6th International Conference on Smart Computing and CommuCommunications nications. nications. Reversible circuit, Quantum circuit, NCT library, GT library, NCV library, NCV-|v1  library. Keywords: Keywords: Reversible circuit, Quantum circuit, NCT library, GT library, NCV library, NCV-|v1  library. Keywords: Reversible circuit, Quantum circuit, NCT library, GT library, NCV library, NCV-|v1  library.

1. Introduction 1. Introduction 1. Introduction Quantum computing shows a possible way of solving problems that are considered very hard for existing comQuantum computing shows computation, a possible way solving problems that hard for0 existing computing paradigms. In quantum theof of the machine areare notconsidered limited to very binary state and 1 but the Quantum computing shows a possible way ofstates solving problems that are considered very hard for existing computing paradigms. In quantum computation, the states of the machine are not limited to binary state 0 and 1 but the superposition of these two states, known as qubits. Qubits are nothing but a microscopic system, such as an atom or puting paradigms. In quantum computation, the states of the machine are not limited to binary state 0 and 1 but the superposition of these two states, known as qubits. Qubits are nothing but a microscopic system, such as an atom or nuclear spin or polarized photon. Therefore, boolean states 0 and 1 are represented by a fixed pair of distinguishable superposition of these two states, known as qubits. Qubits are nothing but a microscopic system, such as an atom or nuclear spin or polarized photon. Therefore, boolean states 0 and 1 are represented by a fixed pair of distinguishable states the or qubit which photon. can be expressed the form of horizontal polarization and vertical polarization nuclearofspin polarized Therefore,inboolean states 0 and 1 are represented| 0by>=↔ a fixed pair of distinguishable states of the qubit which can be expressed in the form of horizontal polarization | 0to>=↔ and vertical polarization |states 1 >=↑. Based on the qubits, the information is computed, as a result, it is capable solve many problems such as of the qubit which can be expressed in the form of horizontal polarization | 0 >=↔ and vertical polarization |factorization, 1 >=↑. Based on the qubits, the information is computed, as a result, it is capable to solve many problems such as database search, graph problems and solving these type of problems with the help of quantum comput| 1 >=↑. Based on the qubits, the information is computed, as a result, it is capable to solve many problems such as factorization, database search, graph problems and solving these type of problems with the help of quantum computing is significantly faster than with conventional computing 3, of 4].problems All the quantum are necessarily factorization, database search, graphthe problems and solving these[2, type with theoperations help of quantum computing is significantly faster than withthe themapping conventional computing [2, 3, 4]. All the quantum operations are necessarily reversible in nature [1]. Therefore, of the reversible circuit to its equivalent quantum circuit is ing is significantly faster than with the conventional computing [2, 3, 4]. All the quantum operations areefficiently necessarily reversible inkeen nature [1]. Therefore, the mapping of the reversible circuit to its equivalent quantum circuit efficiently is the area of interest. reversible in nature [1]. Therefore, the mapping of the reversible circuit to its equivalent quantum circuit efficiently is the area of keen interest. the area of keen interest. ∗

Corresponding author. Mobile.: +919435700703. Corresponding Mobile.: +919435700703. E-mail address:author. [email protected] (Mousum Handique). Corresponding author. Mobile.: +919435700703. E-mail address: [email protected] (MousumB.V. Handique). c 2018 The 1877-0509  Authors. Published by Elsevier E-mail address: [email protected] (Mousum Handique). cunder Peer-review the scientific committee 1877-0509  2018responsibility The Authors.of Published by Elsevier B.V.of the 6th International Conference on Smart Computing and Communications. c 2018 The Authors. Published by Elsevier B.V. 1877-0509 Peer-reviewunder responsibility of the scientific committee of the 6th International Conference on Smart Computing and Communications. Peer-review under responsibility of the scientific committee of the 6th International Conference on Smart Computing and Communications. 1877-0509 © 2018 The Authors. Published by Elsevier B.V. Peer-review under responsibility of the scientific committee of the 6th International Conference on Smart Computing and Communications 10.1016/j.procs.2017.12.106 ∗ ∗

2

Mousum Handique et al. / Procedia Computer Science 125 (2018) 832–839 / Procedia Computer Science 00 (2018) 000–000

833

The reversible circuit is the higher level abstraction of the quantum circuit. Reversible circuits are those circuits which are capable to realize the reversible function using the reversible gates. To implement the reversible circuits, both inputs and outputs are equal and uniquely retrievable from each other. Moreover, there is no fan-out and feedback connections are allowed in reversible circuits to maintain the reversibility [1]. The introduction and synthesis of reversible circuits has been briefly explained in [5, 6, 7]. In this work, we concentrate only on the mapping of the reversible circuits to quantum circuits in terms of quantum cost. In this paper, we are considering the NCV-|v1  quantum library for generating the equivalent quantum circuits and the purpose of using this library is motivated by the previous work, which was introduced in [9]. The proposed mapping approach takes the input as a reversible circuit of NCT and GT library with three constraints. The constraints are as follows, first the given reversible circuit should not consist any negative control, the second is that it should not contain any garbage line, i.e., n-inputs and n-outputs and a last it should not contain any constant input. The output of the proposed approach is an equivalent quantum circuit, which is purely based on only the NCV-|v1  library. For implementation purposes, we are using .t f c file [12] and .real file [15] without making any changes in the format of the files. The rest of the paper is structured as follows: Section 2 gives the basic overviews on reversible circuits and quantum circuits. Later in this section, it provides the information about the machine-readable format of reversible and quantum circuits. The proposed mapping method to transform individual MCT (multiple-control TOFFOLI) and whole reversible circuit to its equivalent quantum circuit are discussed in Section 3. The experimental result is presented in Section 4. Finally, the paper is concluded in Section 5 with some possible future direction. 2. Basics Preliminaries This section describes the background of basic pieces of information which are required for this paper. 2.1. Reversible Circuits The function is called reversible if it contains n-input and n-output and each input of this function can be mapped to a unique output. In other words, there is an equal number of inputs and outputs, and the input patterns can be always reconstructed from the output patterns i.e., bijective in nature. The reversible functions are implemented by the means of reversible logic circuits. The circuit is reversible if (a) it has only reversible gates and (b) the fan-out and feedback connections are not allowed. The reversible circuit is the cascade structure of reversible gates and the combination of different reversible gate results in a various gate library. Some of the fundamental reversible gates are NOT gate (same as conventional circuits), CNOT or FEYNMAN gate [10], TOFFOLI gate [11] and the family of these gates is called NCT library. The TOFFOLI gate is also known as multiple-control TOFFOLI (MCT). However, the MCT gate acts like the NOT gate if no control lines are present. If there is one and two control line(s) in the MCT gate, then it’s referred as CNOT and TOFFOLI gate respectively. The family of MCT gate is called generalized TOFFOLI (GT) library [12]. The NCT and GT library is most commonly used gate library in reversible circuits. Figure. 1 (a) shows the fundamental gates and NCT library and Figure. 1 (b) shows the MCT gate and GT library. a

a

b

b c

c' NOT

a c' CNOT TOFFOLI

(a) NCT Library

a'= a

a1

b'= b c'= a.b

a2 (a c')

. . .

an-1 an

a1

a1

a2

a2

. . .

. .

an-1 (a1.a2....an-2)

an (a1.a2....an-1) MCT (b) GT Library

Fig. 1. (a) Fundamental gates and NCT library

(b) MCT gates and GT library

a'1 a'2 a'n-1 a'n

Mousum Handique et al. / Procedia Computer Science 125 (2018) 832–839 / Procedia Computer Science 00 (2018) 000–000

834

3

2.2. Quantum Circuits The computation of the required parameters for quantum computation can be done only by manipulating the quantum states. The quantum states are defined by the qubits, which are quite different from the classical bits. The state of qubits is represented as |Ψ=α|0 + β|1, where α and β are represented as complex numbers such that |α|2 + |β|2 =1. The qubit is operated by the elementary operator, which is called as quantum gate and the cascade of quantum gates forms the quantum circuit. The quantum gates can be designed by considering 2n × 2n unitary matrices transformation of the qubits. However, all the quantum logic gates are necessarily reversible in nature. There are several quantum gate libraries (e.g. [18], [19]) are available in the literature and NCV library [13] is most commonly used library for generating the quantum circuits. The extended version of NCV library was introduced as NCV-|v1  library [9]. In this work, we are considering the NCV-|v1  library for constructing the equivalent quantum circuits for the given reversible circuits. 2.2.1. NCV Library The NCV library is the fundamental library in quantum circuits and this library was introduced by Barenco et al. [13]. Using the NCV library, any arbitrary reversible boolean function can be realized, therefore it is known as the universal library. The quantum gates, which are included in this library are NOT, CNOT, Controlled V and Controlled V + gate. The operation of these gates is mentioned as below:

1. NOT gate: It inverts a single qubit and unitary matrix represents as NOT =



01 10



2. Controlled NOT gate: It inverts the target qubit if the control qubit is 1. 3. Controlled V gate: It performs a V operation on the target qubit if the control qubit is 1. Two consecutive  V operations are equal to inversion. The operation of this gate is represented by unitary matrix V =

1 + i 1 −i . 2 −i 1

+ is performed at target qubit if 4. Controlled V + gate: It performs inverse operation of V gate. Here,  V operation 

the control qubit is 1 and unitary matrix describes as V + =

1−i 1 i i 1 2

.

2.2.2. NCV-|v1  Library The NCV-|v1  library is introduced by Sasanian et al. [9]. In NCV-|v1  library, the qudits are used in place of qubits, which act as the elementary unit of information. The NCV-|v1  library considers a 4-level (multi-valued) quantum system. Here, each stage of the qudit is limited to 0, v0 , 1 and v1 . Based on the qudits, the NOT, V and V + operations are defined using four-level unitary matrices that are described as below:

  0  0  NOT =   1 0

0 0 0 1

1 0 0 0

 0   1  , 0  0

  0  1  V =  0 0

0 0 1 0

0 0 0 1

 1   0  , 0  0

  0  0  V+ =   0 1

1 0 0 0

0 1 0 0

 0   0   1  0

In contrast to an NCV library in which gates are activated when the input sequence of |1 is applied, the circuits made up NCV-|v1  library is activated on v1 . But in this extended mapping approach, we propose that the controlled V and V + gates can be activated if and only if v1 is applied to the control. In a similar manner, the V and V + gates are also activated on v1 . Moreover, the CNOT gates can be activated on v1 and 1. Table 1 shows the behavior of the operation of NOT, V and V+ over these qudits {0, v0 , 1, v1 }. 2.3. Machine-readable format: .t f c file and .real file The .t f c file [12] is the machine-readable format for reversible circuits. The .t f c file provides the detail structure of the reversible circuits such as input lines, output lines, gate netlist, garbage lines and constant inputs. In .t f c file, the

4

Mousum Handique et al. / Procedia Computer Science 125 (2018) 832–839 / Procedia Computer Science 00 (2018) 000–000

835

Table 1. Behavior of the gate operation

x 0 v0 1 v1

NOT(x) 1 v1 0 v0

V(x) v0 1 v1 0

V+(x) v1 0 v0 1

variables are ’.v’, ’.i’, ’.o’ and ’.c’ and they are placed at the beginning of the file. Here, ’.v’ defines all the possible lines, which are used for constructing the network structure of a given reversible circuit. Similarly, the variable ’.i’, ’.o’ and .’c’ defines a sequenced list of all input variables, all output variables, and input constants respectively, where ’.c’ is optional. Here, the keyword ’BEGIN’ and ’END’ indicate the beginning and end of the reversible circuit network. The more detailed discussion can be found at [12]. For example, we are considering the ham3 (see in [12]) reversible benchmark circuit as mentioned in Figure 2 (a) and the .t f c file [12] format has been shown in Figure 2 (b). In this .t f c file, after the ’BEGIN’ keyword, the first row is “t3 b, c, a” represents the target point is assigned at input line ’a’. The rest of the variables, i.e., b and c indicate the control points. The structure or functioning of other rows of the .t f c file can be explained in a similar manner.

.v a, b, c

.i a, b, c .o a, b, c BEGIN t3 b, c, a t2 c, b t2 b, c

(a)

t2 a, c t2 c, b END

(b)

Fig. 2. (a) Reversible ham3 benchmark circuit

(b) .t f c file [12] for ham3 circuit

The .real file [15] is the machine-readable format for quantum circuits. This file contains the detailed structure (also called netlist) of quantum circuits. The detailed concept of the .real file can be found at [15]. The .real file for Figure 2 (a), which is generated by our proposed method has been shown in Figure 3 (a) and corresponding equivalent quantum circuit using NCV-|v1  library as mentioned in Figure 3 (b) .numvars 3 .variables a b c .inputs a b c .outputs a b c .begin Vb Vbc t2 c a V+ b c V+ b

t2 c b t2 b c t2 a c t2 c b .end

|a> |b> |c>

V+

V V

V+ (b)

(a)

Fig. 3. (a) Generates the .real file after mapping

(b) Equivalent quantum circuit

.numvars 3 t2 b c .variables a b c V+ a b V |a> V+ .inputs a b c V+ a 2.4. Related Work.outputs a b c .end |b> V V+ .begin In this section, V wea are discussing some of the|c> previous works which are relevant to the present paper. In 1995, ab Barenco et al. [13]Vproposed the NCV quantum gate library. This library is the most commonly used quantum gate (a)

(b)

836

Mousum Handique et al. / Procedia Computer Science 125 (2018) 832–839 / Procedia Computer Science 00 (2018) 000–000

5

library and any arbitrary reversible logic function can be mapped to its equivalent quantum circuit, this particular feature makes this library to act as a universal library. In 2008, Maslov et. al [16] proposed local optimization techniques based on templates to optimize the quantum circuits in terms of gate count and level compaction. In 2011, Miller et al. [17] showed the realization of multiple-control TOFFOLI (MCT) gate by elementary quantum gate using NCV library. In this method, the realization of each MCT gate produced the composition of smaller MCT gates such that ancillary lines are efficiently used in the quantum circuits. But, if a large number of MCT gates are present, then the equivalent quantum circuit with NCV library, the resulting structure is very complex and expensive in terms of quantum cost and gate count. In 2012, Sasanian et al. [9] introduced the NCV-|v1  quantum library for mapping reversible circuits to corresponding quantum circuits. This paper proposed that using the proposed library for mapping reversible circuit to quantum circuit, substantially smaller gate counts is required than the prior existing approaches, such as NCV library methodology. The establish of the exact synthesis approach of the NCV-|v1  library for generating the minimal quantum circuits is proposed by Arman et. al [8], in 2015. In the literature, it has observed that different gate libraries are introduced for the physical realization of the quantum circuits. The realization of the quantum circuit using the NCV-|v1  library is the better alternative as compared to the NCV library. The resulting quantum circuit with the NCV-|v1  library is efficient as it has reduced the gate count and efficiently utilized the ancillary line (or lines). Moreover, the mapping methodology from reversible circuits to the quantum circuit using the NCV-|v1  library is simple and less computation complexity. In this work, we present a mapping method to produce the equivalent quantum circuits using the NCV-|v1  library for the given reversible circuit, made up of NCT and GT library. The concept of our mapping method is that the V and V + and the controlled V and V + gate can be activated if and only if the control qudit value is v1 and the CNOT gate can be activated if and only if the control qudit value is set to v1 or 1. 3. Proposed Method The proposed method is able to map a given reversible circuit to its equivalent quantum circuit. This method does not handle reversible circuit consisting negative control, garbage lines and constant inputs. As per the proposed method, process the .t f c file for reversible circuit and collects all the information about the circuit present in the .t f c file by maintaining the exact order in which they are present in the .t f c file. Using this information, the method generates the .real file which is the machine-readable format for the quantum circuit. Before going for the final generation of quantum circuit all necessary information like a total number of variables, input variables, and output variables are obtained to furbish the file of a quantum circuit which has to be maintained necessarily. Now, we describe the proposed method in the form of an algorithm. We are providing some definitions, which are used throughout the algorithm. Definition 1. We defined that; the variable G denotes the list contains all the gates for each level present in the reversible circuit and N is the total length of the list G. If NOT or CNOT gates are present in the list G then the proposed method place them in .real file sequentially as because these two gates act same in a quantum circuit as they act in the reversible circuit. Definition 2. The variable A denotes the list contains the description of all multiple-control TOFFOLI (MCT) gate, where A ⊆ G. The variable n is representing the total number of bit lines present in the MCT gate such that (n-1) element(s) are control variables and nth element is target variable. Definition 3. We define that; the term V A[i] represents inserting a V gate on current bit line A[i]. In other words, V A[i] = {V ∈ G|V ⇒ A[i]}. Also, V A[i] A[i + 1] represents to put on the controlled-V gate between the bit line as a control on the A[i] line and target on the A[i + 1] line. The CNOT gate inserted between A[n − 1] and A[n] as the control point on A[n − 1] bit line and target on A[n], which has described as a term t2 A[n − 1] A[n]. In a similar manner, we are inserting the V + gate and the controlled V + gate in the quantum circuit netlist. Now, we are considering two examples for describing Algorithm 1. At first, Example 1 explains to map the MCT to its equivalent quantum mapping using the proposed algorithm. Example 2 explains how to map a whole reversible circuit to its equivalent quantum circuit. The input to the algorithm is the machine-readable format for the reversible

6

Mousum Handique et al. / Procedia Computer Science 125 (2018) 832–839 / Procedia Computer Science 00 (2018) 000–000

837

circuit, i.e., .t f c file. The input has to be processed in such a way that only necessary information is sent as input to the algorithm. Algorithm 1: Mapping of reversible circuit to quantum circuit Input: Gate list G whose elements are levels of Reversible Circuit build with NOT, CNOT, MCT gates described in .t f c file in exact order and size of list N in a given reversible circuit Output: Mapped .real file containing equivalent Quantum Circuit 1 G = [ ], A = [ ], N = 0 2 for i = 0 to (N − 1) do  3 if G[i] = (NOT CNOT) then 4 Write G[i] in .real file 5 6 7 8 9 10 11 12 13

else Put the bit variables of G[i] in list A[ ] n = sizeof (A[ ]) MCT (A[ ], n)

return .real file Function MCT (A[ ], n) Write V A[0] for i = 0 to (n-2) do Write V A[i] A[i + 1] in .real file

16

Write t2 A[n-1] A[n] in .real file for i = (n-2) to 0 do Write V + A[i]A[i + 1] in .real file

17

Write V + A[0] in .real file

14 15

Example 1. Consider the 3-input TOFFOLI gate, i.e., represented in .t f c file as ’t3 a, b, c’. According to the algorithm, list G[ ] and A[ ] are initially empty. It places the content of the reversible circuit present in the .t f c file in list G[ ], the content of list G [] is ’t3 a, b, c’. Now, the loop runs from 0 to (N-1) to process a gate (or all the gates) present in the list G[ ]. As mentioned in the algorithm, the gate type is checked, if it found a CNOT or NOT gate, then it inserts in the .real file without any changes. But, according to the given input, the gate present in the list G[ ] is not CNOT or NOT gate. Therefore, the condition fails and it goes to the next part as mentioned at line no. 6. Thus, the information obtained from the list G[ ] is sent to list A[ ], and list A[ ] should contain the information like ’a, b, c’. The line no 7, the size of list A[ ] is assigned to variable n. As per the algorithm at line no.8, the function MCT (A[ ], n) is called, which has been described from line no. 11 to 17. Next step, the V gate is to be placed on the bit line that is present in the list A[ ] at the 0th index and the content have written in a .real file in the form of V a. Based on the next loop (line no. 13), the pair for placing controlled V gate is found out and the content is added (with previous one) to the .real file as V a, b. The next process, the CNOT gate is placed in the .real file according to the line no. 14 and the content ’t2 b, c’ is added to the .real file. Similarly, the next loop (line no. 15) is executed for placing the controlled V + gate at (n-2)th and content are placed in the .real file as ’V + a, b’. The last loop is executed for V + gate, which is to be placed on the bit line that is present in the list A[ ] at the 0th index and content ’V + a’ is added to the .real file. The complete .real file and corresponding quantum circuit are shown in Figure 4 (a) and Figure 4 (b) respectively. Example 2. We are considering the reversible benchmark circuit 4b15g 1 and it’s .t f c file as an input to our proposed algorithm, which has been taken from [12]. As mentioned in the algorithm, at starting list G[ ] and A[ ] is empty. As the algorithm starts processing the information it gathers the netlist of the reversible circuit in the list G[ ]. In the list G[ ], the first 3-gates are CNOT gates and the algorithm insert the CNOT gates to the .real file without any changes. Now, the next gate is TOFFOLI gate in the list G[ ]. Therefore, we are applying the same process which has mentioned in Example 1. After processing all the gate contained in list G[ ], we are able to generate the resultant .real file, which has been shown in Figure 5 (due to page limitation, we are unable to present the corresponding quantum circuit).

V

Vb Vbc t2 c a V+ b c V+ b

838

|c>

V+

V

(b)

Mousum Handique et al. / Procedia Computer Science 125 (2018) 832–839 / Procedia Computer Science 00 (2018) 000–000

(a)

.numvars 3 .variables a b c .inputs a b c .outputs a b c .begin Va Vab

t2 b c V+ a b V+ a .end

|a>

V+

V

|c>

(a)

(b)

Fig. 4. (a) Generates the .real file of Example 1

.numvars 4 .variables a b c d .inputs a b c d .outputs a b c d .begin t2 a c t2 c d t2 d a Vb Vbd t2 d c

V+

V

|b>

7

V+ b d V+ b t2 a b Vc Vcd t2 d b V+c d V+ c Va Vab Vbc

(b) Corresponding equivalent quantum circuit

t2 c d V+ b c V+ a b V+ a t2 c a t1 b t1 c t2 a d Vb Vbd t2 d c

V+ b d V+ b Vb Vbc t2 c a V+ b c V+ b Va Vac t2 c b V+ a c

V+ a t1 c .end

Fig. 5. Generates the .real file for 4b15g 1 reversible benchmark circuit in Example 2

4. Experimental Result The proposed algorithm is implemented in Python (version 3.4 and 2.7) on an Intel Core i3 with 4GB RAM, clock speed 1.8 GHz, 500 GB hard drive. The proposed algorithm has been applied to different reversible benchmark circuit based on NCT and GT based gate libraries. The equivalent quantum circuits are generated by the proposed method is compared with existing method [13] as mentioned in column 3 in Table 2 and column 5 in Table 2 indicates the difference between the existing and proposed method based on quantum cost. It has observed that the proposed method gives good performance in terms of quantum cost. Also, the experimental result has shown that the quantum cost of the proposed method is smaller than that by the existing method if the mapping of the reversible circuits belongs to the GT library. By the analysis of the experimental results, we can say that the NCV-|v1  library is a better alternative than NCV library and our mapping method is quite simple. 5. Conclusion In this paper, we discuss an approach for mapping the reversible circuits to their quantum circuits. Moreover, the transformation which takes place by the aforementioned method is not fully optimized, further optimization is possible. But for the presented work the aforementioned method yields a better result and easy for mapping from reversible circuits to quantum circuits. References [1] [2] [3] [4]

Nielson, M., Chuang, I., 2000. Quantum Computation and Quantum Information, Cambridge Univ. Press. Shor, P. W., 1994. Algorithms for quantum computation: discrete logarithms and factoring, Foundations of Computer Science, p. 124-134. Grover, L. K., 1996. A fast quantum mechanical algorithm for database search, in Symp. on Theory of Computing, p. 212-219. D¨urr, Heiligman, C. M., Hoyer, P., Mhalla, M., 2006. Quantum query complexity of some graph problems, SIAM Jour. of Comp., 35:p. 1310-1328.

8

Mousum Handique et al. / Procedia Computer Science 125 (2018) 832–839 / Procedia Computer Science 00 (2018) 000–000

839

Table 2. Comparison of quantum cost with [13] Benchmark Circuits

Gate Library

Quantum Cost using NCV Library [13]

4b15g 1 mspk 4b15g 1 4b15g 2 mspk 4b15g 2 4b15g 3 mspk 4b15g 3 4b15g 4 mspk 4b15g 4 4b15g 5 cycle10 2 cycle10 3 ham7tc ham7-21-69 ham7-25-49 ham15tc1 ham15-70 ham15-109-214 hwb4tc hwb4-11-23 hwb4-11-21 mspk-hwb4-12 mspk-hwb4-13 hwb8 637 hwb8 614 127 45a hwb8 749 619 7a

GT GT GT NCT GT NCT GT GT NCT GT GT GT GT NCT GT GT GT GT NCT NCT NCT NCT GT

47 39 61 31 53 33 47 35 43 1198 6057 81 65 49 1827 453 206 63 23 21 20 19 16522

Quantum Cost using NCV-|v1  Library [Proposed] 41 37 51 35 43 35 41 33 43 215 860 59 53 49 750 236 165 53 23 23 24 25 4997

GT

14695

4157

10538

GT

7013

2349

4664

Difference between [13] & Proposed 6 2 10 4 10 2 6 2 0 983 5197 22 12 0 1077 217 41 10 0 2 4 6 11525

[5] Wille, R., 2011. An introduction to reversible circuit design, Electronics, Communications and Photonics Conference (SIECPC), Saudi International, IEEE. [6] Shende, V. V., Prasad, A. K., Markov, I. L., Hayes J. P., 2003. Synthesis of reversible logic circuits, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 22.6 p. 710-722. [7] Wille, R., Drechsler, R., 2010. Towards a design flow for reversible logic, Springer Science and Business Media. [8] Allahyari-Abhari, A., Wille, R., Drechsler, R., 2015. An Examination of the NCV-|v1  Quantum Library Based on Minimal Circuits, MultipleValued Logic (ISMVL), 2015 IEEE International Symposium on. IEEE. [9] Sasanian, Z., Wille, R., Miller, D. M., 2012. Realizing reversible circuits using a new class of quantum gates, Design Automation Conference (DAC), 49th ACM/EDAC/IEEE. IEEE. [10] Feynman, R. P.,1961. Quantum mechanical computers, Optics InfoBase, Optics News, vol. 11, no. 3, p. 11-20. [11] Toffoli, T., 1980. Reversible computing. In W. de Bakker and J. van Leeuwen, editors, Automata, Language and programming, Springer, p. 632. [12] Maslov, D., Dueck, G., Scott, N.:Reversible logic synthesis Benchmark Page.http://webhome.cs.uvic.ca/-dmaslov/. [13] Barenco, A., Bennett, C. H., Cleve, R., DiVinchenzo, D., Margolus, N., Shor, P., Sleator, T., Smolin, J., Weinfurter, H., 1995. Elementary gates for quantum computation. The American Physical Society, vol. 52, p. 3457-3467. [14] Muthukrishnan, A., Stroud, C. R., 2000. Multi-valued logic gates for quantum computation, vol. 62, p. 052309. [15] Wille, R., Groe, D., Teuber, L., Dueck, G. W., and Drechsler, R., 2008. RevLib: an online resource for reversible functions and reversible circuits, in International Symp. on Multi-Valued Logic, p. 220225, RevLibis available at http://www.revlib.org. [16] Maslov, D., Dueck, G. W., Miller, D.M., Negrevergne, C., 2008. Quantum circuit simplification and level compaction, IEEE Trans. on CAD, 27(3): 436-444. [17] Miller, D. M., Wille, R., Sasanian, Z., 2011. Elementary quantum gate realization for multiple-control Toffoli gates. In Proc. Int’l Symp. on Multi-valued Logic, p. 217-222. [18] Amy, M., Maslov, D., Mosca, M., Roetteler, M. 2013. A meet-in-the-middle algorithm for fast synthesis of depth-optimal quantum circuits, IEEE Trans. on CAD, vol. 32, no. 6, p. 818-830. [19] Biswal, L., Bandyopadhyay, R., Wille, R., Drechsler, R., Rahaman, H. 2016. Improving the realization of multiple-control Toffoli gates using the NCVW quantum gate library.

Suggest Documents