# Inconsistent result trying to simulate measurement of a 2 qubit system

Consider a 2 qubit system in the initial state:

$$\begin{pmatrix} 0 \\ \frac{\sqrt{2}}{2} \\ -\frac{\sqrt{2}}{2} \\ 0 \end{pmatrix}$$

the so-called Bell-pair. Now let's measure the spin of the first qubit along Pauli "$$X$$ direction". Pauli $$X$$ matrix is defined here for reference. To do this we will construct the matrix $$I \otimes X$$ as explained here (or you can do $$X \otimes I$$ which will measure the spin of the other qubit; whether you do $$I \otimes X$$ or $$X \otimes I$$ is irrelevant to the point I am going to make in the question).

$$I \otimes X$$ equals

$$\begin{pmatrix} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \end{pmatrix}$$

Now to simulate the measurement, we need to perform a eigenvalue decomposition of this matrix which is given by:

$$\begin{pmatrix} -\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} & 0 \\ 0 & -\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} \\ \frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} & 0 \\ 0 & \frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} \end{pmatrix}$$

The columns are the eigenvectors associated with eigenvalues $$-1, -1, 1,$$ and $$1$$.

Assume the measurement yielded $$-1$$ corresponding to the first eigenvector. (Side note for advanced readers: there are only 2 unique eigenvalues but the 4 eigenvectors are distinguishable as they are orthogonal - refer to section 2.2.4 in Nielsen and Chuang p. 86 if needed.) The wavefunction is now going to collapse to the first eigenvector which is:

$$\begin{pmatrix} \frac{\sqrt{2}}{2} \\ 0 \\ -\frac{\sqrt{2}}{2} \\ 0 \end{pmatrix}$$

and is same as equation 2.104 in Nielsen and Chuang p. 88 (side note again: the flip in sign of the eigenvector is unimportant and does not make a difference) or refer this

Now we will measure the spin of the other qubit along $$X$$. To do this, we create the complementary matrix $$X \otimes I$$ which is given by:

$$\begin{pmatrix} 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}$$

The eigenvectors of this matrix are

$$\begin{pmatrix} -\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} & 0 \\ \frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} & 0 \\ 0 & -\frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} \\ 0 & \frac{\sqrt{2}}{2} & 0 & \frac{\sqrt{2}}{2} \end{pmatrix}$$

and associated eigenvalues are once again $$-1, -1, 1,$$ and $$1$$.

Now I am interested in the probabilities of measuring these eigenvalues. The formula to do that is given by equation 2.103 in Nielsen and Chuang or one can refer to the same paragraph from lecture notes I pasted above.

The collapsed wavefunction after the first measurement can be verified to be same as:

$$$$\psi' = -\frac{1}{2} q_1 + \frac{1}{2} q_2 + \frac{1}{2} q_3 -\frac{1}{2} q_4$$$$

where $$q_i$$ are the eigenvectors of $$X \otimes I$$ and listed above for clarity. And so the probabilities of observing the 4 eigenvalues are given by modulus square of the coefficients above. In other words, they are all $$0.25$$.

and that brings me to my question. The math I have done above is nothing but a simulation of the EPR experiment. And all the books say that once the spin of the first qubit has been measured to be $$-1$$ it is guaranteed that the spin of the second qubit will be $$+1$$ but I am getting a half and half probability of the spin of the second qubit as well. What gives?

• You can use the environment pmatrix to write matrices in mathjax. E.g., \begin{pmatrix} a & b \\ c & d \end{pmatrix} produces $\begin{pmatrix} a& b \\ c& d \end{pmatrix}$ Jun 17, 2021 at 17:27

Before you measure on the $$X$$ basis as you're doing, you need to write your statevector in terms of the eigenstates of that operator. We have that

\begin{align} |0\rangle &= \frac{1}{\sqrt{2}}(|+\rangle+|-\rangle) \\ |1\rangle &= \frac{1}{\sqrt{2}}(|+\rangle-|-\rangle) \end{align}

Thus, you're state would become

\begin{align} |\psi\rangle &= \frac{1}{\sqrt{2}}(|01\rangle - |10\rangle) \\ &= \frac{1}{\sqrt{2}}\left( \frac{1}{2}(|+\rangle+|-\rangle)(|+\rangle-|-\rangle) - \frac{1}{2}(|+\rangle-|-\rangle)(|+\rangle+|-\rangle) \right) \\ &= \frac{1}{\sqrt{2}}(|-+\rangle - |+-\rangle) \end{align}

You can notice that the entanglement hasn't been lost when we changed to the Hadamard basis, the same relation of $$-1$$ in the first qubit implying $$+1$$ on the second qubit still holds.

Applying the operator $$I \otimes X$$ on this state looks as

\begin{align} \frac{1}{\sqrt{2}}(I\otimes X)(|-+\rangle - |+-\rangle) = \frac{1}{\sqrt{2}}(I|-\rangle \otimes X|+\rangle - I|+\rangle \otimes X |-\rangle) \end{align}

Which can yield one of the following

$$+1|-+\rangle \: \text{or} \: -1|+-\rangle.$$

As you can see, the state of the qubit we measured didn't change it's state after measurement because they are eigenvectors of $$X$$. Now, if you got $$-1$$, you can go ahead and apply the operator $$X \otimes I$$ on $$|+-\rangle$$. This would look like

$$X|+\rangle \otimes I|-\rangle = +1|+-\rangle.$$

Here, you can see that a getting a $$-1$$ when measuring the rightmost qubit implies a $$+1$$ when measuring the leftmost qubit. For more on this, check out the answers to this question.

I will answer my own question. The answer by @epelaaez might be correct but not in a form that I can understand. This assertion in the question:

The wavefunction is now going to collapse to the first eigenvector which is: $$\begin{pmatrix} \frac{\sqrt{2}}{2} \\ 0 \\ -\frac{\sqrt{2}}{2} \\ 0 \end{pmatrix}$$

is incorrect and cuts to the heart of the problem. It is true that the wavefunction will collapse to an eigenvector of the observable, e.g., as stated in these notes:

but this holds only when the eigenvalues are distinct. If the eigenvalues are non-distinct as in this case (there are total 4 eigenvalues but only 2 distinct eigenvalues), the wavefunction will collapse to a superposition of the associated eigenvectors. This is not mentioned in any of the textbooks or wiki etc. but in retrospect what one would expect from common sense intuition.

The collapsed wavefunction in this case is

$$\begin{pmatrix} 1/2 \\ 1/2 \\ -1/2 \\ -1/2 \end{pmatrix}$$

To calculate it, one has to project the wavefunction to each of the "matching" eigenvectors, then create a superposition from the resulting coefficients.

Once you use this wavefunction, the rest of the math in the problem works out and we get 100% probability of measuring $$+1$$ for the other qubit.

This also solves the long-standing question I had.

• Just out of curiosity, how would the rest of the math look like with this state vector? Jun 17, 2021 at 22:37
• just repeat. try doing it as exercise :) Jun 17, 2021 at 22:38
• By the way, the way that I find it easiest to do the maths is to say that, for a measurement $I\otimes X$ with eigenvalues $\pm 1$, I can construct the projector onto the $+1$ space just by using $P=(I\otimes I+I\otimes X)/2$ (eigenvalues 0,1). Then you just have to calculate $P|\Psi^-\rangle$ to find the output after the first measurement. Jun 18, 2021 at 7:02