Note: Cross-posted on Physics SE.
I made some circuit to prepare a 2 qubit state, but I am having trouble understanding how to measure Bell's inequality. I know the inequality is of the form
$$|E(a,b)-E(a,b')+E(a',b)+E(a',b')| \leq 2$$
where for each $E$
$$E = \frac{N_{++} + N_{--} - N_{-+} - N_{+-}}{N_{++} + N_{--} + N_{-+} + N_{+-}} $$
My problem is, what would the different $a,a',b,b'$ be? With this question, I don't mean what their values would be (since IBM Q just outputs $0$ or $1$ in the $01$ basis), but how do I implement this?
Can I just do $a,b$ in $01$ basis and $a',b'$ in $\pm$ basis? And if so, how do I proceed with this? Do I just apply a Hadamard gate before the measurement and take whatever $0$ or $1$ value it outputs?