I was hoping someone can explain to me how to get -1 and 1 for a 2-qubit VQE with $\langle XY\rangle$, since we have 4 states $|00\rangle,|01\rangle,|10\rangle,|11\rangle$? For the case of 1 qubit, it is straightforward that $|0\rangle$ is 1, and $|1\rangle$ is -1.
-
2$\begingroup$ Please do not use images for text. The practice hurts everyone's ability to search for content on the site. $\endgroup$– Adam ZalcmanCommented Aug 29, 2021 at 5:14
-
1$\begingroup$ i removed the image $\endgroup$– comettaCommented Aug 29, 2021 at 8:36
1 Answer
Once you apply the rotations to change the basis back to the computational basis ($Z$ basis) then it's just the parity check, odd parity gives $-1$ and even parity gives $1$. So in this case, where you are measuring $\langle ZZ \rangle$ (after applying the $H$ to the first qubit and $S^\dagger H$ to the second qubit), you have $$ |00\rangle, |11\rangle \rightarrow +1 \hspace{2 cm} |01\rangle, |10 \rangle \rightarrow -1 $$ So if you did $1000$ measurements and recorded $700$ times the state $|00\rangle$, and $300$ times the state $|10\rangle$ then your expectation is, in this case, $\dfrac{700\cdot (1) + 300 \cdot (-1)}{100} = 0.4 $
-
1$\begingroup$ is the odd/even parity that you mentioned applicable for more qubits? 3 qubits,4qubits etc? just see whether the binary is even and odd and assign -1 or 1 ? $\endgroup$– comettaCommented Aug 29, 2021 at 8:23
-
1$\begingroup$ Yes. You can extend this to higher number of qubits. But note that if $IZ$ then you only count the index at $Z$.. in this case, it is the same as a single qubit since you do nothing at $I$. $\endgroup$– KAJ226Commented Aug 29, 2021 at 8:46