As one of the swap bits with c 0 as the other swap

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: as one of the swap bits, with c = 0 as the other swap bit. In the end, we measure the third register where c went in, and this will be a ∧ b Now look what happens: if a = b = 1, then b and c swap, so that the third register reads b = 1: true! If a is one but b is 0, then b and c swap, but the third register is b = 0: false. And clearly, if a = 0 then so to will read the third register. 4.2. SIMULATING CLASSICAL CIRCUITS 39 Figure 4.1: Note that the input and output have the same number of qubits in the reversible quantum circuit. If we construct the corresponding reversible circuit (lets call it RC), we have a small problem. The CSWAP gates end up converting input scratch bits to garbage. Why is this a problem? We have our output |f ￿ (x), don’t we. This seems like it should be good enough. But in fact it is not. All the junk that gets made in the in-between steps can be entangled with the output qubits. Thus if it gets measured, it will screw alter our function. Furthermore, there is a principle which states that any unmeasured, thrown away qubits are just as good as measured. This is called the principle of deferred measurement, and it means that junk qubits are no good. So how do we restore the scratch bits to 0 on output? We use the fact that RC is a reversible circuit. We use the CSWAP gates, for example, to produce the output f (x). We can then copy the output onto some scratch qubits, which we will keep as our output. We then use the reverse of our circuit RC on the input, f (x), and the junk to turn it all back to 0’s and x. But because we copied f (x) in the middle, we keep it at the end. The sequence of steps for the overall circuit is C￿ copy y (C ￿ ) − 1 (x, 0k , 0m , 0k , 1) −→ (x, y, garbagex , 0k , 1) −→ (x, y, garbagex , y, 1) −→ (x, 0k , 0m , y, 1) . 40 CHAPTER 4. FOURIER SAMPLING & SIMON’S ALGORITHM ˆ Overall, this gives us a clean reversible circuit C corresponding to C . 4.3 Fourier Sampling Consider a quantum circuit acting on n qubits, which applies a Hadamard gate to each qubit. i.e. the circuit applies the unitary transformation H ⊗n , or H tensored with itself n times. Another way to define this unitary transformation H2n is as the 2n × 2n matrix in which the (x, y ) entry is 2−n/2 (−1)x·y . n Applying the Hadamard transform (or the Fourier transform over Z2 ) to n states the state of all zeros gives an equal superposition over all 2 1 H2n |0 · · · 0￿ = √ 2n ￿ x∈ { 0 ,1 } n | x￿ . In general, applying the Hadamard transform to the computational basis state |u￿ yields: ￿ 1 H 2n | u ￿ = √ (−1)u·x |x￿ 2n x∈{0,1}n We ￿ define the Fourier sampling problem as follows: Input an n qubit state ⊗n |φ￿ and measure the resulting state |φ￿ = x∈{0,1}n αx |x￿. Compute H ￿ ˆ ˆ2 y αy |y ￿ to output y with probability |αy | . Fourier sampling is probably the most fundamental primitive we use in quantum algorithms (where in place of the Hadamard t...
View Full Document

Ask a homework question - tutors are online