acknowledgements to end, remove n, python capitalization

This commit is contained in:
hiro98 2020-06-10 12:12:31 +02:00
parent 2f457accdd
commit 9463415f58
7 changed files with 70 additions and 62 deletions

View file

@ -21,8 +21,6 @@ captions=nooneline,captions=tableabove,english,DIV=16,numbers=noenddot,final]{sc
\clearpage
\input{./tex/abstract.tex}
\clearpage
\input{./tex/thanks.tex}
\clearpage
\thispagestyle{empty}
\mbox{}
\clearpage
@ -62,4 +60,7 @@ captions=nooneline,captions=tableabove,english,DIV=16,numbers=noenddot,final]{sc
\printbibliography
\clearpage
\input{./tex/erklaerung.tex}
\clearpage
\input{./tex/thanks.tex}
\clearpage
\end{document}

View file

@ -1,4 +1,4 @@
n\chapter{Introduction}%
\chapter{Introduction}%
\label{chap:intro}
Monte Carlo (MC) methods have been and still are one of the most
@ -52,15 +52,11 @@ Throughout, natural units with
otherwise. The fine structure constant's value \(\alpha = 1/137.036\)
is configured in \sherpa\ and used in analytic calculations.
The compatibility of histograms is tested as discussed in
\cref{sec:comphist} and the respective \(P\) and \(T\) values are
being included in the ratio plots.
\section{Source Code}%
\label{sec:source}
The (literate) python code, used to generate most of the results and
figures can be found under
The (literate) \texttt{Python} code, used to generate most of the
results and figures can be found under
\url{https://github.com/vale981/bachelor_thesis/} and more
specifically in the subdirectory \texttt{prog/python/qqgg}.
@ -69,8 +65,8 @@ algorithm related functionality as a module. The file
\texttt{analytical\_xs.org} contains a literate computation notebook
that generates all the results of \cref{chap:mc}. The file
\texttt{parton\_density\_function\_stuff.org} contains all the
computations for \cref{chap:pdf}. The python code makes heavy use of
\href{https://www.scipy.org/}{scipy}~\cite{2020Virtanen:Sc} and
computations for \cref{chap:pdf}. The \texttt{Python} code makes heavy
use of \href{https://www.scipy.org/}{scipy}~\cite{2020Virtanen:Sc} and
its component \href{https://numpy.org/}{numpy}).
\section{Software Versions}%

View file

@ -10,11 +10,11 @@ Monte Carlo methods for multidimensional integration and sampling of
probability distributions are central tools of modern particle
physics. Therefore some simple methods and algorithms are being
studied and implemented from scratch here and will be applied to the
results from \cref{chap:qqgg}. The \verb|python| code for the
results from \cref{chap:qqgg}. The \texttt{Python} code for the
implementation can be found as described in \cref{sec:source}. The
sampling and integration intervals, as well as other parameters have
been chosen as in \cref{sec:compsher} been chosen, so that
\result{xs/python/eta} and \result{xs/python/ecm}. This chapter is
based on the appendix~\cite{buckley:2011ge} and supplants that source
with some derivations and more methods, for instance the
been chosen as in \cref{sec:compsher}, so that \result{xs/python/eta}
and \result{xs/python/ecm}. This chapter is based on the
appendix of~\cite{buckley:2011ge} and supplants that source with some
derivations and more methods, for instance the
\vegas~\cite{Lepage:19781an} algorithm.

View file

@ -68,13 +68,13 @@ variable \(\vb{x}\), and the integration volume
\(\Omega\). Accordingly, some ways variance reductions can be
accomplished are choosing a suitable \(\rho\) (importance sampling),
by transforming the integral onto another variable or by subdividing
integration volume into several sub-volumes of different size while
keeping the sample size constant in all sub-volumes (a special case of
stratified sampling).\footnote{There are of course still other methods
like the multi-channel method.}\footnote{Of course, combinations of
these methods can be applied as well.} Combining ideas from
importance sampling and stratified sampling leads to the \vegas\
algorithm~\cite{Lepage:19781an} that approximates the optimal
the integration volume into several sub-volumes of different size
while keeping the sample size constant in all sub-volumes (a special
case of stratified sampling).\footnote{There are of course still other
methods like the multi-channel method.}\footnote{Of course,
combinations of these methods can be applied as well.} Combining
ideas from importance sampling and stratified sampling leads to the
\vegas\ algorithm~\cite{Lepage:19781an} that approximates the optimal
distribution of importance sampling by adaptive subdivision of the
integration volume into a grid.
@ -83,7 +83,7 @@ dimensionality of the integration volume as opposed to many other
numerical integration algorithms (trapezoid rule, Simpsons rule) that
usually converge like \(N^{-\frac{k}{n}}\) with
\(k\in\mathbb{N}_{>0}\) and \(n\) being the dimensionality. MC
integration in it's simplest form converges like \(N^{-\frac{1}{2}}\)
integration in its simplest form converges like \(N^{-\frac{1}{2}}\)
in \emph{all} dimensions. Because phase space integrals in particle
physics usually have a high dimensionality, MC integration is a
suitable approach for those problems. When implementing MC methods,
@ -171,13 +171,15 @@ equivalent (see \ref{sec:equap}).
\subsection{Integration with \vegas}
\label{sec:mcintvegas}
Stratified sampling gives optimal results, when the variance in every
sub-volume is the same~\cite{Lepage:19781an}. In importance sampling,
the optimal probability distribution is given
by \cref{eq:optimalrho}, where \(f(\Omega) \geq 0\) is presumed
without loss of generality. When applying \vegas\ to multi dimensional
integrals,~\cref{eq:optimalrho} is usually modified to factorize into
distributions for each variable to simplify calculations.
Subdividing the integration volume into sub-volumes and taking the same
number of samples in each volume (stratified sampling), gives optimal
results, when the variance in every sub-volume is the
same~\cite{Lepage:19781an}. In importance sampling, the optimal
probability distribution is given by \cref{eq:optimalrho}, where
\(f(\Omega) \geq 0\) is presumed without loss of generality. When
applying \vegas\ to multi dimensional integrals,~\cref{eq:optimalrho}
is usually modified to factorize into distributions for each variable
to simplify calculations.
%
\begin{equation}
\label{eq:optimalrho}
@ -188,21 +190,23 @@ The idea behind \vegas\ is to subdivide \(\Omega\) into hypercubes
(create a grid), define \(\rho\) as step-function with constant value
on those hypercubes and iteratively approximating
\cref{eq:optimalrho}, instead of trying to minimize the variance
directly. In the end, the samples are concentrated where \(f\) takes
on the highest values and changes most rapidly. This is done by
subdividing the hypercubes into smaller chunks, based on their
contribution to the integral, which is calculated through MC sampling,
and then varying the hypercube borders until all hypercubes contain
the same number of chunks. So if the contribution of a hypercube is
large, it will be divided into more chunks than others. When the
hypercube borders are then shifted, this hypercube will shrink, while
others will grow by consuming the remaining chunks. Repeating this
step in so called \vegas\ iterations will converge the contribution of
each hypercube to the same value. More details about the algorithm can
be found in~\cite{Lepage:19781an}. Note that no knowledge about the
integrand is required. The probability density used by \vegas\ is
given in \cref{eq:vegasrho} with \(K\) being the number of hypercubes
and \(\Omega_i\) being the hypercubes themselves.
directly. As in stratified sampling, the sample number is kept the
same in each hypercube to realize \cref{eq:optimalrho}. In the end,
the samples are concentrated where \(f\) takes on the highest values
and changes most rapidly. This is done by subdividing the hypercubes
into smaller chunks, based on their contribution to the integral,
which is calculated through MC sampling, and then varying the
hypercube borders until all hypercubes contain the same number of
chunks. So if the contribution of a hypercube is large, it will be
divided into more chunks than others. When the hypercube borders are
then shifted, this hypercube will shrink, while others will grow by
consuming the remaining chunks. Repeating this step in so called
\vegas\ iterations will converge the contribution of each hypercube to
the same value. More details about the algorithm can be found
in~\cite{Lepage:19781an}. Note that no knowledge about the integrand
is required. The probability density used by \vegas\ is given in
\cref{eq:vegasrho} with \(K\) being the number of hypercubes and
\(\Omega_i\) being the hypercubes themselves.
%
\begin{equation}
\label{eq:vegasrho}
@ -222,7 +226,7 @@ and \(\Omega_i\) being the hypercubes themselves.
deviations of the distributions with matching color.}
\end{figure}
%
This algorithm has been implemented in python and applied to
This algorithm has been implemented in \texttt{Python} and applied to
\cref{eq:crossec}. In one dimension the hypercubes become simple
interval increments and applying \vegas\ to \cref{eq:crossec} with
\result{xs/python/xs_mc_θ_vegas_K} increments yields

View file

@ -243,9 +243,8 @@ distribution \(f\) is required.
Yet another approach is to subdivide the sampling volume \(\Omega\)
into \(K\) sub-volumes \(\Omega_i\subset\Omega\) and then take a
number of samples from each volume proportional to the integral of the
function \(f\) in that volume. In the context of sampling of
distributions, this is known as \emph{stratified
sampling}. The advantage of this method is, that it is now possible
function \(f\) in that volume. This is a method of stratified
\emph{stratified sampling}, with the advantage that it is now possible
to optimize the sampling in each sub-volume independently.
Let \(N\) be the total sample count (\(N\gg 1\)),
@ -340,9 +339,12 @@ in \cref{sec:simpdiphotriv}.
\caption{\label{fig:histpt} Histogram of the transverse momentum
(\(\pt\)) distribution.}
\end{subfigure}
\caption{\label{fig:histos} Histograms of observables, generated
from a sample of 4-momenta and normalized to unity. The plots
include histograms generated by \sherpa\ and \rivet.}
\caption[Histograms of observables, generated from a sample of
4-momenta and normalized to unity.]{\label{fig:histos} Histograms of
observables, generated from a sample of 4-momenta and normalized
to unity. The plots include histograms generated by \sherpa\ and
\rivet. The \(P\) and \(T\) values are a measure of consistency of
the two histograms as is described in \cref{sec:comphist}.}
\end{figure}
%
Where \cref{fig:histeta} shows clear resemblance of
@ -354,10 +356,14 @@ to \(\pt\) it can be seen in \cref{fig:diff-xs-pt} that there really
is a singularity at \(\pt = \ecm\), due to a term
\(1/\sqrt{1-(2\cdot \pt/\ecm)^2}\) stemming from the Jacobian
determinant. This singularity will vanish once considering a more
realistic process (see \cref{chap:pdf}). Furthermore the histograms
\cref{fig:histeta,fig:histpt} have a \(P\)-value (see
\cref{sec:comphist}) tested for consistency with their
\rivet-generated counterparts and are therefore considered valid.
realistic process (see \cref{chap:pdf}).
The compatibility of histograms is tested as discussed in
\cref{sec:comphist} and the respective \(P\) and \(T\) values are
being included in the ratio plots. The histograms
\cref{fig:histeta,fig:histpt} are (see \cref{sec:comphist}) tested for
consistency with their \rivet-generated counterparts. They have a
\(P\)-value greater than \(.6\) and are therefore considered valid.
%%% Local Variables:
%%% mode: latex

View file

@ -96,7 +96,7 @@ implementation used here can be found as described in
\cref{sec:source} and employs stratified sampling (as discussed in
\cref{sec:stratsamp-real}) and the hit-or-miss method. The matrix
element (ME) and cuts are implemented using
\texttt{cython}~\cite{behnel2011:cy} to obtain better performance as
\texttt{Cython}~\cite{behnel2011:cy} to obtain better performance as
these are evaluated very often. The ME and the cuts are then convolved
with the PDF (as in \cref{eq:weighteddist}) and wrapped into a simple
function with a generic interface and plugged into the \vegas\
@ -123,9 +123,9 @@ one sample is obtained. Taking more than one sample can improve
performance, but introduces bias, as hypercubes with low weight may be
oversampled. At various points, the \texttt{numba}~\cite{lam2015:po}
package has been used to just-in-time compile code to increase
performance. The python \texttt{multiprocessing} module is used to
parallelize the sampling and exploit all CPU cores. Although the
\vegas\ step is very (\emph{very}) time intensive, but the actual
performance. The \texttt{Python} \texttt{multiprocessing} module is
used to parallelize the sampling and exploit all CPU cores. Although
the \vegas\ step is very (\emph{very}) time intensive, but the actual
sampling performance is in the same order of magnitude as \sherpa, but
some parameters have to be manually tuned.

View file

@ -1,3 +1,4 @@
\thispagestyle{empty}
\section*{Acknowledgements}
I want to thank Frank Siegert, my thesis advisor, for his patience