Hw 3 due  2/23

(1) Use Mathematica to evaluate the following inner products 
given   |(Subscript[ψ, 0])⟩ = (((e )^(i π/3))/(Sqrt[2]))|0 ⟩ - (1/(Sqrt[2]))|1⟩,  |(Subscript[ψ, 1])⟩ = ((Sqrt[2])/(Sqrt[3]))|0 ⟩ + (i/(Sqrt[3]))|1⟩. First you must write these states
as column vectors.

(a)  ⟨0|1⟩
(b)  ⟨0|(Subscript[ψ, 1])⟩
(c)  ⟨(Subscript[ψ, 0])|0⟩
(d) ⟨(Subscript[ψ, 1])|(Subscript[ψ, 0])⟩

(Hint: we know how to make column vectors using Mathematica. But it does not distinguish row
vectors from column vectors. Nevertheless it gives the correct answer if we just multiply the two
as regular vectors. Example: suppose we have a column vector

a={1,0,1};
(* and we want to take the inner product with a row vector *)

⟨b |=(0 0 1/3 )

(* we write b as *)
b={0,0,1/3}
(* then the inner product is *)
b.a

Which is the correct answer. We must be careful with complex numbers though,
suppose

|b⟩ = (1/(Sqrt[2])) (({{1
0}, {i}}))  then we know (see our previous lecture)  

⟨b| = (1/(Sqrt[2]))(1 0 -i)   and so  ⟨b|a⟩ would calculate to

Conjugate[1/Sqrt[2]{1,0,I}].{1,0,1}

)

(2)  We also know  from the definition of  |a⟩⟨b|, in our previous notes,  that it evaluates to an operator  (gate). Use Mathematica to construct the following matrices for

(a) |0⟩⟨0|  
(b) |1⟩⟨0|
(c) |0⟩⟨(Subscript[ψ, 0])|
(d) |(Subscript[ψ, 0])⟩⟨0|
(e) |(Subscript[ψ, 0])⟩⟨(Subscript[ψ, 1])|



(3) According to Dirac’s rule  |a⟩⟨b| |ψ⟩ = |a ⟩ (⟨b|ψ⟩ i.e. the operator  |a⟩⟨b| acts on |ψ⟩  and results in a new vector  |a ⟩  multiplied by the number ⟨b|ψ⟩. Show how this works (using Mathematica) when the following operators given in (a)-(e) above act on the state |(Subscript[ψ, 0])⟩.  (i.e. evaluate both the left hand and right hand side of Dirac’s rule explicitly and show that they are equal)


(4) You can generalize the above for more than a single Qubit. First, construct the matrix
|Ψ⟩ = |(Subscript[ψ, 1])⟩|(Subscript[ψ, 0])⟩, then evaluate 

(a) ⟨00|Ψ⟩
(b) ⟨01|Ψ⟩
(c) ⟨Ψ|11⟩
(d) |11⟩⟨00|

(5)  We learned about the Cnot gate (Subscript[C, 01])in the previous lecture notes.  It flips the first bit (the target bit) if the zeroth bit has the value 1, and does not do anything if the zeroth bit has the value 0.

Show that we can also express 

(Subscript[C, 01])= |00⟩⟨00| + |10⟩⟨10 | + |11⟩⟨01| + |01⟩⟨11|

Do this in two ways

(i) By “hand” evaluate the truth table for (Subscript[C, 01]) by using the above expression to act on all 2-Qubits
|00⟩,|10⟩,|01⟩,|11⟩

(ii) Use Mathematica to construct the matrix representation of the sum of the above operators.