Quantum Computing Lecture 7. Quantum Factoring. Anuj Dawar



Similar documents
What Has Quantum Mechanics to Do With Factoring? Things I wish they had told me about Peter Shor s algorithm

Quantum Algorithms in NMR Experiments. 25 th May 2012 Ling LIN & Michael Loretz

Quantum Computing. Robert Sizemore

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, Notes on Algebra

QUANTUM COMPUTERS AND CRYPTOGRAPHY. Mark Zhandry Stanford University

Bits Superposition Quantum Parallelism

Lecture 13 - Basic Number Theory.

Factoring by Quantum Computers

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

Factoring & Primality

Shor s algorithm and secret sharing

Lecture 13: Factoring Integers

Outline. Computer Science 418. Digital Signatures: Observations. Digital Signatures: Definition. Definition 1 (Digital signature) Digital Signatures

A Recent Improvements in Quantum Model and Counter Measures in Quantum Computing

Lukasz Pater CMMS Administrator and Developer

0.1 Phase Estimation Technique

Factoring. Factoring 1

Quantum Computers. And How Does Nature Compute? Kenneth W. Regan 1 University at Buffalo (SUNY) 21 May, Quantum Computers

Lecture 3: One-Way Encryption, RSA Example

Using quantum computing to realize the Fourier Transform in computer vision applications

An Overview of Integer Factoring Algorithms. The Problem

RSA Question 2. Bob thinks that p and q are primes but p isn t. Then, Bob thinks Φ Bob :=(p-1)(q-1) = φ(n). Is this true?

Quantum Algorithms Lecture Notes Summer School on Theory and Technology in Quantum Information, Communication, Computation and Cryptography

Public Key Cryptography and RSA. Review: Number Theory Basics

arxiv:quant-ph/ v2 25 Jan 1996

Public Key Cryptography: RSA and Lots of Number Theory

Advanced Cryptography

Quantum Computing: Lecture Notes. Ronald de Wolf

Modern Factoring Algorithms

The Mathematics of the RSA Public-Key Cryptosystem

2.1 Complexity Classes

Cryptography and Network Security Chapter 9

Faster deterministic integer factorisation

RSA Attacks. By Abdulaziz Alrasheed and Fatima

Quantum Computability and Complexity and the Limits of Quantum Computation

Lecture 1: Course overview, circuits, and formulas

Introduction to Quantum Computing

CIS 6930 Emerging Topics in Network Security. Topic 2. Network Security Primitives

Quantum Computing and Grover s Algorithm

Lecture 1 Version: 14/08/28. Frontiers of Condensed Matter San Sebastian, Aug , Dr. Leo DiCarlo l.dicarlo@tudelft.nl dicarlolab.tudelft.

Breaking Generalized Diffie-Hellman Modulo a Composite is no Easier than Factoring

Cryptographic hash functions and MACs Solved Exercises for Cryptographic Hash Functions and MACs

Cryptography and Network Security Chapter 10

SOLUTIONS FOR PROBLEM SET 2

Algebraic Computation Models. Algebraic Computation Models

Quantum Computing Architectures

Primality - Factorization

1 Digital Signatures. 1.1 The RSA Function: The eth Power Map on Z n. Crypto: Primitives and Protocols Lecture 6.

A simple and fast algorithm for computing exponentials of power series

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

FACTORING. n = fall in the arithmetic sequence

Overview of Public-Key Cryptography

CSCE 465 Computer & Network Security

How To Solve The Prime Factorization Of N With A Polynomials

Quantum Computers vs. Computers

Lecture 3: Finding integer solutions to systems of linear equations

Influences in low-degree polynomials

1 Formulating The Low Degree Testing Problem

Quantum and Non-deterministic computers facing NP-completeness

CIS 5371 Cryptography. 8. Encryption --

Public Key (asymmetric) Cryptography

Factoring Algorithms

Elements of Applied Cryptography Public key encryption

Notes on Network Security Prof. Hemant K. Soni

A New Generic Digital Signature Algorithm

Hash-based Digital Signature Schemes

Study of algorithms for factoring integers and computing discrete logarithms

Factoring Algorithms

CUNSHENG DING HKUST, Hong Kong. Computer Security. Computer Security. Cunsheng DING, HKUST COMP4631

Concrete Security of the Blum-Blum-Shub Pseudorandom Generator

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Arithmetic Coding: Introduction

LUC: A New Public Key System

Cryptography and Network Security

Factorization Methods: Very Quick Overview

Introduction to Quantum Computing

3 1. Note that all cubes solve it; therefore, there are no more

Symmetric Key cryptosystem

Number Theory and Cryptography using PARI/GP

RSA and Primality Testing

Cryptography and Network Security

FFT Algorithms. Chapter 6. Contents 6.1

Secure Network Communication Part II II Public Key Cryptography. Public Key Cryptography

Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

Overview of Cryptographic Tools for Data Security. Murat Kantarcioglu

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

Princeton University Computer Science COS 432: Information Security (Fall 2013)

Integer Factorization using the Quadratic Sieve

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

Transcription:

Quantum Computing Lecture 7 Quantum Factoring Anuj Dawar

Quantum Factoring A polynomial time quantum algorithm for factoring numbers was published by Peter Shor in 1994. polynomial time here means that the number of gates is bounded by a polynomial in the number of bits n of the number being factored. The best known classical algorithms are exponential (in n 1/3 ). Fast factoring would undermine public-key cryptographic systems such as RSA.

Period Finding Suppose we are given a function f : N {0,..., N 1} which we know is periodic, i.e. f (x + r) = f (x) for some fixed r and all x. Can we find the least value of r? If we can find the period of a function efficiently, we can factor integers quickly.

Order Finding Suppose we are given an integer N and an a with a < N and gcd(a, N) = 1. Consider the function f a : N {0,..., N 1} given by f a (x) a x (mod N) Then, f a is periodic, and if we can find the period r, we can factor N.

Factoring Suppose (for simplicity) N = pq, where p and q are prime. And, for some a < N, we know the period r of the function f a. Then, a r+1 a (mod N), so a r 1 (mod N). If r is even and a r/2 + 1 0 (mod N), then take x 2 = a r. x 2 1 0 (mod N) (x 1)(x + 1) 0 (mod N) But, x 1 0 (mod N) (by minimality of r) x + 1 0 (mod N) (by assumption)

Factoring contd. So, (x 1)(x + 1) = kpq for some k. Now, finding gcd(n, x 1) and gcd(n, x + 1) will find p and q. If we randomly choose a < N (and check that gcd(a, N) = 1 if not, we ve already found a factor of N) then, there is a probability > 1 2 that the period of f a is even; and a r/2 + 1 0 (mod N).

Using a Fourier Transform A fast period-finding algorithm allows us to factor numbers quickly. The idea is to use a Fourier Transform to find the period of a function f. Note, classically, we can use the fast Fourier transform algorithm for this purpose, but it can be shown that this would require time N log N, which is exponential in the number of bits of N.

Discrete Fourier Transform The discrete Fourier transform of a sequence of complex numbers x 0,..., x M 1 is another sequence of numbers y 0,..., y M 1 where or where ω = e 2πi/M. y k = 1 M 1 x j e 2πijk/M M j=0 y k = 1 M 1 x j ω jk. M j=0

DFT is Unitary The discrete Fourier transform is a unitary operation on C M. Writing ω for e 2πi/M, are the Mth roots of 1. D = 1 M ω, ω 2,..., ω M 1, ω M = 1 1 1 1 1 1 ω ω 2 ω 1 1 ω 2 ω 4 ω 2 1 ω 3 ω 6 ω 3....... 1 ω M 1 ω 2M 2 ω

Inverse DFT The inverse of the discrete Fourier Transform is given by: 1 1 1 1 1 ω 1 ω 2 ω 1 ω 2 ω 4 ω 2 1 ω 3 ω 6 ω 3 D 1 = 1 M....... 1 ω 1 M ω 2 2M ω M 1 Exercise: Verify that D is unitary. Verify that D 1 as given above is the inverse of D.

Quantum Fourier Transform Computing the discrete Fourier transform classically takes time polynomial in M. Shor showed that D can be implemented using a number of one and two-qubit gates that is only polynomial in the number of qubits O((log M) 2 ). Note: This does not give a fast way to compute the DFT on a quantum computer. There is no way to extract all the complex components from the transformed state.

Fourier Transform on Binary Strings Suppose M = 2 n, and let x be a computational basis state in C M with binary representation b 1 b n. Let η j = e 2πi(0 b j b j+1 b n). Then D x = ( 0 + η n 1 )( 0 + η n 1 1 ) ( 0 + η 1 1 ). Exercise: Verify.

Quantum Fourier Transform Circuit We can use this form to implement the quantum Fourier transform using Hadamard gates and conditional phase-shift gates. H H P H P Q H P Q R In the input, the least significant bit is at the top, in the output, it is at the bottom.

Conditional Phase Shifts Here P = [ 1 0 0 i ] Q = [ 1 0 0 e iπ/4 ] R = [ 1 0 0 e iπ/8 ] Two-qubit conditional phase shift gates are actually symmetric between the two bits, despite the asymmetry in the drawn circuit. It seems that for large n, an n-bit quantum Fourier transform circuit would require conditional phase shifts of arbitrary precision. It can be shown that this can be avoided with some (but not significant) loss in the probability of success for the factoring algorithm.

Preparing the State We are given an implementation of the function f as a unitary operator U f x 0 U f x f(x) Where, now, each of the two input wires represents n distinct qubits Writing Ψ for the state H n 0 n = 1 2 n 1 x. 2 n/2 x=0 We have, U f Ψ 0 n = 1 2 n 1 x f (x). 2 n/2 x=0

First Measurement We measure the second n qubits of the state U f Ψ 0 n and get a value f 0. The state after measurement is: where: m 1 ( 1 x 0 + kr ) f 0. m k=0 x 0 is the least value such that f (x 0 ) = f 0 r is the period of the function f m = 2n r.

Applying the QFT We apply the n-qubit quantum Fourier transform to the first n bits of the transformed state. where ω = e 2πi/2n. D ( 1 x 0 + kr ) m m 1 k=0 2 n 1 = 1 2 n/2 y=0 2 n 1 = y=0 m 1 1 ω (x0+kr)y y m k=0 ω x0y 1 2 n/2 m ( m 1 k=0 ω kry ) y.

Second Measurement The probability of observing a given state y is: 1 2 n m m 1 2 ω kry. k=0 This probability function has peaks when ry/2 n is close to an integer. Indeed, if ry/2 n is an integer, then with probability 1 we measure a y that is a multiple of r/2 n. Given an integer multiple of 2 n /r, it is not difficult to find r.

Exponentiation To complete the factoring algorithm, we need to check that we can also implement the unitary transform U f for the particular function f a (x) = a x mod N. with a number of quantum gates that is polynomial in log N. This is achieved through repeated squaring.

Some Points to Note The two measurement steps can be combined at the end, with the Fourier transform applied before the measurement of f (x). The probability of successfully finding the period in any run of the algorithm is only about 0.4. However, this means a small number of repetitions will suffice to find the period with high probability. Putting a lower bound on the conditional phase shift we are allowed to perform affects the probability of success, but not the rest of the algorithm.