twhittle 22 Dec 2013 09:11

In order to do this, we just need to assign two distinct eigenvalues to the two distinct eigenspaces we are trying to measure (all bit values are equal & all bit values are not equal). The solution below uses 2 for the eigenvalue for the eigenspace where all bit values are equal and 6 for the eigenvalue for the eigenspace where all bit values are not equal.

(1)\begin{align} M = 2\left(|000\rangle\langle 000| + |111\rangle\langle 111|\right) + 6\left(|001\rangle\langle 001| + |010\rangle\langle 010| + |011\rangle\langle 011| + |100\rangle\langle 100| + |101\rangle\langle 101| + |110\rangle\langle 110|\right) \end{align}