Quantum Computing - A new Implementation of Simon Algorithm for 3-Dimensional Registers

Similar documents
Problem Set # 5 Solutions

Analysis of Deutsch-Jozsa Quantum Algorithm

Last time, we talked about how Equation (1) can simulate Equation (2). We asserted that Equation (2) can also simulate Equation (1).

Quantum Information & Quantum Computation

Quantum Computing Lecture 7. Quantum Factoring

C/CS/Phys C191 Deutsch and Deutsch-Josza algorithms 10/20/07 Fall 2007 Lecture 17

Algorithm of Superposition of Boolean Functions Given with Truth Vectors

Quantum Simulation: Solving Schrödinger Equation on a Quantum Computer

The picture in figure 1.1 helps us to see that the area represents the distance traveled. Figure 1: Area represents distance travelled

Apply change-of-basis formula to rewrite x as a linear combination of eigenvectors v j.

TEACHER CERTIFICATION STUDY GUIDE

8. Applications To Linear Differential Equations

Lecture 2: Uncomputability and the Haling Problem

Discrete-Time Systems, LTI Systems, and Discrete-Time Convolution

Quantum computers can search rapidly by using almost any transformation

μ are complex parameters. Other

Decoupling Zeros of Positive Discrete-Time Linear Systems*

Solution of Differential Equation from the Transform Technique

Notes on Quantum Computing

Linear Differential Equations of Higher Order Basic Theory: Initial-Value Problems d y d y dy

Precalculus MATH Sections 3.1, 3.2, 3.3. Exponential, Logistic and Logarithmic Functions

Lecture 11: Pseudorandom functions

Computability and computational complexity

62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 +

Chimica Inorganica 3

A Block Cipher Using Linear Congruences

Olli Simula T / Chapter 1 3. Olli Simula T / Chapter 1 5

PC5215 Numerical Recipes with Applications - Review Problems

Notes for Lecture 5. 1 Grover Search. 1.1 The Setting. 1.2 Motivation. Lecture 5 (September 26, 2018)

PAijpam.eu ON DERIVATION OF RATIONAL SOLUTIONS OF BABBAGE S FUNCTIONAL EQUATION

A Note on the Symmetric Powers of the Standard Representation of S n

Internal Information Representation and Processing

ADVANCED DIGITAL SIGNAL PROCESSING

Physics 324, Fall Dirac Notation. These notes were produced by David Kaplan for Phys. 324 in Autumn 2001.

IP Reference guide for integer programming formulations.

The Random Walk For Dummies

Matrix Algebra 2.2 THE INVERSE OF A MATRIX Pearson Education, Inc.

Principle Of Superposition

Recursive Algorithms. Recurrences. Recursive Algorithms Analysis

Inverse Matrix. A meaning that matrix B is an inverse of matrix A.

Chapter 4. Fourier Series

Optimum LMSE Discrete Transform

SUPPLEMENTARY INFORMATION

Notes on iteration and Newton s method. Iteration

Chapter 9 Computer Design Basics

A widely used display of protein shapes is based on the coordinates of the alpha carbons - - C α

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018

(3) If you replace row i of A by its sum with a multiple of another row, then the determinant is unchanged! Expand across the i th row:

CALCULUS BASIC SUMMER REVIEW

CHAPTER I: Vector Spaces

Addition: Property Name Property Description Examples. a+b = b+a. a+(b+c) = (a+b)+c

ECE-S352 Introduction to Digital Signal Processing Lecture 3A Direct Solution of Difference Equations

MAXIMALLY FLAT FIR FILTERS

Linear Regression Demystified

POSSIBILISTIC OPTIMIZATION WITH APPLICATION TO PORTFOLIO SELECTION

Similarity Solutions to Unsteady Pseudoplastic. Flow Near a Moving Wall

The Mathematical Model and the Simulation Modelling Algoritm of the Multitiered Mechanical System

Polynomial Functions and Their Graphs

1 Hash tables. 1.1 Implementation

arxiv:quant-ph/ v1 21 Jan 1998

Machine Learning for Data Science (CS 4786)

Let A(x) and B(x) be two polynomials of degree n 1:

Generating Functions for Laguerre Type Polynomials. Group Theoretic method

w (1) ˆx w (1) x (1) /ρ and w (2) ˆx w (2) x (2) /ρ.

arxiv: v1 [cs.sc] 2 Jan 2018

Monte Carlo Optimization to Solve a Two-Dimensional Inverse Heat Conduction Problem

Model of Computation and Runtime Analysis

Lecture 9: Hierarchy Theorems

2 Geometric interpretation of complex numbers

POWER SERIES SOLUTION OF FIRST ORDER MATRIX DIFFERENTIAL EQUATIONS

Largest families without an r-fork

Parallel Vector Algorithms David A. Padua

1 6 = 1 6 = + Factorials and Euler s Gamma function

Recurrence Relations

CSI 2101 Discrete Structures Winter Homework Assignment #4 (100 points, weight 5%) Due: Thursday, April 5, at 1:00pm (in lecture)

Model of Computation and Runtime Analysis

PAijpam.eu ON TENSOR PRODUCT DECOMPOSITION

The Discrete Fourier Transform

Infinite Sequences and Series

U8L1: Sec Equations of Lines in R 2

Design and Analysis of Algorithms

subject to A 1 x + A 2 y b x j 0, j = 1,,n 1 y j = 0 or 1, j = 1,,n 2

ECE 308 Discrete-Time Signals and Systems

Chapter Vectors

arxiv:quant-ph/ v1 10 Oct 2002

, then cv V. Differential Equations Elements of Lineaer Algebra Name: Consider the differential equation. and y2 cos( kx)

On the Linear Complexity of Feedback Registers

Appendix: The Laplace Transform

Chapter 4 : Laplace Transform

Lecture 6 Chi Square Distribution (χ 2 ) and Least Squares Fitting

Chapter 7: The z-transform. Chih-Wei Liu

Assignment 2 Solutions SOLUTION. ϕ 1 Â = 3 ϕ 1 4i ϕ 2. The other case can be dealt with in a similar way. { ϕ 2 Â} χ = { 4i ϕ 1 3 ϕ 2 } χ.

CHAPTER 5 SOME MINIMAX AND SADDLE POINT THEOREMS

A New Solution Method for the Finite-Horizon Discrete-Time EOQ Problem

arxiv: v1 [math-ph] 5 Jul 2017

6 Integers Modulo n. integer k can be written as k = qn + r, with q,r, 0 r b. So any integer.

2D DSP Basics: 2D Systems

A NEW CLASS OF 2-STEP RATIONAL MULTISTEP METHODS

C191 - Lecture 2 - Quantum states and observables

Frequency Response of FIR Filters

Transcription:

Joural of Applied Computer Sciece & Mathematics, o. 9 (9) /5, Suceava Quatum Computig - A ew Implemetatio of Simo Algorithm for -Dimesioal Registers Adia BĂRÎLĂ Ștefa cel Mare Uiversity of Suceava, Romaia adia@eed.usv.ro Abstract Quatum computig is a ew field of sciece aimig to use quatum pheomea i order to perform operatios o data. The Simo algorithm is oe of the quatum algorithms which solves a certai problem epoetially faster tha ay classical algorithm solvig the same problem. Simulatig of quatum algorithms is very importat sice quatum hardware is ot available outside of the research labs. QCL (Quatum Computatio Laguage) is the most advaced implemeted quatum computer simulator ad was coceived by Berhard Ömer. The paper presets a implemetatio i QCL of the Simo algorithm i the case of -dimesioal registers. Keywords: quatum computig, quatum gate, quatum algorithm. I. INTRODUCTION Quatum computig is a ew field of sciece whose origi is the Richard Feyma s idea for costructig a computer to simulate the quatum systems []. Itroduced i the early 98 s, quatum computig ivestigates the computatioal power of computer based o quatum mechaical priciples ad wats to fid algorithms faster tha classical algorithms solvig the same problem. David Deutsch itroduced two models for quatum computatio: a quatum versio of Turig machie [] ad quatum circuits []. He demostrated that the uiversal quatum computer ca do thigs that the uiversal Turig machie caot. He also demostrated that quatum gates ca be combied to achieve quatum computatio i the same way that Boolea gates ca be combied to achieve classical computatio. David Deutsch iveted the first quatum algorithm which solves a computatioal problem i a more efficiet way that classical computatio. He preseted a eample which showed that a sigle quatum computatio may suffice to decide whether a give oe-bit fuctio is costat or balaced. The Deutsch-Jozsa algorithm was desiged i 99 to maimally illustrate the computatioal advatage of quatum computig over classical computig. Other otable algorithms were developed by Simo ad Vazirai. But the most importat results i the field of quatum computig are cosidered the Shor s ad the Grover s algorithms. I 994, Peter Shor described a polyomial time quatum algorithm for factorig itegers[4] ad i 996 Lov Grover iveted the quatum database search algorithm which achieved quadratic speedup for the classic problem of database search [5]. From those years, the research i quatum computig field has accelerated, computer scietists tryig to build quatum computers ad fid other quatum algorithms. This paper aims to preset a origial implemetatio of Simo algorithm based o Quatum Computatio Laguage (QCL). Sectio II presets basic cocepts of quatum computatio. Sectio III itroduces Simo algorithm ad sectio IV presets a QCL implemetatio of this. Sectio V draws some coclusio ad future wor. II. QUANTUM COMPUTATION BASIC CONCEPTS The fudamaetal uit of quatum iformatio is called quatum bit or qubit [6]. A qubit is a physical system which has two basis states, covetioally writte ad, correspodig to the classical values ad. Ulie the classical bit, the geeral state of a qubit is a liear combiatio or a superpositio of the basis states: ψ = α + β () where the amplitudes α ad β are comple umbers such that: α + β = () I other words, a qubit ca eist as a zero, a oe, or simultaeously as both ad (whe both α ad β are ozero). Formally, a quatum state is a uit vector i a Hilbert space. A system cosistig of qubits has basis states ad its geeral state is a superpositio of all basis states: where: c () (4) with j represets the state of qubit j ad (or,,, or ) represets the tesor

Computer Sciece Sectio 4 product. The amplitudes c are comple umbers such that: c (5) Lie the sigle-qubit system, a -qubit register ca store simultaeously all the basis states. A state of a -qubit register is a elemet i the space H = HH...H (tesor product). Evolutio of a quatum system ca be described by a uitary trasformatio U. A uitary trasformatio that acts o a small umber of qubits is called a gate. A quatum gate has the same umber of iputs ad outputs. A oe-qubit elemetary gate is described by a matri: d c b a U (6) which trasforms ito a +b ad ito c +d. The Hadamard (H) ad the Pauli (X,Y,Z) gates are eamples of quatum gates that act o a sigle qubit: X H (7) Z i i Y (8) The most importat two-qubit gate is the CNOT (cotrolledot gate). It has two iput qubits, the cotrol ad the target qubit. The target qubit is flipped oly if the cotrol qubit is set to. The matri form of this gate is: CNOT (9) ad the circuit represetatio is represeted i fig.. CNOT is a geeralizatio of the classical XOR gate, sice its actio may be summarized as,y, y, where is additio modulo two, which is the same as XOR. Fig. The CNOT gate Geerally, if U is a oe-qubit gate with matri represetatio: U () the the cotrolled-u gate is a two-qubit gate with matri represetatio: ) ( U C () The first qubit is the cotrol qubit. The SWAP gate is the quatum geeralisatio of the CROSSOVER classical gate. It swaps the quatum states of the qubits. The matri represetatio is: SWAP () The Cph (cotrolled phase) gate acts o two qubits ad it has o classical equivalet. ) ep( ) ( i U cph () A importat three-qubit gate is the CCNOT (cotrolledcotrolled-ot) gate. It has two cotrol qubits ad a target qubit. The target qubit is flipped oly if the cotrol qubits are set to. The matri form of CCNOT gate is give i eq. 4 ad the circuit represetatio is show i fig.. CNOT (4)

Joural of Applied Computer Sciece & Mathematics, o. 9 (9) /5, Suceava So, the iitial state of the system is: (5) Fig. The CCNOT gate Measuremet is the oly oreversible operatio which ca be applied to a quatum state. Measuremet collapses a quatum state ito oe of the possible basis states, so measuremet is a destructive operatio. If a qubit is i the state ψ = α + β ad a measure is performed, it obtaies with probability α (the qubit s state becomes ) ad with probability β (the qubit s state becomes ). The secod step cosist of applyig the H trasform to the first register. H stads for HH H (where H is the Hadamard trasform). The H trasform ca be geeralized o qubits lie i the followig [9]: y H y (6) y where the product y is defied as: III. SIMON ALGORITHM A. Overview Daiel Simo [7] proposed the followig problem: let f be a fuctio of the form: f:,, for a positive iteger. The fuctio f is promised to have the property that there eists a strig s,, s such that:,y,, f() = f(y) y= s The goal of the problem is to fid the period s. For eample, if =, the followig fuctio satisfies the required property: f() Specifically, the strig s is. A quatum algorithm for solvig this problem has a quatum part ad a classical post-processig part [8]. The quatum part cosists of followig steps: I the first step, two -qubit registers are iitialized to =. After the H becomes: y = y y... y trasform is performed, the quatum state H I / (7) I the et step, the oracle trasform U f acts o both registers. The U f trasformatio is defied by: where deotes the bitwise XOR. The quatum state becomes: U f y = f()y (8) U f / / f ( ) (9) Fially, H trasform is applied o first register ad the quatum state becomes: H I H f ( ) () / Accordig to eq (6), the fial state ca be writte as: y y f ( ), y () y y y f ( ) 5

Computer Sciece Sectio Let A = rage(f) ad let z A. By the defiitio of the fuctio f, there are eactly two possible values z, z, such that f(z) = f( z) = z, ad moreover z = zs. So, y y z y z y ( ) ( ) z ' za zy ( z s y ( ) ( ) z y ) () y za y ( ) y za s y ( ) z z y ( Now the value of the first register is measured. I the case where s, probability to measure a value y is: z y P( y) ( ) ( ) za if s y if s y ( s y So, the measuremet always results i a value that satisfies s y =. () Measuremet of the first register will give a y, where y s=. The algorithm is restarted ad a ew measuremet will give a ew value, y, where y s=, yy ad y. s is uiquely determied oce we have liearly idepedet equatios []. Simo s algorithm is repeated - times to obtai a system of - liear equatios of the form: y s = y s =... y - s = The classical post-processig part cosists of solvig this system of equatios i uows (the bits of s) to fid s. B.The Simo s algorithm for = I the case where =, the quatum circuit has two registers of size ad both are iitialized to the state. The ψ, ψ, ψ, ψ quatum states are preseted i the Appedi A. The fial forms of these states are: I order to implemet the algorithm i QCL, the U f trasformatio must be described by quatum gates. Accordig to the defiitio of U f trasformatio (relatio (8)), i the eample give above, the actio of U f i the case where the state of the first register is ca be described as: U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = If the state of the first register is, U f acts as follows: U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = 6

Joural of Applied Computer Sciece & Mathematics, o. 9 (9) /5, Suceava If the state of the first register is, U f acts as follows: U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = U f = f() = = Fig..U f trasformatio for Simo's algorithm Fig.4 The B gate Similarly, the actio of U f ca be described for the other states of the registers. The actio of U f ca be represeted as a 64 64 matri ad ca be reproduced by a set of quatum gates (CNOT, X, CNOT ad B) as show i fig.. I order to simulate the actio of U f, the author defied a gate (B gate) which acts o three qubits a, b, c ad flips the third qubit (c) if oly oe of the first two qubits is set to (if a XOR b). This gate ca be writte usig CCNOT ad X gates as draw i fig. 4. IV. THE QCL IMPLEMENTATION QCL (Quatum Computatio Laguage) is a high-level, architecture idepedet programmig laguage for quatum computers []. It was coceived by Berhard Ömer ad the curret versio appeared i 4. QCL was implemeted i C, as a stadaloe full itegrated compiler ad rus uder Liu operatig system. Its syta ad data types are similar to those i C. The basic built-i quatum data type is qreg (quatum register), which ca be iterpreted as a array of qubits. The mai features of QCL are [], []: a) a classical cotrol laguage with fuctios, flowcotrol, iteractive I/O ad various classical data types (it, real, comple, boolea, strig); b) quatum operator types: geeral uitaria (operator) ad reversible pseudo-classic gates (qufuct); c) iverse eecutio, allowig for o-the-fly determiatio of the iverse operator though cachig of operator calls; d) various quatum data types (qubit registers) for compile time iformatio o access modes (qureg, qucost, quvoid, quscratch); e) coveiet fuctios to maipulate quatum registers (q[] qubit, q[:m] substrig, q&p combied register); f) quatum memory maagemet (quheap) allowig for local quatum variables g) easy adaptatio to idividual sets of elemetary operators. The QCL implemetatio of B quatum gate is preseted below: //B gate operator B(qureg, qureg y, qureg z) CCNot(,y,z); Not(); Not(y); CCNot(,y,z); Not(); Not(y); Not(z); The QCL implemetatio of Simo s algorithm (the quatum part) is preseted below: operator simogates(qureg, qureg y) //the Hadamard trasformatio is applied H(); //the Uf trasformatio is performed CNot(y[],[]); Not(y[]); CNot(y[],[]); B([],[],y[]); //the Hadamard trasformatio is applied H(); procedure simo() qureg []; //the first register qureg y[]; //the secod register it m; it m; //the measured values reset; 7

Computer Sciece Sectio simogates(,y); //measure the register measure,m; prit "The first measured value is: ", m; util (m!=); //the algorithm is restarted //to obtai the secod equatio //the ew measured value must be //differet from the first measured value reset; simogates(,y); //measure the register measure,m; prit "The secod measured value is: ", m; util ((m!=) ad (m!=m)); This has bee implemeted for the case of -dimesioal registers. This paper is a first attempt to develop a QCL implemetatio of Simo algorithm. The oracle trasformatio was simulated by CNOT gates, X gates ad a ew -qubit gate which flips the third qubit if oly oe of the first two qubits is set to. Further we will implemet this algorithm for other dimesios of the iput registers ad other fuctios. Solvig the system of equatios is the classical postprocessig part of the algoritm. The implemetatio of this part, also i QCL, is preseted i the Appedi B. I the figure 5 it ca be see various values measured at various program eecutios. At the first ru of the program the measured values are 6 ( ) ad ( ). So, the system i uows to be solved is: s + s + s = s + s + s = where s, s, s are the bits of strig s ad all of the operatios are modulo operatios. This system has two solutios: s = s = s = ad s = s =,s = But it was supposed s, so the oly valid solutio is s = (6 ). O the last lie QCL displays the curret state of the quatum machie. V.CONCLUSIONS AND FUTURE WORK Quatum computig permits to perform computatioal operatios o data much faster ad efficietly by taig advatage of quatum parallelism. At the same time, by usig the priciple of superpositio, a large amout of data could be stored. I absece of quatum devices, quatum computig simulators helps programmers to eploit the features of quatum computers ad uderstad the costraits imposed by these devices. I the last years may quatum computig simulators have bee developed i order to simulate quatum algorithms. I this paper the QCL quatum laguage has bee used to simulate the quatum algorithm developed by David Simo ad ow as Simo s algorithm. Fig.5. The results for several eecutios of the program ACKNOWLEDGMENT This paper was supported by the project "Sustaiable performace i doctoral ad post-doctoral research PERFORM - Cotract o. POSDRU/59/.5/S/896", project co-fuded from Europea Social Fud through Sectorial Operatioal Program Huma Resources 7-. REFERENCES [] R. Feyma, Simulatig physics with computers, Iteratioal Joural of Theoretical Physics, vol., o. 6, pages 467 488, 98 [] D. Deutsch, Quatum theory, the Church-Turig priciple ad the uiversal quatum computer, Proceedigs of the Royal Society of Lodo A 4, pp. 97-7, 985 [] D. Deutsch, "Quatum computatioal etwors", Proceedigs of the Royal Society of Lodo A 45, pp. 7-9, 989 [4] P.W. Shor, Algorithms for Quatum Computig: Discrete Logarithm ad Factorig, Proceedigs of 5th Aual Symposium o Foudatios of Computer Sciece, Los Alamitos, CA, USA, 994, pp. 4-4 [5] L.K.Grover, A fast quatum mechaical algorithm for database search, Proc. 8th Aual ACM Symposium o the Theory of Computig (STOC), 996, p. -9 [6] B. Schumacher, Quatum codig, Physical Review A, Vol. 5, No. 4, April 995 8

Joural of Applied Computer Sciece & Mathematics, o. 9 (9) /5, Suceava [7] D. R. Simo, O the Power of Quatum Computatio,SIAM Joural o Computig, o. 5, p. 474. [8] Joh Watrous, Lecture Notes o Quatum Computig, Uiversity of Waterloo, 6 [9] D. Mermi, Lectures Notes o Quatum Computer. Corell Uiversity, Ithaca, New Yor, 6. [] Umesh Vazirai, Lecture Notes o Quatum Computig, Uiversity of Califoria, Berely, 7 [] H. De Raedt, K. Michielse, Computatioal Methods for Simulatig Quatum Computers, arxiv:quat-ph/46, 4 [] B. Ömer, Quatum Programmig i QCL, Techical Uiversity of Viea, Austria,. [] B. Ömer, Strucured Quatum Programmig i QCL, Techical Uiversity of Viea, Austria,. Adia Bărîlă is a PhD studet at Ștefa cel Mare Uiversity of Suceava i Computers ad Iformatio Techology area. Her research iterests iclude quatum computig ad databases. Appedi A I the case where = ad U f is the oracle trasform correspodig to fuctio give i this paper, the quatum states ψ, ψ, ψ, ψ are: H I H H H H H U f H I H H H H H H H H Accordig to (6) ψ ca be writte: 9

Computer Sciece Sectio Appedi B The implemetatio of classical post-processig part of the algoritm //m ad m are the measured values //yy[] cotais the values of m ad m //represeted i base two prit "The system to be solved is: "; for i= to prit "s*",yy[i,],"+s*",yy[i,],"+ s*", yy[i,]," = "; sum[] = (yy[,]+yy[,]+yy[,]) mod ; sum[] = (yy[,]+yy[,]+yy[,]) mod ; p[] = (yy[,]*yy[,]*yy[,]) mod ; p[] = (yy[,]*yy[,]*yy[,]) mod ; i=; o=; while (i<) ad (o==) if p[i]== if sum[i]== o=;l=i; i=i+; if o== for i= to if yy[l,i]== =i;s[]=; l = (l+) mod ; =-; =-; for j= to if j!= if < =j; else =j; if yy[l,]== s[]=; s[]=; else if yy[l,]== s[]=; s[]=; else s[]=; s[]=; else if (p[]== ad p[]==) for j= to s[j]=; else if p[]== l=; else l=; for j= to s[j]=yy[l,j]; prit "s = ",s[],s[],s[];