I'm not sure is it the right place to ask this but, I think it is better to ask here than Math Overflow. It is about how to find the matrix representation of an operator (for the CHSH test).
What are the matrices that has $\left|\frac{\pi}{8}\right>$ and $\left|\frac{5 \pi}{8}\right>$ with eigenvalues $\{1,-1\}$?
I can relate an operator with eigenbasis geometrically, but I do not know how to represent the operator matrix using these eigenbases and eigenvalues.