Quantum Algorithms Lecture #2 Stephen Jordan
Last Time Defined quantum circuit model. Argued it captures all of quantum computation. Developed some building blocks: Gate universality Controlled-unitaries Reversible computing Phase kickback Phase estimation
This Time We'll expand our collection of building blocks Oracles & Recursion Hadamard Test Hadamard Transform Fourier Transform We'll use these blocks to build quantum algorithms: Deutsch-Jozsa Algorithm Bernstein-Vazirani Algorithm Shor's Algorithm
Oracles Oracles are analogous to function calls. As in the classical case, functions can be used recursively but there are new issues, without classical analogue.
Hadamard Test Suppose we wish to estimate. If can be implemented by gates and and can be constructed by and gates, respectively, then we can estimate and to precision in time
Hadamard Test Suppose: Then: So, it suffices to estimate quantities of the form:
Exercise #1 Q. Given a circuit for circuit for? how do we make a
Exercise #1 Q. Given a circuit for circuit for? A. Gate by gate: how do we make a
Hadamard Test Probability of measuring is
Hadamard Test Probability of measuring is
Hadamard Test Probability of measuring is
Hadamard Test Probability of measuring is
Hadamard Test Probability of measuring is
Hadamard Test Probability of measuring is
Hadamard Test Probability of measuring is Probability of measuring is
Hadamard Test If can be implemented by gates and and can be constructed by and gates, respectively, then we can estimate and to precision in time
An Application Applying the Hadamard test to a quantum simulation yields a transition amplitude. In particular, certain transition amplitudes of anyons encode Jones polynomials.
Deutsch's Algorithm Given: oracle for Goal: determine whether Classical: must query twice: f(0) and f(1) Quantum: query once
Deutsch's Algorithm Recall:
Deutsch's Algorithm Recall:
Deutsch's Algorithm
Parity Given: oracle for Goal: determine whether odd Classical: must query is even or times Idea: can we use Deutsch's algorithm recursively?
Recursion We can use one quantum algorithm as the oracle for another...but it needs to be clean. Deutsch's algorithm yielded: Global phases are unobservable in QM. However, in controlled-operations they aren't global!
Recursion Our oracle has the form: The phase kicked-back in Deutsch's circuit is then.
Clean Oracles An oracle can always be cleaned up by uncomputation. Dirty: Clean: (double
Parity Idea: can we use Deutsch's algorithm recursively? NO: Input-dependent phase spoils the interference. Cleaning up the oracle cancels the speedup. We now know that any quantum algorithm for Cleve, Mosca, de Wolf, 1998] parity requires at[beals, leastbuhrman, N/2 queries. [Farhi, Goldstone, Gutmann, Sipser, 1998]
Hadamard Transform Recall: Let:
Hadamard Transform Examples: (Hadamard transform is self-inverse.)
Deutsch-Jozsa Algorithm Given: oracle for Promise: f is balanced or constant i.e. Goal: determine balanced vs. constant Classical exact: query times Classical probabilistic: query O(1) times
Deutsch-Jozsa Algorithm Step 1: prepare
Deutsch-Jozsa Algorithm Step 1: prepare Step 2: Hadamard transform Recall: Thus :
Deutsch-Jozsa Algorithm Step 1: prepare Step 2: Hadamard transform
Deutsch-Jozsa Algorithm Step 1: prepare Step 2: Hadamard transform Step 3: Measure in the computational basis
The Deutsch-Jozsa algorithm looks like this: The same algorithm can distinguish other interesting properties of f. Bernstein-Vazirani Problem: Promise: Goal: find k Classically: we need n queries
Bernstein-Vazirani Algorithm Bernstein-Vazirani Problem: Promise: Goal: find k Recall:
Bernstein-Vazirani Algorithm Bernstein-Vazirani Problem: Promise: Goal: find k Recall:
Bernstein-Vazirani Algorithm Bernstein-Vazirani Problem: Promise: Goal: find k One query! (vs. n classically)
Estimating Gradients We can generalize the Bernstein-Vazirani algorithm to solve a more natural problem. Gradient Problem: Oracle: Promise: Goal: find Classically: we need n+1 queries
Estimating Gradients
Estimating Gradients Now consider arbitrary differentiable Over a small enough region is linear:
Estimating Gradients Now consider arbitrary differentiable Over a small enough region is linear:
An Optical Analogy
An Optical Analogy
The Quantum Fourier Transform We've seen many applications: We'll see even more Switching to the momentum basis to simulate chemistry Preparing initial states for phase kickback Phase estimation Gradient estimation Period finding Discrete Logarithms & Factoring So...let's look at the actual quantum circuit.
The Quantum Fourier Transform (This is a unitary transformation.)
The Quantum Fourier Transform Written abstractly: Written with binary place-value: If we achieve this for basis states, correct behavior for arbitrary states follows by linearity.
The Quantum Fourier Transform
The Quantum Fourier Transform Classically, we have fast algorithms for Fourier transforms. They transform a vector of N amplitudes in time. Our quantum circuit acts on uses quantum gates. amplitudes and This is an exponential speedup...but it is not directly usable for computing Fourier transforms!
Period Finding Oracle: Promise: Goal: find Classically: we need O(N) queries Quantum complexity:
Period Finding If N is not a power of 2 then the state preparation and Fourier transforms are slight generalizations of what I have shown you. For simplicity, I'll assume M divides N. (We don't need this.)
Period Finding
Period Finding r
Period Finding r
Period Finding r
Period Finding r Random multiple of N/M.
Period Finding Measuring yields random multiples of N/M. We can compute gcd! After not many samples, gcd is likely to be N/M.
Multidimensional Periodicity Find basis for. solution: Create superposition over. d-dimensional quantum Fourier transform. Measurement samples from dual lattice.
Order Finding Given, find smallest s.t. Examples:,,... Reduce this to period finding:
Order Finding Given, find smallest s.t. Examples:,,... Reduces to period finding:
Exercise #2: Discrete Logarithms Given, find smallest s.t. Q. Reduce to 2-dimensional period finding:
Exercise #2: Discrete Logarithms Given, find smallest s.t. A. Reduces to 2-dimensional period finding:
Factorization or is a nontrivial factor of N
Summary Building blocks Oracles & Recursion Hadamard Test Hadamard Transform Fourier Transform Quantum algorithms: Deutsch-Jozsa Algorithm Bernstein-Vazirani Algorithm Shor's Algorithm
Hidden Subgroup Problem Let: G be a finite group S be a finite set H be a subgroup of G We're given an oracle for. Promise: f is constant and distinct on (left-)cosets of H. Goal: Find a generating set for H.
Hidden Subgroup Problem Example: integers mod n under addition for some In this case, f is a function with period M. Our goal is to find m (since It's period finding. We just did this! ).
Hidden Subgroup Problem Solved for Abelian groups in time polylog( G ). This is multidimensional period finding. For symmetric group would solve graph isomorphism. (unsolved) Dihedral group HSP is closely related to lattice problems. (Best algorithm is Kuperberg's sieve, which runs in subexponential time.)
Hidden Shift Given: oracles for Promise: Find s. and Quantumly, this is closely related to dihedral hidden shift. Build Preimage state:
Hidden Shift By Kuperberg's sieve, we can solve hidden shift for arbitrary injective functions in time. For certain functions we can do better: Legendre symbols [van Dam et al.] This breaks Damgard's pseudorandom function Multiplicative characters of finite rings or fields Random Boolean functions [Gavinsky, Roetteler, Roland]
Fourier Convolution Theorem Let Theorem: and
Hidden Shift by Deconvolution 1)Create: 2)Fourier transform: 3)Divide by : 4)Transform back:
Hidden Shift by Deconvolution Steps 2 and 4 are just Fourier transforms... No problem. 1)Create: If f(x+s) is a phase 3)Divide by If, we can do this. : is an efficiently computable phase, we can do this.
Legendre Symbol Just right for deconvolution!
Random Boolean Hidden Shift For a random such function, with high probability, a quantum algorithm can, by querying f(x+s) find s in O(n) time. Also relies on flatness of