\documentclass[./schrodinger_simulation.tex]{subfiles}

\begin{document}
\section{Theoretical background}\label{sec:theory}
Scientists have made use of light in devices leading to...

The use of light have facilitated many discoveries through history. The invention  
of the compound microscope, which used lenses to focus light, led to the first 
observation of animal cells. And the telescope, which led to a greater understanding 
of the universe. 

The nature of light has long been a subject of interest and discussion. Around year
1600 the first microscope was invented, which made use of light through lenses.  
The observation made using the microscope led to a greater understanding of the 
world at a microscopic scale. However, the study of light itself have led to (something).

Through the 1600s, the view shifted from particle to wave. 
% Introduction?
The nature of light has long been a subject of interest and discussion, from the 1500s 
and the invention of microscopes, through the 1700s where both a particle theory 
and a wave theory. In the late 1600s, Christiaan Huygens proposed the wave theory of light, 
which was challenged by Isaac Newton's particle theory. The particle theory was 
the leading theory in the beginning of 1800s, when Thomas Young demonstrated 
the interference of light, through his double-slit experiment. The wave theory found 
new hold. 

In the 1800s, the study of ideal black bodies done by Gustav R. Kirchhoff, lead to a 
better understanding of heat radiation. Wilhelm Wien started working on determining the 
spectral energy distribution, and Wien's law. The law did make sense for high frequencies, 
however, as there were inconsistencies when the frequency were lower than a threshold value. 
Wiens law led to an exponential curve, which disagree with the law of conservation.

Max Planck guessed a solution to the problem, which led to Planck's radiation law.
He later derived the radiation law using Boltzmanns statistical interpretation of 
the second law of thermodynamics. 
Plancks findings gave rise to the quantum hypothesis, and later Einsteins wave-particle 
duality \cite{britannica:1998:planck}.  

For small atoms classical mechanics are not sufficient in describing the position of a particle,
and Heisenberg uncertainty priciple suggest that the particles have a wavelike behavior.
The wave-particle duality was later proposed to apply to particles by Louis de Broglie,
which inspired Erwin Schrödinger who proposed a wave function to describe the quantum 
state of a particle, resulting in the wave equation.

% Methods?
% Double-slit experiment
Thomas Young first performed the double-slit experiment in 1801, to demonstrate 
the principle of interference of light \cite{britannica:2023:young}, postulating 
light as waves. In the study of blackbodies, scientists were not able to describe 
the radiated intensity of increased frequencies using classical mechanichs, as they 
contradicted the principle of conservation of energy \cite{britannica:1998:planck}. 
Max Planck assumed that the radiated energy consist of discrete values, or quanta, 
to describe the peak in radiated energy. 

% Reference: https://tex.stackexchange.com/questions/469109/how-to-change-arrowheads-to-lie-on-a-plane
\begin{tikzpicture}[scale=1.25,every node/.append style={transform shape}]
    \foreach \x in {-1,-0.75,...,0} {
        \draw (\x,-1) -- (\x,1);
    }
    \draw[fill=black!10] (0.5,-2,-1) -- (0.5,-2,1) -- (0.5,2,1) -- (0.5,2,-1) -- (0.5,-2,-1);
    \fill (0.5,0,0) circle (0.05);
    \foreach \r in {0.25,0.5,...,1.75} {
        \draw (0.5,0) ++(-60:\r) arc (-60:60:\r);
    }
    \draw[fill=black!10] (2,-2,-1) -- (2,-2,1) -- (2,2,1) -- (2,2,-1) -- (2,-2,-1);
    %\fill (2,0.5) circle (0.05) (2,-0.5) circle (0.05);
    \foreach \r in {0.25,0.5,...,2} {
        \draw (2,0.5) ++(-60:\r) arc (-60:60:\r);
        \draw (2,-0.5) ++(-60:\r) arc (-60:60:\r);
    }
    \draw[fill=black!10] (4,-2,-1) -- (4,-2,1) -- (4,2,1) -- (4,2,-1) -- (4,-2,-1);
%       LABELLING
        \begin{scope}[canvas is yz plane at x=2,rotate=-90]
            \node[circle,inner sep=0.5mm,fill,label=above:{S${}_1$}] at (0,0.5){};
            \node[circle,inner sep=0.5mm,fill,label=below:{S${}_2$}] at (0,-0.5) {};
            \draw[dash pattern=on 1.5pt off 1pt,thin] (-0.5,0.5) -- (0,0.5)
            (-0.5,-0.5) -- (0,-0.5);
            \pgflowlevelsynccm          
            \draw[|<->|] (-0.5,0.5) -- (-0.5,-0.5) node[midway,right=-0.1cm] {d};
        \end{scope}
        \begin{scope}[canvas is yz plane at x=0.5,rotate=-90]
            \node[below left=-0.1cm] at (0,0) {S${}_0$};
        \end{scope}
    \begin{scope}[xshift=4cm,yshift=2cm,rotate=-90,canvas is xy plane at z=0]
        \fill[white] (0,0) rectangle (4,4);
        \begin{axis}[
            width=5.575cm,
            xmin=-0.5,
            xmax=0.5,
            ticks=none
        ]
            \addplot [samples=1000,blue
            ]
            {(cos(deg(5*pi*sin(deg(x)))))^(2)*((sin(deg(4*pi*sin(deg(x)))))/(4*pi*sin(deg(x))))^(2)};
        \end{axis}
    \end{scope}
    \draw[thin,densely dashed,blue] (2,0) -- (6.9,0);
    \draw[thin,densely dashed,blue] (2,0) -- +(15:2.5);
    \draw[thin,densely dashed,blue] (2,0) -- +(-15:2.5);
    \draw[thin,densely dashed,blue] (2,0) -- +(32:2.5);
    \draw[thin,densely dashed,blue] (2,0) -- +(-32:2.5);
\end{tikzpicture}

% Author: Izaak Neutelings (June 2020)
% Inspiration:
%  https://courses.physics.ucsd.edu/2011/Summer/session1/physics2c/diffraction.pdf
%  https://tex.stackexchange.com/questions/201830/periodic-shading-in-tikz
% \begin{tikzpicture}[
%     nodal/.style={mylightgreen,dashed,very thin},
%     declare function={
%       %xnode(\n,\dn,\lam,\f) = sqrt( (\n^2+(\n+\dn)^2)*\lambd^2/2 - (\n^2-(\n+\dn)^2)^2*\lambd^4/(4*\a^2) - \a^2/4 );
%       xnode(\n,\dn,\lam,\f) = \lam/\f*sqrt( \n^2*(\f^2-\dn^2)+\n*\dn*(\f^2-\dn^2)+\dn^2*\f^2/2-(\f^4+\dn^4)/4 );
%       ynode(\n,\dn,\lam,\a) = (2*\n*\dn+\dn^2)*\lam/(2*\f);
%       intensity(\y,\lam,\a,\L) = cos(180*\a*\y/(2*\lam*sqrt(\L*\L+\y*\y)))^2;
%     }
%   ]
  
%   \def\L{3.8}       % distance between walls
%   \def\H{5.4}       % total wall height
%   \def\h{2.8}       % plane wave height
%   \def\t{0.15}      % wall thickness
%   \def\a{1.15}      % slit distance
%   \def\d{0.20}      % slit size
%   \def\N{21}        % number of waves
%   \def\lambd{0.20}  % wavelength
%   \def\R{\N*\lambd} % wave radius
%   \def\Nlines{3}    % number of nodal lines
%   \def\A{1.6}       % amplitude
%   %\def\r{0.06}      % point source radius
%   %\def\nmax{10}
%   \def\nsamples{100}
%   \def\ang{62}
  
%   \begin{scope}
%     \clip (-\t/2,-\H/2) rectangle (\L,\H/2);
%     %\clip (-\t/2,0.7*\a) -- (0.6*\L,\H/2) -- (\L,\H/2) --
%     %      (\L,-\H/2) -- (0.6*\L,-\H/2) -- (-\t/2,-0.7*\a) -- cycle;
    
%     % NODAL LINES
%     \draw[nodal]
%       (0.08*\N*\lambd,0) -- (1.06*\R,0);
%     \coordinate (NP0) at (\L,0);  % to avoid "Dimension too large error"
%     \foreach \dn [evaluate={
%                    \f=\a/\lambd;
%                    \nmin=2.5+0.2*\dn; %0.501*(-\dn+\f)
%                    \nmax=10; %(NP0)
%                    \c=int(\dn<\f);
%                    \y=\L/sqrt((\a/(\lambd*\dn))^2-1);
%                  }] in {1,...,\Nlines}{
%       \coordinate (NP+\dn) at (\L,\y);  % to avoid "Dimension too large error"
%       \coordinate (NP-\dn) at (\L,-\y); % to avoid "Dimension too large error"
%       \ifnum\c=1
%         \draw[nodal,variable=\n,samples=\nsamples,smooth]
%           plot[domain=\nmin:\nmax] ({xnode(\n,\dn,\lambd,\f)},{ynode(\n,\dn,\lambd,\f)})
%           -- (NP+\dn);
%         \draw[nodal,variable=\n,samples=\nsamples,smooth]
%           plot[domain=\nmin:\nmax] ({xnode(\n,\dn,\lambd,\f)},{-ynode(\n,\dn,\lambd,\f)})
%           -- (NP-\dn);
%       \fi
%     }
    
%     % WAVES
%     \foreach \i [evaluate={\R=\i*\lambd;}] in {1,...,\N}{
%       \ifodd\i
%         \draw[myblue,line width=0.8] (0,\a/2)++(\ang:\R) arc (\ang:-\ang:\R);
%         \draw[myred,line width=0.8] (0,-\a/2)++(\ang:\R) arc (\ang:-\ang:\R);
%       \else
%         \draw[myblue!80,line width=0.1] (0,\a/2)++(\ang:\R) arc (\ang:-\ang:\R);
%         \draw[myred!80,line width=0.1] (0,-\a/2)++(\ang:\R) arc (\ang:-\ang:\R);
%       \fi
%     }
%   \end{scope}
  
%   % PLANE WAVES
%   \foreach \i [evaluate={\x=-\i*\lambd;}] in {0,...,5}{
%     \ifodd\i
%       \draw[myblue,line width=0.8] (\x,-\h/2) -- (\x,\h/2);
%     \else
%       \draw[myblue,line width=0.1] (\x,-\h/2) -- (\x,\h/2);
%     \fi
%   }
  
%   % WALL
%   \fill[wall]
%     (\t/2,\a/2-\d/2) rectangle (-\t/2,-\a/2+\d/2)
%     (\t/2,\a/2+\d/2) rectangle (-\t/2,\H/2)
%     (\t/2,-\a/2-\d/2) rectangle (-\t/2,-\H/2)
%     (\L,-\H/2) rectangle (\L+\t,\H/2);
  
%   % SHADES
%   \begin{scope}[shift={(1.08*\L,0)}]
%     \def\yz{\L/sqrt((\a/\lambd)^2-1)} % m = +- 1/2
%     \def\yZ{\L/sqrt((\a/\lambd/2)^2-1)} % m = +- 1
%     \clip (0,-\H/2) rectangle (1.1*\A,\H/2);
%     \fill[white] (0,-\H/2) rectangle++ (\A,\H); % to fill seams
%     \foreach \i [evaluate={\n=0.5*\i;\yn=\L/sqrt((\a/(2*\lambd*\n))^2-1);
%                  }] in {1,...,\Nlines}{
%       \ifodd\i % if even
%         \fill[myshadow] (0,{-\yn-0.1}) rectangle++ (\A,0.2); % to fill seams
%         \fill[myshadow] (0,{ \yn-0.1}) rectangle++ (\A,0.2); % to fill seams
%       \fi
%     }
%     \path[left color=myshadow,right color=myshadow,middle color=white,shading angle={180}]
%       (0,{-\yz}) rectangle (\A,{\yz});
%     \foreach \i [evaluate={
%                   \n=0.5*\i;
%                   \m=0.5*(\i+1);
%                   \yn=\L/sqrt((\a/(2*\lambd*\n))^2-1);
%                   \ym=\L/sqrt((\a/(2*\lambd*\m))^2-1);
%                   \dang=mod(\i,2)*180;
%                  }] in {1,...,\Nlines}{
%       \path[left color=myshadow,right color=white,shading angle={\dang}]
%         (0,\yn) rectangle (\A,\ym);
%       \path[left color=myshadow,right color=white,shading angle={180+\dang}]
%         (0,-\yn) rectangle (\A,-\ym);
%     }
%   \end{scope}
  
%   % INTENSITY
%   \begin{scope}[shift={(1.1*\L+1.1*\A,0)}]
%     \draw[->,thick] (-0.08*\A,0) -- (1.3*\A,0) node[right=-2] {$\expval{I}$}; % I axis
%     \draw[->,thick] (0,-0.52*\H) -- (0,0.54*\H) node[right] {$y$}; % y axis
%     \draw[nodal] (NP0) --++ (0.15*\L+2.1*\A,0); % green nodal lines
%     \foreach \i [evaluate={\y=\L/sqrt((\a/(\lambd*\i))^2-1)}] in {1,...,\Nlines}{ % green nodal lines
%       \draw[nodal] (NP+\i) --++ ({0.15*\L+1.1*\A+\A*intensity(\y,\lambd,\a,\L)},0);
%       \draw[nodal] (NP-\i) --++ ({0.15*\L+1.1*\A+\A*intensity(\y,\lambd,\a,\L)},0);
%     }
%     \draw[myred,thick,variable=\y,samples=\nsamples,smooth,domain=-\H/2:\H/2]
%       plot({\A*intensity(\y,\lambd,\a,\L)},\y);
%     \foreach \i [evaluate={ % ticks
%         \modd=\i; %int(\i);
%         \meven=int(\i-1);
%         \y=\L/sqrt((\a/(\lambd*\i))^2-1);
%                 }] in {1,...,\Nlines}{
%       \ifodd\i
%         \tick{0,-\y}{180} node[right=0,scale=0.85] {$m=-\frac{\modd}{2}$};
%         \tick{0,\y}{180} node[right=0,scale=0.85] {$m=+\frac{\modd}{2}$};
%       \else
%         \tick{0,-\y}{180} node[right=0,scale=0.85] {$m=-\meven$};
%         \tick{0,\y}{180} node[right=0,scale=0.85] {$m=+\meven$};
%       \fi
%     }
%   \end{scope}
  
% \end{tikzpicture}

% Schrödinger
% -----------
% The wave equation, Schrödinger equation has a general form 
% \begin{align}
%     i \hbar \frac{\partial}{\partial t} | \Psi \rangle &= \hat{H} | \Psi \rangle \ ,
%     \label{eq:schrodinger_general}
% \end{align}
% where $i$ is the imaginary number, and $\hbar$ is Plancks constant. Here $| \Psi \rangle$ 
% is the quantum state and $\hat{H}$ is a Hamiltonian operator. % which represent the energy of the system 
% For two-dimensional position space, the quantum state can be expressed using the 
% time-dependent complex-valued wave function $\Psi (x, y, t)$. The square modulus of the wave function $|\psi|^{2}$, predicts probability of finding the particle at position $(x, y)$ at time t. 
% % Segue to Born
% The modulus of the wave function, is related to the probability density function 
% \begin{align}
%     p(x, y \ | \ t) &= |\Psi(x, y, t)|^{2} = \Psi^{*}(x, y, t) \Psi(x, y, t)
%     \label{eq:born_rule}
% \end{align}
% using the Born rule, where $^{*}$ denotes the complex conjugated wave function. 
% When the potential is time-independent, the Schrödinger equation can be expressed as 
% \begin{align*}
%     i \hbar \frac{\partial}{\partial t} \Psi (x, y, t) &= - \frac{\hbar^{2}}{2m} \bigg( \frac{\partial^{2}}{\partial x^{2}} + \frac{\partial^{2}}{\partial y^{2}} \bigg) \Psi (x, y, t) \\
%     & \quad + V(x, y, t) \Psi (x, y, t) \numberthis \ .
%     \label{eq:schrodinger_special}
% \end{align*}
% When we scale Schrödinger equation by the dimensionful variables, we are left with 
% a wave function $u$, potential $v$ and the dimensionless equation
% \begin{align}
%     i \frac{\partial u}{\partial t} &= - \frac{\partial^{2} u}{\partial x^{2}} - \frac{\partial^{2} u}{\partial y^{2}} + v(x, y) u \ .
%     \label{eq:schrodinger_dimensionless}
% \end{align}

% Crank-Nicolson
% --------------
% To evaluate the position of a single particle, we have to consider partial differential 
% equations (PDE). To solve these numerically, we have to discretize Equation \eqref{eq:schrodinger_dimensionless}. 
% We use the Crank-Nicolson method (CN), which combines the forward and backward finite 
% difference method. 
% Include the general $\theta$-method 
% Using the $\theta$-rule \footnote{For $\theta \in [0, 1]$ we can derive Forward Euler using $\theta = 1$, Backward Euler using $\theta = 0$, and $\theta = 1/2$ gives Crank-Nicolson} 
% with $\theta = 1/2$, CN can be written as 
% \begin{align}
%     \frac{u_{\ivec, \jvec}^{n+1} - u_{\ivec, \jvec}^{n}}{\Delta t} &= \frac{1}{2} \bigg[ F_{\ivec, \jvec}^{n+1} + F_{\ivec, \jvec}^{n} \bigg] \ .
%     \label{eq:crank_nicolson}
% \end{align}
% To simplify notation and avoid confusion of indices with the imaginary number $i$, 
% we have used the notation $\ivec, \jvec$ in subscript to indicate the commonly named indices $i, j$ 
% in x- and y-direction. In addition, the superscript $n, n+1$ indicate position in time. 
% We use CN to derive the discretized Schrödinger equation 
% \begin{align*}
%     & u_{\ivec, \jvec}^{n+1} - \frac{i \Delta t}{2 \Delta x^{2}} \big[ u_{\ivec+1, \jvec}^{n+1} - 2u_{\ivec, \jvec}^{n+1} + u_{\ivec-1, \jvec}^{n+1} \big] \\
%     & - \frac{i \Delta t}{2 \Delta y^{2}} \big[ u_{\ivec, \jvec+1}^{n+1} - 2u_{\ivec, \jvec}^{n+1} + u_{\ivec, \jvec-1}^{n+1} \big] + \frac{i \Delta t}{2} v_{\ivec, \jvec} u_{\ivec, \jvec}^{n+1} \\
%     &= u_{\ivec, \jvec}^{n} + \frac{i \Delta t}{2 \Delta x^{2}} \big[ u_{\ivec+1, \jvec}^{n} - 2u_{\ivec, \jvec}^{n} + u_{\ivec-1, \jvec}^{n} \big] \\
%     & \quad + \frac{i \Delta t}{2 \Delta y^{2}} \big[ u_{\ivec, \jvec+1}^{n} - 2u_{\ivec, \jvec}^{n} + u_{\ivec, \jvec-1}^{n} \big] - \frac{i \Delta t}{2} v_{\ivec, \jvec} u_{\ivec, \jvec}^{n} \numberthis \ .
%     \label{eq:schrodinger_discretized} 
% \end{align*}
% The full derivation of both Equation \eqref{eq:crank_nicolson} and Equation \eqref{eq:schrodinger_discretized} 
% can be found in Appendix \ref{ap:crank_nicolson}. 

% Implementation
The implementation of CN is simplified usein Dirichlet boundary conditions, which 
can be found in Table \ref{tab:dirichlet}. In addition, we use Gaussian wave packets 
for the initial wave function 
\begin{align}
    u(x, y, t=0) = e^{- \frac{(x-x_{c})^{2}}{2 \sigma_{x}^{2}} - \frac{(y-y_{c})^{2}}{2 \sigma_{y}^{2}} + ip_{x}x + ip_{y}y}
\end{align}
\begin{algorithm}[H]
    \caption{Crank-Nicolson scheme}
    \label{algo:cn_scheme}
    \begin{algorithmic}
            \Procedure{Crank-Nicolson}{$args$}
            \State Insert pseudo code $var \leftarrow \text{ some text}$
            \EndProcedure
    \end{algorithmic}
\end{algorithm}


\section{Notes}\label{sec:notes}
\subsection*{Introduction - draft 2}
In classical mechanics we study the kinematics and dynamics of physical objects, 
ignoring their intrinsic properties for simplicity. It allows us to describe the 
forces acting on an object as well as the motion of the object. We can describe 
a planets orbital movement \cite{britannica:2023:kepler}, calculate the ... necessary 
to launch satellites into orbit, or simply figure out where a ball is going to land 
when you throw it... However, when want to study an object at a microscopic level, 
e.g. a single atom, classical mechanics falls short. 

% Thomas Young first performed the double-slit experiment in 1801, to demonstrate 
% the principle of interference of light \cite{britannica:2023:young}, postulating 
% light as waves. In the study of blackbodies, scientists were not able to describe 
% the radiated intensity of increased frequencies using classical mechanichs, as they 
% contradicted the principle of conservation of energy \cite{britannica:1998:planck}. 
% Max Planck assumed that the radiated energy consist of discrete values, or quanta, 
% to describe the peak in radiated energy. 

Light as particles -> waves -> particles/packets
Erwin Schrödinger wanted to find a mathematical description of the wave characteristics 
of matter, supporting the wave-particle idea. He postulated a function which varies 
with position, where the function swuared can be interpreted as the probability 
of finding an electron at a given position. 

\subsection*{Introduction - draft 1}
In classical mechanics, we study the motion of particles at a macroscopic ,using 
physical laws such as Newtons second law. These laws and concepts were used to solve 
the motion of the planets. 

However, when we zoom in on a single atom, at a microscopic level, classical mechanics 
are no longer sufficient in describing the motion of particles. That is, elementary 
particles do not behave in a way which can be described using classical mechanics. 
Introducing quantum mechanics, where a quantum is the minimum amount of something, 
such as an elementary particle of a given field. 

Beginning with the study of blackbodies and radiation, radiated intensity as a 
function of frequency, contradicting the principle of conservation of energy. Max 
Planck derived an equation Plancks Law, electromagnetic energy takes the form of 
quanta (discrete packets now known as photons). Energy of the photon is equal to 
plancks constant times the freq of light.

Thomas Young first performed the double-slit experiment in 1801, to demonstrate 
the principle of interference of light \cite{britannica:2023:young}, postulating 
light as waves.  

In the 1860s James Clerk Maxwell predicted that light waves consisted of coupled 
electric and magnetic fields.

Erwin Schrödinger wanted to find a wave equation for matter when classical mechanics 
fell short, the wave function. The wave function squared can be interpreted as the 
probability of finding an electron at a given position. Schrödingers equation can 
be solved for the hydrogen atom, wave equation of the energy levels for a hydrogen 
atom. The time-dependent equation also shows how a quantum state evolves with time 
\cite[p. 81]{wu:2023:quantum}.

\subsection*{Research material}
Simulating the double-slit experiment requires solving partial differential equations, 
when the number of spatial variables increases so does the complexity of the problem. 

Crank-Nicolson set out to find a numerical method to solve the diffusion equation, 
with a higher stability than the explicit and implicit schemes. Combining both schemes, 
they developed a finite difference method where a solution is stable for all dx and dt.

To solve equations, such as Schrödingers, numerically, a discretized equation is 
derived using difference methods of explicit and implicit scheme.

Distribution of particle position.
The wave function can be interpreted in several ways, not unity in agreement, does it apply to one electron, or a system of electrons. Use to find probabilities of measurements. Probability (squared) of finding the electron at a given position, need to do measurements many times for statistical reasons...

energy defined in quanta, photoelectric effect

Applying the wave-particle duality to matter, allows us to analyze the behavior of elementary particles more accurately.

Heisenberg uncertainty principle

diffraction and interference, describing waves through double slit experiment (Thomas Young). Diffraction pattern where light interfere constructively result in bright spots, whereas destructive interference result in dark spots. 

Path difference: distance between the center of each slit times sine of the angle between the point on the screen and the slits.

Progress in quantum mechanics without knowing how it works!
- Quantum is the minimum amount of something, elementary particle of a given field, smallest unit of excitation in a fundamental field (inject energy).
- Planck: father of quantum mechanics
Quantum mechanics (MIT open course ware):
- superposition principle: an object can simultaneously appear in two different places or have two different velocities \cite[p. 3]{wu:2023:quantum}
- quantum randomness: the outcome of a measurement is random when a particle is in a superposition of two positions.
- electron color: black or white, hardness: hard or soft
- Identical particles: an absolute in quantum mechanics, two particles can't be distinguished from each other. 
- Wave-Particle duality: Electrons are waves, and can form standing waves around protons.
- Schrödinger equation: wave equation of the energy levels for a hydrogen atom. It also shows how a quantum state evolves with time \cite[p. 81]{wu:2023:quantum}. 
\begin{align}
    i\hbar \frac{\partial}{\partial t} \Psi (x, y, t) &= - \frac{\hbar^{2}}{2m} \bigg( \frac{\partial^{2}}{\partial x^{2}} + \frac{\partial^{2}}{\partial y^{2}} \bigg) \Psi (x, y, t) + V(x, y, t) \Psi (x, y, t)
\end{align}
- $\psi$ is a wave function and describes the quantum state of a particle at time t. The square modulus of the wave function $|\psi|^{2}$, predicts probability of finding the particle at position $(x, y)$ at time t. 
- lhs: describe the rate of change of a wave function over time t. 
- rhs: describe the variation of the wave function in space.
- eq: describe the relation between the lhs and rhs, formulation of wave-particle duality.

Partial differential equations
- problems with many variables, constrained by boundary conditions and initial values.

Diffusion equation: describe the density of a quantity as a function of time, where the flux density obeys the Gauss-Green theorem (div = 0).
Crank-Nicolson: combines the implicit and explicit methods in solving a pde, rewriting the pde as a set of mat-vec multiplications.
Originally the method was derived for the diffusion 
equation, however, it can be used for the wave equation as well.

Wave equation in two dimensions (lec. p. 322), discretize position and time, to obtain 
\begin{align*}
    u_{\ivec, \jvec}^{n+1} &- r [ u_{\ivec+1, \jvec}^{n+1} - 2u_{\ivec, \jvec}^{n+1} + u_{\ivec-1, \jvec}^{n+1}] - r [ u_{\ivec, \jvec+1}^{n+1} - 2u_{\ivec, \jvec}^{n+1} + u_{\ivec, \jvec-1}^{n+1}] + \frac{i \Delta t}{2} v_{\ivec, \jvec} u_{\ivec, \jvec}^{n+1} \\
    &= u_{\ivec, \jvec}^{n} + r [ u_{\ivec+1, \jvec}^{n} - 2u_{\ivec, \jvec}^{n} + u_{\ivec-1, \jvec}^{n}] + r [ u_{\ivec, \jvec+1}^{n} - 2u_{\ivec, \jvec}^{n} + u_{\ivec, \jvec-1}^{n}] - \frac{i \Delta t}{2} v_{\ivec, \jvec} u_{\ivec, \jvec}^{n}
\end{align*}
Goal: Simulate the two-dimensional time-dependent schrödinger equation, to study a double-slit-in-a-box setup.
% Introduction
The double-slit experiment, interference using slits observe result on canvas. An experiment by Thomas Young to demonstrate the wave-particle duality of light. Electrons are waves as well as particles. 

When we consider an elementary particle, classical physics are not sufficient in describing the particles position in time. We introduce a probability density function for detecting the particle at a given position. 

We can study the quantum state of a particle in two dimensions, using Schrödinger's equation and the wave function. The kinetic energy are found from the partial derivative of the wave function in respect to the position varables. To solve this numerically, we use the crank-nicolson method to discretize position and time, which combines the explicit and implicit method in solving pdes.
\end{document}