From 57abf18fa616ac96597fd42f5a974da38cdf103d Mon Sep 17 00:00:00 2001 From: Janita Willumsen Date: Mon, 1 Jan 2024 17:36:17 +0100 Subject: [PATCH] Finish report --- latex/references.bib | 23 +++++++++++++++++ latex/schrodinger_simulation.tex | 2 +- latex/sections/abstract.tex | 2 +- latex/sections/appendices.tex | 4 +-- latex/sections/conclusion.tex | 23 ++++------------- latex/sections/introduction.tex | 22 ++++++++-------- latex/sections/methods.tex | 44 +++++++++++++++----------------- latex/sections/results.tex | 28 ++++++++++---------- 8 files changed, 77 insertions(+), 71 deletions(-) diff --git a/latex/references.bib b/latex/references.bib index e7380fa..572bc39 100644 --- a/latex/references.bib +++ b/latex/references.bib @@ -187,6 +187,29 @@ pages = {3021} } +@article{harris:2020:numpy, + title = {Array programming with {NumPy}}, + author = {Charles R. Harris and K. Jarrod Millman and St{\'{e}}fan J. + van der Walt and Ralf Gommers and Pauli Virtanen and David + Cournapeau and Eric Wieser and Julian Taylor and Sebastian + Berg and Nathaniel J. Smith and Robert Kern and Matti Picus + and Stephan Hoyer and Marten H. van Kerkwijk and Matthew + Brett and Allan Haldane and Jaime Fern{\'{a}}ndez del + R{\'{i}}o and Mark Wiebe and Pearu Peterson and Pierre + G{\'{e}}rard-Marchant and Kevin Sheppard and Tyler Reddy and + Warren Weckesser and Hameer Abbasi and Christoph Gohlke and + Travis E. Oliphant}, + year = {2020}, + month = sep, + journal = {Nature}, + volume = {585}, + number = {7825}, + pages = {357--362}, + doi = {10.1038/s41586-020-2649-2}, + publisher = {Springer Science and Business Media {LLC}}, + url = {https://doi.org/10.1038/s41586-020-2649-2} +} + # C++ libraries @misc{openmp:2018, author = {OpenMP}, diff --git a/latex/schrodinger_simulation.tex b/latex/schrodinger_simulation.tex index 0058e3a..258d20b 100644 --- a/latex/schrodinger_simulation.tex +++ b/latex/schrodinger_simulation.tex @@ -83,7 +83,7 @@ \begin{document} \title{Simulating the Schrödinger wave equation using the Crank-Nicolson scheme in 2+1 dimensions} % self-explanatory -\author{Cory Alexander Balaton \& Janita Ovidie Sandtrøen Willumsen \\ \faGithub \, \url{https://github.uio.no/FYS3150-G2-2023/Project-4}} % self-explanatory +\author{Cory Alexander Balaton \& Janita Ovidie Sandtrøen Willumsen \\ \faGithub \, \url{https://github.uio.no/FYS3150-G2-2023/Project-5}} % self-explanatory \date{\today} % self-explanatory \noaffiliation % ignore this, but keep it. diff --git a/latex/sections/abstract.tex b/latex/sections/abstract.tex index 34bc0f7..e0d384c 100644 --- a/latex/sections/abstract.tex +++ b/latex/sections/abstract.tex @@ -10,7 +10,7 @@ it using the sparse matrix solver \verb|superlu|. Our implementation, and choice of solver method, resulted in a deviation from conserved total probability on the scale $10^{-14}$, for both the single and double slit setup. To illustrate the time evolution of the probability function, we created colormap plots for time steps -$t = [0, 0.001, 0.002]$. We also included separate plots for each time step of +$t=\{0, 0.001, 0.002\}$. We also included separate plots for each time step of Re$(u_{\ivec, \jvec})$ and Im$(u_{\ivec, \jvec})$. In addition, we determined the normalized particle detection probability $p(y \ | \ x=0.8, t=0.002)$, for single-, double- and triple-slit. diff --git a/latex/sections/appendices.tex b/latex/sections/appendices.tex index 54adff5..b4adfe2 100644 --- a/latex/sections/appendices.tex +++ b/latex/sections/appendices.tex @@ -47,7 +47,7 @@ the left hand side, and the terms containing $n$ time step on the right hand sid &= 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} \end{align*} -Since we will use an equal step size $h$ in both $x$ and $y$ direction, we can use +Since we use an equal step size $h$ in both $x$ and $y$ direction, we can use \begin{align*} \frac{i \Delta t}{2 \Delta h^{2}} = \frac{i \Delta t}{2 \Delta x^{2}} = \frac{i \Delta t}{2 \Delta y^{2}} \ , \end{align*} @@ -65,7 +65,7 @@ Now, the discretized Schrödinger equation can be rewritten as \section{Matrix structure}\label{ap:matrix_structure} -For $u$ vector of length $(M-2) = 3$, the matrices $A$ and $B$ have size +For a $u$ vector of length $(M-2) = 3$, the matrices $A$ and $B$ have size $(M-2)^{2} \times (M-2)^{2} = 9 \times 9$ given by \begin{align*} A = diff --git a/latex/sections/conclusion.tex b/latex/sections/conclusion.tex index 3e74e12..4211214 100644 --- a/latex/sections/conclusion.tex +++ b/latex/sections/conclusion.tex @@ -2,19 +2,6 @@ \begin{document} \section{Conclusion}\label{sec:conclusion} -% We have simulated the two-dimensional time-dependent Schrödinger equation, to study -% variations of the double-slit experiment. To derive a discretized equation -% we applied the Crank-Nicolson scheme in 2+1 dimensions. In addition, we have used -% Dirichlet boundary conditions to express the equation in matrix form, and solve -% it using the sparse matrix solver \verb|superlu|. Our implementation, and choice -% of solver method, resulted in a deviation from conserved total probability on the -% scale $10^{-14}$, for both the single and double slit setup. To illustrate the time -evolution of the probability function, we created colormap plots for time steps -$t = [0, 0.001, 0.002]$. We also included separate plots for each time step of -Re$(u_{\ivec, \jvec})$ and Im$(u_{\ivec, \jvec})$. In addition, we determined the -normalized particle detection probability $p(y \ | \ x=0.8, t=0.002)$, for single-, -double- and triple-slit. -% Rewrite this section to differ from the abstract We simulated the two-dimensional time-dependent Schrödinger equation, and studied variations of the double-slit experiment. To solve the partial differential equations we applied the Crank-Nicolson scheme in 2+1 dimensions, and derived a discretized @@ -25,13 +12,13 @@ deviated from $1.0$ by a factor of $10^{-14}$ for both the single and double sli setup. % Add something about computational accuracy? We illustrated the time evolution of the probability function $p_{\ivec, \jvec}^{n} = u_{\ivec, \jvec}^{n*} u_{\ivec, \jvec}^{n}$, -using colormap plots for time steps $t = [0, 0.001, 0.002]$. In addition, we included +using colormap plots for time steps $t = \{0, 0.001, 0.002\}$. In addition, we included separate plots for each time step of Re$(u_{\ivec, \jvec})$ and Im$(u_{\ivec, \jvec})$, -to show the components of the complex values. This resulted in a visible diffraction +to show the components of the complex values. This resulted in visible diffraction patterns for the double-slit experiment. In addition, we studied the normalized particle detection probability $p(y \ | \ x=0.8, t=0.002)$, -for single-, double- and triple-slit. We found that increasing the number of slits -in the barrier, increased the number of areas of both high and low probability of -particle detection. +for single-, double- and triple-slit setups. We found that increasing the number of slits +in the barrier, resulted in an increased number of areas of both high and low probability +for particle detection. It also increased the variance of particle detection probability. \end{document} diff --git a/latex/sections/introduction.tex b/latex/sections/introduction.tex index 33f2675..bc58e16 100644 --- a/latex/sections/introduction.tex +++ b/latex/sections/introduction.tex @@ -6,27 +6,27 @@ The nature of light has long been a subject of interest and discussion. In classical mechanics, we study the kinematics and dynamics of physical objects, while ignoring their intrinsic properties for simplicity. Elementary particles, such as photons -and electrons, does not abide by the laws of classical mechanics. A solution was -proposed by Max Planck in the radiation law, which he later derived 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}. +and electrons, do not abide by the laws of classical mechanics. A solution was +proposed by Max Planck with the radiation law, which he later derived using Boltzmann's +statistical interpretation of the second law of thermodynamics. Planck's findings +gave rise to the quantum hypothesis, and later Einstein's wave-particle duality \cite{britannica:1998:planck}. -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 particle theory was the leading theory in the beginning of the 1800s, when +Thomas Young demonstrated the interference of light, through his double-slit experiment, while postulating light as waves \cite{young:1804:double_slit}. The study of -interference of light, and Gustav R. Kirchhoffs study of ideal blackbodies, -showed that light exibits both wavelike and particle-like characteristics. The +interference of light, and Gustav R. Kirchhoff's study of ideal blackbodies, +showed that light exhibits both wavelike and particle-like characteristics. 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. +state of particles, resulting in the wave equation. We will simulate the time-dependent Schrödinger equation in two dimensions, to study the light wave interference in the double-slit experiment. In addition, we -will include variations of walls such as single- and triple-slit. To solve the equation, +will include variations of barriers with single-slit and triple-slits. To solve the equation, we will apply the Crank-Nicolson method in 2+1 dimensions. In Section \ref{sec:methods}, we will present the theoretical background for -this experiment, as well as the algorithms and tools used in the implementation. +this experiment, as well as the methods and tools used in the implementation. Continuing with Section \ref{sec:results}, we will present our results and discuss our findings. Lastly, we will conclude our findings in Section \ref{sec:conclusion}. \end{document} diff --git a/latex/sections/methods.tex b/latex/sections/methods.tex index 1994cdf..6ec8279 100644 --- a/latex/sections/methods.tex +++ b/latex/sections/methods.tex @@ -3,11 +3,8 @@ \begin{document} \section{Methods}\label{sec:methods} % \subsection{The Schrödinger equation}\label{ssec:schrodinger} % -% Add something that takes Planck to Schrödinger -% In classical mechanics, we have Newton laws and conservation of energy. In quantum -% mechanics, we have Schrödinger equation. Erwin Schrödinger wanted to find a mathematical description of the wave characteristics -of matter, supporting the wave-particle idea. He postulated a wave function which varies +of matter, which supported the wave-particle idea. He postulated a wave function which varies with position, where the function squared can be interpreted as the probability of finding an electron at a given position. This resulted in the Schrödinger equation, a wave eqution of the energy levels for a hydrogen atom. It also shows how a quantum @@ -17,21 +14,20 @@ has a general form i \hbar \frac{\partial}{\partial t} | \Psi \rangle &= \hat{H} | \Psi \rangle \ , \label{eq:schrodinger_general} \end{align} -where $i$ is the imaginary unit, and $\hbar$ is Plancks constant. $\hat{H}$ is +where $i$ is the imaginary unit, and $\hbar$ is the reduced Planck's constant. $\hat{H}$ is a Hamiltonian operator, which represents the energy for the system, and $| \Psi \rangle$ is the quantum state. In two-dimensional position space, the quantum state can be expressed using the time-dependent complex-valued wave function $\Psi (x, y, t)$. -Using Born rule, the square modulus of the wave function is proportional to the +Using the Born rule, the square modulus of the wave function is proportional to the probability density of detecting a particle at position $(x, y)$ at time $t$. The relation is given by \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} -where $\Psi^{*}$ denotes the complex conjugated wave function. -% Add something about kinetic and potential energy, to introduce the potential V -When the potential is time-independent, and the particle is non-relativistic, -the Schrödinger equation can be expressed as +where $\Psi^{*}$ denotes the complex conjugate of the wave function. When the potential +is time-independent, and the particle is non-relativistic, 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 \ . @@ -39,9 +35,9 @@ the Schrödinger equation can be expressed as \end{align*} The partial derivatives are expressions of the kinetic energy, and the potental $V$ encodes the external environment. In this experiment we will only consider the case where -the potential is time-independent, resulting in $V = V(x, y)$ +the potential is time-independent, resulting in $V = V(x, y)$. -When we scale Schrödinger equation by the dimensionful variables, we are left with +When we scale the Schrödinger equation by the dimensionful variables, we are left with the wave function $u$ and the potential $v$. The dimensionless equation is given by \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 \ . @@ -63,9 +59,9 @@ given by $p_{x}$ and $p_{y}$. \subsection{The Crank-Nicolson scheme}\label{ssec:crank_nicolson} % -When we evaluate a particles position, we have to consider partial differential -equations (PDE). To solve these numerically, we have to discretize Equation \eqref{eq:schrodinger_dimensionless}. -We use the $\theta$-rule \footnote{Using the $\theta$-rule, we can derive Forward Euler using $\theta = 1$, and Backward Euler using $\theta = 0$}, +When we evaluate a particle's position, we have to consider partial differential +equations (PDEs). To solve these numerically, we have to discretize Equation \eqref{eq:schrodinger_dimensionless}. +We use the $\theta$-rule \footnote{We can derive Forward Euler using $\theta = 1$, and Backward Euler using $\theta = 0$, in the $\theta$-rule.}, to combine the forward (explicit) and backward (implicit) finite difference methods. The result is a linear combination of the explicit and implicit scheme, given by \begin{align} @@ -99,7 +95,7 @@ can be found in Appendix \ref{ap:crank_nicolson}. \subsection{The double-slit experiment}\label{ssec:double_slit} % Thomas Young first performed the double-slit experiment in 1801 to demonstrate the -principle of interference of light \cite{britannica:2023:young}, while postulating +principle of the interference of light \cite{britannica:2023:young}, while postulating light as waves rather than particles. The double-slit experiment results in a diffraction pattern on a detector screen, where constructive interference of light result in bright spots, and destructive interference result in dark spots. An illustration @@ -133,14 +129,14 @@ and destructive interference when \subsection{Implementation}\label{ssec:implementation} % -In this experiment, we set up the grid with an equal step size in x- and y-direction $h$, -and step size in t-direction $\Delta t$, such that +In this experiment, we set up the grid with an equal step size in the x- and y-direction $h$, +and step size in the t-direction $\Delta t$, such that \begin{align*} x \in [0, 1] && x \rightarrow x_{\ivec} = \ivec h && \ivec = 0, 1, \dots, M-1 \\ y \in [0, 1] && y \rightarrow y_{\jvec} = \jvec h && \jvec = 0, 1, \dots, M-1 \\ t \in [0, T] && t \rightarrow t_{n} = n \Delta t && n = 0, 1, \dots, N_{t}-1 \ . \end{align*} -In addition, we simplified the indices such that +In addition, we simplify the indices such that \begin{align*} u(x, y, t) \rightarrow u(\ivec h, \jvec h, n \Delta t) \equiv u_{\ivec, \jvec}^{n} \\ v(x, y) \rightarrow u(\ivec h, \jvec h) \equiv v_{\ivec, \jvec} \ , @@ -152,7 +148,7 @@ conditions, given by u(x=0, y, t) &= 0 & u(x=1, y, t) &= 0 \\ u(x, y=0, t) &= 0 & u(x, y=1, t) &= 0 \ , \end{align*} -which allowed us to express Equation \eqref{eq:schrodinger_discretized} as a matrix +which allows us to express Equation \eqref{eq:schrodinger_discretized} as a matrix equation \begin{align} A u^{n+1} = B u^{n} \ . @@ -221,12 +217,12 @@ with the following pattern \end{matrix} \end{bmatrix} \ . \end{align*} -To fill the matrices $A$ and $B$, we used +To fill the matrices $A$ and $B$, we use \begin{align*} a_{k} &= 1 + 4r + \frac{i \Delta t}{2} v_{\ivec, \jvec} \\ b_{k} &= 1 - 4r - \frac{i \Delta t}{2} v_{\ivec, \jvec} \ . \end{align*} -An example of filled matrices can be found in Appendix \ref{ap:matrix_structure}. +An example of a pair of filled matrices can be found in Appendix \ref{ap:matrix_structure}. For the general setup of the barrier, we used the values in Table \ref{tab:barrier_setup}, and for the simulations, we used the parameter settings in Table \ref{tab:sim_settings}. @@ -265,7 +261,7 @@ and for the simulations, we used the parameter settings in Table \ref{tab:sim_se \hline \end{tabular} \caption{Simulation settings used in the double slit experiment. Setting 1 is - used when the barrier is switched off and setting 2 is used when the barrier + applied when the barrier is switched off and setting 2 is applied when the barrier switched on.} \label{tab:sim_settings} \end{table} @@ -279,7 +275,7 @@ was correct, we computed the deviation from $1.0$ given by \subsection{Tools}\label{ssec:tools} % The double-slit experiment is implemented in C++. We use the Python library -\verb|matplotlib| \cite{hunter:2007:matplotlib} to produce all the plots, and +\verb|NumPy| \cite{harris:2020:numpy}, \verb|matplotlib| \cite{hunter:2007:matplotlib} to produce all the plots, and \verb|seaborn| \cite{waskom:2021:seaborn} to set the theme in the figures. \end{document} diff --git a/latex/sections/results.tex b/latex/sections/results.tex index 02543fb..13b1388 100644 --- a/latex/sections/results.tex +++ b/latex/sections/results.tex @@ -11,7 +11,7 @@ memory usage compared to \verb|superlu|. % Problem 7: Consequenses of solver choice, in regards to accuracy of probability conserved % Add plot of deviation for both single- and double-slit Since we used a solver for sparse matrices, we decrease the number of computations performed -compared to number of computations using a solver for dense matrices. +compared to the number of computations using a solver for dense matrices. We checked if the total probability was conserved over time, by plotting the deviation from $1.0$. \begin{figure} @@ -24,11 +24,11 @@ We simulated the wave equation with the barrier switched off, using setting 1 in Table \ref{tab:sim_settings} found in Section \ref{ssec:implementation}. When the barrier was switched on, we used setting 2 in \ref{tab:sim_settings}. We observed a larger deviation of total probability for a barrier with double slits compared -to no barrier, the result is showed in Figure \ref{fig:deviation}. The wave interacts -with the barrier resulting in a change in kinetic energy. The result is more prone +to no barrier. The result can found in Figure \ref{fig:deviation}. When the wave interacts +with the barrier, it results in a larger change in kinetic energy. The result is more prone to computational errors, than if the wave propagates without interacting with a barrier. No interaction results in a more stable deviation from the total probability. -In addition, we have to consider the limitation of a computer, some computational +In addition, we have to consider the limitations of the computer, therefore some computational error is to be expected. @@ -39,9 +39,9 @@ We studied the time evolution of the probability function, using setting 2 in Table \ref{tab:sim_settings}, found in Section \ref{ssec:implementation}. To visualize the time evolution, we created colormap plots for different time steps. Figure \ref{fig:colormap_0_prob}, Figure \ref{fig:colormap_1_prob}, and Figure \ref{fig:colormap_2_prob} show the -results for time steps $t=[0, 0.001, 0.002]$, respectively. In addition, we created +results for time steps $t=\{0, 0.001, 0.002\}$, respectively. In addition, we created separate plots for the real and imaginary part of $u_{\ivec, \jvec}$, for the same -time steps. The results can be found in Appendix \ref{ap:figures}, in Figure \ref{fig:colormap}. +time steps. The results can be found in Appendix \ref{ap:figures}, in Figure \ref{fig:colormap_real_imag}. \begin{figure} \centering \includegraphics[width=\linewidth]{images/color_map_0_prob.pdf} @@ -65,8 +65,8 @@ with the double slit barrier, we observe a clear diffraction pattern in the probability function. At time step $t=0$ (Figure \ref{fig:colormap_0_prob}) and $t=0.002$ (Figure \ref{fig:colormap_2_prob}), the diffraction pattern is not as clear. It is, however, more visible when we observe the real and imaginary part -separately in Figure \ref{fig:colormap}, found in Appendix \ref{ap:figures}. Since -the probability function is a product of $u_{\ivec, \jvec}$ and its conjugate $u_{\ivec, \jvec}^{*}$, +separately in Figure \ref{fig:colormap_real_imag}. Since the probability function +is a product of $u_{\ivec, \jvec}$ and its conjugate $u_{\ivec, \jvec}^{*}$, initialized by a Gaussian wavepacket, the result is a sum of the real and imaginary part. % This can be found using Euler's formula, and the diffraction pattern is determined by interference given by \eqref{eq:interference} In Figure \ref{fig:colormap_2_prob}, the probability function result in positive @@ -91,11 +91,11 @@ better visualize the diffraction pattern. \subsection{Particle detection}\label{ssec:particle_detection} % Problem 9: Plot detection probability for single-, double- and triple-slit -We simulation the wave equation using setting 2 in Table \ref{tab:sim_settings}, +We simulated the wave equation using setting 2 in Table \ref{tab:sim_settings}, and assumed a detector screen located at $x=0.8$. To visualize the pattern of constructive and destructive interference, we plotted the probability of particle detection, along the screen, at time $t=0.002$. We adjusted the parameters to include single-, double-, and triple-slit -barriers. The results is found in Figure \ref{fig:particle_detection_single}, +barriers. The results are found in Figure \ref{fig:particle_detection_single}, Figure \ref{fig:particle_detection_double}, and Figure \ref{fig:particle_detection_triple}, respectively. \begin{figure} @@ -121,8 +121,8 @@ respectively. \end{figure} When the barrier has a single slit, there is no destructive interference and we observe a single peak in the probability of particle detection. Adding another slit -result in more peaks, as there are both constructive and destructive interference. -When we use a triple-slit barrier, we observe an increase in interference which -result in narrow peaks. In addition, the probability of detecting a particle at -the ends of the screen increase with number of slits. +result in more peaks, as there is both constructive and destructive interference. +When we used a triple-slit barrier, we observed an increase in interference which +resulted in narrow peaks. In addition, the probability of detecting a particle at +the ends of the screen increased with the number of slits. \end{document}