Class Project Due 5/3/2016  2:30 PM

(a)  For a register containing n bits we pointed out, in the previous lecture that

(Subscript[U, FT])| (Subscript[b, n-1]) (Subscript[b, n-2]) ... (Subscript[b, 1])(Subscript[b, 0])⟩ =   (1/(2^(n/2))) ( | 0 ⟩ + (e^( i  2π  [.(Subscript[b, 0])])) |1 ⟩)  ( | 0 ⟩ + (e^( i  2π  [.(Subscript[b, 1])(Subscript[b, 0])])) |1 ⟩)  ...  ( | 0 ⟩ + (e^( i  2π  [.(Subscript[b, n-1 ])(Subscript[b, n-2])...(Subscript[b, 1])(Subscript[b, 0])])) |1 ⟩) 
and we showed explicitly for the case n=2  the validity of this identity.  Do the same for the case n=3. Show all work.

(b)  Consider the following circuit diagram

Build each of the seven components in that diagram. e.g. the first component would be the 
3-qubit gate  H ⊗ I ⊗ I  on the extreme left of the figure.  Multiply each of these seven component gates, and
compare the result  with the 3-Qubit QFT gate. Comment.

(c)  Consider a 3 bit register |x ⟩_3  and  the following function f: {0,1}^(⊗3) ⟶{0,1}

 ({{x, f(x)}, {000, 0}, {001, 1}, {010, 0}, {011, 1}, {100, 0}, {101, 1}, {110, 0}, {111, 1}})

Construct an operator that has the property 
(Subscript[U, f])| x ⟩_3|y⟩ = | x ⟩_3| f(x) + y ⟩

(d) Now construct a gate  (Subscript[W, f])  so that
   (Subscript[W, f]) | 0 ⟩_3|0⟩ = (1/(Sqrt[8])) (Underoverscript[ ∑, (a=0), (a=7)]) (Subscript[| a ⟩, 3]) |f(a) ⟩  
   Write a  Mathematica code, which incorporates the gate constructed above, that has as its input  |0⟩_3|0⟩, 
    and outputs the result  for  (1/(Sqrt[8])) (Underoverscript[ ∑, (a=0), (a=7)]) (Subscript[|a ⟩, 3]) |f(a) ⟩.

(e) Now construct a simulation (Mathematica code) of a quantum computer that has as its input | 000 ⟩_3|0⟩ .  That input goes
through the gate constructed in part (d) above. Finally, that output goes through a 3-qubit QFT (acting on the first register ) gate.
Perform measurements of the output in that register.  Perform several runs and make a histogram of the output, comment on the significance of your results. (Remember: A simulation should behave just like a quantum computer ! )