A code for trained lattice
In our quest for a local-realistic model for Quantum Mechanics, we have discussed in the last post how the lattice - that mediates locally the interactions between single instances of a same ensemble of particles - is progressively "trained" as subsequent particles are emitted.
With the lattice already trained, the Matlab code discussed in this post can be strongly simplified as shown below.
%%% Simulate an ensemble of Np particles emitted at intervals Nti
%%% from either of Ns distinct sources xs(1,...,Ns) having
%%% probability Ps(1,...,Ns). Evaluate the frequency of arrivals at %%% a 'screen' after Nt iterations.
%%%
%%% Parameters: Np,Ns,Nt,Nti,xs,Ps.
%%%
%%% Evaluate the number of possible bosons for this scenario.
B = Ns*(Ns-1)/2;
%%% Evaluate a priori the probability of each Quantum Reset
iB = 0;
for i = 1:Ns-1
for j = i+1:Ns
iB = iB+1;
Pb(iB) = 2*Ps(i)*Ps(j);
dd(iB) = abs(xs(i)-xs(j));
end
end
%%% Start simulating
%
for i = 1:Np
%%% Pre-allocate particle boson momenta (w) and lifetime (k)
k = zeros(1,B);
w = zeros(1,B);
%%% Attribute a random source momentum (v0)
v0 = -1+2*rand;
%%% Choose the source node according to probability vector
x0 = xs(find(rand<cumsum(Ps),1,'first'));
%%% Position the particle to be emitted at the source node x0
x = x0;
%%% Initialize span l
l = 0;
%%% Simulate Nt time steps
for t = 1:Nt
%%% Evaluate momentum and energy propensity
vQ = sum(w);
V = v0-2*vQ;
e = (1+V^2)/2;
%%% Attribute a momentum v
v1 = [1,0,-1];
v = v1(find(rand<[(e+V)/2,1-(e-V)/2,1],1,'first'));
%%% Increase the particle's position s according to momentum
x = x+v;
%%% Increase the particle's span
l = l+v;
%%% Update PB lifetime and momenta
k = k+1;
w = w.*(1-1./(2*k));
%%% Detect Quantum Reset
r1 = rand;
if r1 < sum(Pb)
%%% Detect boson type involved
iB = find(rand<cumsum(Pb),1,'first');
%%% Reset momentum and lifetime of PB of type iB
k(iB) = 0;
w(iB) = sin(pi*dd(iB)*x/t)/(pi*dd(iB));
end
end
end
%%% Record arrival node for further analysis
X(i) = x;
end
With the lattice already trained, the Matlab code discussed in this post can be strongly simplified as shown below.
%%% Simulate an ensemble of Np particles emitted at intervals Nti
%%% from either of Ns distinct sources xs(1,...,Ns) having
%%% probability Ps(1,...,Ns). Evaluate the frequency of arrivals at %%% a 'screen' after Nt iterations.
%%%
%%% Parameters: Np,Ns,Nt,Nti,xs,Ps.
%%%
%%% Evaluate the number of possible bosons for this scenario.
B = Ns*(Ns-1)/2;
%%% Evaluate a priori the probability of each Quantum Reset
iB = 0;
for i = 1:Ns-1
for j = i+1:Ns
iB = iB+1;
Pb(iB) = 2*Ps(i)*Ps(j);
dd(iB) = abs(xs(i)-xs(j));
end
end
%
for i = 1:Np
%%% Pre-allocate particle boson momenta (w) and lifetime (k)
k = zeros(1,B);
w = zeros(1,B);
%%% Attribute a random source momentum (v0)
v0 = -1+2*rand;
%%% Choose the source node according to probability vector
x0 = xs(find(rand<cumsum(Ps),1,'first'));
%%% Position the particle to be emitted at the source node x0
x = x0;
%%% Initialize span l
l = 0;
%%% Simulate Nt time steps
for t = 1:Nt
%%% Evaluate momentum and energy propensity
vQ = sum(w);
V = v0-2*vQ;
e = (1+V^2)/2;
%%% Attribute a momentum v
v1 = [1,0,-1];
v = v1(find(rand<[(e+V)/2,1-(e-V)/2,1],1,'first'));
%%% Increase the particle's position s according to momentum
x = x+v;
%%% Increase the particle's span
l = l+v;
%%% Update PB lifetime and momenta
k = k+1;
w = w.*(1-1./(2*k));
%%% Detect Quantum Reset
r1 = rand;
if r1 < sum(Pb)
iB = find(rand<cumsum(Pb),1,'first');
%%% Reset momentum and lifetime of PB of type iB
k(iB) = 0;
w(iB) = sin(pi*dd(iB)*x/t)/(pi*dd(iB));
end
end
end
%%% Record arrival node for further analysis
X(i) = x;
end
Note that all calculations involving the lattice traces and the lattice boson momenta have disappeared. The detection of a Quantum Reset is made directly using probabilities of such events (of the type PiPj for boson type ij). The Reset of particle boson momenta is made by taking the steady-state values of the lattice boson momenta.
An example simulation with this code is given below. The scenario is the same two-slit experiment already treated in the previous post. Only, the number of iterations and particle emissions can be increased dramatically, while keeping the computing time reasonably low. Having used Nt = 500, Np = 500,000, the Matlab simulation took a few minutes on my computer. Also, the computed distribution of the number of arrivals at the "screen" placed at Nt has converged closer to the theoretical probability density. Much better!
An example simulation with this code is given below. The scenario is the same two-slit experiment already treated in the previous post. Only, the number of iterations and particle emissions can be increased dramatically, while keeping the computing time reasonably low. Having used Nt = 500, Np = 500,000, the Matlab simulation took a few minutes on my computer. Also, the computed distribution of the number of arrivals at the "screen" placed at Nt has converged closer to the theoretical probability density. Much better!
![]() |
Number of particle arrivals at Nt = 500 (blue) obtained with the lattice-trained code (Np = 500,000) for a double-slit scenario, and QM probability density (red) |
Comments
Post a Comment