From 33c8ace539db826075e90f41491b5c13ce036826 Mon Sep 17 00:00:00 2001 From: Janita Willumsen Date: Wed, 29 Nov 2023 15:47:55 +0100 Subject: [PATCH] Start proofreading result section --- latex/ising_model.tex | 17 +++++- latex/sections/appendices.tex | 15 +++++ latex/sections/methods.tex | 39 +++++++------ latex/sections/results.tex | 103 ++++++++++++++++++++++++++++++++++ 4 files changed, 153 insertions(+), 21 deletions(-) diff --git a/latex/ising_model.tex b/latex/ising_model.tex index b14570d..0c01ddb 100644 --- a/latex/ising_model.tex +++ b/latex/ising_model.tex @@ -85,5 +85,20 @@ % Appendix \subfile{sections/appendices} - \end{document} + +% Method +% Problem 1: OK +% Problem 2: OK +% Problem 3: OK - missing theory of phase transition +% Problem 7: +% Problem 9: + +% Results +% Problem 4: +% Problem 5: +% Problem 6: +% Problem 8: +% Problem 9: +% +% \ No newline at end of file diff --git a/latex/sections/appendices.tex b/latex/sections/appendices.tex index 94801a0..9dec019 100644 --- a/latex/sections/appendices.tex +++ b/latex/sections/appendices.tex @@ -127,5 +127,20 @@ and susceptibility \frac{\chi}{N} &= \frac{4}{N k_{B} T} \bigg( \frac{3e^{8 \beta J} + e^{-8 \beta J} + 3}{(\cosh(8 \beta J) + 3)^{2}} \bigg) \ . \end{align*} +\section{Change in total system energy}\label{sec:delta_energy} +When we consider the change in energy after flipping a single spin, we evaluate +$\Delta E = E_{\text{after}} - E_{\text{before}}$. We find the $3^{2}$ values as +\begin{align*} + \Delta E = -8J - (-8J) = 0 \\ + \Delta E = -8J - 0 = -8J \\ + \Delta E = -8J - 8J = -16J \\ + \Delta E = 0 - (-8J) = 8J \\ + \Delta E = 0 - 0 = 0 \\ + \Delta E = 0 - 8J = -8J \\ + \Delta E = 8J - (-8J) = 16J \\ + \Delta E = 8J - 0 = 8J \\ + \Delta E = 8J - 8J = 0, +\end{align*} +where the five distinct values are $\Delta E = \{-16J, -8J, 0, 8J, 16J\}$. \end{document} \ No newline at end of file diff --git a/latex/sections/methods.tex b/latex/sections/methods.tex index 8b38140..390f61b 100644 --- a/latex/sections/methods.tex +++ b/latex/sections/methods.tex @@ -177,6 +177,9 @@ Boltzmann constant we derive the remaining units, which can be found in Table \label{tab:units} \end{table} +\subsection{Phase transition and critical temperature}\label{subsec:phase_critical} +% P9 critical temperature + \subsection{The Markov chain Monte Carlo method}\label{subsec:mcmc_method} Markov chains consist of a sequence of samples, where the probability of the next sample depend on the probability of the current sample. Whereas the Monte Carlo @@ -202,8 +205,9 @@ At each step of flipping a spin, the change in energy is evaluated as \begin{align*} \Delta E &= E_{\text{after}} - E_{\text{before}} \ . \end{align*} -We have to evaluate - +Since the total system energy only takes three different values, the change in +energy can take $3^{2}$ values. However, there are only five distinct values +$\Delta E = \{-16J, -8J, 0, 8J, 16J\}$, which we find in Appendix \ref{sec:delta_energy}. \begin{figure}[H] \begin{algorithm}[H] \caption{Metropolis-Hastings Algorithm} @@ -226,13 +230,22 @@ We have to evaluate \EndProcedure \end{algorithmic} \end{algorithm} - \caption{Algo} \end{figure} - -\subsection{Phase transition and critical temperature}\label{subsec:phase_critical} +We can avoid computing the Boltzmann factor +\begin{equation} + p(\mathbf{s} | T) = e^{-\beta \Delta E} + \label{eq:boltzmann_factor} +\end{equation} +at every spin flip, by using a look up table (LUT) with the possible values. We use +the change in energy $\Delta E$ as a key for the resulting value of the exponential +function in a hash map. \subsection{Implementation}\label{subsec:implementation} -% P2 +% P3 boundary condition and if-tests +To avoid the overhead of if-tests, and take advantage of the parallelization, we +define an index for every edge case. That is, for a spin at a given boundary index +we use a pre-set index (...), to avoid if-tests and reduce overhead and runtime. +% P7 parallelization \subsection{Tools}\label{subsec:tools} The Ising model and MCMC methods are implemented in C++, and parallelized using @@ -244,17 +257,3 @@ addition, while optimizing our implementation we used the profiler \end{document} -% Method -% Problem 1: OK -% Problem 2: -% Problem 3: - -% Results -% Problem 4: -% Problem 5: -% Problem 6: -% Problem 7: -% Problem 8: -% Problem 9: -% -% diff --git a/latex/sections/results.tex b/latex/sections/results.tex index 26924a0..8c349e3 100644 --- a/latex/sections/results.tex +++ b/latex/sections/results.tex @@ -2,5 +2,108 @@ \begin{document} \section{Results}\label{sec:results} +\subsection{Burn-in time}\label{subsec:burnin_time} +We start with a lattice where $L = 20$, to study the burn-in time, that is the +number of Monte Carlo cycles necessary for the system to reach an equilibrium. +We consider two different temperatures $T_{1} = 1.0 J/k_{B}$ and $T_{2} = 2.4 J/k_{B}$, +where $T_{2}$ is close to the critical temperature. We can use the correlation +time $\tau \approx L^{d + z}$ to determine time, where $d$ is the dimensionality +of the system and $z = 2.1665 \pm 0.0012$ \footnote{This value was determined by +Nightingale and Blöte for the Metropolis algorithm.} +% Need to include a section of Onsager's analytical result. +We show the numerical estimates for temperature $T_{1}$ of $\langle \epsilon \rangle$ +in Figure \ref{fig:burn_in_energy_1_0} and $\langle |m| \rangle$ in Figure +\ref{fig:burn_in_magnetization_1_0}. For temperature $T_{2}$, the numercal estimate +of $\langle \epsilon \rangle$ is shown in Figure \ref{fig:burn_in_energy_2_4} and +$\langle |m| \rangle$ in Figure \ref{fig:burn_in_magnetization_2_4}. The lattice +is initialized in both an ordered and an unordered state. We observe that for +$T_{1}$ there is no change in either expectation value with increasing number of +Monte Carlo cycles, when we start with an ordered state. As for the unordered +lattice, we observe a change for the first 5000 MC cycles, where it stabilizes. +The approximated expected energy is $-2$ and expected magnetization is $1.0$, +which is to be expected for temperature 0f $1.0$. T is below the critical and the +pdf using $T = 1.0$ result in +\begin{align*} + p(s|T=1.0) &= \frac{1}{e^{-\beta \sum E(s)}} e^{-\beta E(s)} \\ + &= \frac{1}{e^{-(1/k_{B}) \sum E(s)}} e^{-(1/k_{B}) E(s)} \ . +\end{align*} +% Burn-in figures +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{../images/burn_in_time_magnetization_1_0.pdf} + \caption{$\langle |m| \rangle$ as a function of time, for $T = 1.0 J / k_{B}$} + \label{fig:burn_in_magnetization_1_0} +\end{figure} +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{../images/burn_in_time_energy_1_0.pdf} + \caption{$\langle \epsilon \rangle$ as a function of time, for $T = 1.0 J / k_{B}$} + \label{fig:burn_in_energy_1_0} +\end{figure} +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{../images/burn_in_time_magnetization_2_4.pdf} + \caption{$\langle |m| \rangle$ as a function of time, for $T = 2.4 J / k_{B}$} + \label{fig:burn_in_magnetization_2_4} +\end{figure} +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{../images/burn_in_time_energy_2_4.pdf} + \caption{$\langle \epsilon \rangle$ as a function of time, for $T = 2.4 J / k_{B}$} + \label{fig:burn_in_energy_2_4} +\end{figure} + +% Histogram figures +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{../images/pd_estimate_1_0.pdf} + \caption{Histogram $T = 1.0 J / k_{B}$} + \label{fig:histogram_1_0} +\end{figure} +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{../images/pd_estimate_2_4.pdf} + \caption{Histogram $T = 2.4 J / k_{B}$} + \label{fig:histogram_2_4} +\end{figure} + +% Phase transition figures +\begin{figure} + \centering + \includegraphics[width=\linewidth]{../images/phase_transition/fox/wide/1M/energy.pdf} + \caption{$\langle \epsilon \rangle$ for $T \in [2.1, 2.4]$, 1000000 MC cycles.} + \label{fig:phase_energy} +\end{figure} + +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{../images/phase_transition/fox/wide/1M/magnetization.pdf} + \caption{$\langle |m| \rangle$ for $T \in [2.1, 2.4]$, 1000000 MC cycles.} + \label{fig:phase_magnetization} +\end{figure} + +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{../images/phase_transition/fox/wide/1M/heat_capacity.pdf} + \caption{$C_{V}$ for $T \in [2.1, 2.4]$, 1000000 MC cycles.} + \label{fig:phase_heat} +\end{figure} + +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{../images/phase_transition/fox/wide/1M/susceptibility.pdf} + \caption{$\chi$ for $T \in [2.1, 2.4]$, 1000000 MC cycles.} + \label{fig:phase_susceptibility} +\end{figure} + +% Critical temp regression figure +\begin{figure}[H] + \centering + \includegraphics[width=\linewidth]{../images/phase_transition/fox/wide/1M/linreg.pdf} + \caption{Linear regression, where $\beta_{0}$ is the intercept $T_{c}(L = \infty)$ and $\beta_{1}$ is the slope.} + \label{fig:linreg} +\end{figure} + + \end{document}