Next Article in Journal
Research on Fault Diagnosis of IPMSM for Electric Vehicles Based on Multi-Level Feature Fusion SPP Network
Previous Article in Journal
On the Durrmeyer-Type Variant and Generalizations of Lototsky–Bernstein Operators
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Efficient Designs of Quantum Adder/Subtractor Using Universal Reversible Gate on IBM Q

1
Department of Mathematics, Faculty of Science, Damanhour University, Damanhour 22511, Egypt
2
Academy of Scientific Research and Technology (ASRT), Cairo 11516, Egypt
3
Department of Mathematics and Computer Science, Faculty of Science, Alexandria University, Alexandria 21568, Egypt
*
Author to whom correspondence should be addressed.
Symmetry 2021, 13(10), 1842; https://doi.org/10.3390/sym13101842
Submission received: 2 September 2021 / Revised: 18 September 2021 / Accepted: 26 September 2021 / Published: 2 October 2021

Abstract

:
Reversible arithmetic and logic unit (ALU) is a necessary part of quantum computing. In this work, we present improved designs of reversible half and full addition and subtraction circuits. The proposed designs are based on a universal one type gate (G gate library). The G gate library can generate all possible permutations of the symmetric group. The presented designs are multi-function circuits that are capable of performing additional logical operations. We achieve a reduction in the quantum cost, gate count, number of constant inputs, and delay with zero garbage, compared to relevant results obtained by others. The experimental results using IBM Quantum Experience (IBM Q) illustrate the success probability of the proposed designs.

1. Introduction

Reversible logic [1,2] is an essential part of building a reversible circuit. A circuit is called reversible if the circuit maps each input to an exclusive output, and the output contains enough information to retrieve the input, i.e., there is a one-to-one consistency among the input/output [3]. Many applications have been proposed for reversible circuits in many technologies [3], e.g., nano-technologies, low-power CMOS [4,5], quantum-dot cellular automata [6,7].
Quantum computers [8,9,10] are constructed of reversible circuits, which have demonstrated capabilities for solving certain problems faster than classical counterparts [11], e.g., Grover presented a quantum algorithm for searching in an unstructured database with quadratic speed-up over classical computers [12]. Shor provided a polynomial-time quantum algorithm for factoring integers into their prime factors [13]. The reversible nature of quantum computers and quantum logic gates [14] demands the need to construct efficient reversible circuits, taking into consideration certain parameters [15], e.g., number of garbage output, quantum cost, number of constant inputs, gate count and delay.
Arithmetic and logic unit (ALU) [16] is an essential part of any computational device. It works as a multi-function circuit capable of performing a predefined set of logical and arithmetic operations. Two of the fundamental functions of ALU are arithmetic addition and subtraction. Several designs have been proposed for full adder and full subtractor reversible circuits. For instance, Thapliyal and Ranganathan proposed a full subtractor using two TRG gates [17]. Gupta et al. introduced an improved construction of full reversible adder/subtractor [18] using three F2G gates and a single MUX gate. Moghimi and Reshadinezhad provided a 4 × 4 full adder and subtractor [19] using one Peres gate and one Fredkin gate with a reduction in cost. Montaser et al. presented a full adder and subtractor design using two R-gate [20].
Recently, many reversible n-bit gate libraries have been proposed [21,22,23]. These libraries are proven to be single-type gate libraries, universal for reversible circuit synthesis, and extendable according to the number of bits in reversible circuit design. The importance of using single-type gate library stems from the need to build cheaper reversible circuits by using similar building blocks [16].
In this paper, we propose improved designs of half and full adder/subtractor circuits. The proposed designs are based on the G 3 gate library [21] which, in turn, is capable of generating the permutation group of size 40,320 ( 2 3 ! ). This permutation group is also a subset of the symmetric group of degree 3. The introduced designs are capable of performing the addition and subtraction operations as part of ALU. The suggested designs are found to be of low quantum cost, delay, gate count, constant input, and zero garbage outputs when compared to relevant work. Furthermore, the proposed designs are implemented and tested on IBM Q [24] using Python SDK [25] to measure the success probability of obtaining the correct results.

2. Preliminaries

2.1. Basic Definitions

Definition 1.
Given two bits X and Y, a half adder (HA) circuit is a combinational circuit which is capable of performing the arithmetic addition of X and Y [26]. The output of the half adder circuit can be expressed in sum-of-products (SOP) form as follows [26]:
S u m = X Y C o u t = X Y ,
where C o u t is the carry from the arithmetic addition of X and Y, and is the exclusive-or (XOR) operation.
Definition 2.
Given three bits X , Y and C i n , a full adder (FA) circuit is a compositional circuit that fulfills the arithmetic addition of X , Y and C, where X and Y are the basic inputs, and C i n is the carry from the last addition operation of the prior least significant bits [26]. The output of the full adder circuit can be expressed in SOP as follows [26,27]:
S u m = X Y C i n C o u t = X Y X C i n Y C i n ,
where C o u t is the carry from the arithmetic addition of X , Y and C i n .
Definition 3.
A half subtractor (HS) circuit is a combinational circuit that calculates the arithmetic subtraction of two input bits [26]. For two input bits X and Y, the output of the half subtractor can be expressed in SOP as follows:
D i f f = X Y B o u t = X Y Y ,
where D i f f is the difference and B o u t is the borrow out.
Definition 4.
A full subtractor (FS) circuit is a compositional circuit that fulfills the arithmetic subtraction of three input bits [26]. For three input bits X , Y and B i n , the output of the full subtractor can be expressed in SOP as follows:
D i f f = X Y B i n B o u t = X Y X B i n Y B i n Y B i n .
Definition 5.
A Boolean function f ( x 1 , x 2 , , x n ) with n input variables and n output variables is a controlled mapping from { 0 , 1 } n to { 0 , 1 } n , i.e., f : { 0 , 1 } n { 0 , 1 } n .
Definition 6.
The truth table of a Boolean function f that maps an input vector v i { 0 , 1 } n to { 0 , 1 } n , is defined as the lexicographical order of v i mapped to f ( v i ) { 0 , 1 } n :
v 1 = ( 0 , 0 , , 0 ) f ( v 1 ) v 2 = ( 0 , 0 , , 1 ) f ( v 2 ) v 2 n = ( 1 , 1 , , 1 ) f ( v 2 n ) .
Definition 7.
Given a Boolean function f : { 0 , 1 } n { 0 , 1 } n , f is called reversible if and only if each input vector v i { 0 , 1 } n is mapped to one and only one exclusive output f ( v i ) .
Definition 8.
We say that a gate with n input and n output ( n × n ) is reversible, if that gate is a realization of a reversible Boolean function.
Definition 9.
Given a set of reversible gates L, we say that L is a library, if L can be used to build reversible circuits [21,22].
Definition 10.
Given a reversible gate library L, we say that L is universal, if L can be used to synthesize any reversible circuit ( n × n ) [21,22].
Definition 11.
Given a ( k × k ) reversible gate Z acting on ( n × n ) reversible circuit, the Z gate is denoted as Z p 1 p 2 p k n , where the superscript represents the number of bit wires in the reversible circuit and the subscript taking p 1 , p 2 p k 1 as the indices of the control bits and p k as the index of the target bit, as shown in Figure 1.

2.1.1. NOT Gate

The N O T (N) gate is a Boolean ( 1 × 1 ) reversible gate that works on a single bit and inverts it unconditionally. It has quantum cost of zero [28]. Figure 2 illustrates all possible variations of N gate working on 3-bit circuit. The effect of the N gate acting on a bit indexed l A in a circuit of n bits is demonstrated as follows:
N l n : y l = x l 1 ,
where ⊕ is the exclusive-or operation (XOR).

2.1.2. Feynman Gate

The Feynman (C) gate is a reversible Boolean ( 2 × 2 ) gate (also known as the Controlled-NOT gate) that acts on two input bits and inverts the target bit if and only if the control bit is set to one. The quantum cost of the C gate is one [28]. Figure 3 illustrates the six possible variations of C gate.
The effect of the C gate acting on wires indexed i , j A is described as follows:
C i j n : y i = x i y j = x i x j .

2.1.3. Controlled Square-Root NOT Gate

The controlled square-root NOT gate is a reversible ( 2 × 2 ) gate that acts on two qubits, and apply the square-root NOT gate on the target bit if and only if the control bit is set to 1. There are two possible gates for the controlled square-root NOT gate: controlled-V(v) and controlled- V (u) gates. Figure 4 illustrates the possible variations of v and u gates acting on three qubits reversible circuit.
The v and u gates acting on wires indexed g , h A have the following properties:
v g h n · u g h n = u g h n · v g h n = I , u g h n · u g h n = v g h n · v g h n = C g h n ,
where I represents the identity gate.

2.1.4. Toffoli Gate

The Toffoli T gate [29] is a reversible Boolean ( 3 × 3 ) gate that takes three input bits and produce an output by flipping the target bit if and only if the control bits are set to one, as illustrated in Figure 5b. The T gate can be decomposed to five ( 2 × 2 ) elementary gates [30,31], as illustrated in Figure 5b, and thus it has a quantum cost of five. The action of the T gate acting on wires indexed r , s , t A is described as follows:
T r s t : y r = x r y s = x s y t = x t x r x s .
The T gate can be generalized to work in a circuit of n bits as a ( k × k ) gate, taking k-inputs and producing k-outputs flipping the target bit if and only if the k 1 control bits are set to 1. The T gate acting on wires indexed p 1 , p 2 p k 1 , p k A can be shown as follows:
T p 1 p 2 p k : y p 1 = x p 1 y p 2 = x p 2 y p k = x p k q = 1 k 1 x p q ,
where q = 1 k 1 x p q is a product term of k 1 variables.

2.1.5. G Gate

The G n gate library was introduced by Younes [21]. It is a reversible universal gate library that can be used to synthesize any reversible circuit with n-input/output variables, for n 2 . The G n associates N n gate, C n gate and the T n gate to build a library that acts on n-bits circuits. Figure 6 illustrates the G 3 library in a circuit of three bits. The action of the G gate acting on three bits indexed a , b , c A in a circuit of n = 3 wires can be described as follows:
G a b c 3 : y a = x a 1 , y b = x a x b , y c = x c x a x b .
Definition 12.
A garbage output [15] is any meaningless output of a reversible quantum circuit.
Definition 13.
Given a reversible quantum circuit, the quantum cost (QC) [15] is defined as the number of elementary quantum gates used to construct this circuit.
There are two cost metrics to calculate the cost of elementary quantum gates: cost11 metric [30,32,33] and cost01 metric [34].The cost11 metric regards the QC of ( 1 × 1 ) and ( 2 × 2 ) gates as one, respectively. However, the cost01 metric regards the QC of ( 1 × 1 ) and ( 2 × 2 ) gates as 0 and 1 [28], respectively. In this paper, cost01 metric is used to calculate the QC.
Definition 14.
Gate count (GC) [15] of a reversible quantum circuit is the number of quantum gates used to construct this circuit.
Definition 15.
Given a reversible quantum circuit, a constant input (CI) [15] is an input bit that is set with a constant input value, and it is used to compute a certain Boolean function.
Definition 16.
Given a logic circuit, the amount of time for a signal to circulate from the input to output is called delay [26].
It is known that the delay in reversible quantum circuits is dependent on the technologies invested in producing those circuits, and it can be explicitly determined when the technologies used in production is determined [15].
The method introduced in [15] for calculating the delay in quantum circuits is defined as follows:
  • Every ( 1 × 1 ) or ( 2 × 2 ) quantum gates will have only one unit delay.
  • Every quantum gates with ( 3 × 3 ) or bigger will be substituted with their equivalent ( 1 × 1 ) gates and ( 2 × 2 ) gates.
  • Find the path from input to output which has the maximum delay; this is considered the unit delay Δ of the circuit.

3. The Proposed Designs

In this section, we introduce the proposed designs for the reversible HA/HS circuits and the reversible FA/FS circuits.

3.1. The Proposed Reversible Half Adder/Subtractor Circuits

We construct our proposed HA/HS using a single G 123 3 gate, as shown in Figure 7a. The proposed design is a 3 × 3 circuit, where x 3 is the control bit. Setting x 1 = X , x 2 = Y and x 3 = 0 , the proposed design will work as a HA such that the bit y 2 will output Sum, and y 3 will output C o u t ; the y 1 bit will produce X ¯ which is the negation (NOT) operation. Setting x 1 = X and x 2 = x 3 = Y , the proposed design will work as a HS, where the bit y 2 will output Diff and the bit y 3 will output B o u t ; the bit y 1 will perform the N O T operation on X. Figure 7b shows the Toffoli decomposition for the proposed HA/HS. Figure 7c illustrates the equivalent decomposition using five elementary gates, where QC equals to four, and the delay equals to three. Table 1 summarizes the possible operations that the proposed HA/HS is able to perform.

3.2. The Proposed Reversible Full Adder Circuit

Using two  G 3 gates, we are able to construct a FA circuit capable of performing the addition operation. We use both G 132 3 and G 231 3 cascaded as illustrated in Figure 8a. Setting x 2 = 0 as a constant bit and considering x 1 , x 2 and x 4 as X, Y and C i n respectively, the proposed FA will calculate the addition operation where the y 2 bit will output the S u m and y 4 bit will output the C o u t ; in addition, y 1 will output X ¯ , and y 3 will output X Y ¯ which is the exclusive-NOR ( X N O R ) operation. It is clear that the proposed FA does not produce any garbage output and has only one constant bit. By changing the values of x 2 and x 4 , the proposed FA can perform additional logical operations on x 1 and x 3 such as N O T , A N D , exclusive-or ( X O R ), O R , N O R and N A N D , also with no garbage output. Table 2 summarizes the possible operations that the proposed FA is able to perform.
Figure 8b illustrates the equivalent decomposition for the proposed FA circuit into its Toffoli decomposition. Using the rules of optimization defined in [30] and a Toffoli decomposition technique in [31], the number of elementary gates used to build the proposed FA can be reduced from 14 gates to eight gates, as shown in Figure 8c. Figure 8d shows the optimized decomposition of the proposed FA into eight elementary gates, with a QC equals to six (using cost01 metric) and a delay equals to 4 Δ .

3.3. The Proposed Reversible Full Subtractor Circuit

We are able to build a FS that is capable of performing the binary subtraction operation, using two  G 3 gates. The proposed FS uses G 132 3 and G 231 3 in addition to two N O T gates, as illustrated by Figure 9a. Setting x 2 = x 3 = Y , and considering x 1 and x 4 as X and B i n , respectively, the proposed FS will perform the binary subtraction operation and the y 2 bit will output D i f f and the y 4 bit will output B o u t ; in addition, y 1 outputs the result of applying the N O T operation on X and y 3 performs the X O R operation X Y . It is clear that the proposed FS has no constant inputs and no garbage as well. Table 2 summarizes the possible operations that the proposed FS is capable of.
The proposed FS can be further optimized by replacing the T 3 gates with a suitable decomposition, as illustrated in Figure 9b. It is evident that the proposed FA design has a QC of eight and a 7 Δ delay.

4. Experimental Results and Discussion

In this section, the experiments on IBM Q [24] using Qiskit Python SDK [25] are presented for the proposed designs. Each design is tested 8192 times. In addition, we discuss and compare the results obtained by proposed designs with other results in the relevant work. The main criteria of comparison are QC, GO, CI, GC, and circuit delay.

Executing the Proposed Designs on IBM Q

Figure 10 shows the actual sequence of gates that are used to implement the proposed designs on IBM Q [24]. This involves Hadamard gate (denoted H), π / 4 gate (denoted T ), complex conjugate transpose of T (denoted T ), rotation gate with three Euler angles (denoted U 3 ), and controlled-not gate. All the proposed designs are tested on IBM Q [24] using Qiskit Python SDK [25], each design is tested 8192 times. The success probability is the probability of obtaining the desired output for a given function over all trials. In the presented work, the maximum number of trials permitted by IBM Q 5 Santiago backend specification [24] is 8192 trials and this is the number of trials we used. The average success probability for each proposed design is calculated.
Table 3 shows the truth table for the proposed HA, and illustrates the probability of obtaining the correct output after executing on IBM Q [24], with a maximum success probability 0.8829 and an average success probability 0.8259 . Further more, Table 4 shows the truth table of the proposed HS, and illustrates the probability of obtaining the correct output after executing on IBM Q with a maximum success probability 0.7545 and an average success probability 0.7456 .
Table 5 shows the truth table of the addition operation for the proposed FA. In addition, it illustrates the success probability of finding the desired output after running the proposed FA on IBM Q [24], with a maximum success probability 0.7703 and an average success probability 0.6935 . Figure 10b illustrates the proposed FA circuit implementation using Qiskit Python SDK [25].
The proposed FS is tested on IBM Q [24]. For each possible input, the desired output is produced with certain success probability, as depicted in Table 6. The proposed FS circuit implementation using Qiskit Python SDK [25] is depicted in Figure 10c, with a maximum success probability 0.76 and an average success probability 0.6829 .
Table 7 studies the proposed FA and the proposed FS, and compares them with relevant work [18,19,20,35,36,37,38,39,40]. It shows that the proposed FA has no garbage output and QC of six, which is the best among the designs in the comparison. In addition, the proposed FA design has CI of one, which is similar to [20,35,37,39], and GC of two similar to [18,20,35]. The delay of the proposed FA design has the smallest delay among the relevant work that considered circuit delay as a metric. Overall, the proposed FA design functions with better results when it is compared to relevant work.
In addition, Table 7 describes the proposed FS design in terms of known metrics and compares it to relevant work [17,18,19,20,36,37,40]. Table 7 shows that the proposed FS design has no GO and no CI which is the best results obtained when comparing it to relevant work. Additionally, the proposed FS design shows QC of eight and delay of seven which are high when it is compared to the FS design in [17], but the FS design in [17] did not consider other metrics such as GO, CI or GC. Overall, the proposed FS design shows better results when it is compared to relevant designs.

5. Conclusions

In this paper, we proposed an efficient designs of reversible half and full addition and subtraction circuits. The addition and subtraction operations are the basic operations in the ALUs, since the multiplication and division operations can be obtained using repeated addition and subtraction. The proposed designs are based on a universal single type library G which can be used to construct cheap reversible circuits using similar building blocks. The proposed full adder and full subtractor are built using two G gates, which works as a 1-bit ALU and can also be extended to work on any number of bits using multiplexers. The presented designs are multi-function circuits which are capable of performing additional logical operations: AND, OR, NOT, XOR, XNOR, NOR and NAND. These logical gates are sufficient to construct classical universal libraries, e.g., {AND, OR, NOT}. The proposed designs show reduction in quantum cost, gate count, constant input, and delay with zero garbage output, when they are compared to relevant work in the literature.
The experimental results show the efficiency of the proposed designs when they are implemented and tested on IBM Q to measure the success probability of obtaining the correct results. It is shown that the average success probability of the half adder is 0.8259 with a maximum success probability 0.8239. The average success probability of the half subtractor is 0.7456 with a maximum success probability 0.7545. In addition, the average success probability for the full adder is 0.6935, with a maximum success probability 0.7703. Finally, the full subtractor illustrates 0.6829 average success probability with a maximum success probability of 0.76. An effort is required to improve the average success probability of the proposed designs on different quantum computer architectures. Further effort is required to expand the proposed design to its elemental gates and provide optimization techniques to reduce the gate count and improve the efficiency of the designs.

Author Contributions

Conceptualization, M.O. and K.E.-W.; supervision, M.O.; software M.O. and K.E.-W.; validation M.O. and K.E.-W.; writing the paper, M.O. and K.E.-W. Both authors have read and agreed to the published version of the manuscript.

Funding

This project was supported financially by the Academy of Scientific Research and Technology (ASRT), Egypt, Grant No. 6614, (ASRT) is the 2nd affiliation of this research.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Acknowledgments

We acknowledge the use of IBM Quantum services for this paper. The views expressed are those of the authors, and do not reflect the official policy or position of IBM or the IBM Quantum team.

Conflicts of Interest

The authors declare that they have no conflict of interest.

References

  1. Bennett, C.H. Logical reversibility of computation. IBM J. Res. Dev. 1973, 17, 525–532. [Google Scholar] [CrossRef]
  2. Fredkin, E.; Toffoli, T. Conservative logic. Int. J. Theor. Phys. 1982, 21, 219–253. [Google Scholar] [CrossRef]
  3. Garipelly, R.; Kiran, P.M.; Kumar, A.S. A review on reversible logic gates and their implementation. Int. J. Emerg. Technol. Adv. Eng. 2013, 3, 417–423. [Google Scholar]
  4. De Vos, A.; Desoete, B.; Janiak, F.; Nogawski, A. Control Gates as Building Blocks for Reversible Computers; Proceedings Patmos 2001 Conference; Springer: New York, NY, USA, 2001. [Google Scholar]
  5. De Vos, A.; Desoete, B.; Adamski, A.; Pietrzak, P.; Sibiński, M.; Widerski, T. Design of reversible logic circuits by means of control gates. In International Workshop on Power and Timing Modeling, Optimization and Simulation; Springer: Berlin/Heidelberg, Germany, 2000; pp. 255–264. [Google Scholar]
  6. Orlov, A.; Amlani, I.; Bernstein, G.; Lent, C.; Snider, G. Realization of a functional cell for quantum-dot cellular automata. Science 1997, 277, 928–930. [Google Scholar] [CrossRef] [Green Version]
  7. Amlani, I.; Orlov, A.O.; Toth, G.; Bernstein, G.H.; Lent, C.S.; Snider, G.L. Digital logic gate using quantum-dot cellular automata. Science 1999, 284, 289–291. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  8. Feynman, R.P. Quantum mechanical computers. Found. Phys. 1986, 16, 507–531. [Google Scholar] [CrossRef]
  9. Deutsch, D. Quantum theory, the Church–Turing principle and the universal quantum computer. Proc. R. Soc. London. A Math. Phys. Sci. 1985, 400, 97–117. [Google Scholar]
  10. Lloyd, S. A potentially realizable quantum computer. Science 1993, 261, 1569–1571. [Google Scholar] [CrossRef] [PubMed]
  11. Buhrman, H.; Cleve, R.; Wigderson, A. Quantum vs. classical communication and computation. In Proceedings of the Thirtieth Annual ACM Symposium on Theory of Computing, Dallas, TX, USA, 24–26 May 1998; pp. 63–68. [Google Scholar]
  12. Grover, L.K. Quantum mechanics helps in searching for a needle in a haystack. Phys. Rev. Lett. 1997, 79, 325. [Google Scholar] [CrossRef] [Green Version]
  13. Shor, P.W. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM Rev. 1999, 41, 303–332. [Google Scholar] [CrossRef]
  14. Nielsen, M.A.; Chuang, I. Quantum Computation and Quantum Information; Cambridge University Press: Cambridge, UK, 2002. [Google Scholar]
  15. Mohammadi, M.; Eshghi, M. On figures of merit in reversible and quantum logic designs. Quantum Inf. Process. 2009, 8, 297–318. [Google Scholar] [CrossRef]
  16. Patterson, D.A.; Hennessy, J.L. Computer Organization and Design ARM Edition: The Hardware Software Interface; Morgan Kaufmann: San Francisco, CA, USA, 2016. [Google Scholar]
  17. Thapliyal, H.; Ranganathan, N. A new design of the reversible subtractor circuit. In Proceedings of the 2011 11th IEEE International Conference on Nanotechnology, Portland, OR, USA, 15–18 August 2011; pp. 1430–1435. [Google Scholar]
  18. Gupta, A.; Singla, P.; Gupta, J.; Maheshwari, N. An improved structure of reversible adder and subtractor. arXiv 2013, arXiv:1306.1889. [Google Scholar]
  19. Moghimi, S.; Reshadinezhad, M.R. A Novel 4*4 Universal Reversible Gate as a Cost Efficient Full Adder/Subtractor in Terms of Reversible and Quantum Metrics. Int. J. Mod. Educ. Comput. Sci. 2015, 7. [Google Scholar] [CrossRef] [Green Version]
  20. Montaser, R.; Younes, A.; Abdel-Aty, M. New design of reversible full adder/subtractor using R gate. Int. J. Theor. Phys. 2019, 58, 167–183. [Google Scholar] [CrossRef] [Green Version]
  21. Younes, A. On the universality of n-bit reversible gate libraries. Appl. Math. Inf. Sci. 2015, 9, 2579. [Google Scholar]
  22. Montaser, R.; Younes, A.; Abdel-Aty, M. New Design of Universal Reversible Gate Library. Quantum Matter 2017, 6, 89–96. [Google Scholar] [CrossRef]
  23. Osman, M.; Younes, A.; Ismail, G.; Farouk, R. An Improved Design of n-Bit Universal Reversible Gate Library. Int. J. Theor. Phys. 2019, 58, 2531–2549. [Google Scholar] [CrossRef]
  24. Team I.Q. IBM Q 5 Santiago Backend Specification V1.0.0; IBM: Armonk, NY, USA, 2018. [Google Scholar]
  25. Qiskit: An Open-source Framework for Quantum Computing. 2019. Available online: https://qiskit.org/ (accessed on 8 August 2021).
  26. Mano, M.M.; Ciletti, M. Digital Design: With an Introduction to the Verilog HDL; Pearson: New York, NY, USA, 2013. [Google Scholar]
  27. Katz, R.H.; Borriello, G. Contemporary Logic Design. 2005. Available online: https://www.amazon.com/Contemporary-Logic-Design-Randy-Katz/dp/0201308576 (accessed on 8 August 2021).
  28. Yang, G.; Song, X.; Perkowski, M.A.; Hung, W.N.; Seo, C.J. Minimal universal library for n× n reversible circuits. Comput. Math. Appl. 2008, 56, 160–165. [Google Scholar] [CrossRef] [Green Version]
  29. Toffoli, T. Reversible computing. In International Colloquium on Automata, Languages, and Programming; Springer: Berlin/Heidelberg, Germany, 1980; pp. 632–644. [Google Scholar]
  30. Montaser, R.; Younes, A.; Abdel-Aty, M. Improving the quantum cost of NCT-based reversible circuit. Quantum Inf. Process. 2015, 14, 1249–1263. [Google Scholar] [CrossRef]
  31. Ali, M.B.; Hirayama, T.; Yamanaka, K.; Nishitani, Y. Quantum cost reduction of reversible circuits using new Toffoli decomposition techniques. In Proceedings of the 2015 International Conference on Computational Science and Computational Intelligence (CSCI), Las Vegas, NV, USA, 7–9 December 2015; pp. 59–64. [Google Scholar]
  32. Shende, V.V.; Prasad, A.K.; Markov, I.L.; Hayes, J.P. Synthesis of reversible logic circuits. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2003, 22, 710–722. [Google Scholar] [CrossRef] [Green Version]
  33. Maslov, D.; Miller, D.M. Comparison of the cost metrics for reversible and quantum logic synthesis. arXiv 2005, arXiv:quant-ph/0511008. [Google Scholar]
  34. Yang, G.; Song, X.; Hung, W.N.; Perkowski, M.A.; Seo, C.J. Synthesis of reversible circuits with minimal costs. Calcolo 2008, 45, 193–206. [Google Scholar] [CrossRef]
  35. Ni, L.; Guan, Z.; Zhu, W. A general method of constructing the reversible full-adder. In Proceedings of the 2010 Third International Symposium on Intelligent Information Technology and Security Informatics, Jian, China, 2–4 April 2010; pp. 109–113. [Google Scholar]
  36. Morrison, M.; Ranganathan, N. Design of a reversible ALU based on novel programmable reversible logic gate structures. In Proceedings of the 2011 IEEE Computer Society Annual Symposium on VLSI, Chennai, India, 4–6 July 2011; pp. 126–131. [Google Scholar]
  37. Rangaraju, H.; Venugopal, U.; Muralidhara, K.; Raja, K. Design of efficient reversible parallel Binary adder/subtractor. In International Conference on Advances in Communication, Network, and Computing; Springer: Berlin/Heidelberg, Germany, 2011; pp. 83–87. [Google Scholar]
  38. Bruce, J.; Thornton, M.A.; Shivakumaraiah, L.; Kokate, P.; Li, X. Efficient adder circuits based on a conservative reversible logic gate. In Proceedings of the IEEE Computer Society Annual Symposium on VLSI. New Paradigms for VLSI Systems Design (ISVLSI 2002), Pittsburgh, PA, USA, 25–26 April 2002; pp. 83–88. [Google Scholar]
  39. Babu, H.M.H.; Islam, M.R.; Chowdhury, S.M.A.; Chowdhury, A.R. Synthesis of full-adder circuit using reversible logic. In Proceedings of the 17th International Conference on VLSI Design. Proceedings, Mumbai, India, 9 January 2004; pp. 757–760. [Google Scholar]
  40. Thapliyal, H.; Srinivas, M. A new reversible TSG gate and its application for designing efficient adder circuits. arXiv 2006, arXiv:cs/0603091. [Google Scholar]
Figure 1. A general representation of a reversible ( k × k ) gate with controls p 1 , p 2 , , p k 1 control wires and p k target wire.
Figure 1. A general representation of a reversible ( k × k ) gate with controls p 1 , p 2 , , p k 1 control wires and p k target wire.
Symmetry 13 01842 g001
Figure 2. All possible variations of N gate acting on three bits.
Figure 2. All possible variations of N gate acting on three bits.
Symmetry 13 01842 g002
Figure 3. All possible variations of C gate acting on three bits.
Figure 3. All possible variations of C gate acting on three bits.
Symmetry 13 01842 g003
Figure 4. All possible variations of v and u gate acting on three qubits circuit.
Figure 4. All possible variations of v and u gate acting on three qubits circuit.
Symmetry 13 01842 g004
Figure 5. The T 3 gate where: (a) all possible variations of T gate acting on three circuit, (b) the T 123 decomposition into five elementary gates.
Figure 5. The T 3 gate where: (a) all possible variations of T gate acting on three circuit, (b) the T 123 decomposition into five elementary gates.
Symmetry 13 01842 g005
Figure 6. The gate representation of G 3 gates for a 3-bit reversible circuit [21].
Figure 6. The gate representation of G 3 gates for a 3-bit reversible circuit [21].
Symmetry 13 01842 g006
Figure 7. (a) The proposed HA/HS using the G 3 library, (b) the Toffoli decomposition of the proposed HA/HS, (c) the optimized decomposition of the proposed HA/HS into five elementary gates with Q C equal to four.
Figure 7. (a) The proposed HA/HS using the G 3 library, (b) the Toffoli decomposition of the proposed HA/HS, (c) the optimized decomposition of the proposed HA/HS into five elementary gates with Q C equal to four.
Symmetry 13 01842 g007
Figure 8. (a) The proposed design of the FA using the G 3 library, (b) the Toffoli decomposition of the proposed FA design, (c) decomposes the proposed design FA into its 14 elementary gates, and (d) the optimized decomposition of the proposed FA into eight basic gates with a total Q C equals to six.
Figure 8. (a) The proposed design of the FA using the G 3 library, (b) the Toffoli decomposition of the proposed FA design, (c) decomposes the proposed design FA into its 14 elementary gates, and (d) the optimized decomposition of the proposed FA into eight basic gates with a total Q C equals to six.
Symmetry 13 01842 g008
Figure 9. (a) The proposed design of the FS using the G 3 library, and (b) the optimized decomposition of the proposed FA into 12 basic gates with a total Q C equals to eight.
Figure 9. (a) The proposed design of the FS using the G 3 library, and (b) the optimized decomposition of the proposed FA into 12 basic gates with a total Q C equals to eight.
Symmetry 13 01842 g009
Figure 10. The actual representation for the proposed designs, where (a) The proposed design Section 3.1: HA/HS circuit representation on IBM’s using Qiskit Python SDK, (b) The proposed design Section 3.2: FA circuit representation on IBM’s using Qiskit Python SDK and its decomposition and (c) The proposed design Section 3.3: FS circuit representation on IBM’s using Qiskit Python SDK and its decomposition [25].
Figure 10. The actual representation for the proposed designs, where (a) The proposed design Section 3.1: HA/HS circuit representation on IBM’s using Qiskit Python SDK, (b) The proposed design Section 3.2: FA circuit representation on IBM’s using Qiskit Python SDK and its decomposition and (c) The proposed design Section 3.3: FS circuit representation on IBM’s using Qiskit Python SDK and its decomposition [25].
Symmetry 13 01842 g010
Table 1. The possible functions that can be performed using the proposed design Section 3.1.
Table 1. The possible functions that can be performed using the proposed design Section 3.1.
x 1 x 2 x 3 y 1 y 2 y 3 Result
Proposed design Section 3.1 X Y 0 X ¯ Sum C o u t ADD, NOT
X Y Y X ¯ Diff B o u t SUB, NOT
Table 2. The possible Boolean operations that can be performed using the proposed designs Section 3.2 and Section 3.3 by changing the input bits x 2 , x 3 and x 4 .
Table 2. The possible Boolean operations that can be performed using the proposed designs Section 3.2 and Section 3.3 by changing the input bits x 2 , x 3 and x 4 .
x 1 x 2 x 3 x 4 y 1 y 2 y 3 y 4 Result
Proposed design Section 3.2 X 0 Y C i n X ¯ Sum X Y ¯ C o u t ADD, NOT, XNOR
X 0 Y 0 X ¯ XY X Y ¯ X Y NOT, AND, XNOR, XOR
X 0 Y 1 X ¯ XY X Y X Y ¯ X Y ¯ NOT, OR, XNOR
X 1 Y 0 X ¯ X Y ¯ X Y ¯ X Y NOT, NAND, XNOR, XOR
X 1 Y 1 X ¯ XY X Y ¯ X Y ¯ X Y ¯ NOT, NOR, XNOR, XOR
Proposed design Section 3.3 X Y Y B i n X ¯ Difference X Y B o u t SUB, NOT, XOR
Table 3. The result of executing the proposed HA on IBM Q [24].
Table 3. The result of executing the proposed HA on IBM Q [24].
X Y C out SUMSuccess Probability
0 0 0 0 0.8829
0 1 0 1 0.8001
1 0 0 1 0.7969
1 1 1 0 0.8239
Average success probability 0.8259
Table 4. The result of executing the proposed HS on IBM Q [24].
Table 4. The result of executing the proposed HS on IBM Q [24].
X Y B out DiffSuccess Probability
0 0 0 0 0.7457
0 1 1 1 0.7387
1 0 0 1 0.7545
1 1 0 0 0.7436
Average success probability 0.7456
Table 5. The result of executing the proposed FA on IBM Q [24].
Table 5. The result of executing the proposed FA on IBM Q [24].
X Y C in C out SUMSuccess Probability
0 0 0 0 0 0.7088
0 0 1 0 1 0.7117
0 1 0 0 1 0.7703
0 1 1 1 0 0.7620
1 0 0 0 1 0.6081
1 0 1 1 0 0.6854
1 1 0 1 0 0.6879
1 1 1 1 1 0.6138
Average success probability 0.6935
Table 6. The results of executing the proposed FS on IBM Q [24].
Table 6. The results of executing the proposed FS on IBM Q [24].
X Y B in B out DiffSuccess Probability
0 0 0 0 0 0.76
0 0 1 1 1 0.6376
0 1 0 1 1 0.6531
0 1 1 1 0 0.6632
1 0 0 0 1 0.7121
1 0 1 0 0 0.7266
1 1 0 0 0 0.7033
1 1 1 1 1 0.6075
Average success probability 0.6829
Table 7. Comparing the proposed FA and FS designs with relevant work, where (−) refers to metric not calculated by the others.
Table 7. Comparing the proposed FA and FS designs with relevant work, where (−) refers to metric not calculated by the others.
ReferenceFunctionQCGOCIGCDelay
Proposed designSection 3.2FA 6 0 1 2 4 Δ
Proposed designSection 3.3FS 8 0 0 4 7 Δ
[35]FA 2 1 2
[36]FA/FS 24 6 7 6 16 Δ
Design 1 [37]FA/FS 21 3 3 8
Design 2 [37]FA/FS 14 3 1 4
Design 3 [37]FA/FS 10 3 1 4
[38]FA 3 2 4
[39]FA 10 2 1 3
[17]FS 6 6 Δ
[40]FA 2 1
[18]FA/FS 19 8
[19]FA/FS 11 2 0 1
[20]FA/FS 8 2 1 2 8 Δ
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Osman, M.; El-Wazan, K. Efficient Designs of Quantum Adder/Subtractor Using Universal Reversible Gate on IBM Q. Symmetry 2021, 13, 1842. https://doi.org/10.3390/sym13101842

AMA Style

Osman M, El-Wazan K. Efficient Designs of Quantum Adder/Subtractor Using Universal Reversible Gate on IBM Q. Symmetry. 2021; 13(10):1842. https://doi.org/10.3390/sym13101842

Chicago/Turabian Style

Osman, Mohamed, and Khaled El-Wazan. 2021. "Efficient Designs of Quantum Adder/Subtractor Using Universal Reversible Gate on IBM Q" Symmetry 13, no. 10: 1842. https://doi.org/10.3390/sym13101842

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop