Computer Simulation of EPR Scenarios

Foundations of physics and/or philosophy of physics, and in particular, posts on unresolved or controversial issues

Re: Computer Simulation of EPR Scenarios

Postby gill1109 » Thu Feb 20, 2014 3:46 am

I have now also ported Chantal's Java code, verifying part of Joy's theory, to R:

http://rpubs.com/gill1109/13494

Because this is not an event-based simulation in the usual sense, but a Monte Carlo verification of one particular part of the analytical claims made in the theory, I would prefer we discuss it in the thread devoted to Joy's two page proof:

viewtopic.php?f=6&t=18

My code is based on the code at:

https://github.com/chenopodium/JCS
https://github.com/chenopodium/JCS2

See also Daniel Sabsay's Javascript version

http://libertesphilosophica.info/eprsim ... ion5M.html
http://libertesphilosophica.info/eprsim/eprsim.txt

The formulas for Cab, Na, Nb are taken from Christian's paper "Whither...": http://arxiv.org/abs/1301.1653

Cab is given in (A27), Na and Nb are given by the expressions just after (A28) and (A29). The "phases" phi_o^p etc. also come from this paper.
The procedure generating an outcome +/-1 for the product of Alice and Bob's measurement, or 0 for "no state", with the help of an auxiliary randomization, is taken from Roth and Sabsay's code, who I presume have implemented Joy's intended procedure correctly.
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Computer Simulation of EPR Scenarios

Postby gill1109 » Fri Feb 21, 2014 5:22 pm

I just realized that Chantal's simulation is easily extended to be "event-based". She simulates an outcome (+/-1) of A times B. With an extra independent fair coin toss we can decide what are the outcomes for A and B separately.

And I wrote that I took the rejection criterium (the hidden state is generated by what is called rejection sampling) from Roth and Sabsay's code ... but on careful reading, one sees that it is explicitly defined in Joy's description.

Joy doesn't explicitly mention the *uniform* probability distribution of e_0 on S^2 or the *uniform* probability distribution of theta_0 on [0, pi/2], nor their statistical independence, but those are of course the "default" assumptions, and they are adopted (by default) by Roth and by Sabsay.
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Computer Simulation of EPR Scenarios

Postby FrediFizzx » Sat Feb 22, 2014 1:50 am

Here is a graph of six different outputs of John Reed's Mathematic version of the Minkwe simulation going from theta_0 = 0 to equal to pi/2.

Image

This illustrates the cases that Joy mentions on page 258 to 259 here. The first graph is when theta_0 = 0 and we can see we get the Bell case of straight lines. Then the graphs increment in tenths of pi until we get to pi/2 which is the optimal case. So we can see that gradually we are going from straight lines to more and more towards the cosine curve. Now another thing to mention is that these graphs are generated with 5 million trials at one degree increments (rounded to that). So the finer that we make the degree intervals to round to, the better we will fit to the cosine curve. But the simulation will never actually get all the way there because we would have to go to zero degree intervals.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Computer Simulation of EPR Scenarios

Postby Ben6993 » Sat Feb 22, 2014 2:29 am

I have just run Richard's version of Chantal's simulation (http://rpubs.com/gill1109/JCS2opt) which gives correlation coefficient = 0.9801 with individual detector angles chosen at 7.5 degree intervals, with one million pairs of data generated.

I have run the same program twice more with angle intervals of 3.75 and 1.875. The correlation in these two cases is still 0.9801. The same correlation is also found on two further runs with detector angle intervals of 15 and 30 degrees. So, reducing the angle interval is not increasing the correlation in Richard's R language version of Chantal's simulation. And the cosine curve is being imperfectly met in the regions near to 0 and 180 degrees.
Ben6993
 
Posts: 287
Joined: Sun Feb 09, 2014 12:53 pm

Re: Computer Simulation of EPR Scenarios

Postby gill1109 » Sat Feb 22, 2014 2:30 am

Fred: please now simulate just *one* point on the curve, and give us error bars (standard errors).

I don't want to see pretty pictures. I want numbers.

For an example of what I mean, see

http://rpubs.com/gill1109/EPRB23big

Ben: Chantal's model is different from Michel's model. Bit different philosophy, bit different formulas. Chantal simulates directly the product A times B, not the separate values of A and B. Joy has written out a derivation of Chantal's model and it includes some "fudge factors" or phase shifts which were chosen by trial and error to make the curve look good. In Michel's model, for which as far as I know Joy did not write out an independent justification, though he does duplicate some of the formulas which Michel is using in his writings, there are no fudge factors.

Chantal's does badly at 0 degrees. Michel's does badly at around 30 degrees.

Michel's approach is more or less described in Joy's short documents "EPRB.pdf" and "complete.pdf", which can be found on his site.
http://libertesphilosophica.info/blog/wp-content/uploads/2014/01/EPRB.pdf
http://libertesphilosophica.info/blog/wp-content/uploads/2014/02/complete.pdf

Chantal's approach is derived in his article "Whither..." which is on arXiv, 1301.1653.

This article is reproduced more or less exactly in the appendix to the second edition of his book.

Chantal's model: see formula (A.9.27) and the formula for Na on page 248, and for Nb on page 249.
http://libertesphilosophica.info/blog/wp-content/uploads/2014/01/Book-Chapter.pdf

Michel's model is not treated there, as far as I can see.
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Computer Simulation of EPR Scenarios

Postby gill1109 » Sat Feb 22, 2014 3:00 am

Ben6993 wrote:I have just run Richard's version of Chantal's simulation (http://rpubs.com/gill1109/JCS2opt) which gives correlation coefficient = 0.9801 with individual detector angles chosen at 7.5 degree intervals, with one million pairs of data generated.

I have run the same program twice more with angle intervals of 3.75 and 1.875. The correlation in these two cases is still 0.9801. The same correlation is also found on two further runs with detector angle intervals of 15 and 30 degrees. So, reducing the angle interval is not increasing the correlation in Richard's R language version of Chantal's simulation. And the cosine curve is being imperfectly met in the regions near to 0 and 180 degrees.


Dear Ben

I hope you are also using a different seed for the pseudo random generator in each new experiment.

Well - actually the sample size is so large that we won't see much randomness when we round to four decimals after the point ... but it is good to do several "independent" replications.

Richard
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Computer Simulation of EPR Scenarios

Postby Joy Christian » Sat Feb 22, 2014 4:40 am

Ben6993 wrote:I have just run Richard's version of Chantal's simulation (http://rpubs.com/gill1109/JCS2opt) which gives correlation coefficient = 0.9801 with individual detector angles chosen at 7.5 degree intervals, with one million pairs of data generated.

I have run the same program twice more with angle intervals of 3.75 and 1.875. The correlation in these two cases is still 0.9801. The same correlation is also found on two further runs with detector angle intervals of 15 and 30 degrees. So, reducing the angle interval is not increasing the correlation in Richard's R language version of Chantal's simulation. And the cosine curve is being imperfectly met in the regions near to 0 and 180 degrees.


Hi Ben,

Fred is talking about Michel's simulation, whereas you have analysed Chantal's simulation. The two simulations are theoretically complementary, but computationally different. In Chantal's simulation you would have to adjust the two phase angles in order to achieve perfect (anti) correlation at equal settings.

In Michel's simulation, however, phase angles do not seem to be necessary despite my earlier suspicion (apart from pi to get the minus sign on one side). So in Michel's simulation the size of the increment would make a difference, as does in John Reed's Mathematica version of Michel's simulation (cf. the pictures posted by Fred).
Joy Christian
Research Physicist
 
Posts: 2793
Joined: Wed Feb 05, 2014 4:49 am
Location: Oxford, United Kingdom

Re: Computer Simulation of EPR Scenarios

Postby gill1109 » Sat Feb 22, 2014 5:06 am

The pictures posted by Fred don't have high enough resolution to prove anything, and still suffer from the totally unnecessary choice to draw measurement angles completely at random between 0 and 2 pi, and bin their differences. I have asked Fred to fix the angles alpha and beta at say 0 and 30 degrees, and do 1 million (preferably 100 million) runs, and report to us the numbers. I even told him which lines of Reed's Mathematica code to alter, if he insists on doing it in Mathematica (irresponsible, unprofessional).

The pictures are a smokescreen.

When he does that, he should reproduce

http://rpubs.com/gill1109/13390

(if he uses the S^2 version of Michel's approach). The S^1 version gives worse results, not better!
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Computer Simulation of EPR Scenarios

Postby gill1109 » Sat Feb 22, 2014 6:56 am

Fred, will you please post Reed's Mathematica code somewhere as a plain text file so it can be copy-pasted into a remote terminal to a Mathematica server? The pdf is absolutey useless.

If the mountain will not come to Mohammed, then Mohammed must go to the mountain.
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Computer Simulation of EPR Scenarios

Postby gill1109 » Sat Feb 22, 2014 8:01 am

OK, here's the Mathematica code for an experiment in which Alice and Bob's angles are fixed

Code: Select all
spin = 1/2;
phase = 2 Pi spin;
spin2 = 2 spin;
trials = 1000000;

aliceDeg = 0;
bobDeg = 0;

aliceAngle = 0;
aliceDeg = 0;
bobAngle = Pi / 6;
bobDeg = 30;

nPP = 0;
nNN = 0;
nPN = 0;
nNP = 0;
nA = 0;
nB = 0;

test[angle_, e_, lambda_] := Module[{c, out},
c = Cos[1 (angle - e)];
If[lambda >= Abs[c], out = 0, out = Sign[c]]; out]

Do[
eVector = RandomReal[{0, 2 Pi}];
lambda = (1/2) Sin[RandomReal[{0, Pi / 2}]]^2;
eLeft = RandomReal[{0, 2 Pi}];
eRight = eLeft + 2 Pi spin;
aliceD = test[aliceAngle, eLeft, lambda];
bobD = test[bobAngle, eRight, lambda];
If[aliceD == 1, nA++];
If[bobD ==1, nB++];
If[aliceD ==1 && bobD == 1, nPP++];
If[aliceD == 1 && bobD == -1, nPN++];
If[aliceD == -1 && bobD == 1, nNP++];
If[aliceD == -1 && bobD == -1, nNN++],
{i, trials}];

corr = (nPP - nPN - nNP + nNN)/(nPP + nPN + nNP + nNN)

corr // N
-Cos[bobAngle] // N


And here are the results

Code: Select all
In[96]:= (nPP - nPN - nNP + nNN)/(nPP + nPN + nNP + nNN)  //N             

Out[96]= -0.848954

In[97]:= - Cos[bobAngle] // N                                                   

Out[97]= -0.866025
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Computer Simulation of EPR Scenarios

Postby FrediFizzx » Sat Feb 22, 2014 12:10 pm

Here you go. We stand up next to a mountain and chop it down with the edge of our hands! --j hendrix :D

Code: Select all
(* Michel Fodje's Minkwe simulation
translated from Python to Mathematica by John Reed
13 Nov 2013 *)
(* Set run time parameters, initialize arrays *)
spin=1/2;
phase=2 \[Pi] spin;
spin2=2 spin;
trials=5000000;
aliceDeg=ConstantArray[0,trials];
bobDeg=ConstantArray[0,trials];
aliceDet=ConstantArray[0,trials];
bobDet=ConstantArray[0,trials];

nPP=ConstantArray[0,361];
nNN=ConstantArray[0,361];
nPN=ConstantArray[0,361];
nNP=ConstantArray[0,361];
nA=ConstantArray[0,361];
nB=ConstantArray[0,361];
(* Detector test function *)
test[angle_,e_,\[Lambda]_]:=Module[{c,out},
c=-Cos[1(angle-e)];
If[\[Lambda]>=Abs[c],out=0,out=Sign[c]];
out]
(* Generate particle data  *)
Do[
eVector=RandomReal[{0,2 \[Pi]}];
\[Lambda]=1/2 Sin[RandomReal[{0,\[Pi](0.5)}]]^2;
eLeft=RandomReal[{0,2 \[Pi]}];
eRight=eLeft+2 \[Pi] spin;
aliceAngle=RandomReal[{0,2 \[Pi]}];
aliceDeg[[i]]=aliceAngle/Degree;
bobAngle=RandomReal[{0,2 \[Pi]}];
bobDeg[[i]]=bobAngle/Degree;
aliceDet[[i]]=test[aliceAngle,eLeft,\[Lambda]];
bobDet[[i]]=test[bobAngle,eRight,\[Lambda]],
{i,trials}]

(* statistical analysis of particle data  *)
Do[
\[Theta]=Ceiling[(aliceDeg[[i]]-bobDeg[[i]])]-1;
aliceD=aliceDet[[i]];bobD=bobDet[[i]];
If[aliceD==1,nA[[\[Theta]]]++];
If[bobD==1,nB[[\[Theta]]]++];
If[aliceD==1&&bobD==1,nPP[[\[Theta]]]++];
If[aliceD==1&&bobD==-1,nPN[[\[Theta]]]++];
If[aliceD==-1&&bobD==1,nNP[[\[Theta]]]++];
If[aliceD==-1&&bobD==-1,nNN[[\[Theta]]]++],
{i,trials}]
(* Calculate mean values and plot *)
pPP=0; pPN=0; pNP=0;pNN=0;
mean=ConstantArray[0,361];
Do[
sum=nPP[[i]]+nPN[[i]]+nNP[[i]]+nNN[[i]];
If[sum==0,Goto[jump],
{pPP=nPP[[i]]/sum;
       pNP=nNP[[i]]/sum;
       pPN=nPN[[i]]/sum;
       pNN=nNN[[i]]/sum;
mean[[i]]=pPP+pNN-pPN-pNP}];
Label[jump],
{i,361}]

simulation=ListPlot[mean]
(mean[[24]]+mean[[23]])/2//N
-0.900397
(mean[[68]]+mean[[69]])/2//N
-0.342987
cos=Plot[-Cos[x Degree],{x,0,360},PlotStyle->{Red,Thick}];
(* Compare mean values with Cosine *)
Show[simulation,cos]
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Computer Simulation of EPR Scenarios

Postby gill1109 » Sat Feb 22, 2014 12:35 pm

:D

Thanks but while you were asleep (?) I managed to copy the text from the pdf and to simplify to just two, fixed, settings on each side.

Long live J Hendrik!
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Computer Simulation of EPR Scenarios

Postby FrediFizzx » Sat Feb 22, 2014 2:21 pm

That doesn't mean anything.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Computer Simulation of EPR Scenarios

Postby Joy Christian » Sat Feb 22, 2014 2:36 pm

FrediFizzx wrote:That doesn't mean anything.


Fred,

Here is what he wrote on the FQXi blog: "Just fix all of Alice angles to 0 degrees, and all Bob's angles to 30 degrees ...Just calculate one correlation."

To which I replied: "That is not the model. The model is S^3, which is a simply-connected topological manifold. What Fred is doing is correct. He can show the same exact cosine correlation in the 0-increment limit without the pictures. The pictures simply make things easier for everyone to understand."

But he does not get it. As theta_o approaches pi/2 from 0 the corrrelations match exactly to the theoretical curve. But he does not get it.
Joy Christian
Research Physicist
 
Posts: 2793
Joined: Wed Feb 05, 2014 4:49 am
Location: Oxford, United Kingdom

Re: Computer Simulation of EPR Scenarios

Postby Joy Christian » Sat Feb 22, 2014 4:18 pm

FrediFizzx wrote:That doesn't mean anything.


Hi Fred,

I have now checked to see whether your argument goes through in Gill's code, and it does not seem to. I have downloaded R and ran his code on my laptop, this one, starting with the increments of 7.5 degrees as he has done, and then going all the way down to increments of 0.3 degrees. The resolution improves, but his second plot where he shows the difference in the two curves remains unchanged. I suspect the difference will persist even for smaller increments like 0.000003.

On the other hand, I am able to reduce the discrepancy to nearly insignificant when I run his code with the two phase angles on Bob's side as we discussed above.

Another possibility that may be playing a role is how theta_o has been implemented in his code as well as in the original code of Michel. It has been taken randomly from the interval [0, pi/2], but that is not exactly how it appears in my analytical picture. We can see from eq.(10) that what should be done according to the analytical model is choose two vectors, e_o and g_o, randomly, so that eq.(10) is satisfied. So strictly speaking theta_o is an approximation. In Michel's simulation this approximation seems to work, but in Gill's more refined code the difference between random theta_o versus random vector g_o may be playing a significant role.

So, upon further reflections and investigations, it seems to me that there are more than one factors that are contributing to the discrepancy Gill has been reporting.
Joy Christian
Research Physicist
 
Posts: 2793
Joined: Wed Feb 05, 2014 4:49 am
Location: Oxford, United Kingdom

Re: Computer Simulation of EPR Scenarios

Postby FrediFizzx » Sat Feb 22, 2014 5:09 pm

I'm sorry, the Codecogs server for LaTeX seems to be down again. You should edit your math above to be ascii text format.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Computer Simulation of EPR Scenarios

Postby Joy Christian » Sat Feb 22, 2014 5:11 pm

Zen wrote:A few probabilistic comments about definition (A.9.1) in this document http://libertesphilosophica.info/blog/w ... 1/EPRB.pdf


The above two page document is a summary of more detailed and extensive argument: http://libertesphilosophica.info/blog/w ... hapter.pdf.

See also the appendix of this paper: http://arxiv.org/abs/1211.0784.

Finally, it is important to note that I am working within S^3, not R^3. In S^3 the set is not a null set: http://libertesphilosophica.info/blog/w ... mplete.pdf.

Zen wrote:It is a good idea to say explicitly that has a uniform distribution on the interval . There are infinitely many distributions with this support.


This is an important comment and may be significant for the slight discrepancy Gill has been reporting. In particular, instead of theta_o it is better to take e_o and g_o as two uniformly distributed random vecotrs on S^2, satisfying eq.(10) of the above one-page document.


PS: I can read the equations too.
Last edited by Joy Christian on Sat Feb 22, 2014 5:38 pm, edited 2 times in total.
Joy Christian
Research Physicist
 
Posts: 2793
Joined: Wed Feb 05, 2014 4:49 am
Location: Oxford, United Kingdom

Re: Computer Simulation of EPR Scenarios

Postby FrediFizzx » Sat Feb 22, 2014 5:15 pm

Must be a DNS problem as I can't see them. Only image placeholders.
Update: Tried resetting my cable modem, router, etc. Still no go. Well... not the first time Time Warner Cable has had DNS problems. But I tried over my phone (not thru TWC but thru ATT) and still no math images and I can't even get on codecogs.com website to report the problem. Strange indeed!
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Computer Simulation of EPR Scenarios

Postby minkwe » Sat Feb 22, 2014 10:04 pm

I've been too busy to participate in this thread but I do not see the observed discrepancy when I run my python code, probably because as you can see on line 26 of the code, the way the p distribution is obtained is specific. I do not uniformly select t from 0 to pi/2 and then calculate 1/2 sin(t)^2. Rather, I generate a uniformly spaced set of t from 0 to pi/2, calculate 1/2 sin(t)^2 for each value in this set, then randomly pick p values from this set, with replacement.
minkwe
 
Posts: 1441
Joined: Sat Feb 08, 2014 10:22 am

Re: Computer Simulation of EPR Scenarios

Postby FrediFizzx » Sat Feb 22, 2014 10:56 pm

Yes, your python program is a bit more sophisticated than the others so I would expect better results. But since I improved John Reed's Mathematica translation by taking out the Abs function in the Ceiling process, it has been working well. And much easier for me to understand. I did download Python for Windows but got busy with other stuff and haven't installed it yet. But it may be better to fire up my Linux box and run it on that. Anyways, it is pretty easy to see what is going on using the Mathematica version.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

PreviousNext

Return to Sci.Physics.Foundations

Who is online

Users browsing this forum: ahrefs [Bot] and 128 guests

CodeCogs - An Open Source Scientific Library