Classical and Quantum Circuit Synthesis An Algorithmic Approach.

Slides:



Advertisements
Similar presentations
Quantum Computation and Quantum Information – Lecture 3
Advertisements

Reversible Gates in various realization technologies
Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
Combinational Circuits
Combinational Circuits ENEL 111. Common Combinationals Circuits NAND gates and Duality Adders Multiplexers.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 9 Programmable Configurations Read Only Memory (ROM) – –a fixed array of AND gates.
ECE 331 – Digital System Design
A Transformation Based Algorithm for Reversible Logic Synthesis D. Michael Miller Dmitri Maslov Gerhard W. Dueck Design Automation Conference, 2003.
Quantum Error Correction SOURCES: Michele Mosca Daniel Gottesman Richard Spillman Andrew Landahl.
Logic Synthesis by Branch and Bound A C++ Program Aditya Prasad.
Department of Computer Science & Engineering University of Washington
Reversible Circuit Synthesis Vivek Shende & Aditya Prasad.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 4-1 Chapter #2: Two-Level Combinational Logic Section 2.3, Switches and Tools.
Minimization Techniques for Reversible Logic Synthesis.
Lecture 3. Boolean Algebra, Logic Gates
Backtracking.
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Digital Design.
ROM-based computations: quantum versus classical B.C. Travaglione, M.A.Nielsen, H.M. Wiseman, and A. Ambainis.
Overview Part 2 – Circuit Optimization 2-4 Two-Level Optimization
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Classical Versus Quantum. Goal: Fast, low-cost implementation of useful algorithms using standard components (gates) and design techniques Classical Logic.
June 10, Functionally Linear Decomposition and Synthesis of Logic Circuits for FPGAs Tomasz S. Czajkowski and Stephen D. Brown University of Toronto.
Chapter 3: The Fundamentals: Algorithms, the Integers, and Matrices
Chapter 2 Combinational Systems And / Or / Not. TRIAD PRINCIPLE: Combinational is about And / Or / Not combinations As well as equivalent functions. It.
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
Homework Problems 1. M1 runs the program P in 1.4 * 9 * ns or ns M2 runs the program P in 1.6*9800*10ns or ns Hence M2 is faster by.
Combinational and Sequential Logic Circuits.
Identifying Reversible Functions From an ROBDD Adam MacDonald.
CS1Q Computer Systems Lecture 8
1 Cost Metrics for Reversible and Quantum Logic Synthesis Dmitri Maslov 1 D. Michael Miller 2 1 Dept. of ECE, McGill University 2 Dept. of CS, University.
Computer Architecture I: Digital Design Dr. Robert D. Kent Logic Design Medium Scale Integration and Programmable Logic Devices Part I.
Chapter 10 (Part 2): Boolean Algebra  Logic Gates (10.3) (cont.)  Minimization of Circuits (10.4)
1 © 2015 B. Wilkinson Modification date: January 1, 2015 Designing combinational circuits Logic circuits whose outputs are dependent upon the values placed.
EE2420 – Digital Logic Summer II 2013 Hassan Salamy Ingram School of Engineering Texas State University Set 4: Other Gates.
CHAPTER 4 Combinational Logic
Important Components, Blocks and Methodologies. To remember 1.EXORS 2.Counters and Generalized Counters 3.State Machines (Moore, Mealy, Rabin-Scott) 4.Controllers.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
CS231 Boolean Algebra1 K-map Summary K-maps are an alternative to algebra for simplifying expressions. – The result is a minimal sum of products, which.
1 hardware of quantum computer 1. quantum registers 2. quantum gates.
1 A Novel Synthesis Algorithm for Reversible Circuits Mehdi Saeedi, Mehdi Sedighi*, Morteza Saheb Zamani {msaeedi, msedighi, aut.ac.ir.
Logic Design CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
Sep 29, 2004Subtraction (lvk)1 Negative Numbers and Subtraction The adders we designed can add only non-negative numbers – If we can represent negative.
ELE 523E COMPUTATIONAL NANOELECTRONICS
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP
Arithmetic Operations
1 Chapter 4 Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables,
Garbage in Reversible Designs of Multiple Output Functions
Combinational Circuit Design. Digital Circuits Combinational CircuitsSequential Circuits Output is determined by current values of inputs only. Output.
Recursive Architectures for 2DLNS Multiplication RESEARCH CENTRE FOR INTEGRATED MICROSYSTEMS - UNIVERSITY OF WINDSOR 11 Recursive Architectures for 2DLNS.
Arithmetic Logic Unit (ALU) Introduction to Computer Yung-Yu Chuang with slides by Sedgewick & Wayne ( introcs.cs.princeton.edu ), Nisan & Schocken (
Addition and multiplication Arithmetic is the most basic thing you can do with a computer, but it’s not as easy as you might expect! These next few lectures.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
President UniversityErwin SitompulDigital Systems 7/1 Lecture 7 Digital Systems Dr.-Ing. Erwin Sitompul President University
BDD-based Synthesis of Reversible Logic for Large Functions Robert Wille Rolf Drechsler DAC’09 Presenter: Meng-yen Li.
Gunjeet Kaur Dronacharya Group of Institutions. Binary Adder-Subtractor A combinational circuit that performs the addition of two bits is called a half.
Chapter 12. Chapter Summary Boolean Functions Representing Boolean Functions Logic Gates Minimization of Circuits (not currently included in overheads)
An Iterative FFT We rewrite the loop to calculate nkyk[1] once
Combinational Circuits
Algorithms with numbers (1) CISC4080, Computer Algorithms
Subtraction The arithmetic we did so far was limited to unsigned (positive) integers. Today we’ll consider negative numbers and subtraction. The main problem.
Week 7: Gates and Circuits: PART II
Digital Logic.
13 Digital Logic Circuits.
Gates Type AND denoted by X.Y OR denoted by X + Y NOR denoted by X + Y
Quantum Computation and Information Chap 1 Intro and Overview: p 28-58
ECE 352 Digital System Fundamentals
ECE 352 Digital System Fundamentals
More Example.
Presentation transcript:

Classical and Quantum Circuit Synthesis An Algorithmic Approach

Problem How do we synthesize efficient n-input quantum circuits using CNOT gates only ? Of the n! possible n-qubit permutations, how many can be implemented in this way? What is the longest such circuit? How can long chains of CNOTs be systematically reduced?

Goals Way to synthesize quantum circuits Currently, reducing chains of C-Not gates is important More complex circuits (with Toffoli gates, etc...) Larger circuits (more qubits, more gates, etc...)

Reducing C-Nots Want to minimize error Need an algorithmic approach Classical circuit approach  discrete reversible case

wire 0: X--O-----X--X--O- wire 1: -O--X-----X--O--O-----X- wire 2: -X--O--O-----X-----O---- Reduces to: wire 0: -O- wire 1: --- wire 2: -X- Example

Classical program goals Synthesize optimal classical circuits Provides method for creating reduced chains of C-Not gates Scalable As many inputs/outputs as necessary Versatile Use various gate libraries (AND, OR, NOT, etc...)

Refresher – Truth Tables XYZ=X^Y AND gate (Columnar format) These can be represented in row format as well: X = > 3 Y = > Z = > 1 (3^5)==1

How to Synthesize? Inputs X = 0011 Y = 0101 Desired result Z = 0110 ?

How to Synthesize? Inputs X = 0011 Y = 0101 Desired result Z = 0110 Gate Library: AND, OR, NAND

Tree Structure Solution space representable as a tree Inputs at head of tree Each level down represents addition of new gate Branch factor depends on number of current gates and allowable new gates

Inputs X, Y A=X*YA=X+Y B=X*YB=X+YB=X*AB=X+AB=Y*AB=Y+A Level 1 Level 2(Same as left) If we have N inputs (N=2 here) G gate types (G=2, we have AND and OR) Then at level L we have a branch factor of B = G * (N+L-1, 2) / 2

Branch and Bound Depth-first search First do top  bottom, then left  right Travel down to leaves before going to siblings Can be implemented by a recursive function, passing L+1 with each call

DFS Branch & Bound

B&B Synthesis Inputs X = 0011 Y = 0101 Desired result Z = 0110 A=X*X=0011

B&B Synthesis Inputs X = 0011 Y = 0101 Desired result Z = 0110 A=X*X=0011B=X*X=0011

B&B Synthesis Inputs X = 0011 Y = 0101 Desired result Z = 0110 A=X*X=0011B=X*X=0011 C=X*X=0011 C=X+X=0011 C=(X*X)’=1100 C=X*Y=

B&B Synthesis Inputs X = 0011 Y = 0101 Desired result Z = 0110 A=X*X=0011B=X+X=0011 C=X*X=0011 C=X+X=0011 C=(X*X)’=1100 C=X*Y=

B&B Synthesis Inputs X = 0011 Y = 0101 Desired result Z = 0110 A=X*X=0011B=(X*X)’=0011 C=X*X=0011 C=X+X=0011 C=(X*X)’=1100 C=X*Y=

Solution Found! Inputs X = 0011 Y = 0101 Desired result Z = 0110 A=X+Y=0111B=(X*Y)’=1110C=A*B=0110

Bounding Conditions Branch factor unnecessarily large Need bounding conditions Don’t need duplicate gates (A=X*X,B=X*X) Symmetrical gates done only once Don’t need X*Y, then Y*X Symmetrical branches of solution space can be bounded away Optimality requirement creates a bound

Optimality Bounding Current circuit  Assume we are only allowed one more gate  This gate cannot use all three level-two gates as inputs  If added, two of the level-two gates would be used, one would be left dangling  No reason to add a gate, bound now

Don’t-cares Suppose we are interested in only part of the output. Say Z=0110 and Z=0111 are both desirable outputs. We don’t care about the last bit. Can represent output as Z = 011X This relaxed restriction allows us to find a suitable match more quickly Quantum circuits can also have don’t-cares, but they are different than classical ones.

Multiple Outputs We may desire more than one output Ex: Half adder. Has two bits as input, two bits as output (sum, carry) Optimal multi-output circuit may be different than circuit created by merging the individual optimal ones. Causes an approximately linear increase in synthesis time.

Reversible Synthesis To maintain reversibility, must have same number of qubits at every stage Fan out must be 1, so there is no expansion in the number of gates at any stage Both the input/output functions and all the gates must be reversible

Compact Representation (Revisited) For a three qubit function, our inputs (A, B, C) will have these values: ABCV A = = 15 B = = 51 C = = 85

Permutation Representation We want to synthesize the outputs A’, B’, and C’ from the inputs A, B, and C ABCV A’B’C’V To be reversible, all of the values of V must be distinct. This allows us to treat the outputs as permutations of the inputs.

Permutation Representation ABCV A’B’C’V’ So the problem: (15,51,85)->(178,120,27) Can be expressed as: >

Simplified Circuit Representation A B C A’ B’ C’ (A, B) (B, C)

Simplified Circuit Representation A B C A’ B’ C’ A1 B1 C1 A2 C2 B2 (A, B) (B, C)

ABCV A1B1C1V (A, B) (B, C) A2B2C2V A’B’C’V’

Results Question: given a 3-Qubit system, what is the longest possible irreducible chain of C-Nots? Note that some longest chain *must* exist because there are finitely many (8!) permutations.

Bounding At each stage, we store the value on each wire. If all wire values are the same, bound If two gates can be permuted w/o affecting the circuit, only try one of them -O-O- -X--- = ---X- ---X- -X---

Answer Longest chains: wire 0: --O--X--O wire 1: X--O--X-- wire 2: --X--O--X--O--X--O-- AND wire 0: X--O--X-- wire 1: --O--X--O wire 2: --X--O--X--O--X--O--

Why? Recall that C-Nots act like XOR gates. That is, |x>|y>  |x>|x XOR y> What does this code do? A = A xor B B = A xor B A = A xor B This is a variable swap. The chains on the previous page represent wire swaps.

How many C-Nots? Experimental results: Of the (=8!) permutations, exactly 168 are achievable. 2 of them require 6 C-Not gates 24 require 5 60 require 4 51 require 3 24 require 2 (6 * 6 - duplicates) 6 require 1 (3 control choices * 2 targets) 1 requires 0

Why only 168? Not all of the 8! permutations are achievable The permutation must be even. Recall every C-Not caused two pairs of values to be swapped Exactly half of the 8! permutations are even Various other factors reduce this more

Parity of a Permutation The number of line crossings determines the parity of a permutation. There are four in this case, and so the permutation is even.

Future Plans... Make Program: More scalable Currently using 32-bit integers to store wire values. 2^5 = 32; only 5 wires at a time now. More versatile Currently only using C-Not gates. Allow n-input Toffoli gates, other gates Quicker Determine methods for bounding better, exploit characteristics of quantum circuits.

Potential improvements Scalability Use STL bit_vector, or bit_set... fully expandable Speed Since all the gates and the functions are reversible, the whole circuit is too. Functions can be synthesized in reverse

Reversible Synthesis Recall that C-Not acts like XOR C-Not is its own inverse (going left to right is same as right to left) Synthesis can be done right  left We already know how to achieve the input values with several gates, because we’ve done this left  right before This allows us to have a LUT when we get near enough to the inputs