Quantum circuits for floating-point arithmetic

Slides:



Advertisements
Similar presentations
Zhongkai Chen. Gonzalez-Navarro, S. ; Tsen, C. ; Schulte, M. ; Univ. of Malaga, Malaga This paper appears in: Signals, Systems and Computers, ACSSC.
Advertisements

1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
1 CONSTRUCTING AN ARITHMETIC LOGIC UNIT CHAPTER 4: PART II.
1 Lecture 9: Floating Point Today’s topics:  Division  IEEE 754 representations  FP arithmetic Reminder: assignment 4 will be posted later today.
Assembly Language and Computer Architecture Using C++ and Java
Number Systems Standard positional representation of numbers:
1  2004 Morgan Kaufmann Publishers Chapter Three.
Assembly Language and Computer Architecture Using C++ and Java
CSE 378 Floating-point1 How to represent real numbers In decimal scientific notation –sign –fraction –base (i.e., 10) to some power Most of the time, usual.
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic Part 4.
Logic and data representation Revision. AND gate A B A B All inputs have to be true ( i.e 1) for the output of the gate to be high, in all other cases.
Computer Arithmetic Nizamettin AYDIN
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
Computing Systems Basic arithmetic for computers.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
Oct. 18, 2007SYSC 2001* - Fall SYSC2001-Ch9.ppt1 See Stallings Chapter 9 Computer Arithmetic.
HW/SW PARTITIONING OF FLOATING POINT SOFTWARE APPLICATIONS TO FIXED - POINTED COPROCESSOR CIRCUITS - Nalini Kumar Gaurav Chitroda Komal Kasat.
Lecture 9: Floating Point
Operand Addressing And Instruction Representation Cs355-Chapter 6.
1 Lecture 10: Floating Point, Digital Design Today’s topics:  FP arithmetic  Intro to Boolean functions.
Binary Arithmetic.
1 ELEN 033 Lecture 4 Chapter 4 of Text (COD2E) Chapters 3 and 4 of Goodman and Miller book.
순천향대학교 정보기술공학부 이 상 정 1 3. Arithmetic for Computers.
Recursive Architectures for 2DLNS Multiplication RESEARCH CENTRE FOR INTEGRATED MICROSYSTEMS - UNIVERSITY OF WINDSOR 11 Recursive Architectures for 2DLNS.
Chapter 9 Computer Arithmetic
William Stallings Computer Organization and Architecture 8th Edition
CHAPTER 5: Representing Numerical Data
Floating Point Representations
CS2100 Computer Organisation
Dr.Faisal Alzyoud 2/20/2018 Binary Arithmetic.
Control Unit Lecture 6.
Lecture 9: Floating Point
UNIVERSITY OF MASSACHUSETTS Dept
William Stallings Computer Organization and Architecture 7th Edition
Chapter 6 Floating Point
Data Structures Mohammed Thajeel To the second year students
Lecture 10: Floating Point, Digital Design
Binary Numbers Material on Data Representation can be found in Chapter 2 of Computer Architecture (Nicholas Carter) CSC 370 (Blum)
Introduction to cosynthesis Rabi Mahapatra CSCE617
ECE/CS 552: Floating Point
Data Representation and Arithmetic Algorithms
Data Representation Data Types Complements Fixed Point Representation
Objective of This Course
Arithmetic Logical Unit
CSE 370 – Winter 2002 – Comb. Logic building blocks - 1
How to represent real numbers
How to represent real numbers
Approximations and Round-Off Errors Chapter 3
ECEG-3202 Computer Architecture and Organization
Data Representation and Arithmetic Algorithms
Computer Architecture
Overview Part 1 – Design Procedure Part 2 – Combinational Logic
Chapter 8 Computer Arithmetic
UNIVERSITY OF MASSACHUSETTS Dept
Floating Point Numbers
UNIVERSITY OF MASSACHUSETTS Dept
Presentation transcript:

Quantum circuits for floating-point arithmetic Authors: Thomas Haener, Mathias Soeken, Martin Roetteler, and Krysta M. Svore Slides by: Sreeraj Rajendran Date: Nov 19, 2018

Contents Motivation Background Hand-optimized Circuits Automatic Circuit Synthesis Analysis Conclusion Feasibility

Motivation Floating point can support a much wider range of values than fixed point, with the ability to represent very small numbers and very large numbers. Dynamic range is especially important when processing extremely large data sets or data sets where the range may be unpredictable. Hence, ideal for computationally intensive applications like Quantum Machine Learning. Algorithms that focus on physical phenomena, such as quantum chemistry and quantum field theory calculations seem especially likely to be able to take advantage of floating point arithmetic.

Motivation… Study the impact of different choices of floating-point representations on the number of quantum bits (qubits) and number of T-gates that are required for basic arithmetic operations. Great savings in number of qubits compared to fixed point representation when the required range of values and/or relative precision is large. Efficient hardware-software co-design : It is crucial to analyze the resulting circuits in order to acquire resource estimates.

Background Floating point representation: Addition Every number x is approximated using three registers: 1 sign bit xS, M bits for the (non-negative) mantissa xM ([1, 2)), and E bits for the exponent xE. Addition

Background… Multiplication:

Background … Quantum Circuits Every quantum instruction must be reversible Intermediate results need to be stored in ancilla qubits Quantum Error Correction : all quantum operations need to be mapped to a discrete gate set (Clifford+T) T-gate - most expensive quantum operation Circuit size: KQ= T-depth.#Qubits T –count: number of T gates ( 7) T -depth : number of T-stages(6)

Hand Optimized Circuits Building blocks: Circuit for finding the first one in the bit-representation of x. f is toggled on finding first 1 and position of the first one is stored in the p-register. QUIRK Shift circuit for an 8-bit number x. The shift s must be such that the top, i.e., least-significant s bits of x are 0. Shift_circuit

Hand Optimized Circuit: Addition Circuit Sort inputs by exponent : CMP +SWAPs Shift 2nd mantissa by difference of exponents Add 2nd mantissa to first and convert back from 2’s compliment If carry, shift result by 1bit and increment exp by 1 RN gate renormalize the intermediate result using first one ckt followed by shifting the mantissa by the output of the first-ones circuit and copies out the resulting floating point representation.

Hand Optimized Circuit: Multiplication Circuit Multiply input mantissas (Mx and My) into new register of 2m qubits Right shift by 1 if Mx.My>=2 Update exponent Add input exponents Ex and Ey to Ez’ if Mx.My!=0 COPY: copying out of the resulting exponent, mantissa and sign bit to take care of special cases such as over- and underflows in computing the resulting exponent which turn to infinity and zero outcomes, respectively

Automatic Circuit Synthesis LUT based hierarchical synthesis approach (LHRS) Input - classical gate-level logic network (Verilog file) Apply logic synthesis algorithms to map the gate-level netlist into a LUT(lookup table) network. There is a one-to-one connection between a k-input LUT in a logic network and a reversible single-target gate with k control lines in a reversible network. Single-target gates: reversible gates in which the value of a target line is inverted if a given Boolean control function evaluates to true on the control line. Translate into a reversible network composed of single-target gates. Each single-target gate can be synthesized into a quantum circuit using techniques such as exclusive-sum-of-product (ESOP) decomposition. Hierarchical Reversible Logic Synthesis Using LUTs In this paper we present a hierarchical synthesis approach based on k-feasible Boolean logic networks. These are logic networks in which every gate has at most k inputs. These are often also referred to as k-LUT (lookup table) networks. We show that there is a one to-one connection between a k-input LUT in a logic network and a reversible single-target gate with k control lines in a reversible network. A single-target gate has a control function and a single target line, that is inverted if and only if the control function evaluates to 1. Each single-target gate can be synthesized into a quantum circuit using techniques such as exclusive-sum-of-product (ESOP) decomposition [13]. As a first step, our synthesis approach can quickly derive a skeleton for the reversible network that is only based on single-target gates. In this skeleton, the number of required additional lines is already final, and also it is guaranteed that it has no garbage outputs. In the second step, each single-target gate is synthesized using a separate algorithm. It is possible to parallelize the second step. The ability of a K-input LUT to implement any Boolean function of K variables di$eren,tiates the synthesis of LUT circuits from synthesis for conventional ASIC technologies. The major difference occurs during the technology mapping phase of logic synthesis.

Automatic Circuit Synthesis

Automatic Circuit Synthesis Aim: find a reversible network with as few ancillae as possible Each single-target gates is mapped to a Clifford+T network For each single-target gate, all available mappers were implemented and the quality of resulting Clifford+T networks were compared evaluate circuits using circuit depth (execution time) and KQ metric\ In order to use quantum error correction, however, all quantum operations need to be mapped to a discrete gate set. One such set of operations is called Cliord+T, where the T-gate is usually the most expensive quantum operation.

Comparison of Resource Counts Resource counts for Hand Optimized Circuit Resource counts for Automatically Generated Circuits minimum possible number of T gates (called the T-count) T -stages in a circuit, rather than the number of T -gates. A T -stage is a group of one or more T - and/or T † -gates on distinct qubits that can be performed simultaneously.

Analysis: Disadvantage of Automatic Synthesis cost in handcrafted floating-point circuits are much lower than automatic synthesis tool Optimization function is based on classical problems where in the objective is to minimize time and bits are available in plenty. It also highly depends on the logic network that is input to the synthesis algorithm. The relation of this objective to the number of qubits and T-count is not fully understood.

Analysis: Advantages of Automatic Synthesis Automatic synthesis can be applied to various designs and results can be obtained immediately compared to several months in case of hand crafted. Adjustable synthesis parameter : various different implementations of the same design can be found. Design space exploration: depending on the targeted quantum platform or the context of the design inside a quantum algorithm, one can address different objectives. Potential to find a design that requires fewer qubits. Automatic synthesis techniques can in principle find quantum circuits without any ancilla qubits (except to store the result of the outputs)

Feasibility Floating-point arithmetic using hand-optimized circuit for quantum computing is viable. Automatic synthesis results in v.large circuits. Circuit size, KQ= T-depth.#Qubits <= 439,320 : 39.3% improvement over previous work (KQ=723,301) Cost of floating-point multiplication is very similar to performing it in a fixed-point representation floating-point multiplier can deal with a much wider range of values at constant relative error

Conclusion The cost of using floating-point arithmetic is manageable and incurs almost no overhead for typical scientific applications. For many quantum algorithms, the extra range and constant relative error offered by a floating-point representation are well worth an increase in circuit size of 2-3×.

Discussion Larger overheads compared to fixed point arithmetic is partly because of strict requirements of IEEE standards for floating point arithmetic. In combination with manual circuit optimization, relaxing the requirements allows for significant savings size of the circuit. Differences in objective functions in optimization process for classical and quantum computing. Future scope: investigate this combination of approaches. Some of the subroutines in hand optimized circuits can still be further optimized using methods from the automatic synthesis approach.

Thank You