diff --git a/Lectures_my/EMPP/2016/Lecture1/Makefile b/Lectures_my/EMPP/2016/Lecture1/Makefile new file mode 100644 index 0000000..e4cf8e8 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/Makefile @@ -0,0 +1,9 @@ +all: mchrzasz.pdf + +mchrzasz.pdf: mchrzasz.tex + xelatex mchrzasz.tex +# bibtex mchrzasz + xelatex mchrzasz.tex +# xelatex mchrzasz.tex +clean: + rm *.aux *.bbl *.blg *.log *.out *.pdf *.sh *.xml *.snm *.toc *.nav diff --git a/Lectures_my/EMPP/2016/Lecture1/beamercolorthemeFlip.sty b/Lectures_my/EMPP/2016/Lecture1/beamercolorthemeFlip.sty new file mode 100755 index 0000000..d6b9c50 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/beamercolorthemeFlip.sty @@ -0,0 +1,179 @@ +% Color style file for the BEAMER FLIP THEME +% Copyright 2012 by Flip Tanedo +% This file may be distributed and/or modified +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. + + + +\mode +\newif\ifbeamer@Flip@dark +\beamer@Flip@darkfalse +\DeclareOptionBeamer{dark}{\beamer@Flip@darktrue} +\ProcessOptionsBeamer + + +% These are a few colors that I like. + +\definecolor{crimsonred}{RGB}{153,0,0} % Neurtal red, good for dark or light bg +\definecolor{darkcharcoal}{RGB}{25,25,25} % Darker gray +\definecolor{charcoal}{RGB}{51,51,51} % Darker gray +\definecolor{ash}{RGB}{100,100,100} % medium gray +\definecolor{paleblue}{RGB}{0,102,102} % More of an `ocean' color +\definecolor{turtlegreen}{RGB}{51,153,0} % A more neutral green +\definecolor{paleale}{RGB}{204,204,102} % Only for dark BG +\definecolor{lager}{RGB}{140,110,10} % Use instead of pale ale for white BG +\definecolor{regal}{RGB}{90,0,120} % A more neutral purple +\definecolor{jeans}{RGB}{20,30,150} % A more neutral blue + + +% Define some "invariant colors" so that a color that doen't work with a +% light/dark background will automatically be substituted with one that does. +% These will be rewritten in beamercolorthemeFlipDark + +\ifbeamer@Flip@dark + \definecolor{FlipSand}{RGB}{204,204,102} % paleale, Only for dark BG + \definecolor{FlipGreen}{RGB}{0,255,0} % Neon-like green, only for dark BG +\else + \definecolor{FlipSand}{RGB}{140,110,10} % lager, Only for light BG + \definecolor{FlipGreen}{RGB}{51,153,0} % turtlegreen, works for both +\fi + +%% Future revision: It would be nice to define these in terms of the palette. + + +\ifbeamer@Flip@dark + \setbeamercolor{normal text}{fg=white, bg=black} + \setbeamercolor{structure}{fg=gray, bg=black} % fg controls bullets + \setbeamercolor*{footerlike}{fg=white,bg=black} % Controls the footerline +\else + % Default to black on white + \setbeamercolor*{footerlike}{fg=white,bg=charcoal} % for charcoal footer + \setbeamercolor{structure}{fg=charcoal, bg=white} % fg controls bullets + % \setbeamercolor{normal text}{fg=white, bg=black} +\fi + + + + + +% These defined colors can be used in \textcolor{colorname}{text in that color}. + +% Colors for Keynote background: DARK +\definecolor{keynotebottom}{rgb}{0.32,0.3,0.38} +\definecolor{keynotemiddle}{rgb}{0.08,0.08,0.16} +\definecolor{keynotetop}{rgb}{0,0,0} +%%% Example of usage: +%% \setbeamertemplate{background canvas}[vertical shading] +%% [bottom=keynotebottom, middle=keynotemiddle, top=keynotetop] + + + + +% ALERT AND COMMENT COLORS (just copies of the above colors) +% (I don't know how ot do this more elegantly) +\ifbeamer@Flip@dark + \definecolor{ALERT}{RGB}{153,0,0} % crimsonred + \definecolor{Alert}{RGB}{51,153,0} % turtlegreen + \definecolor{alert}{RGB}{204,204,102} % paleale + \definecolor{charcoal}{RGB}{51,51,51} % charcoal + \definecolor{comment}{RGB}{80,80,80} % light charcoal + \definecolor{Comment}{RGB}{100,100,100} % ash + \definecolor{COMMENT}{RGB}{80,20,120} % regal +\else +% \definecolor{ALERT}{RGB}{153,0,0} % crimsonred + \definecolor{ALERT}{RGB}{28,134,238} % DodgerBlue2 +% \definecolor{Alert}{RGB}{51,153,0} % turtlegreen + \definecolor{Alert}{RGB}{255,127,36} % chocolate1 +% \definecolor{alert}{RGB}{140,110,10} % lager + \definecolor{alert}{RGB}{0,205,102} % SpringGreen3 + \definecolor{charcoal}{RGB}{80,80,80} % light charcoal + \definecolor{comment}{RGB}{51,51,51} % charcoal + \definecolor{Comment}{RGB}{100,100,100} % ash + \definecolor{COMMENT}{RGB}{80,20,120} % regal +\fi + + +% \definecolor{crimsonred}{RGB}{153,0,0} % Neurtal red, good for dark or light bg +% \definecolor{charcoal}{RGB}{51,51,51} % Darker gray +% \definecolor{ash}{RGB}{100,100,100} % medium gray +% \definecolor{paleblue}{RGB}{0,102,102} % More of an `ocean' color +% \definecolor{turtlegreen}{RGB}{51,153,0} % A more neutral green +% \definecolor{paleale}{RGB}{204,204,102} % Only for dark BG +% \definecolor{lager}{RGB}{140,110,10} % Use instead of pale ale for white BG +% \definecolor{regal}{RGB}{90,0,120} % A more neutral purple +% \definecolor{jeans}{RGB}{20,30,150} % A more neutral blue + + +% A few useful colors +\setbeamercolor{alerted text}{fg=alert} + +%% I would like ot use these colors, but there seems to be a bug in Beamer +%% where the footnote color infects the normal text color +%% See: http://tex.stackexchange.com/questions/8264/beamer-changing-the-footnote-color-also-changes-the-normal-text-color/8268#8268 + +% \setbeamercolor{footnote}{parent=normal text, fg=FlipSand} +% \setbeamercolor{footnote mark}{parent=normal text, fg=FlipSand} + +% Blocks +\setbeamercolor{block title}{fg=gray!30!white,bg=charcoal} +\setbeamercolor{block body}{parent=normal text,bg=gray, fg=white} + +\setbeamercolor{block title example}{fg=turtlegreen!30!white,bg=turtlegreen!40!black} +\setbeamercolor{block body example}{parent=normal text,bg=turtlegreen, fg=white} +% +\setbeamercolor{block title alerted}{fg=crimsonred!30!white,bg=crimsonred!40!black} +\setbeamercolor{block body alerted}{parent=normal text,bg=crimsonred, fg=white} + + + +% These "setbeamercolor" commands are more standardized. + + +%% From the Beamer User Guide: +% Outer themes base the color of navigational elements and, possibly, also of other elements, on the +% four palette colors. The “primary” palette should be used for the most important navigational elements, +% which are usually the ones that change most often and hence require the most attention by the audience. +% The “secondary” and “tertiary” are less important, the “quaternary” one is least important. +% By default, the palette colors do not have a background and the foreground ranges from structure.fg to black. +% For the sidebar, there is an extra set of palette colors, see palette sidebar primary. + +\setbeamercolor*{palette primary}{fg=crimsonred,bg=charcoal} +\setbeamercolor*{palette secondary}{fg=paleale,bg=lager} +\setbeamercolor*{palette tertiary}{fg=turtlegreen,bg=jeans} +\setbeamercolor*{palette quaternary}{fg=paleblue,bg=regal} + +% \setbeamercolor*{palette primary}{fg=crimsonred,bg=white} +% \setbeamercolor*{palette secondary}{fg=charcoal,bg=white} +% \setbeamercolor*{palette tertiary}{fg=paleblue,bg=white} +% \setbeamercolor*{palette quaternary}{fg=turtlegreen,bg=white} + + + +%% These are some structures that I define for use in the outer theme. + +\setbeamercolor*{crimsontown}{fg=paleblue,bg=crimsonred} +\setbeamercolor*{bluetown}{fg=white,bg=DodgerBlue2} +%\setbeamercolor*{titlelike}{fg=crimsonred} +\setbeamercolor*{titlelike}{fg=DodgerBlue2} +\setbeamercolor*{topbarlike}{fg=white, bg=charcoal} + + + + + +%% Some old definitions that I might want to get back to +% +% \setbeamercolor*{frametitle}{bg=white,fg=charcoal} +% \setbeamercolor*{part title}{bg=white,fg=charcoal} +% \setbeamercolor*{item}{fg=charcoal, bg=white} +% +% \setbeamercolor*{separation line}{} +% \setbeamercolor*{fine separation line}{} + + + + + +\mode + diff --git a/Lectures_my/EMPP/2016/Lecture1/beamerinnerthemeFlip.sty b/Lectures_my/EMPP/2016/Lecture1/beamerinnerthemeFlip.sty new file mode 100755 index 0000000..9910f4d --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/beamerinnerthemeFlip.sty @@ -0,0 +1,95 @@ +% Inner style file for the BEAMER FLIP THEME +% Copyright 2010 by Flip Tanedo +% This file may be distributed and/or modified +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% Based on: beamerinnerthemeFlip by Marco Barisione + +\mode + +% % Use alternative title page style. +% \DeclareOptionBeamer{alternativetitlepage}[true]{\def\beamer@Flip@alternativetitlepage{#1}} + +% Logo to use in the alternative title page. +% \def\beamer@Flip@titlepagelogo{} +% \DeclareOptionBeamer{titlepagelogo}{\def\beamer@Flip@titlepagelogo{#1}} + +% Bullet shape. +\DeclareOptionBeamer{bullet}{\def\beamer@Flip@bullet{#1}} +\DeclareOptionBeamer{shadow}[true]{\def\beamer@themerounded@shadow{#1}} +\ExecuteOptionsBeamer{shadow=false} + + +% \ExecuteOptionsBeamer{alternativetitlepage=false,bullet=square} +\ProcessOptionsBeamer + + + +% Margins. +\newlength{\beamer@Flip@normalmargin} +\setlength{\beamer@Flip@normalmargin}{.06\paperwidth} +\setbeamersize{text margin left=\beamer@Flip@normalmargin} +\setbeamersize{text margin right=\beamer@Flip@normalmargin} +\setlength\leftmargini{.6\beamer@Flip@normalmargin} +\setlength\leftmarginii{.6\beamer@Flip@normalmargin} +\setlength\leftmarginiii{.6\beamer@Flip@normalmargin} + +% Normal title page. +\defbeamertemplate*{title page normal}{Flip theme}[1][] +{ + \vbox{} + \vfill + \begin{centering} + \begin{beamercolorbox}[wd=\paperwidth,sep=8pt,center,#1]{title page header} + \usebeamerfont{title}\inserttitle\par% + \ifx\insertsubtitle\@empty% + \else% + \vskip0.25em% + {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}% + \fi% + \end{beamercolorbox}% + \vskip1em\par + \begin{beamercolorbox}[sep=8pt,center,#1]{author} + \usebeamerfont{author}\insertauthor + \end{beamercolorbox} + \begin{beamercolorbox}[sep=8pt,center,#1]{institute} + \usebeamerfont{institute}\insertinstitute + \end{beamercolorbox} + \begin{beamercolorbox}[sep=8pt,center,#1]{date} + \usebeamerfont{date}\insertdate + \end{beamercolorbox}\vskip0.5em + {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par} + \end{centering} + \vfill +} + + +% Items. +\defbeamertemplate{itemize item}{squarealt}% +{\tiny\raise.5ex\hbox{\donotcoloroutermaths$\blacksquare$}} +\defbeamertemplate{itemize subitem}{squarealt}% +{\tiny\raise.4ex\hbox{\donotcoloroutermaths$\square$}} +\defbeamertemplate{itemize subsubitem}{squarealt}% +{\tiny\raise.3ex\hbox{\donotcoloroutermaths$\blacksquare$}} +% +\defbeamertemplate{itemize item}{circlealt}% +{\small\raise.2ex\hbox{\donotcoloroutermaths$\bullet$}} +\defbeamertemplate{itemize subitem}{circlealt}% +{\small\raise.1ex\hbox{\donotcoloroutermaths$\circ$}} +\defbeamertemplate{itemize subsubitem}{circlealt}% +{\scriptsize\raise.1ex\hbox{\donotcoloroutermaths$\bullet$}} +\setbeamertemplate{items}[circlealt] +% +\def\circletext{circle} +\ifx\beamer@Flip@bullet\circletext + \setbeamertemplate{items}[circlealt] +\else + \setbeamertemplate{items}[squarealt] +\fi + +\setbeamertemplate{blocks}[rounded][shadow=\beamer@themerounded@shadow] + + +\mode + diff --git a/Lectures_my/EMPP/2016/Lecture1/beamerouterthemeFlip.sty b/Lectures_my/EMPP/2016/Lecture1/beamerouterthemeFlip.sty new file mode 100755 index 0000000..d12f6d6 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/beamerouterthemeFlip.sty @@ -0,0 +1,189 @@ +% Outer style file for the BEAMER FLIP THEME 212 +% Copyright 2012 by Flip Tanedo +% This file may be distributed and/or modified +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% Based on: beamerouterthemesplit by Till Tantau + + +\mode + +% Watermark +\DeclareOptionBeamer{watermark}{\def\beamer@Flip@watermark{#1}} +\ExecuteOptionsBeamer{watermark=} % Default value is empty + + +\newif\ifbeamer@Flip@bigpagenumber +\beamer@Flip@bigpagenumberfalse +\DeclareOptionBeamer{bigpagenumber}{\beamer@Flip@bigpagenumbertrue} + + +\def\beamer@Flip@truetext{true} % Kludge for true/false so I can use ifx + +\DeclareOptionBeamer{topline}[true]{\def\beamer@Flip@topline{#1}} +\ExecuteOptionsBeamer{topline=false} % Default + + + +% \ExecuteOptionsBeamer{topline=} % Default value is empty + + +\ProcessOptionsBeamer + + +\usepackage{tikz} % For fancy decorations + + +% I should fix these up to be more robust against color changes +\setbeamercolor{section in head/foot}{parent=footerlike} +\setbeamercolor{subsection in head/foot}{parent=footerlike} +\setbeamercolor{author in head/foot}{parent=footerlike} +\setbeamercolor{title in head/foot}{parent=footerlike} + + +% \setbeamercolor{author in head/foot}{parent=section in head/foot} +% \setbeamercolor{title in head/foot}{parent=subsection in head/foot} + +%\setbeamercolor{topbar}{parent=crimsontown} +\setbeamercolor{topbar}{parent=bluetown} + + + + +\usesectionheadtemplate + {\hfill\insertsectionhead} + {\hfill\color{fg!50!bg}\insertsectionhead} + + +%%%%%%%%%%%%%%%%%% +% The footer bar % +%%%%%%%%%%%%%%%%%% + +\defbeamertemplate*{footline}{Flip theme} +{% + \leavevmode% +% OBSERVATION: the "%" symbols inside hbox are all very important here. +% The \hbox enviroment will insert spaces whenever there's whitespace +% Adding a % at the END of each line ensures that any hard returns aren't +% interpreted as white space. This allows the color boxes to be flush against +% one another. If a faint white line appears one could probably do something like +% hspace{-1px} and add an additional pixel-or-two wide beamercolorbox. + +\hbox{% +\begin{beamercolorbox}[wd=.4\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm, rightskip=.3cm plus1fil]{author in head/foot}% + \usebeamerfont{author in head/foot}\insertshortauthor \end{beamercolorbox}% +% +\begin{beamercolorbox}[wd=.6\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}% + \usebeamerfont{title in head/foot}{\textit \insertshorttitle}% + \hskip2ex plus1fill% + % \insertpagenumber\,/\,\insertpresentationendpage %% Want FRAME, not SLIDE number + \insertframenumber/\inserttotalframenumber + \end{beamercolorbox}% +}% + +% This is a complete kludge for the faint white line which appears +% between the beamer color boxes above. (It doesnt appear in presentation mode +% but sometimes looks funny when the pdfs are viewed in a window) +\begin{tikzpicture}[overlay] + \usebeamercolor[bg]{author in head/foot} + \draw[thick] (0,3.625ex) -- (\paperwidth,3.625ex); + \draw (.4\paperwidth,0) -- (.4\paperwidth,3.625ex); + \draw[thick] (0,0) -- (\paperwidth,0); +\end{tikzpicture} + + + +\ifbeamer@Flip@bigpagenumber + \begin{tikzpicture}[overlay] + \usebeamercolor[bg]{author in head/foot} + \draw[fill] (\paperwidth-5ex,3.625ex) circle (6ex); + \usebeamercolor[fg]{author in head/foot} + \draw[fill] (\paperwidth-5ex,3.625ex) circle (5ex); + \usebeamercolor[bg]{author in head/foot} + \node at (\paperwidth-5ex,4ex) {\small$^\text{\insertframenumber}/_\text{\inserttotalframenumber}$}; + \end{tikzpicture} +\fi +} + + + +\defbeamertemplate*{frametitle}{Flip theme}[1][left] +{ +% \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}% +\@tempdima=\textwidth% +\advance\@tempdima by\beamer@leftmargin% +\advance\@tempdima by\beamer@rightmargin% + +\vbox{}\vskip-3.5ex% +% +\begin{beamercolorbox}[sep=0.3cm,#1,wd=\the\@tempdima]{titlelike} + \usebeamerfont{frametitle}% + \vbox{}\vskip-1ex% + \if@tempswa\else\csname beamer@fte#1\endcsname\fi% + % \strut{\bf\insertframetitle}\strut\par% %% Include the \bf + \strut{\insertframetitle}\strut\par% + {% + \ifx\insertframesubtitle\@empty% + \else + {\usebeamerfont{framesubtitle} + \usebeamercolor[fg]{framesubtitle} + \insertframesubtitle\strut\par}% + \fi + }% + % + \vskip-1ex% + \if@tempswa\else\vskip-.3cm\fi% set inside beamercolorbox... evil here... +\end{beamercolorbox}% +%% + +% \def\beamer@fteright{\vskip0.35cm\advance\leftskip by 1.7cm\advance\rightskip by1.7cm} +} + + + + +% Sidebar right is important: anything placed here will be +% visible *behind* the main text. This is where to put any +% interesting watermarks. +% +% +\defbeamertemplate*{sidebar right}{Flip theme} +{ +% \llap{\includegraphics[width=50px]{footdecoration}} +% \llap{\includegraphics[width=\paperwidth,height=\paperheight]{upperleft_watermark_transp}} +% +% THIS WOULD BE A NICE WAY TO PUT THE PARTICLE BUBBLE CHAMBER BG +% ... make a png of the background with TRANSPARENT BG +% ... then put the image here (use \hfill to get it on the left) +% Now one can FURTHER apply a slight gradient in the BG +% +% +% % Top Line +\ifx\beamer@Flip@topline\beamer@Flip@truetext + \begin{tikzpicture}[overlay] + \usebeamercolor[fg]{titlelike} % alternately, topbarlike would be a good beamercolor +% \usebeamercolor[fg]{topbarlike} % alternately, topbarlike would be a good beamercolor + \draw[fill] (-\paperwidth,0) rectangle (0,-3pt); + \end{tikzpicture} +\fi +% +% + \vskip.2\beamer@leftmargin% + %\llap{\insertlogo\hskip.5\beamer@leftmargin}% + \llap{\insertlogo\hskip.08\beamer@leftmargin}% + \vfill% + \if \beamer@Flip@watermark\@empty + % This is kind of a kludge since if I put anything in here, I automatically get errors + % Somehow LaTeX wants to read the \else part! + \else% + \llap{\includegraphics[width=\paperwidth,height=\paperheight]{\beamer@Flip@watermark}} + \fi +} + + + +\mode +\endinput + + diff --git a/Lectures_my/EMPP/2016/Lecture1/beamerouterthemedecolines.sty b/Lectures_my/EMPP/2016/Lecture1/beamerouterthemedecolines.sty new file mode 100755 index 0000000..669e493 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/beamerouterthemedecolines.sty @@ -0,0 +1,168 @@ +% Copyright 2007 by Marco Barisione +% +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. + +\mode + +% String used between the current page and the total page count. +\def\beamer@decolines@pageofpages{/} +\DeclareOptionBeamer{pageofpages}{\def\beamer@decolines@pageofpages{#1}} + +% Show a line below the frame title. +\DeclareOptionBeamer{titleline}[true]{\def\beamer@decolines@titleline{#1}} + +% Image used for the watermark. +\def\beamer@decolines@watermarkorig{} +\DeclareOptionBeamer{watermark}{\def\beamer@decolines@watermarkorig{#1}} + +% Height of the watermark. +\def\beamer@decolines@watermarkheight{100px} +\DeclareOptionBeamer{watermarkheight}{\def\beamer@decolines@watermarkheight{#1}} + +% The original image height is watermarkheightmult * watermarkheight. +\def\beamer@decolines@watermarkheightmult{1} +\DeclareOptionBeamer{watermarkheightmult}{\def\beamer@decolines@watermarkheightmult{#1}} + +\ExecuteOptionsBeamer{titleline=false} +\ProcessOptionsBeamer + +% Enable/disable the watermark. +\def\watermarkon{% + \def\beamer@decolines@watermark{\beamer@decolines@watermarkorig}% +} +\def\watermarkoff{\def\beamer@decolines@watermark{}} + +% Initially enable the watermark. +\watermarkon + +% Colors. +\setbeamercolor*{lineup}{parent=palette primary} +\setbeamercolor*{linemid}{parent=palette secondary} +\setbeamercolor*{linebottom}{parent=palette tertiary} +\setbeamercolor*{page header}{parent=titlelike} + +% Lengths +\newlength{\headerheight} +\setlength{\headerheight}{.045\paperheight} +\newlength{\beamer@decolines@lineup} +\setlength{\beamer@decolines@lineup}{.025\paperheight} +\newlength{\beamer@decolines@linemid} +\setlength{\beamer@decolines@linemid}{.015\paperheight} +\newlength{\beamer@decolines@linebottom} +\setlength{\beamer@decolines@linebottom}{.01\paperheight} + +% The height of the watermark part below the 3 bottom lines. +\newlength{\beamer@decolines@watermarkheightbottom} +\addtolength{\beamer@decolines@watermarkheightbottom}{\beamer@decolines@lineup} +\addtolength{\beamer@decolines@watermarkheightbottom}{\beamer@decolines@linemid} +\addtolength{\beamer@decolines@watermarkheightbottom}{\beamer@decolines@linebottom} + +% The height of the watermark part over the 3 bottom lines before shrinking. +\newlength{\beamer@decolines@watermarkheightupperorig} +\setlength{\beamer@decolines@watermarkheightupperorig}{\beamer@decolines@watermarkheight} +\addtolength{\beamer@decolines@watermarkheightupperorig}{-\beamer@decolines@watermarkheightbottom} +\multiply\beamer@decolines@watermarkheightupperorig by \beamer@decolines@watermarkheightmult + +% % Footer. +% \defbeamertemplate*{footline}{decolines theme} +% { +% \leavevmode% +% % Page number. +% \hbox{% +% \begin{beamercolorbox}[wd=.2\paperwidth,ht=0ex,dp=0ex,center]{}% +% \usebeamerfont{palette primary}\insertframenumber{} \beamer@decolines@pageofpages{} \inserttotalframenumber% +% \end{beamercolorbox}% +% \begin{beamercolorbox}[wd=.8\paperwidth,ht=0ex,dp=0ex]{}% +% \end{beamercolorbox}% +% } % +% % First line. +% \hbox{% +% \begin{beamercolorbox}[wd=.2\paperwidth,ht=\beamer@decolines@lineup,dp=0pt]{}% +% \end{beamercolorbox}% +% \begin{beamercolorbox}[wd=.8\paperwidth,ht=\beamer@decolines@lineup,dp=0pt]{lineup}% +% \end{beamercolorbox}% +% } % +% % Second line. +% \hbox{% +% \begin{beamercolorbox}[wd=\paperwidth,ht=\beamer@decolines@linemid,dp=0pt]{linemid}% +% \end{beamercolorbox}% +% } % +% % Third line. +% \hbox{% +% \begin{beamercolorbox}[wd=.1\paperwidth,ht=\beamer@decolines@linebottom,dp=0pt]{}% +% \end{beamercolorbox}% +% \begin{beamercolorbox}[wd=.9\paperwidth,ht=\beamer@decolines@linebottom,dp=0pt]{linebottom}% +% \end{beamercolorbox}% +% }% +% % This seems to fix some alignment problems with the watermark. It has to be +% % always applied if you do not want to see the footer moving up and down when +% % moving from a page with watermark to a page without or vice versa. +% \vskip-.5px% +% % Watermark. +% \if\beamer@decolines@watermark\@empty\else% +% \vskip-\beamer@decolines@watermarkheightbottom% +% \llap{\includegraphics[height=\beamer@decolines@watermarkheightbottom,clip=true,% +% trim=0pt 0pt 0pt \beamer@decolines@watermarkheightupperorig]{\beamer@decolines@watermark}\hskip-\paperwidth}% +% \fi% +% } + +\defbeamertemplate*{headline}{decolines theme} +{ + \leavevmode% + \hbox{% + \begin{beamercolorbox}[wd=\paperwidth,ht=\headerheight,dp=0pt]{page header}% + \end{beamercolorbox}% + } % + \vskip0pt% +} + +\defbeamertemplate*{frametitle}{decolines theme}[1][left] +{ + \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}% + \@tempdima=\textwidth% + \advance\@tempdima by\beamer@leftmargin% + \advance\@tempdima by\beamer@rightmargin% + \vbox{}\vskip-.5\beamer@leftmargin% + \begin{beamercolorbox}[sep=\beamer@leftmargin,#1,wd=\the\@tempdima]{} + \usebeamerfont{frametitle}\usebeamercolor[bg]{framesubtitle}% + \vbox{}\vskip0ex% + \if@tempswa\else\csname beamer@fte#1\endcsname\fi% + \strut\insertframetitle\strut\par% + {% + \ifx\insertframesubtitle\@empty% + \else% + {\usebeamerfont{framesubtitle}\usebeamercolor[bg]{framesubtitle}\insertframesubtitle\strut\par}% + \fi + }% + \vskip-1ex% + \if@tempswa\else\vskip-\beamer@leftmargin\fi + \end{beamercolorbox}% + \def\beamer@decolines@truetext{true}% + \ifx\beamer@decolines@titleline\beamer@decolines@truetext% + \vskip-.5\beamer@leftmargin% + \begin{beamercolorbox}[wd=\textwidth,ht=.1ex,dp=0ex]{linemid}% + \end{beamercolorbox}% + \fi +} + +% Frame title continuations, default +\defbeamertemplate*{frametitle continuation}{decolines theme}{(\insertcontinuationcount)} + + + +\defbeamertemplate*{sidebar right}{decolines theme} +{ + \vskip.1\beamer@leftmargin% + \llap{\insertlogo\hskip.5\beamer@leftmargin}% + \vfill% + \if\beamer@decolines@watermark\@empty\else% + \llap{\includegraphics[height=\beamer@decolines@watermarkheight]{\beamer@decolines@watermark}}% + \vskip-\beamer@decolines@watermarkheightbottom% + \fi +} + +\mode + diff --git a/Lectures_my/EMPP/2016/Lecture1/beamerthemeFlip.sty b/Lectures_my/EMPP/2016/Lecture1/beamerthemeFlip.sty new file mode 100755 index 0000000..a615ff5 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/beamerthemeFlip.sty @@ -0,0 +1,59 @@ +% Main style file for the BEAMER FLIP THEME 2012 +% Copyright 2012 by Flip Tanedo +% This file may be distributed and/or modified +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% Comments: This is still a work in progress. +% A good way to present: http://www.cs.hmc.edu/~oneill/freesoftware/pdftokeynote.html + +% \usepackage{beamerthemesplit} +\mode + + +%% These are the options that are fed in through the driver file +%% Some of them get passed on to the other theme files +\DeclareOptionBeamer{bullet}{\PassOptionsToPackage{bullet=#1}{beamerinnerthemeFlip}} +\DeclareOptionBeamer{bigpagenumber}{\PassOptionsToPackage{bigpagenumber}{beamerouterthemeFlip}} +\DeclareOptionBeamer{topline}[true]{\PassOptionsToPackage{topline=#1}{beamerouterthemeFlip}} +\DeclareOptionBeamer{shadow}[false]{\PassOptionsToPackage{shadow=#1}{beamerinnerthemeFlip}} + +\DeclareOptionBeamer{watermark}{\PassOptionsToPackage{watermark=#1}{beamerouterthemeFlip}} + +\ProcessOptionsBeamer + +\useinnertheme{Flip} % Calls beamerinnerthemeFlip.sty +\useoutertheme{Flip} % Calls beamerouterthemeFlip.sty +\usecolortheme{Flip} % Calls beamercolorthemeFlip.sty + + + +%%%%%%%%%%%%%%%%%%%%%%%% +% Background Gradient % +%%%%%%%%%%%%%%%%%%%%%%%% + + +%% Usually I would leave this on +%% However, there seems to be problems with XeLaTeX +%% http://tex.stackexchange.com/questions/29497/xelatex-preventing-beamer-from-using-different-backgrounds +\setbeamertemplate{background canvas}[vertical shading][bottom=blue!.1, middle=white, top=white] + +%% HOWEVER: it seems to make it impossible to change this later on in the document + + +%% For a dark background: +% \setbeamertemplate{background canvas}[vertical shading][bottom=keynotebottom, middle=keynotemiddle, top=keynotetop] + + +%% An alternate way: \beamertemplateshadingbackground{blue!.1}{red!2} +%% In general: you want the gradient to be subtle! + + +%%%%%%%%%%%%%%%%%%%%%%% +% Navigation symbols % +%%%%%%%%%%%%%%%%%%%%%%% + +\setbeamertemplate{navigation symbols}{} % Turns off PDF navigation symbols + +\mode +\endinput \ No newline at end of file diff --git a/Lectures_my/EMPP/2016/Lecture1/images/BG_lower.png b/Lectures_my/EMPP/2016/Lecture1/images/BG_lower.png new file mode 100755 index 0000000..073034a --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/BG_lower.png Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/Higs_Ellis_SM.png b/Lectures_my/EMPP/2016/Lecture1/images/Higs_Ellis_SM.png new file mode 100644 index 0000000..7722291 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/Higs_Ellis_SM.png Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/bubble.gif b/Lectures_my/EMPP/2016/Lecture1/images/bubble.gif new file mode 100644 index 0000000..ecff282 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/bubble.gif Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/bubble.jpg b/Lectures_my/EMPP/2016/Lecture1/images/bubble.jpg new file mode 100644 index 0000000..ceb584d --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/bubble.jpg Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/bubble2.jpg b/Lectures_my/EMPP/2016/Lecture1/images/bubble2.jpg new file mode 100644 index 0000000..0fd03bb --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/bubble2.jpg Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/buffon.png b/Lectures_my/EMPP/2016/Lecture1/images/buffon.png new file mode 100644 index 0000000..b3c1f65 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/buffon.png Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/dupa.png b/Lectures_my/EMPP/2016/Lecture1/images/dupa.png new file mode 100644 index 0000000..70db5f7 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/dupa.png Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/result.png b/Lectures_my/EMPP/2016/Lecture1/images/result.png new file mode 100644 index 0000000..3617873 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/result.png Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/result_error.pdf b/Lectures_my/EMPP/2016/Lecture1/images/result_error.pdf new file mode 100644 index 0000000..f7a21bd --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/result_error.pdf Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/result_error_dep.pdf b/Lectures_my/EMPP/2016/Lecture1/images/result_error_dep.pdf new file mode 100644 index 0000000..8017f1e --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/result_error_dep.pdf Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/result_weight.png b/Lectures_my/EMPP/2016/Lecture1/images/result_weight.png new file mode 100644 index 0000000..afda7e1 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/result_weight.png Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/results_0.pdf b/Lectures_my/EMPP/2016/Lecture1/images/results_0.pdf new file mode 100644 index 0000000..cc9f45a --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/results_0.pdf Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/results_1.pdf b/Lectures_my/EMPP/2016/Lecture1/images/results_1.pdf new file mode 100644 index 0000000..b0c4fa9 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/results_1.pdf Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/results_fit_0.pdf b/Lectures_my/EMPP/2016/Lecture1/images/results_fit_0.pdf new file mode 100644 index 0000000..4ac392a --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/results_fit_0.pdf Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/results_fit_1.pdf b/Lectures_my/EMPP/2016/Lecture1/images/results_fit_1.pdf new file mode 100644 index 0000000..8bc7be0 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/results_fit_1.pdf Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/images/uzh-transp.pdf b/Lectures_my/EMPP/2016/Lecture1/images/uzh-transp.pdf new file mode 100644 index 0000000..977da67 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/images/uzh-transp.pdf Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/mchrzasz-blx.bib b/Lectures_my/EMPP/2016/Lecture1/mchrzasz-blx.bib new file mode 100644 index 0000000..9e405b3 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/mchrzasz-blx.bib @@ -0,0 +1,11 @@ +@Comment{$ biblatex control file $} +@Comment{$ biblatex version 2.3 $} +Do not modify this file! + +This is an auxiliary file used by the 'biblatex' package. +This file may safely be deleted. It will be recreated as +required. + +@Control{biblatex-control, + options = {2.3:0:0:1:0:0:1:1:0:0:0:0:1:1:3:1:79:+}, +} diff --git a/Lectures_my/EMPP/2016/Lecture1/mchrzasz.synctex.gz b/Lectures_my/EMPP/2016/Lecture1/mchrzasz.synctex.gz new file mode 100644 index 0000000..0328aab --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/mchrzasz.synctex.gz Binary files differ diff --git a/Lectures_my/EMPP/2016/Lecture1/mchrzasz.tex b/Lectures_my/EMPP/2016/Lecture1/mchrzasz.tex new file mode 100644 index 0000000..84f30d5 --- /dev/null +++ b/Lectures_my/EMPP/2016/Lecture1/mchrzasz.tex @@ -0,0 +1,923 @@ +\documentclass[11 pt,xcolor={dvipsnames,svgnames,x11names,table}]{beamer} + +\usepackage[english]{babel} +\usepackage{polski} + + +\usetheme[ + bullet=circle, % Other option: square + bigpagenumber, % circled page number on lower right + topline=true, % colored bar at the top of the frame + shadow=false, % Shading for beamer blocks + watermark=BG_lower, % png file for the watermark + ]{Flip} + +%\logo{\kern+1.em\includegraphics[height=1cm]{SHiP-3_LightCharcoal}} + + +\usepackage[lf]{berenis} +\usepackage[LY1]{fontenc} +\usepackage[utf8]{inputenc} + +\usepackage{emerald} +\usefonttheme{professionalfonts} +\usepackage[no-math]{fontspec} +\defaultfontfeatures{Mapping=tex-text} % This seems to be important for mapping glyphs properly + +\setmainfont{Gillius ADF} % Beamer ignores "main font" in favor of sans font +\setsansfont{Gillius ADF} % This is the font that beamer will use by default +% \setmainfont{Gill Sans Light} % Prettier, but harder to read + +\setbeamerfont{title}{family=\fontspec{Gillius ADF}} + +\input t1augie.fd + +%\newcommand{\handwriting}{\fontspec{augie}} % From Emerald City, free font +%\newcommand{\handwriting}{\usefont{T1}{fau}{m}{n}} % From Emerald City, free font +% \newcommand{\handwriting}{} % If you prefer no special handwriting font or don't have augie + +%% Gill Sans doesn't look very nice when boldfaced +%% This is a hack to use Helvetica instead +%% Usage: \textbf{\forbold some stuff} +%\newcommand{\forbold}{\fontspec{Arial}} + +\usepackage{graphicx} +\usepackage[export]{adjustbox} + +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{amssymb} +\usepackage{bm} +\usepackage{colortbl} +\usepackage{mathrsfs} % For Weinberg-esque letters +\usepackage{cancel} % For "SUSY-breaking" symbol +\usepackage{slashed} % for slashed characters in math mode +\usepackage{bbm} % for \mathbbm{1} (unit matrix) +\usepackage{amsthm} % For theorem environment +\usepackage{multirow} % For multi row cells in table +\usepackage{arydshln} % For dashed lines in arrays and tables +\usepackage{siunitx} +\usepackage{xhfill} +\usepackage{grffile} +\usepackage{textpos} +\usepackage{subfigure} +\usepackage{tikz} +\usepackage{hyperref} +%\usepackage{hepparticles} +\usepackage[italic]{hepparticles} + +\usepackage{hepnicenames} + +% Drawing a line +\tikzstyle{lw} = [line width=20pt] +\newcommand{\topline}{% + \tikz[remember picture,overlay] {% + \draw[crimsonred] ([yshift=-23.5pt]current page.north west) + -- ([yshift=-23.5pt,xshift=\paperwidth]current page.north west);}} + + + +% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % +\usepackage{tikzfeynman} % For Feynman diagrams +\usetikzlibrary{arrows,shapes} +\usetikzlibrary{trees} +\usetikzlibrary{matrix,arrows} % For commutative diagram +% http://www.felixl.de/commu.pdf +\usetikzlibrary{positioning} % For "above of=" commands +\usetikzlibrary{calc,through} % For coordinates +\usetikzlibrary{decorations.pathreplacing} % For curly braces +% http://www.math.ucla.edu/~getreuer/tikz.html +\usepackage{pgffor} % For repeating patterns + +\usetikzlibrary{decorations.pathmorphing} % For Feynman Diagrams +\usetikzlibrary{decorations.markings} +\tikzset{ + % >=stealth', %% Uncomment for more conventional arrows + vector/.style={decorate, decoration={snake}, draw}, + provector/.style={decorate, decoration={snake,amplitude=2.5pt}, draw}, + antivector/.style={decorate, decoration={snake,amplitude=-2.5pt}, draw}, + fermion/.style={draw=gray, postaction={decorate}, + decoration={markings,mark=at position .55 with {\arrow[draw=gray]{>}}}}, + fermionbar/.style={draw=gray, postaction={decorate}, + decoration={markings,mark=at position .55 with {\arrow[draw=gray]{<}}}}, + fermionnoarrow/.style={draw=gray}, + gluon/.style={decorate, draw=black, + decoration={coil,amplitude=4pt, segment length=5pt}}, + scalar/.style={dashed,draw=black, postaction={decorate}, + decoration={markings,mark=at position .55 with {\arrow[draw=black]{>}}}}, + scalarbar/.style={dashed,draw=black, postaction={decorate}, + decoration={markings,mark=at position .55 with {\arrow[draw=black]{<}}}}, + scalarnoarrow/.style={dashed,draw=black}, + electron/.style={draw=black, postaction={decorate}, + decoration={markings,mark=at position .55 with {\arrow[draw=black]{>}}}}, + bigvector/.style={decorate, decoration={snake,amplitude=4pt}, draw}, +} + +% TIKZ - for block diagrams, +% from http://www.texample.net/tikz/examples/control-system-principles/ +% \usetikzlibrary{shapes,arrows} +\tikzstyle{block} = [draw, rectangle, +minimum height=3em, minimum width=6em] + + + + +\usetikzlibrary{backgrounds} +\usetikzlibrary{mindmap,trees} % For mind map +\newcommand{\degree}{\ensuremath{^\circ}} +\newcommand{\E}{\mathrm{E}} +\newcommand{\Var}{\mathrm{Var}} +\newcommand{\Cov}{\mathrm{Cov}} +\newcommand\Ts{\rule{0pt}{2.6ex}} % Top strut +\newcommand\Bs{\rule[-1.2ex]{0pt}{0pt}} % Bottom strut + +\graphicspath{{images/}} % Put all images in this directory. Avoids clutter. + +% SOME COMMANDS THAT I FIND HANDY +% \renewcommand{\tilde}{\widetilde} % dinky tildes look silly, dosn't work with fontspec +\newcommand{\comment}[1]{\textcolor{comment}{\footnotesize{#1}\normalsize}} % comment mild +\newcommand{\Comment}[1]{\textcolor{Comment}{\footnotesize{#1}\normalsize}} % comment bold +\newcommand{\COMMENT}[1]{\textcolor{COMMENT}{\footnotesize{#1}\normalsize}} % comment crazy bold +\newcommand{\Alert}[1]{\textcolor{Alert}{#1}} % louder alert +\newcommand{\ALERT}[1]{\textcolor{ALERT}{#1}} % loudest alert +%% "\alert" is already a beamer pre-defined +\newcommand*{\Scale}[2][4]{\scalebox{#1}{$#2$}}% + +\def\Put(#1,#2)#3{\leavevmode\makebox(0,0){\put(#1,#2){#3}}} + +\usepackage{gmp} +\usepackage[final]{feynmp-auto} + +\usepackage[backend=bibtex,style=numeric-comp,firstinits=true]{biblatex} +\bibliography{bib} +\setbeamertemplate{bibliography item}[text] + +\makeatletter\let\frametextheight\beamer@frametextheight\makeatother + +% suppress frame numbering for backup slides +% you always need the appendix for this! +\newcommand{\backupbegin}{ + \newcounter{framenumberappendix} + \setcounter{framenumberappendix}{\value{framenumber}} +} +\newcommand{\backupend}{ + \addtocounter{framenumberappendix}{-\value{framenumber}} + \addtocounter{framenumber}{\value{framenumberappendix}} +} + + +\definecolor{links}{HTML}{2A1B81} +%\hypersetup{colorlinks,linkcolor=,urlcolor=links} + +% For shapo's formulas: +\def\lsi{\raise0.3ex\hbox{$<$\kern-0.75em\raise-1.1ex\hbox{$\sim$}}} +\def\gsi{\raise0.3ex\hbox{$>$\kern-0.75em\raise-1.1ex\hbox{$\sim$}}} +\newcommand{\lsim}{\mathop{\lsi}} +\newcommand{\gsim}{\mathop{\gsi}} +\newcommand{\wt}{\widetilde} +%\newcommand{\ol}{\overline} +\newcommand{\Tr}{\rm{Tr}} +\newcommand{\tr}{\rm{tr}} +\newcommand{\eqn}[1]{&\hspace{-0.7em}#1\hspace{-0.7em}&} +\newcommand{\vev}[1]{\rm{$\langle #1 \rangle$}} +\newcommand{\abs}[1]{\rm{$\left| #1 \right|$}} +\newcommand{\eV}{\rm{eV}} +\newcommand{\keV}{\rm{keV}} +\newcommand{\GeV}{\rm{GeV}} +\newcommand{\im}{\rm{Im}} +\newcommand{\disp}{\displaystyle} +\def\be{\begin{equation}} +\def\ee{\end{equation}} +\def\ba{\begin{eqnarray}} +\def\ea{\end{eqnarray}} +\def\d{\partial} +\def\l{\left(} +\def\r{\right)} +\def\la{\langle} +\def\ra{\rangle} +\def\e{{\rm e}} +\def\Br{{\rm Br}} +\def\fixme{{\color{red} FIXME!}} +\def\mc{{\color{Magenta}{MC}}} +\def\pdf{{\rm p.d.f.}} + +\author{ {\fontspec{Trebuchet MS}Marcin Chrz\k{a}szcz} (Universit\"{a}t Z\"{u}rich)} +\institute{UZH} +\title[Introduction to \\Monte Carlo methods]{Introduction to \\Monte Carlo methods} +\date{\fixme} + + +\begin{document} +\tikzstyle{every picture}+=[remember picture] + +{ +\setbeamertemplate{sidebar right}{\llap{\includegraphics[width=\paperwidth,height=\paperheight]{bubble2}}} +\begin{frame}[c]%{\phantom{title page}} +\begin{center} +\begin{center} + \begin{columns} + \begin{column}{0.9\textwidth} + \flushright\fontspec{Trebuchet MS}\bfseries \Huge {Introduction to \\Monte Carlo methods} + \end{column} + \begin{column}{0.2\textwidth} + %\includegraphics[width=\textwidth]{SHiP-2} + \end{column} + \end{columns} +\end{center} + \quad + \vspace{3em} +\begin{columns} +\begin{column}{0.44\textwidth} +\flushright \vspace{-1.8em} {\fontspec{Trebuchet MS} \Large Marcin Chrząszcz\\\vspace{-0.1em}\small \href{mailto:mchrzasz@cern.ch}{mchrzasz@cern.ch}} + +\end{column} +\begin{column}{0.53\textwidth} +\includegraphics[height=1.3cm]{uzh-transp} +\end{column} +\end{columns} + +\vspace{1em} +% \footnotesize\textcolor{gray}{With N. Serra, B. Storaci\\Thanks to the theory support from M. Shaposhnikov, D. Gorbunov}\normalsize\\ +\vspace{0.5em} + \textcolor{normal text.fg!50!Comment}{Experimental Methods in Particle Physics, \\ 5 October, 2016} +\end{center} +\end{frame} +} + + +\begin{frame}\frametitle{Literature} + +\begin{enumerate} +\item J. M. Hammersley, D. C. Hamdscomb, ``Monte Carlo Methods'', London: Methuen \& Co. Ltd., New York: J. Wiley \& Sons Inc., 1964 +\item I. M. Sobol, ``The Monte Carlo Method'', Mir Publishers, Moscow, 1975. +\item M. H. Kalos, P. A. Whitlock, ,,Monte Carlo Methods”, J. Wiley \& Sons Inc., New York, 1986 +\item G. S. Fishman, ,,Monte Carlo: Concepts, Algorithms and Applications”, Springer, 1996. +\item R. Y. Rubinstein, D. P. Kroese, ,,Simulation and the Monte Carlo Method”, Second Edition, J. Wiley \& Sons Inc., 2008. +\item R. Korn, E. Korn, G. Kroisandt, ,,Monte Carlo methods and models in finance and insurance”, CRC Press, +Taylor \& Francis Group, 2010. +\item S. Jadach, ,,Practical Guide to Monte Carlo”, \href{http://arxiv.org/abs/physics/9906056}{arXiv:physics/9906056}, \href{http://cern.ch/jadach/MCguide/}{http://cern.ch/jadach/MCguide/}. +\end{enumerate} + + +\end{frame} + + + + +\begin{frame}\frametitle{Course Plan} + +We will have 6 hours of Monte Carlo (MC) lectures. The lectures will be devoted:\\ + +\hspace{1.5cm} +\begin{itemize} +\item 1 h: Mathematical introduction to MC methods. +\item 1 h: MC integration methods. +\item 2 h: Random numbers generators. +\item 2 h: Markov Chain MC. +\item 2 h: Tutorial and examples. +\end{itemize} +\hspace{1cm} \\ +The hands-on tutorial will consist of program templates in which we will implement couple of algorithms that were explained in the lecture. \\ +$\Rrightarrow$ All examples shown in this course are available in the github repository:\\ +\url{https://github.com/mchrzasz/EMPP_MC}\\ +\color{RubineRed}{There will be an indication (in this color) on the adequate slide for each of the macro.} + + +\end{frame} + + +\begin{frame}\frametitle{Definitions} +\begin{footnotesize} +$\Rrightarrow$ Basic definition:\\ + \begin{exampleblock}{} + Monte Carlo method is any technique that uses {\it{random numbers}} to solve a given mathematical problem. + \end{exampleblock} +% \vspace{0.5cm} + +$\rightarrowtail$ Random number: For the purpose of this course we need to assume that we know what it is, although the formal definition is highly non-trivial.\\ +\vspace{0.05cm} +$\Rrightarrow$ My favourite definition (Halton 1970): \begin{scriptsize}more complicated, but more accurate.\end{scriptsize} + +\begin{exampleblock}{} +''Representing the solution of a problem as a parameter of a hypothetical population, and using a random sequence of numbers to construct a sample of the population, from which statistical estimates of the parameter can be obtained.'' + \end{exampleblock} +To put this definition in mathematical language:\\ +Let $F$ be a solution of a given mathematical problem. The estimate of the result $\hat{F}$:\\ +\begin{equation*} +\hat{F}=f( \lbrace r_1, r_2, r_3,...,r_n \rbrace; ...), +\end{equation*} +where $\lbrace r_1, r_2, r_3,...,r_n \rbrace$ are random numbers. +\begin{center} +\color{red}{The problem we are solving doesn't need to be stochastic!} +\end{center} +\begin{scriptsize} +$\twoheadrightarrow$ One could wonder why are we trying to add all the stochastic properties to a deterministic problem. Those are the properties that allow to use all well known statistic theorems. + \end{scriptsize} +\end{footnotesize} +\end{frame} + +\begin{frame}\frametitle{History of MC methods} +\begin{footnotesize} +\begin{itemize} +\item {\color{PineGreen}{G. Compte de Buffon (1777)}} - First documented usage of random numbers for integral computation (Buffon thrown niddle on the table with parrarel line; we will do a modern version of this exercise). +\item {\color{PineGreen}{Marquis de Laplace (1886)}} - Used the Buffon niddle to determine the value of $\pi$ number. +\item {\color{PineGreen}{Lord Kelvin (1901)}} - Thanks to drawing randomly numbered cards he managed he managed to calculate some integrals in kinematic gas theorem. +\item {\color{PineGreen}{W. S. Gosse (better knows as Student) (1908)}} - Used similar way as Lord Kelvin to get random numbers to prove \textit{t}-Student distribution. +\item {\color{PineGreen}{Enrico Fermi (1930) }} - First mechanical device (\texttt{FERMIAC}) for random number generations. Solved neutron transport equations in the nuclear plants. +\item {\color{PineGreen}{S. Ulam, R. Feynman, J. von Neumann et. al.}} - First massive usage of random numbers. Most applications were in Manhattan project to calculate neutron scattering and absorption. \\ +In {\color{NavyBlue}{Los Alamos}} the name {\color{Mahogany}{Monte Carlo}} was created as kryptonim of this kind of calculations. +\end{itemize} + + +\end{footnotesize} +\end{frame} + + + +\begin{frame}\frametitle{Euler number determination, $\rm \color{RubineRed}{Lecture1/Euler\_number}$ } +\begin{footnotesize} +$\Rrightarrow$ As mentioned before \mc~methods can be used to solve problems that \textbf{do not} have stochastic nature! All the integrals calculated in Los Alamos during the Manhattan project are nowadays solvable without any \mc~methods.\\ +$\rightarrowtail$ Let's give a trivial example of solving a non stochastic problem: calculating Euler number $e$. We know that $e=2.7182818...$. +$\Rrightarrow$ To calculate the $\hat{e}$ we will use the following algorithm: +\begin{itemize} +\item We generate a random number in range $(0,1)$ (in stat. $\mathcal{U}(0,1)$) until the number we generate is smaller then the previous one, aka we get the following sequence: +\begin{align*} +x_1x_{n} +\end{align*} +\item We store the number $n$. We repeat this experiment $N$ times and calculate the arithmetic average of $n$. The obtained value is an statistical estimator of $e$: +\begin{align*} +\hat{e}= \dfrac{1}{N}\sum_{i=1}^N n_i \xrightarrow{N\to \infty} e . +\end{align*} +\end{itemize} +$\Rrightarrow$ Numerical example: +\begin{tabular}{r c c c } +$N$ & $\hat{e}$ & $\hat{e} - e$ & \multirow{5}{*}{Is this $\sim\sqrt{N}$?} \\ +100 & $2.760000$ & $0.041718$ \\ +10000 & $2.725000$ & $0.006718$ \\ +1000000 & $2.718891$ & $0.000609$ \\ +100000000 & $2.718328$ & $0.000046$\\ +\end{tabular} + + +\end{footnotesize} +\end{frame} + +\begin{frame}\frametitle{Let's test the $\sqrt{N}$, $\rm \color{RubineRed}{Lecture1/Euler\_number}$ } + +\only<1> +{ +$\Rrightarrow$ In the last example we measured the Euler number using different number of pseudo-experiments.\\ +$\rightarrowtail$ We compared the obtained value to the true and observed roughly a $\sqrt{N}$ dependence on the difference between the true value and the obtained one.\\ +} +$\rightarrowtail$ Could we test this? YES! Lets put our experimentalist hat on!\\ +$\rightarrowtail$ From the begging of studies they tooth us to get the error you need to repeat the measurements. +\only<1> +{ +\begin{exampleblock}{The algorithm:} +Previous time we measured Euler number using $N$ events, where $N \in (100, 1000, 10000, 100000)$. Now lets repeat this measurement $n_N$ times (of course each time we use new generated numbers). From the distribution of $\hat{e} -e$ we could say something about the uncertainty of our estimator for given $N$. + \end{exampleblock} +} + +\begin{center} +\only<2> +{ +\includegraphics[angle=-90,width=0.8\textwidth]{images/result_error.pdf} +} +\only<3> +{ +\includegraphics[angle=-90,width=0.8\textwidth]{images/result_error_dep.pdf} +} +\end{center} + + + + + + + + + + + + +\end{frame} + +\begin{frame}\frametitle{Monte Carlo and integration} +\begin{footnotesize} +$\hookrightarrow$ {\color{BrickRed}{\textbf{All MC calculations are equivalent to preforming an integration.}}}\\ +$\rightrightarrows$ Assumptions: $r_i$ random numbers from $\mathcal{U}(0,1)$. The MC result: +\begin{align*} +F=F(r_1,r_2,...r_n) +\end{align*} +is unbias estimator of an integral: +\begin{align*} +I=\int_0^1...\int_0^1 F(x_1,x_2,...,x_n)dx_1,dx_2...,dx_n +\end{align*} +aka the expected value of the $I$ integral is: +\begin{align*} +E(F)=I. +\end{align*} + \begin{exampleblock}{} +$\Rrightarrow$ This mathematical identity is the most useful property of the MC methods. It is a link between mathematical analysis and statistic world. Now we can use the best of the both world! + \end{exampleblock} +If we want to calculate the integral in different range then $(0,1)$ we just scale the the previous result: +\begin{align*} +\dfrac{1}{N}\sum_{i=1}^N f(x_i) \xrightarrow{N\to \infty} E(f)=\dfrac{1}{b-a}\int_a^b f(x)dx +\end{align*} + + +\end{footnotesize} +\end{frame} + + +\begin{frame}\frametitle{Uncertainty from Monte Carlo methods} +\begin{footnotesize} +$\Rrightarrow$ In practice we do not have $N\to \infty$ so we will never know the exact result of an integral :(\\ +$\longmapsto$ Let's use the {\color{BrickRed}{statistical}} world and estimate the uncertainty of an integral in this case :)\\ +$\rightarrowtail$ A variance of a MC integral: +\begin{align*} +V(\hat{I}) = \dfrac{1}{n} \Big\lbrace E(f^2) - E^2(f) \Big\rbrace = \dfrac{1}{n} \Big\lbrace \dfrac{1}{b-a} \int_a^b f^2(x)dx - I^2 \Big\rbrace +\end{align*} + \begin{alertblock}{} +$\looparrowright$ To calculate $V(\hat{I})$ one needs to know the value of $I$! +\end{alertblock} +$\Rrightarrow$ In practice $V(\hat{I})$ is calculated via estimator: +\begin{columns} +\column{2in} +\begin{align*} +\hat{V}(\hat{I})=\dfrac{1}{n}\hat{V}(f), +\end{align*} +\column{3in} +\begin{align*} +\hat{V}(f) = \dfrac{1}{n-1}\sum_{i=1}^n \Big[ f(x_i)-\dfrac{1}{n} \sum_{i=1}^nf(x_i)\Big]^2. +\end{align*} +\end{columns} + + +$\Rrightarrow$ MC estimator of standard deviation: $\hat{\sigma}=\sqrt{\hat{V}(\hat{I})}$ + + +\end{footnotesize} +\end{frame} + + +\begin{frame}\frametitle{Buffon needle - $\pi$ number calculus} +\begin{footnotesize} + +$\Rrightarrow$ Buffon needle (Buffon 1777, Laplace 1886): +We are throwing a needle (of length $l$) on to a surface covered with parallel lines width distance $L$. If a thrown needle touches a line we count a hit, else miss. Knowing the number of hits and misses one can calculate the $\pi$ number. +\vspace{0.3cm} +\begin{columns} +\column{0.1in} +{~} +\column{2in} +{\color{ForestGreen}{Experiment:}} +\column{2.8in} +{\color{Cerulean}{Theory:}} + +\end{columns} + + +\begin{columns} +\column{0.1in} +{~} +\column{2in} + +\includegraphics[width=0.9\textwidth]{images/buffon.png}\\ +$n$ - number of hits\\ +$N$ number of hits and misses,\\ +aka number of tries. + +\column{2.8in} +$\Rightarrow$ x - angle between needle and horizontal line, $x \in \mathcal{U}(0,\pi)$. +$\Rightarrow$ the probability density function (\pdf) for x: +\begin{align*} +\rho(x)=\dfrac{1}{\pi} +\end{align*} +$\Rightarrow$ $p(x)$ probability to hit a line for a given x value: +\begin{align*} +p(x)=\dfrac{l}{L}\vert \cos x \vert +\end{align*} +$\Rightarrow$ Total hit probability: +\begin{align*} +P = E[p(x)]=\int_0^{\pi}p(x)\rho(x)dx=\dfrac{2l}{\pi L} +\end{align*} + +\end{columns} +Now one can calculate $\hat{P}$ from MC : $\hat{P}=\dfrac{n}{N} \xrightarrow{N\to \infty} P= \dfrac{2l}{\pi L} \Rightarrow \hat{\pi}=\dfrac{2Nl}{nL}$ + + +\end{footnotesize} +\end{frame} + + + + + + + + + + + +\begin{frame}\frametitle{Buffon needle - Simplest Carlo method} +\begin{footnotesize} +{\color{MidnightBlue}{Monte Carlo type ''heads or tails''}}\\ +Let's use the summery of $p(x)$ function nad take $0 p(x): & \text{miss}. +\end{cases} +\end{align*} + +\column{2.5in} +\includegraphics[width=0.75\textwidth]{images/result.png} + + + +\end{columns} +Let's define weight function: $w(x,y)=\Theta(p(x)-y)$, \\ +where $\Theta(x)$ is the step function.\\ +$\rightarrowtail$ \pdf : $\varrho(x,y)=\rho(x)g(y)=\frac{2}{\pi} \cdot 1$\\ +$\Rightarrow$ Integrated probability: +\begin{align*} +P=E(w)=\int w(x,y) \varrho(x,y)dx dy = \dfrac{2l}{\pi L} \xleftarrow{N\to \infty}\hat{P}=\frac{1}{N} \sum_{i=1}^N w(x_i,y_i)= \dfrac{n}{N} +\end{align*} +Standard deviation for $\hat{P}$: $\hat{\sigma}=\dfrac{1}{\sqrt{N-1}}\sqrt{\dfrac{n}{N}\Big(1-\dfrac{n}{N}\Big)} $ + + + +\end{footnotesize} +\end{frame} + + +\begin{frame}\frametitle{Buffon needle, $\rm \color{RubineRed}{Lecture1/Heads\_tails}$ } +\begin{small} + + +$\Rrightarrow$ Lets make this toy experiment and calculate the $\pi$ number.\\ +$\hookrightarrow$ We can simulate the central position $(y)$ of an needle between $(-L, L)$ from $\mathcal{U}(-L, L)$. + + \begin{exampleblock}{Symmetry:} +Please note the symmetry of the problem, if the position of the needle would be $>L$ then we can shift the needle by any number of $L$'s. + \end{exampleblock} + +$\hookrightarrow$ New we simulate the angle $(\phi)$ with a flat distribution from $(0,\pi)$. +$\hookrightarrow$ The maximum and minimum $y$ position of the needle are: +\begin{align*} +y_{\max}=y+\vert \cos \phi \vert l\\ +y_{\min}=y-\vert \cos \phi \vert l +\end{align*} +$\hookrightarrow$ Now we check if the needle touches any of the lines: $y=L$, $y=0$ or $y=-L$. If yes we count the events. +\end{small} +\begin{center} + + +\begin{footnotesize} + + +\begin{tabular}{r c c c } +$N$ & $\hat{\pi}$ & $\hat{\pi} - \pi$ & $\sigma(\hat{\pi})$ \\ +10000 & $3.12317$ & $-0.01842$ & $0.03047$\\ +100000 & $3.14707$ & $0.00547$ & $0.00979$\\ +1000000 & $3.13682$ & $-0.00477$ & $0.00307$\\ +10000000 & $3.14096$ & $-0.00063$ & $0.00097$\\ + + +\end{tabular} + +\end{footnotesize} +\end{center} +\end{frame} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}\frametitle{Central Limit Theorem, $\rm \color{RubineRed}{Lecture1/CLT}$ } +\begin{footnotesize} + \begin{exampleblock}{} +Large independent random numbers assembly has always Gaussian distribution no matter from what distribution they were generated from as far as they have finite variances and expected values and the assembly is sufficiently large. + \end{exampleblock} +\includegraphics[width=0.9\textwidth]{images/dupa.png} + + +\end{footnotesize} +\end{frame} + + +\begin{frame}\frametitle{Crude Monte Carlo method of integration} +\begin{footnotesize} +$\Rrightarrow$ {\color{MidnightBlue}{Crude Monte Carlo method of integration is based on Central Limit Theorem (CLT): }}\\ +\begin{align*} +\dfrac{1}{N} \sum_{i=1}^N f(x_i) \xrightarrow{N\to \infty} \dfrac{1}{b-a}\int_a^b f(x)dx =E(f) +\end{align*} +$\Rrightarrow$ The standard deviation can be calculated: +\begin{align*} +\sigma = \dfrac{1}{\sqrt{N}} \sqrt{\Big[ E(f^2) -E^2(f)\Big] } +\end{align*} + +$\Rrightarrow$ From LNT we have: +\begin{align*} +P= \int w(x) \rho(x) dx = \int_0^{\pi/2} (\frac{l}{L} \cos x ) \frac{2}{\pi} dx= \dfrac{2l}{\pi L} \xrightarrow{N\to \infty} \frac{1}{N}\sum_{i=1}^N w(x_i) +\end{align*} +$\Rrightarrow$ Important comparison between ''Hit and mishit'' and Crude \mc~methods. One can analytically calculate: + +\begin{align*} +\hat{\sigma}^{{\rm{Crude}}} < \hat{\sigma}^{{\rm{Hit~and~mishit}}} +\end{align*} + + +$\Rrightarrow$ Crude \mc~is \textbf{always} better then ''Hit and mishit'' method. We will prove this on an example (can be proven analytically as well). + + +\end{footnotesize} +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{frame}\frametitle{Crude MC vs ”Hit and mishit”, $\rm \color{RubineRed}{Lecture1/Crude\_vs\_HT}$} + +$\Rrightarrow$ We can repeat a toy MC studies as we did in the Euler needle case.\\ +$\hookrightarrow$ In this example we want to calculate $\int_0^{\pi/2} \cos x dx$ + +\only<1>{ +\begin{center} +\includegraphics[angle=-90,width=0.8\textwidth]{images/results_0.pdf} +\end{center} +} +\only<2>{ +\begin{center} +\includegraphics[angle=-90,width=0.8\textwidth]{images/results_1.pdf} +\end{center} +} +\only<3>{ +\begin{center} + +\includegraphics[angle=-90,width=0.4\textwidth]{images/results_fit_0.pdf} +\includegraphics[angle=-90,width=0.4\textwidth]{images/results_fit_1.pdf}\\ +\end{center} +$\Rrightarrow$ One clearly sees that both methods follow $1/\sqrt{N}$ dependence and that the Crude MC is always better then the ''Hit and mishit''.\\ +$\Rrightarrow$ Please note that for the ''Hit and mishit'' we are suing 2 times more random numbers than for the Crude method so in terms of timing the Crude MC is also much faster. + +} + + + +\end{frame} + +\begin{frame}\frametitle{Classical methods of variance reduction} +\begin{footnotesize} + +$\Rrightarrow$ In Monte Carlo methods the statistical uncertainty is defined as: +\begin{align*} +\sigma = \dfrac{1}{\sqrt{N}}\sqrt{V(f)} +\end{align*} +$\Rrightarrow$ Obvious conclusion: +\begin{itemize} +\item To reduce the uncertainty one needs to increase $N$.\\ +$\rightrightarrows$ Slow convergence. In order to reduce the error by factor of 10 one needs to simulate factor of 100 more points! +\end{itemize} +$\Rrightarrow$ How ever the other handle ($V(f)$) can be changed! $\longrightarrow$ Lot's of theoretical effort goes into reducing this factor.\\ +$\Rrightarrow$ We will discuss {\color{Mahogany}{four}} classical methods of variance reduction: +\begin{enumerate} +\item Stratified sampling. +\item Importance sampling. +\item Control variates. +\item Antithetic variates. +\end{enumerate} + + + + + +\end{footnotesize} +\end{frame} + + + + +\begin{frame}\frametitle{Stratified sampling} +\begin{footnotesize} +$\Rrightarrow$ The most intuitive method of variance reduction. The idea behind it is to divide the function in different ranges and to use the Riemann integral property: +\begin{align*} +I = \int_0^1 f(u) du = \int_0^a f(u)du + \int_a^1 f(u) du,~ 0