# How to know state coresponding to -1 or 1 for multi qubits VQE?

Can help to explain how to get -1 and 1 for 2 qubits 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 straight forward $$|0\rangle$$ is 1 , $$|1\rangle$$ is -1.

• Please do not use images for text. The practice hurts everyone's ability to search for content on the site. Aug 29 '21 at 5:14
• i removed the image Aug 29 '21 at 8:36

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$$
• 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$. Aug 29 '21 at 8:46