C/CS/Phy191 Midterm Quiz Solutions October 0, 009 1 (5 points) Short answer questions: a) (5 points) Let f be a function from n bits to 1 bit You have a quantum circuit U f for computing f If you wish to compute f (x) for some n bit string x, what would you feed as input to U( f ) and what would be the output? Answer The key idea in reversible quantum computation is that every operation needs to be reversible Given a classical circuit f, we can have a quantum circuit such that U f x 0 x f (x) or more generally, U f x y x y f (x) Technically speaking, you also need to supply some number of ancillary 0 qubits to convert all of the classical gates to quantum (reversible) gates b) (5 points) Give a simple quantum circuit that transforms the state 0 1 ( 0 + 1 ) to 1 ( 0 + 1 ) 0 (there may be more than one circuit which accomplishes the task for this specific state Any one of them will do as an answer) Answer Observe that H H 1, and further that H 0 + The input state can be written as 0+ So then H H 0+ + 0
c) (5 points) Show that the circuit below performs a projective measurement in the basis of the Bell states Answer You have showed that H gate on qubit one followed by CNOT gate controlled on the first qubit maps a unique element of the two qubit computational basis to a unique element of the Bell basis You also know that the H gate is its own inverse, and so is CNOT Then this circuit is the inverse of the Bell-state creation circuit So this circuit maps an element of the Bell basis to a unique element in the computational basis So a particular combination of qubit measurement outcomes maps directly to a unique input Bell state Since each measurement result codes directly for a specific and unique Bell state input to the circuit, the entire circuit can be considered a measurement in the Bell basis d) (5 points) Alice starts with a Bell state φ + She teleports one of the qubits to Bob and the other to Charlie Are the two qubits received by Bob and Charlie still entangled? Answer Yes, the two qubits are still entangled A way to see this without working through the entire circuit is by noting that by the principle of deferred measurement, all of the conditional operations can be replaced by controlled unitary operations in the circuit, and the measurements deferred to the end Unitary operations don t break entanglement, and the two teleported qubits are never measured, so they remain entangled at the end
e) (5 points) Consider the superposition ψ x S 1/ k/ x, where S is the set of all n bit strings whose last n k bits are the fixed string y Note that S k What is the Hadamard transform H n ψ? H n ψ [ H n 1/ k/ k 1 x0 x ] y H k H n k 1/ k/ x0 k 1 x y [ H k 1/ k/ k 1 ] x H n k y x0 Now the first term can be evaluated by noting that 1/ k/ k 1 x Hk0k x0 so that the first term becomes H k H k 0k 0k The second term can be evaluated straightforwardly by application of the Hadamard transform, ie, H n k y 1 n k 1 (n k)/ z0 ( 1) z y z Putting these together gives H n ψ 1 n k 1 (n k)/ x0 ( 1) x y 0 k x
(5 points) The parity of a n-qubit register is defined as P n 1 for an odd number of qubits in state 1 and as P n +1 for an even number of qubits (including zero) in state 1 Consider the circuit of sequential CNOT gates between 3 qubits and an ancilla that is initialized to 0 : a) (5 points) Find the state of the ancilla after the second CNOT gate for the 4 possible inputs 00, 11, 01, 10 of the first qubits Write the state of the ancilla in terms of the parity function P of the first qubits Answer Note that if the CNOT gate is performed an even number of times, there is no effect on the ancilla Thus, the ancilla will be in the state 1 iff the register containing the control bits contains an odd number of qubits in the state 1 Letting φ represent the ancilla qubit, φ 0 if P 1 and φ 1 if P 1 Otherwise it is in state 0 Explicitly performing the CNOT gates, we obtain 00 0,11 0,01 1,10 1 b) (10 points) If we generalize this circuit to n qubits with sequential CNOT gates to the ancilla, what would be the state of the ancilla after n CNOT gates? Hint: it may help to first continue the analysis in a) to find the state of the ancilla after the third CNOT gate Answer The previous analysis also holds here, so that φ 0 if P n 1 and φ 1 if P n 1
c) (10 points) Now consider the circuit below What is the single qubit gate that we need to insert in the empty box on the ancilla line in order to simulate the time evolution U exp( iht/ h) for the Hamiltonian H Z 1 Z Z 3? Answer First observe that the H is diagonal in the computational basis Now let ψ be a three qubit state We know that since Z sends 1 1, then Z 1 Z Z 3 will yield a (-1) phase on ψ whenever ψ contains an odd number of qubits in the 1 state In math: Z 1 Z Z 3 ψ P 3 ψ so that the time evolution operator U exp iht/ h will produce a phase of exp it/ h on ψ whenever ψ contains an even number of 1s, and a phase of exp+it/ h whenever ψ contains an odd number of 1s Now let ψ represent the control qubits, and φ the target After the first three CNOTs have been performed, the ancilla is in the state 0 if the parity of the controls is 1, and 1 otherwise Thus we can write the total state Ψ of the four qubit system as something like Ψ Controls with even parity 0 + Controls with odd parity 1 We want the Hamiltonian to apply a phase shift of exp( it/ h) to the even parity states of the control register, and exp(+it/ h) to the odd parity states Because the state of the controls becomes entangled with the ancilla in the way indicated above, then the unitary gate ( e it/ h 0 U 0 e +it/ h ) on the ancilla qubit, ie, exp( iz a t/ h), will produce this evolution
0 + 1 3 (5 points) Consider a qubit in the state Suppose that some external physical process can apply a single Z gate at some time t > 0, but does so in a probabilistic manner The probability distribution for having applied the Z gate by time t is given by p(t) 1 1 e t/τ a) (7 points) Write down the expectation values X, Y, and Z for the system at t 0 Answer The initial state is an eigenstate of X, so, X 1 Y 0 Z 0 b) (6 points) Write down the density matrix for the qubit at time t 0 Answer The density matrix is defined by ρ i p i ψ i ψi At time t, the system is in state ψ + with probability 1 p(t) and in the state Z ψ with probability p(t) So ρ(t) (1 p(t)) + + + p(t) c) (7 points) Now write down the expectation values X and Z for all times t Answer First, observe that the system is either in the state + or the state In both of these cases, Z 0, so that in general Z 0 Now let s look at X X Tr(Xρ) X Tr(Xρ) Tr((1 p) + + p(t) ) (1 p) p (1 p(t)) e t/τ
You should note that the elements + + and correspond to the diagonal elements of the density matrix in this basis You showed in homework that the trace of a matrix is invariant under changes of basis, so that we are free to evaluate the trace in any basis we d like, namely { +, } d) (5 points) You ve just shown that X decays exponentially in time What happens to the offdiagonal elements of the density matrix as t? You learned in class that two systems with the same density matrix are indistinguishable How does the density matrix for this system in the t limit compare to the density matrix for a classically mixed state with 1/ probability of being in the state 0 and 1/ probability of being in the state 1? Answer Note that both p(t) and 1 p(t) approach 1/ in the t limit So in this limit ρ 1 ( + + + ) 1 ( 0 0 + 1 1 ) We see that the off-diagonal matrix elements in the computational basis have vanished, so in this limit the state is indistinguishable from the classical mixture
4 (5 points) Suppose you are given an efficient quantum circuit for computing a function f : {0,1} n {0,1} n a) (18 points) Use this to construct an efficient quantum circuit that sets up a uniform superposition of the form φ y > α y x x > The particular value of y need not be fixed in advance rather you are to construct a circuit which will produce a uniform superposition over the pre-image of y, for some y in the range of f You may assume the standard conversion from a classical circuit f to a quantum circuit U f, as given in class Answer First, create a uniform superposition over the inputs n/ x x By applying the n-qubit Hadamard to the state 0 n Now append ancillary qubits in the state 0 n to preserve unitarity and apply Uf, storing the result in the ancillary qubits, which will then give you n/ x f (x) x Now measure the second register, containing the function values This will cause the first register to collapse to the values consistent with the measurement The first register contains the states x that map to f (x), so the first register collapses to 1 {x: f (x)y} {x: f (x)y} x, which is a uniform superposition over the pre-image of y b) (7 points) What is the closed form expression for α y? Answer The leading factor, α y, should be chosen for proper normalization and hence is given by 1 {x: f (x)y}
5 (5 points) Suppose an electron is prepared in the state Ψ 0 Show how a magnetic field of strength B might be applied to transform this electron into the state Ψ 1 0 1 + i 1 with 100% efficiency, answering the following specific questions: a) (10 points) In what direction is the magnetic field pointed? Hint: where does the desired final state lie on the Bloch sphere? Answer The initial state lies along the +Z axis on the Bloch sphere, and the final state lies on the +Y axis So then the magnetic field should point along the X axis to produce a rotation about X b) (15 points) For how long is the magnetic field applied? Hint: recall that a magnetic field causes a rotation of a 1-qubit spin state according to R j ( θ) exp( is j θ/ h), θ (eb/m) t where ˆx j is the direction of the magnetic field You may express your answer in terms of B and the fundamental constants e,m Answer If the magnetic fields points along the +X axis, then the qubit needs to undergo a counterclockwise rotation of 3π about the X axis The Hamiltonian must therefore generate a rotation operator R x ( 3π ) ( exp i S x h ) ( 3π exp i X ) 3π The Hamiltonian is H e m BS X e h m BX which generates the time evolution operator ( U exp iht ) ( ) iebxt exp, h m ( Requiring that U generates R 3π x 3 obtain t 3π m eb ) allows us to equate the arguments of the exponential and hence