gf(4) based synthesis of quaternary reversible/quantum logic circuits mozammel h. a. khan east west...
Post on 19-Dec-2015
215 views
TRANSCRIPT
GF(4) Based Synthesis of Quaternary Reversible/Quantum Logic Circuits
Mozammel H. A. KhanEast West University, Dhaka, Bangladesh
Marek A. PerkowskiPortland State University, Portland, OR, USA
Introduction
• D-level (multiple-valued) quantum circuits have many advantages
• There is not much published about the practical circuit realization for such circuits
• MV logic functions having many inputs can be expressed as GFSOP
• GFSOP can be realized as cascade of Feynman and Toffoli gates
• No work has yet been done on expressing quaternary logic function as QGFSOP
• No work has yet been done on realizing QGFSOP as cascade of quaternary Feynman and Toffoli gates
Contribution of the Paper
• We have developed nine QGFEs (QGFE1 – QGFE9)
• We show way of constructing QGFDDsQGFDDs using QGFEs
• We show method of generating QGFSOPQGFSOP by flattening QGFDD
• We show technique of realizing QGFSOP as a cascade cascade of quaternary 1-qudit, Feynman, and Toffoli gates
Contribution of the Paper (contd)
• We show way of 2-bit encoded quaternary realization of binary functions
– We have developed circuit for binary-to-quaternary encoding– We have developed circuit for quaternary-to-binary decoding
Quaternary Galois field arithmetic Quaternary Galois field arithmetic Q = {0, 1, 2, 3}
Table 1. GF(4) operations
+ 0 1 2 3 0 1 2 3
0 0 1 2 3 0 0 0 0 0
1 1 0 3 2 1 0 1 2 3
2 2 3 0 1 2 0 2 3 1
3 3 2 1 0 3 0 3 1 2
Example: (2 x+1) 2= (2 2) x + (1 2) = 3 x + 2
Quaternary Galois field sum of products expressionQuaternary Galois field sum of products expressionTable 2. Basic quaternary reversible-literals
Input x x+1 x+2 x+3
0123
0123
1032
2301
3210
Input 2x 2x+1 2x+2 2x+3
0123
0231
1320
2013
3102
Input 3x 3x+1 3x+2 3x+3
0123
0312
1203
2130
3021
Input x2 x2+1 x2+2 x2+3
0123
0132
1023
2310
3201
Input 2x2 2x2+1 2x2+2 2x2+3
0123
0213
1302
2031
3120
Input 3x2 3x2+1 3x2+2 3x2+3
0123
0321
1230
2103
3012
Example of one-qutrit gate3x2+1Example of one-qutrit gate
Quaternary Galois field sum of products expression (contd)
Table 3. Products of basic quaternary reversible-literals and the constant 2Table 3. Products of basic quaternary reversible-literals and the constant 2
literal x x+1 x+2 x+3
2(literal) 2x 2x+2 2x+3 2x+1
literal 2x 2x+1 2x+2 2x+3
2(literal) 3x 3x+2 3x+3 3x+1
literal 3x 3x+1 3x+2 3x+3
2(literal) x x+2 x+3 x+1
literal x2 x2+1 x2+2 x2+3
2(literal) 2x2 2x2+2 2x2+3 2x2+1
literal 2x2 2x2+1 2x2+2 2x2+3
2(literal) 3x2 3x2+2 3x2+3 3x2+1
literal 3x2 3x2+1 3x2+2 3x2+3
2(literal) x2 x2+2 x2+3 x2+1
Example: (2 x+1) 2= (2 2) x + (1 2) = 3 x + 2
Quaternary Galois field sum of products expression (contd)
Table 4. Product of basic quaternary reversible-literal and the constant 3
literal x x+1 x+2 x+3
3(literal) 3x 3x+3 3x+1 3x+2
literal 2x 2x+1 2x+2 2x+3
3(literal) x x+3 x+1 x+2
literal 3x 3x+1 3x+2 3x+3
3(literal) 2x 2x+3 2x+1 2x+2
literal x2 x2+1 x2+2 x2+3
3(literal) 3x2 3x2+3 3x2+1 3x2+2
literal 2x2 2x2+1 2x2+2 2x2+3
3(literal) x2 x2+3 x2+1 x2+2
literal 3x2 3x2+1 3x2+2 3x2+3
3(literal) 2x2 2x2+3 2x2+1 2x2+2
Quaternary Galois field sum of products expression (contd)
• Product of two or more basic quaternary reversible-literals is called a QGFP.
(2x+2)(3x2+2)(2x2)
• Sum of two or more QGFP is called a QGFSOP
(2x+2)(3x2+2) + (3x+1)(2x) + x
These may be functions of one or more variablesThese may be functions of one or more variables
Quaternary Galois field expansionsQuaternary Galois field expansions
• Cofactors
),,0,,,( 210 nxxxff
),,1,,,( 211 nxxxff
),,2,,,( 212 nxxxff
),,3,,,( 213 nxxxff
Quaternary Galois field expansion Quaternary Galois field expansion (contd)(contd)
• Composite Cofactors
1001 fff
2002 fff
3003 fff
2112 fff
3113 fff
3223 fff
210012 ffff
310013 ffff 320023 ffff
321123 ffff
32100123 fffff
321)33)(22(1 32 ffff
321)32)(23(1 23 ffff
See notation for some See notation for some composite cofactorscomposite cofactors
Quaternary Galois field expansions (contd)Quaternary Galois field expansions (contd)
•QGFE 1:
•QGFE 2:
•QGFE 3:
•QGFE 4:
0302
010
)2)(1()3)(1(
)3)(2(
fxxxfxxx
fxxxff
1312
011
)2)(1()3)(1(
)3)(2)(1(
fxxxfxxx
fxxxff
2312
022
)2)(1()3)(2(
)3)(2)(1(
fxxxfxxx
fxxxff
2313
033
)3)(1()3)(2(
)3)(2)(1(
fxxxfxxx
fxxxff
First four Quaternary Expansions – they are generalizations of the First four Quaternary Expansions – they are generalizations of the familiar Shannon and Davio expansionsfamiliar Shannon and Davio expansions
Can be derived from inverted from quaternary Shannon Expansion. Can be derived from inverted from quaternary Shannon Expansion.
Quaternary Galois field expansions (contd)
• QGFE 5:
232
132
032
012
)2)(3(
)1)(1(
fxx
fxxxfxff
232
132
032
012
)13)(12(
)33)(22(32
fxx
fxxxfxf
232
132
032
012
)32)(23(
)22)(33(23
fxx
fxxxfxf
Quaternary Galois field expansions (contd)
• QGFE 6:
232
122
022
013
)3)(2(
)1)(1(
fxx
fxxxfxff
232
122
022
013
)23)(32(
)33)(22(32
fxx
fxxxfxf
232
122
022
013
)12)(13(
)22)(33(23
fxx
fxxxfxf
Quaternary Galois field expansions (contd)
• QGFE 7:
132
122
012
023
)3)(2(
)2)(3(
fxx
fxxxfxff
132
122
012
023
)23)(32(
)13)(12(32
fxx
fxxxfxf
132
122
012
023
)12)(13(
)32)(23(23
fxx
fxxxfxf
Quaternary Galois field expansions (contd)
• QGFE 8:
• QGFE 9:
032
022
012
123
)3)(2()2)(3(
)1)(1(
fxxfxx
fxxff
032
022
012
123
)23)(32()13)(12(
)33)(22(
fxxfxx
fxxf
032
022
012
123
)12)(13()32)(23(
)22)(33(
fxxfxx
fxxf
)32)(23(1)33)(22(12
01232
0 xffxxfxff
Quaternary Galois field decision diagramsQuaternary Galois field decision diagrams
Table 5.Table 5. Truth Table of an example quaternary function
F = x + y (GF4)
x y 00 01 02 03 10 11 12 13
f(x,y) 0 1 2 3 1 0 3 2
xy 20 21 22 23 30 31 32 33
f(x,y) 2 3 0 1 3 2 1 0
x y
Quaternary Galois field decision diagrams (contd)
Figure 1. QGFDD for the function of Table 5 using QGFE1 and QGFE2
f
x
y
0 1 2 3
001 02
03
01/112
131
13/12/011
13/12/01 13/12/01
1
1 QGFE
QGFE2 QGFE2 QGFE2 QGFE2
)2)(1(3)3)(1(2
)3)(2()2)(1(2
)3)(1(3)3)(2)(1(1
xxxxxx
xxxyyy
yyyyyyf
x
y
Two expansion variables, x and y
Quaternary Galois field decision diagrams (contd)
Figure 2. QGFDD for the function of Table 5 using QGFE9
f
x
y
0 1 2 3
0
0123)33)(22(1
)32)(23(1
)33)(22(1
/0123/0
)32)(23(1
0)32)(23(1
/)33)(22(1
/0123
QGFE9
QGFE9 QGFE9
yxf x
y
Quaternary Galois Field Decision Diagrams
• Similarly to KFDDs, the order of variables and the choice of expansion type for every level affects the number of nodes (size) of the decision diagram.
Quaternary 1-qudit Quaternary 1-qudit reversible/quantum gatesreversible/quantum gates
• Each of the 24 quaternary reversible-literals can be implemented as 1-qudit gates using quantum technology
Figure 3. Representation of quaternary reversible 1-qudit gates
x exp QGF y
Quaternary 2-qudit Muthukrishnan-Stroud gate family
Figure 4. Quaternary Muthukrishnan-Stroud gate family
z
A
B
AP
otherwise
3 if of transform-
B
ABzQ
2 Table of sformqudit tran-1any is z
Quaternary Feynman gate
Figure 5. Quaternary Feynman gate
Figure 6. Realization of quaternary Feynman gate
A
B
AP
(GF4) BAQ
1 2 3
A
B
1a2 3 12a 3a
AP
[GF(4)] BAQ
Quaternary Toffoli gate
Figure 7. Quaternary Toffoli gate
Figure 8. Realization of quaternary Toffoli gate
A
B
C
AP BQ
[GF(4)] CABR
A
B
0
C
2 3 1 BQ
2 3 1 2 2 3 1 2 2 3 1 2 AP
1 2 3 1 2 3 1 2 3 2 3 1
1 2 3
AB
[GF(4)] CABR
1a
1b
1t
2a
2b
2t
3a
3b
ABt 3
1Segment 2Segment 3Segment 4Segment
One One ancilla bitancilla bit
Quaternary Toffoli gate (contd)
Figure 9. Four-input quaternary Toffoli gate
A
B
0
C
D
AB
A
B
0
CDABC
A
B
CDABC
A
B
C
D
Symbol (a)nRealizatio (b) Two Two
ancilla ancilla bitsbits
Synthesis of QGFSOP expressionsSynthesis of QGFSOP expressions
Figure 10. Realization of QGFSOP expression
)2)(1(3)3)(1(2
)3)(2()2)(1(2
)3)(1(3)3)(2)(1(1
xxxxxx
xxxyyy
yyyyyyf
x
0
0
0
x
x
x
1x
x
x
2x
3x
x2
x3
y
0
0
0
y1y
2y
3y
y2
y3
0
0
0
0
1f
y
y
y
y
Binary-to-quaternary encoder and quaternary-to-binary decoder circuits
Figure 11. Binary-to-quaternary encoder circuit
Figure 12. Quaternary-to-binary decoder circuit
0A
1A
0 B
2
2
21
*0A*1A
1
1 1
1 1
2
B0
0
0
0A
1A
0B
1BB
output
input
inputs
outputs
garbage
Are d-level quantum circuit an advantage?
• Benchmarking is necessary.
• In some cases quaternary circuit is much simpler than binary.
• These applications include especially circuits with many arithmetic blocks and comparators.
• Control should be binary, data path should be multiple-valued.
• We need hybrid circuits that convert from binary to d-level and vice versa. This is relatively easy in quantum.
Oracle for Quantum Map of Europe ColoringOracle for Quantum Map of Europe Coloring
Spain
France
Germany
Switzerland
Spain
France
Germany
Switzerland
Good Good coloringcoloring
quaternary
Oracle for Quantum Map of Europe ColoringOracle for Quantum Map of Europe Coloring
0 1 2 3
1 0 3 2
2 3 0 1
3 2 1 0
0+1=1 1+1=0 2+1=3 3=1=2
0+0=0 1+0=1 2+0=2 3+0=3
0+3=3 1+3=2 2+3=1 3+3=0
0+2=2 1+2=3 2+2=0 3+2=1
0
1
2
3
0 1 2 3
0 1 2 3
0 1 2 3
0
1
2
3
+2
+3
0
1
2
3
+1
+3
+2
Quaternary Feynman Quaternary input/binary output comparator of equality
1 when A = B
A
B+1
Oracle for Quantum Map of Europe ColoringOracle for Quantum Map of Europe Coloring
0
1
2
3
+1
+3
+2
A
B
+11
1
0
1
2
3
+1
+3
+2
C
D
+11
1
1 1 -- when control 1
1 -- for controls 0,2 and 3
Binary qudit =1 for frontier AB when countries A and B have different colors
0
Binary signal 1 when all frontiers well colored
Comparator for Comparator for each frontiereach frontier
Quaternary controlled binary target gate
Binary Toffoli
Conclusion Conclusion • We have developed nine QGFEs
• These QGFEs can be used for constructing QGFDDs
• By flattening the QGFDD we can generate QGFSOP
• We have shown example of implementation of QGFSOP as cascade of quaternary 1-qudit gate, Feynman gate, and Toffoli gate
Conclusion (contd)
• For QGFSOP based quantum realization of functions with many input variables, we need to use quantum gates with many inputs. • Quantum gates with more than two inputs are very difficult to realize as a primitive gate
• We have shown the quantum realization of macro-level quaternary 2-qudit Feynman and 3-qudit Toffoli gates on the top of theoretically liquid ion-trap realizable 1-qudit gates and 2-qudit Muthukrishnan-Stroud primitive gates •We also show the realization of m-qudit (m > 3) Toffoli gates using 3-qudit Toffoli gates
Conclusion (contd)
• The quaternary base is very useful for 2-bit encoded realization of binary function • We show quantum circuit for binary-to-quaternary encoder and quaternary-to-binary decoder for this purpose
Conclusion (contd)
• The presented method is especially applicable to quantum oracles • The developed method performs a conversion of a non-reversible function to a reversible one as a byproduct of the synthesis process
• Our method can be used for large functions
• As it is using Galois logic, the circuits are highly testable
Conclusion (contd)• Our future research includes
(1) developing more QGFEs, if such expansions exist
(2) developing algorithms for(i) selecting expansion for each variable(ii) variable ordering(iii) constructing QGFDD (Kronecker and
pseudo-Kronecker types) for both single-output and multi-output functions
(3) Building gates on the level of Pauli Rotations, similarly as it was done in our published paper – Soonchil Lee et al.
Conclusion (contd)• Building gates on the level of Pauli
Rotations will require deciding in which points on the Bloch Sphere are the basic states
– Paper in RM 2007Paper in RM 2007
• This will affect rotations between these states, which means complexity of single-qudit and two-qudit gates.
• For each of created gates we will calculate quantum cost – numbers of Pauli rotations and Interaction gates (Controlled Z).
Conclusion (contd)
• Building blocks on the levels of first these gates and next Pauli Rotations to analyse what is the real gain of using mv concepts – example is comparator in Graph Coloring Oracle for Grover.
– Adders, multipliers, comparators of order, counting circuits, converters between various representations, etc.
• Practical realization of Pauli rotations and Interaction gates (Controlled Z) in NMR, ion trap, one-way and other technologies.
Research Questions1. What is the best location of basic states?
2. Can Galois Field mathematical theory be used for more efficient factorization or expansion, in general for synthesis?
3. Can we generalize Galois Field to circuits with 6 basic states (for which good placement on Bloch Sphere exists)?
4. Can we create some kind of algebra to allow expansion, factorization and other algebraic rules directly applied to easily realizable MS gates, rather than complex gates such as based on Galois Fields?
Thanks
Questions?