Bell's Inequality III

Alice has the measuring device S(θϕ) and an electron that is in some spin state |ψ⟩.  Suppose the state |ψ⟩=|0⟩ and
Alice decides to measure with S(θ=π/2, ϕ=0)

Sp[θ_,ϕ_]={{Cos[θ],Exp[-I ϕ]Sin[θ]},{Exp[-I ϕ]Sin[θ],-Cos[θ]}};
up[θ_,ϕ_]={Cos[θ/2],Exp[I ϕ] Sin[θ/2]};
down[θ_,ϕ_]={-Sin[(θ/2)],(E^(I ϕ)) Cos[(θ/2)]};
psi={1,0};

Sp[Pi/2,0];
MatrixForm[%]

i.e the component of spin along the x-axis.  The sample space for possible outcomes of this experiment correspond to eigenvalues
+1, and -1 which we also use to define the random variable Q associated with these two events. Each event has a probability measure
that is given by the Born rule.

According to the Born rule she will obtain the result   (+1)
with probability

ComplexExpand[Conjugate[up[Pi/2,0]].psi]^2

And the result (-1) with probability measure 1/2.

Our goal here is to try to  build a physical model, based on common classical-like notions. 

Model I 
The experiment described above can be re-produced using a classical model in which a set of marbles, colored either black or
white,  are in an urn. Alice reaches into the urn, without looking, and picks a marble.

Question: Are the results given by this hypothetical model consistent with the results Alice obtains with her quantum experiment.
Do they have a similar sample space? How can one get the probabilities to work out the right way?

Question II, suppose the quantum state |ψ⟩ =  (Sqrt[2/3]) |0⟩  + (e^((i π)/4)) (Sqrt[1/3]) |1 ⟩ ?

The probabilities for Q= ±1 are

psi={(Sqrt[2/3]),Exp[I Pi/4](Sqrt[1/3])};
N[ComplexExpand[Abs[Conjugate[up[Pi/2,0]].psi]]^2]
N[ComplexExpand[Abs[Conjugate[down[Pi/2,0]].psi]]^2]

How can you get these probabilities in the classical model ?

Experiment II

But Alice can also perform measurements using S(θ,ϕ) in some other direction. So consider a situation in which
Alice first measures with instrument S(θ=π/2, ϕ=0) as above, and then along the S(θ=0, ϕ=0)  (i.e. Spin along the z-direction ).

Question:  what are the possible results for the first measurement  with random variable Q?, how about the second
measurement ? (Let's call this random variable R) . So what is the sample space ?

Q=1  R=1
Q=1  R=-1
Q=-1 R=1
Q=-1 R=-1

So in order to model this lets assume the marbles in our urn have color black and white, corresponding to Q=±1, but in addition
have some other measurable characteristic, lets suppose they have a number printed on them, call them R=1, -1. Thus 
in the urn we would have marbles with the following characteristics

Color  Number
Black   1
Black  -1
White   1
White  -1 

and we use the random variable assignments defined by Alice.  Since each member of Alice's sample space has to have
a probability measure

p(Q=1,R=1) ≡p(1,1)
p(Q=1,R=-1) ≡p(1,-1)
p(Q=-1,R=1) ≡p(-1,1)
p(Q=-1,R=-1)≡p(-1,1)

So p(1,1) is the probability that Alice obtains the result Q=1 and then  R=1 for the  subsequent measurement.  For the classical system
this is easy,  one picks a marble and both these attributes are encoded in a single marble. In the quantum case it is clear we cannot give
this interpretation because of the collapse hypothesis, so a measurement with Q first collapse the wave function into an eigenstate of the
Q instrument, after which a measurement of R is performed.

Example: Assuming the state |ψ⟩ Visa  (Subscript[c, 1])|0⟩ + (Subscript[c, 2])|1⟩  the probability for obtain the value Q=1 is

psi={c1,c2};
Expand[Simplify[Conjugate[up[Pi/2,0]].psi Conjugate[psi].up[Pi/2,0]]];
% /. (1/2) c1 Conjugate[c1]+(1/2) c2 Conjugate[c2] ->1/2
Expand[Simplify[Conjugate[down[Pi/2,0]].psi Conjugate[psi].down[Pi/2,0]]];
% /. (1/2) c1 Conjugate[c1]+(1/2) c2 Conjugate[c2] ->1/2

For the value Q=1 the system collapse into

psi=up[Pi/2,0]

Now we perform a measurement on R

Expand[Simplify[Conjugate[up[0,0]].psi Conjugate[psi].up[0,0]]]

Therefore the probability to get  Q=1,R=1 is
((1/2)+(1/2) c2 Conjugate[c1]+(1/2) c1 Conjugate[c2]) c1 Conjugate[c1]

Now lets reverse the order to measurement. We first measure R

psi={c1,c2};
Expand[Simplify[Conjugate[up[0,0]].psi Conjugate[psi].up[0,0]]]
Expand[Simplify[Conjugate[down[0,0]].psi Conjugate[psi].down[0,0]]];

If R=1 the system collapses to  the eigenstate corresponding to this measurement, i.e.

psi=up[0,0]

and the measurement with respect to Q gives for the value Q=1

Expand[Simplify[Conjugate[up[Pi/2,0]].psi Conjugate[psi].up[Pi/2,0]]]

and therefore the probability p(R=1,Q=1) is 

(1/2) c1 Conjugate[c1]

Which is very different from the measurement we made with Q first followed by R.  So in order to model two measurement
of Q and R we should re-state the experiment

Alice has a state |ψ⟩ and measures first with Q,  then she measures with R but not on the same physical system she measured with Q.
For example in the morning she measures with Q  given the state |ψ⟩.
In the afternoon she again has the  state |ψ⟩ available, but now she decides to measure R.
In her lab book she  notates the results for Q and R for each day, and repeats this experiment every day of
the week. Her lab book might look something like this

                            Q     R 
Monday             +1    +1
Tuesday            +1     -1
Wednesday       -1     -1
Thursday           -1     -1
Friday                -1     +1

etc.  you get the idea.  Thus in this form we note the sample space might look something like this

{+1 +1}, {+1,-1},  {-1,-1},  {-1,+1}.  And for each point there is no ambiguity since a measurement by Q in the morning of
|ψ⟩, should be completely independent of a measurement of R (using the same |ψ⟩ ) in the afternoon. Furthermore
because of this independence we can safely assume   P(Q=q,R=r) = P(q) P(r).  Now according to the Born rule
if    |ψ⟩ =  (Subscript[c, 1])|0⟩ + (Subscript[c, 2])|1⟩  the probability of obtaining Q=1 is

p(Q=1) =  1+(1/2) c2 Conjugate[c1]+(1/2) c1 Conjugate[c2]

and the probability of obtaining 

p(R=1) = c1 Conjugate[c1]  

and so

p(Q=1,R=1) = ( (1/2)+(1/2) c2 Conjugate[c1]+(1/2) c1 Conjugate[c2]) ( c1 Conjugate[c1]  )

Likewise

p(Q=1,R=-1) =  ( (1/2)+(1/2) c2 Conjugate[c1]+(1/2) c1 Conjugate[c2]) (c2 Conjugate[c2])

p(Q=-1,R=1) =  ( (1/2)-(1/2) c2 Conjugate[c1]-(1/2) c1 Conjugate[c2]) (c1 Conjugate[c1] )

p(Q=-1,R=-1)=  ( (1/2)-(1/2) c2 Conjugate[c1]-(1/2) c1 Conjugate[c2])  (c2 Conjugate[c2])

p[1,1]=((1/2)+(1/2) c2 Conjugate[c1]+(1/2) c1 Conjugate[c2]) (c1 Conjugate[c1]);

p[1,-1]=((1/2)+(1/2) c2 Conjugate[c1]+(1/2) c1 Conjugate[c2]) (c2 Conjugate[c2]);

p[-1,1]=((1/2)-(1/2) c2 Conjugate[c1]-(1/2) c1 Conjugate[c2]) (c1 Conjugate[c1]);

p[-1,-1]=((1/2)-(1/2) c2 Conjugate[c1]-(1/2) c1 Conjugate[c2]) (c2 Conjugate[c2]);

Simplify[p[1,1]+p[1,-1]+p[-1,1]+p[-1,-1]]
% /. c1 Conjugate[c1]+c2 Conjugate[c2] ->1

coeff={c1->Cos[χ],c2->Sin[χ]}

FullSimplify[p[1,1] /. coeff,Assumptions->χ>0]
FullSimplify[p[1,-1] /. coeff,Assumptions->χ>0]
FullSimplify[p[-1,1] /. coeff,Assumptions->χ>0]
FullSimplify[p[1,1] /. coeff,Assumptions->χ>0]

So in an urn put a large number of N marbles so that the fraction     (1/2) ((Cos[χ])^2) (1+Sin[2 χ])/N are black and have the number  1
                                                                                                           (1/2) ((Sin[χ])^2) (1+Sin[2 χ])/N  are black and have the number -1
                                                                                                           (1/2) ((Cos[χ])^2) (1-Sin[2 χ])/N  are white and have the number -1
                                                                                                           (1/2) ((Cos[χ])^2) (1+Sin[2 χ])/N  are white and have the number +1

So we can always mimic this quantum experimentit by a suitable chosen classical model, in which an object picked randomly form an urn has
 black/white  and has number  ±1.

Experiment II

Consider now another system where Alice and Bob measure spin components of different particles in a given quantum
state  |ψ⟩. We suppose Alice uses measuring device S(θ=π/2,0)  and Bob uses device S(θ=Pi/4,0).  Alice will only measure
values +1,-1, as will Bob.  Alice calls her values Q = ±1, and Bob calls his measured values S=±1.  The sample space
looks similar as the one above.

{Q=1,S=1}  {Q=1,S=-1},  {Q=-1,S=1}, {Q=-1,S= -1}

so we have a probability measure for each point. Further we assume that the system is in the Bell state

|ψ⟩ =  (1/(Sqrt[2])) ( | 0 1⟩ - |1 0 ⟩ )

According to Born rule the probability that particle 1 has eigenvalue a   and  particle 2  has eigenvalue b 

|⟨a b  | ψ⟩ ((|)^2) = (1/2) | ⟨a|0⟩ ⟨b|1⟩ - ⟨a|1⟩ ⟨b|0⟩ ((|)^2) 

and so

p[1,1]=1/2FullSimplify[( Conjugate[up[Pi/2,0]].up[0,0] Conjugate[up[Pi/4,0]].down[0,0]
- Conjugate[up[Pi/2,0]].down[0,0] Conjugate[up[Pi/4,0]].up[0,0])^2]
p[1,-1]=1/2FullSimplify[ ( Conjugate[up[Pi/2,0]].up[0,0] Conjugate[down[Pi/4,0]].down[0,0]
- Conjugate[up[Pi/2,0]].down[0,0] Conjugate[down[Pi/4,0]].up[0,0])^2]
p[-1,1]=1/2FullSimplify[( Conjugate[down[Pi/2,0]].up[0,0] Conjugate[up[Pi/4,0]].down[0,0]
- Conjugate[down[Pi/2,0]].down[0,0] Conjugate[up[Pi/4,0]].up[0,0])^2]
p[-1,-1]=1/2FullSimplify[ ( Conjugate[down[Pi/2,0]].up[0,0] Conjugate[down[Pi/4,0]].down[0,0]
- Conjugate[down[Pi/2,0]].down[0,0] Conjugate[down[Pi/4,0]].up[0,0])^2]

Simplify[p[1,1]+p[1,-1]+p[-1,1]+p[-1,-1]]

Lets evaluate the expectation value  EQS = (∑_qs)p(q,s)  q s
or

EQS=p[1,1] 1 1 + p[1,-1] 1 (-1) + p[-1,1] (-1) (1) + p[-1,-1] (-1) (-1)
Simplify[%]

Note: this result can also be obtained in a simpler manner, using the epxression

EQS = ⟨ψ| Q S |ψ ⟩

Proof: Consider any operator A and its eigenstates |(Subscript[a, i])⟩.  The expectation value is

EA ≡ (∑_( i))p((Subscript[a, i])) (Subscript[a, i])=  (∑_( i))|⟨(Subscript[a, i])|ψ⟩ ((|)^2) (Subscript[a, i]) = (∑_( i)) ⟨ψ|(Subscript[a, i])⟩⟨(Subscript[a, i])|ψ⟩ (Subscript[a, i]) = (∑_( i)) ⟨ψ| A | (Subscript[a, i])⟩⟨(Subscript[a, i])|ψ⟩ now we use the closure theorem

(∑_( i)) | (Subscript[a, i])⟩⟨(Subscript[a, i])| =1

therefore 

EA =  ⟨ψ| A |ψ ⟩

for any Hermitian operator A. But Q and S are Hermitian and they also commute i.e. QS-SQ=0, and so the product QS = SQ is also Hermitian
therefore

EQS = ⟨ψ| Q S |ψ ⟩ 

QED.  In order to test this identity let’s use our example above

unit={{1,0},{0,1}};
Q=KroneckerProduct[Sp[Pi/2,0],unit];
S=KroneckerProduct[unit,Sp[Pi/4,0]];
SQ=S.Q
(* note this is the same as Q.S *)

Now we need to construct   |ψ⟩ =  (1/(Sqrt[2])) ( | 0 1⟩ - |1 0 ⟩ )  = (1/(Sqrt[2])) ( | 1  -1⟩  -  | -1  1 ⟩ )

psi=1/Sqrt[2](Flatten[KroneckerProduct[up[0,0],down[0,0]]]- Flatten[KroneckerProduct[down[0,0],up[0,0]]])

FullSimplify[Conjugate[psi].SQ.psi]

The result of these measurements show that they are correlated. There is no correlation when Alice gets the value -1 and Bob is just as likely to get
+1, and -1.  The same is true if Alice gets +1. At the end of the day Alice measures just as many up hits as Bob measures down hits.  In this scenario the average of the product
of random variable Q,S is zero. But for the Bell state this does not happen, the non-zero negative correlation implies that if Alice measures a +1,  Bob is more
likely to measure -1, and visa-versa.

Bertelmann's Socks

Can we make a simple classical model to get such correlations?  Suppose we have a jar of connected Lego blocks. During a measurement Alice gets one the pieces
and Bob gets the other one. Alice’s machine can only measure the Q property i.e. the block is either white of black. Bob can only measure the number property S that is
-1 or 1.  

So if the jar contains blocks of a given color (Q=1, black) and (Q=-1, white)  and are also labeled S=±1
                                          then if     (1/8) (2-(Sqrt[2]))/N   are both black in color and are labeled 1. 
                                                         (1/8) (2+(Sqrt[2]))/N    are both black  and are labeled -1.
                                                         (1/8) (2+(Sqrt[2]))/N   are both white and are labeled 1
                                                         (1/8) (2-(Sqrt[2]))/N   are both white and are labeled -1
 As N -> ∞  we can reproduce the statistics that Alice and Bob gleaned from their quantum experiment.

Experiment III 
Clauser-Horne-Shimony-Holt inequality (CSHS)

Suppose now we have a somewhat more involved experiment. In this experiment,  Alice
measures Q, and Bob measure S, in the morning. In the afternoon Alice decides to measure R and Bob measures along the direction T=S(θ=Pi/4,Pi). 
They both jot down their results in their notebooks, at the end of the day they may have data that looks something like this

Q    R     S    T   
-1   1      -1    1

They keep doing this experiment each day, how many distinct results will they get ?  What is the  sample space?,
If Alice measures Q and Bob measures T instead of S, would the data look fundamentally different ?

Instead of trying to figure out the probability distribution for each sample point, ie. p(q,r,s,t) Let's take a simpler approach and
assume that we can assign a probability measure to each sample point.  We then evaluate the following expectation values

EQS ≡ (∑_(q,r,s,t))p(q,r,s,t)  q s

ERS ≡ (∑_(q,r,s,t))p(q,r,s,t)  r s

ERT ≡ (∑_(q,r,s,t))p(q,r,s,t)  r t

EQT ≡ (∑_(q,r,s,t))p(q,r,s,t)  q t

therefore

EQS + ERS + ERT - EQT  = (∑_(q,r,s,t))p(q,r,s,t)  (  q s + r s + r t -q t )=
                                              (∑_(q,r,s,t))p(q,r,s,t)   (  (q + r)  s + (r - q) t )
                                              
                                              since Q, R take values of ±1   if    q + r =2  the  r - q =0
                                                                                                    q+ r =0   then r-q = ±2
                                                                                                    q + r =-2 then r-q=0
                                                                                                    
                                             in either case the quantity    (q+r) r  + (r -q) t  can only take two
                                             values  ±2  
                                             
                                             and so
                                             
   | EQS + ERS + ERT - EQT |  <    2

Lets see how this work out for the following operators

Q=KroneckerProduct[Sp[Pi/2,0],unit];
R=KroneckerProduct[Sp[0,0],unit];
S=KroneckerProduct[unit,Sp[Pi/4,0]];
T=KroneckerProduct[unit,Sp[Pi/4,Pi]];
SQ=S.Q
RS=R.S
RT=R.T
QT=Q.T

ESQ=FullSimplify[Conjugate[psi].SQ.psi]
ERS=FullSimplify[Conjugate[psi].RS.psi]
ERT=FullSimplify[Conjugate[psi].RT.psi]
EQT=FullSimplify[Conjugate[psi].QT.psi]

ESQ+ERS+ERT-EQT

Question:  What went wrong ?