This version is very simple to understand so, for the benefit of lurkers like Justo, we will do some further explanation of the code. First we have the singlet 3D unit vector "s" being randomly generated in an independent Do-loop. Then we use that to make Ls1 and Ls2 which are pure quaternions that represent the spin of the two particles that go to Alice and Bob,
Code: Select all
Ls1[[k]] = s . Qcoordinates; (*Convert to quaternion; A particle spin*)
Ls2[[k]] = -s . Qcoordinates, (*B particle spin plus conservation of angular momentum*)
Which typically look like this for the first iteration,
Code: Select all
In[662]:= Ls1[[1]]
Ls2[[1]]
Out[662]= Quaternion[0., -0.650358, 0.707279, 0.277111]
Out[663]= Quaternion[0., 0.650358, -0.707279, -0.277111]
Then we do the same thing for the "a" and "b" polarizer detection angles by converting them to x-y coordinates in a 3D setting,
Code: Select all
Da = aa . Qcoordinates; (*Convert to quaternion; A detector*)
And they typically look like this for the second iteration,
Code: Select all
In[666]:= Daa[[2]]
Dbb[[2]]
Out[666]= Quaternion[0., -0.207912, 0.978148, 0.]
Out[667]= Quaternion[0., -0.857167, 0.515038, 0.]
Pure quaternions with the "z" or "K" component set to zero. Then we have the interaction between the two particle spins and the detectors which look like this for the second iteration,
Code: Select all
In[668]:= Daa[[2]] ** Ls1[[2]]
Ls2[[2]] ** Dbb[[2]]
Out[668]= Quaternion[0.533731, 0.783663, 0.166573, 0.270661]
Out[669]= Quaternion[-0.166055, 0.412633, 0.686737, 0.574937]
We then have the product calculation with the limits imposed which typically looks like,
Code: Select all
In[670]:= pc = Limit[Daa[[2]] ** Ls1[[2]] ** Ls2[[2]] ** Dbb[[2]], {Ls1[[2]] -> Sign[aa1[[2]] . s1[[2]]] Daa[[2]],
Ls2[[2]] -> Sign[bb1[[2]] . s1[[2]]] Dbb[[2]]}]
Out[670]= Quaternion[-0.681998, 4.18649*10^-18, 3.39127*10^-17, 0.731354]
And then we can see that the real part of that quaternion is equal to
-a.b for the second iteration again,
Code: Select all
In[671]:= -aa1[[2]].bb1[[2]]
Out[671]= -0.681998
So over many iterations, the imaginary components cancel each other in the same way as the A and B outcomes individually vanish and we have for the mean,
Code: Select all
Imaginary part vanishes. meanpc = (0.00788064 +8.69336*10^-21 I)-1.62212*10^-19 J+0.00311446 K
That is all there is do it other than showing the A and B outcome averages.
.