\section{Conclusion\label{section:conclusion}}

We have implemented a simulation with the following characteristics:
\begin{itemize}

\item The simulation is composed of a cellular automaton embedded in a reactive environment providing global instants and broadcast events.

\item The basic components are threads that are executed in synchronous parallelism. Each cell of the cellular automaton is implemented by a thread. After detection, each particle is animated by several threads of the reactive environment.

\item The cells living at instant $t$ code the superposition state of the particle at instant $t$. Before detection, the evolution of the particle is defined by the cellular automaton rule ({{\bf U}} procedure).

\item Detection of a particle generates a broadcast event, instantaneously received by all the corresponding living cells of the cellular automaton.

\item After detection, living cells are instantaneously reset, and a particle animated by the reactive environment is created. The state of the created particle is randomly chosen among the basic states composing the superposition  ({{\bf R}} procedure). This is the only source of nondeterminism in the simulation.

\item Entanglement of particles basically means that they share the same procedure {{\bf R}}. The shared event corresponding to {{\bf R}} is instantaneously broadcast to all entangled particles by the reactive environment.

\end{itemize}

There are at least two regards in which the simulation could certainly be improved:
\begin{itemize}
\item In the current simulation, superposition states are segments; they could be replaced by circular shapes centered on the source. Hexagonal CA's could be useful for that purpose.

\item One may wonder how to introduce gravity, for particles that have a mass.  With real particles, this is not a problem: gravity can be naturally implemented as a field. But it is not clear how to introduce gravity when the particle is virtual (the cell rule of the cellular automaton should implement it).

\end{itemize}

\section{Introduction}

The work described here is an exercise in parallel programming inspired
by Physics (more precisely, by R. Penrose's books
\cite{Penrose-NewMind,Penrose-Road}). Actually, it presents a simulation
intended to reflect three rather intriguing aspects of Quantum Mechanics (QM):

\begin{enumerate}

\item {\it Self-interference}: this is basically Young's
  experiment where a particle interferes with itself when passing through
  two slits.

\item {\it Superposition}: the state of a particle is a superposition of
several basic states which disappears when a measure occurs.

\item {\it Entanglement}: a measure performed on one element of a pair
  of entangled particles has an instantaneous effect on the other.

\end{enumerate}

The main objective of the simulation is to build global behaviours as
{\it parallel compositions} of elementary ones. The variant of
parallelism used is the {\it synchronous} one
\cite{Halbwachs-Synchrone}. The goal is not to exactly model reality
(actually, one gets something which is is {\it certainly not} a good
model of reality as it does not compute over probabilities) but to
mimic some aspects of it, linked to QM.

\input{mc}

We make the assumption of a discrete world built over a cellular
automaton (CA) \cite{ToffoliMargolus-CA}, implementing the {{\bf U}}
procedure. We do not model fields, which are non-discrete objects, but
CA's which are discrete ones. Actually, in CA's, both space and time
are discrete.  The rate at which a CA is simulated is the limit
speed\footnote{it can be considered as the ``light speed'' of the system.}
of the system. CA's are embedded in a synchronous world which is
actually the one of the simulation. There are thus {\it global
  instants} during which actions are considered as simultaneous. The
basic hypothesis is that the {{\bf U}} procedure is deterministic and local
(thus, not instantaneous, as it can take several instants for a change
to propagate in space). On the opposite, the {{\bf R}} procedure is
nondeterministic, global, and instantaneous (in a sense to be made
precise later).  The main basic notions are: synchronous parallelism,
determinism of {{\bf U}} and nondeterminism of {{\bf R}}, discrete space (CA)
and discrete time (synchrony hypothesis).

In the simulation, a (virtual) particle at instant $t$ is represented by a
set of cells living at instant $t$. Each cell is in a basic state of the
particle, and the particle global state is the superposition of all the
basic states of the associated cells. Basic states are identified by
specific colors and cells are drawn according to the basic state they
hold. When superposition disappears, after execution of procedure {{\bf R}}, one
cell is chosen randomly and the created (real) particle falls in the
basic state of the chosen cell (the particle then receives the color
of the cell).  Thus, the probability for a particle to fall in a given
basic state $\ket a$ depends on the number of cells holding this state: the
more there are cells holding $\ket a$, the more the probability to
choose $\ket a$ is high.

A measure is implemented by the emission of a broadcast event that is
instantaneously received by all the cells implementing the measured
object. This is basically the {{\bf R}} procedure. In reaction to {{\bf R}}, one cell
is nondeterministically chosen and the real particle is produced from
that cell (with its basic state).

A particle is virtual when it is implemented by the CA. It turns to
real after application of the {{\bf R}} procedure. A real particle is animated
by the synchronous simulation; it is a data structure with coordinates
and speed, animated by several elementary parallel behaviours (for
example, an inertia behaviour, which at each instant sets the
coordinates according to the speed, and a bouncing behaviour which
makes the particle bounce on the simulation borders\footnote{borders
  do not have any physical significance; they are there just to contain
  particles in a limited area.}.

The simulation basically shows the following aspects:
\begin{enumerate}
\item Self-interference is illustrated by Young's
  experiment where a particle is emitted  against a
  wall with two slits. The particle passes through both slits, which
  produces interferences. The simulation shows the production of
  interferences, and their disappearance when one slit is obstructed.

\item The simulation shows the production of a real particle when a
  detector reacts to the presence of a living cell; in this case, the {{\bf R}} procedure
  entails the reduction to a basic state.

\item Pairs of entangled particles are considered. The measure of one
element of the pair triggers the {{\bf R}} procedure for it, which produces a
real particle. The measure also triggers the {{\bf R}} procedure for the
second particle. Moreover, it forces the choice of the basic state of the real
particle produced from the second virtual particle.
\end{enumerate}

Section \ref{section:simulation} describes the simulation.  Section
\ref{section:implementation} describes the implementation and gives the
most important pieces of code.  Some related work is described in
Section \ref{section:related-work}. Finally, Section
\ref{section:conclusion} concludes the text.

\subsection{Young's Experiment}

A new wall is introduced in Figure \ref{slits} which separates the
simulation in two parts. In the left image, two slits are present; in
the right image, the right slit is obstructed.  This basically
corresponds to Young's experiment. In the right image, the structure
under the separation wall is reproduced over the
separation wall. In the left part, the two structures produced from the
two slits interfere when they overlap.

\begin{figure}[!htbf]
\begin{center}
\begin{tabular}{cc}
\includegraphics[width=220pt]{slit2.eps} &
\includegraphics[width=220pt]{slit1.eps}
\end{tabular}
\end{center}
\caption{Young's Experiment}
\label{slits}
\end{figure}

We now consider the detection of particles in Young's
experiment. Figure \ref{slits-2} shows the situation after
detection of 100 particles (in presence of 2 slits).

\begin{figure}[!htbf]
\begin{center}
\includegraphics[width=300pt]{prob2.eps}
\end{center}
\caption{Young's Experiment - 2}
\label{slits-2}
\end{figure}

Once the number of slits is fixed, all particles reach the detector in
the same superposition of basic states (because {{\bf U}} is deterministic and
local). When the {{\bf R}} procedure is executed, a cell is randomly chosen
from the superposition and the particle gets the cell basic state. The
probability for a particle to fall on the basic state $\ket a$ only depends
on the percentage of cells with state $\ket a$ appearing in the
superposition. The superposition state thus directly codes the
probabilities associated with the basic states. The probability of
a basic state $\ket a$ in a superposition $S$ is:

\begin{equation}
Prob (\ket a, S) = \frac {\#a \in S} {\#S}
\end{equation}

These probabilities depend on the number of slits, on the localisation
of the detector and on the localisation of the slits. Here is for
example a typical result (with 1000 particles):

\begin{center}
\begin{tabular}{|c|cccccc|}
                                                                                \hline
basic state      &0     &1    &2    &3    &4    &5      \\ \hline
1 slit               & 0.327 & 0.023 & 0.281 & 0.153 & 0.017 & 0.199   \\ \hline
2 slits             & 0.226 & 0.039 & 0.298 & 0.171 & 0.116 & 0.150    \\ \hline

\end{tabular}
\end{center}
\noindent
In the configuration from which this table is produced, a particle
has for example probability 0.327 to fall in state 0 with 1 slit,
while it has probability 0.226 to fall in the same state with 2 slits.