I'm working through MIT's Quantum Information Science I, Part 1
on OpenCourseWare, and for the life of me I can't figure out the following problem:
Given the circuit above, where the meter sign denotes the measurement with $\{|0⟩,|1⟩\}$ basis:
- Suppose $U$ is a unitary having eigenvalue $e^{i\theta_1}$ with eigenstate $|u_1\rangle$, and eigenvalue $e^{i\theta_2}$ with eigenstate $|u_2\rangle$. Also, suppose that $e^{i\theta_1} \ne e^{i\theta_2}$. Let $|\psi_i=a|u_1\rangle+b|u_2\rangle$ where $a,b$ are real numbers satisfying $a^2+b^2=1$. Find the probability of getting the measurement result 0. Express the probability in terms of $a$, $\cos(\theta_1)$, and $\cos(\theta_2)$.
So far, I think I've managed to work out that, after the second Hadamard gate, we have $a(1+e^{i\theta_1}+b(1+e^{i\theta_2})) \otimes |+\rangle$. However, I'm absolutely confused about where to go next.
Our starting state is $|0\rangle \otimes |\psi_i\rangle$.
Then, we perform a Hadamard operation on the first qubit, and we get $|+\rangle \otimes |\psi_i\rangle$.
Then, we perform the controlled-U operation, and we get $(|0\rangle \otimes (a|u_1\rangle + b|u_2\rangle) + |1\rangle \otimes (e^{i\theta_1}a|u_1\rangle + e^{i\theta_2}b|u_2\rangle))$.
Finally, we perform a Hadamard operation on the first qubit again, getting state $(|0\rangle \otimes (a(1+e^{i\theta_1})|u_1\rangle + b(1+e^{i\theta_2})|u_2\rangle)) + (|1\rangle \otimes (a(1-e^{i\theta_1})|u_1\rangle + b(1-e^{i\theta_2})|u_2\rangle))$.
However, when I try to calculate the probability of measuring |0>, the math explodes and I wind up with crazy terms like $a^2(2i\cos\theta_1+2i\sin\theta_1+2\cos^2\theta_1+2\cos\theta_1)\cos^2\theta_1)+b^2(2i\cos\theta_2+2i\sin\theta_2+2\cos^2\theta_2+2\cos\theta_2)\cos^2\theta_2)$. Am I going wrong conceptually here or mathematically?