\documentclass[12pt]{article}
\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}

\usepackage{setspace}
\onehalfspacing

\newif\ifeqns
\eqnstrue

\usepackage{amssymb}
%% The amsthm package provides extended theorem environments
\usepackage{amsthm}
\usepackage{epsfig}
\usepackage{times}
\renewcommand{\ttdefault}{cmtt}
\usepackage{amsmath}
\usepackage{graphicx} % for graphics files

% Draw figures yourself
\usepackage{tikz}

% writing elements
\usepackage{mhchem}

% The float package HAS to load before hyperref
\usepackage{float} % for psuedocode formatting
\usepackage{xspace}

% from Denovo Methods Manual
\usepackage{mathrsfs}
\usepackage[mathcal]{euscript}
\usepackage{color}
\usepackage{array}

\usepackage[pdftex]{hyperref}
\usepackage[parfill]{parskip}

% math syntax
\newcommand{\nth}{n\ensuremath{^{\text{th}}} }
\newcommand{\ve}[1]{\ensuremath{\mathbf{#1}}}
\newcommand{\Macro}{\ensuremath{\Sigma}}
\newcommand{\rvec}{\ensuremath{\vec{r}}}
\newcommand{\vecr}{\ensuremath{\vec{r}}}
\newcommand{\omvec}{\ensuremath{\hat{\Omega}}}
\newcommand{\sigs}{\ensuremath{\Sigma_s(\rvec,E'\rightarrow E,\omvec'\rightarrow\omvec)}}
\newcommand{\el}{\ensuremath{\ell}}
\newcommand{\sigso}{\ensuremath{\Sigma_{s,0}}}
\newcommand{\sigsi}{\ensuremath{\Sigma_{s,1}}}
\newcommand{\cc}[1]{\ensuremath{\overline{#1}}}
\newcommand{\ccm}[1]{\ensuremath{\overline{\mathbf{#1}}}}
%---------------------------------------------------------------------------
%---------------------------------------------------------------------------
\begin{document}
\begin{center}
{\bf NE 250, F17\\
October 5, 2017
}
\end{center}

Duderstadt and Hamilton Chp.\ 5.II.A

** In these notes, $\psi$ is a generic function, the the angular flux **

The last thing we were working on was how to solve the \textbf{one-speed} diffusion equation:

\begin{equation*}
\frac{1}{v_1}\frac{\partial \phi_1(\rvec,t)}{\partial t} = S_1(\rvec,t) -
\Sigma_{a,1}(\rvec)\phi_1(\rvec,t) + \nabla\cdot[D_1(\rvec)\nabla\phi_1(\rvec,t)]
\end{equation*}
We had then looked at steady state and homogeneous to get
\ifeqns
\begin{equation*}
\nabla^2\phi(\vecr) - \frac{1}{L^2}\phi(\rvec) = -\frac{S(\rvec)}{D},
\end{equation*}
\else
\vspace*{3em}
\fi

The one-group formulation is actually quite useful when thinking through initial design concepts. You can layer together geometry components and see if ideas have any validity at all, and this is something you can do by hand to check computational results.

There are three main ways to solve this. Last time we focused on variation of constants/parameters, which is likely what you learned first in differential equations class. You can get more information in any Diff.\ Eq.\ text book, or start at Wikipedia and go from there (\url{https://en.wikipedia.org/wiki/Variation_of_parameters}).

This class we'll look at \textbf{Green's Functions} and the \textbf{Eigenfunction Expansion} method. Having multiple tools available can allow you to solve different problems with whichever one is the easiest for that problem. Further, these methods can be used in more sophisticated contexts later on, so it's worth understanding each of them.

\subsection*{Green's Functions}
A Green's function is the impulse response of an inhomogeneous linear differential equation defined on a domain, with specified initial conditions or boundary conditions.

Through the superposition principle for linear operator problems, the convolution of a Green's function with an arbitrary function $f(x)$ on that domain is the solution to the inhomogeneous differential equation for $f (x)$. \url{https://en.wikipedia.org/wiki/Green\%27s_function}

To see how this works, we start with two equations. We'll consider a unit source located at $\vec{r'}$. The first equation is the way we're used to seeing it:
\begin{align}
\nabla &\cdot D \nabla \phi(\vec{r}) + \Sigma_a \phi(\vec{r}) = -S(\vec{r}) \:, \qquad \forall \vec{r} \in V  \\
%
&\phi(\vec{r}) = 0\:, \qquad \forall \vec{r} \in \mathcal{S} \equiv \partial V\:.\ \nonumber
 \label{eq:de}
\end{align}
%
We will also state that $G(\vec{r}, \vec{r'})$ is the flux at $\vec{r}$ due to a unit source at $\vec{r'}$. Since this is a solution to our problem, we can write:
\begin{align}
\nabla &\cdot D \nabla G(\vec{r}, \vec{r'}) + \Sigma_a G(\vec{r}, \vec{r'}) = -\delta(\vec{r} - \vec{r'}) \:, \qquad \forall \vec{r} \in V  \\
%
&G(\vec{r}, \vec{r'}) = 0\:, \qquad \forall \vec{r} \in \mathcal{S} \equiv \partial V\:. \nonumber
\label{eq:green}
\end{align}

Now, we'll take the approach of multiplying the LHS of each equation by the opposite solution function, subtracting, and integrating over phase space. This is a common math trick that we'll use again later.
\begin{align*}
\int_V dV\: \bigl[(\nabla &\cdot D \nabla \phi(\vec{r}))G(\vec{r}, \vec{r'}) + (\Sigma_a \phi(\vec{r})) G(\vec{r}, \vec{r'}) \\
-(\nabla &\cdot D \nabla G(\vec{r}, \vec{r'}))\phi(\vec{r}) - (\Sigma_a G(\vec{r}, \vec{r'}))\phi(\vec{r}) \bigr] = 0\\
\end{align*}
We can see this by using divergence theorem and the boundary conditions to note:
\[\int_{\mathcal{S}} d\mathcal{S}\: \hat{e}_s \cdot D[\nabla \phi(\vec{r}))G(\vec{r}, \vec{r'}) - \nabla G(\vec{r}, \vec{r'}))\phi(\vec{r})] = 0\]

From there, we can subtract the right hand sides to see:
\begin{align*}
\int_V dV\: &S(\vec{r})G(\vec{r}, \vec{r'}) - \delta(\vec{r} - \vec{r'})\phi(\vec{r}) = 0\\%
\phi(\vec{r'}) = \int_V dV\: S(\vec{r})G(\vec{r}, \vec{r'})\\
\text{or }\: \phi(\vec{r}) = \int_V dV\: S(\vec{r'})G(\vec{r'}, \vec{r})
\end{align*}
%
Thus, we have shown that the Green's function is the general solution to the diffusion equation. This is also known as a kernel.

The challenge is: how do we find $G(\vec{r}, \vec{r'})$? We'll use some of the strategies we've already developed. Consider a plane source in an infinite medium:
\begin{align*}
\frac{d^2\phi}{dx^2} &- \frac{1}{L^2}\phi(x) = -S(x)\delta(x)\\
&\lim_{x \rightarrow \pm \infty} \phi(x) = 0\\
%
\frac{d^2 G(x,x')}{dx^2} &- \frac{1}{L^2}G(x,x') = -S(x)\delta(x)\\
&\lim_{x \rightarrow \pm \infty} G(x,x') = 0
\end{align*}

Now we use variation of constants like we were doing before to get
\[
G(x,x') = \frac{L}{2D} H(x-x') \exp[\frac{-|x-x'|}{L}] +  \frac{L}{2D}(1- H(x-x')) \exp[\frac{|x-x'|}{L}]\]
Then we substitute this in to get
\begin{align*}
\phi &= \int_{-\infty}^{\infty} dx'\: G(x,x')\delta(x') S\\
\phi &= \frac{SL}{2D} \exp(\frac{-|x|}{L})
\end{align*}

%-------------------------
\subsection*{Eigenfunction Expansion Method}
A powerful method for solving boundary value problems is to obtain the solution as an expansion in the set of eigenfunctions.

\subsection*{Eigenvalue Review}

Eigenvalues are a special set of scalars associated with a linear system of equations (a matrix equation) that are sometimes also known as characteristic roots.

Each eigenvalue is paired with a corresponding so-called eigenvector.

The decomposition of a square matrix $\ve{A}$ into eigenvalues and eigenvectors is known as eigen decomposition, and the fact that \textbf{this decomposition is always possible as long as the matrix consisting of the eigenvectors of $\ve{A}$ is square} is known as the eigen decomposition theorem.

Let $\ve{A} \in \mathbb{R}^{n \times n}$. If there is a vector $\vec{x} \in \mathbb{R}^{n}$ such that
%
\[\ve{A} \vec{x} = \lambda \vec{x}\]
%
for some scalar $\lambda$, then $\lambda$ is an eigenvalue of $\ve{A}$ with a corresponding (right) eigenvector $\vec{x}$. Note that the eigenvalue represents the ``stretching factor" in the direction of its associated eigenvector.

(\url{http://math.stackexchange.com/questions/54176/is-there-a-geometric-meaning}\\ \url{-of-the-frobenius-norm})

We find eigenvalues by re-writing the stated relationship as $(\ve{A} - \lambda \ve{I})\vec{x}=0$ and solving for the $\lambda$s that make this true. The $\lambda$s are then the eigenvalues and the $\vec{x}$s that go with them are the corresponding eigenvectors.

A linear system of equations has nontrivial solutions iff the determinant vanishes (Cramer's rule; related to the theorem for finding out if a solution exits that we talked about above), so the solutions of this equation are given by
%
\[\det(\ve{A} - \lambda \ve{I})=0 \:.\]
%
This equation is known as the characteristic equation of $\ve{A}$, and the left-hand side is known as the characteristic polynomial.

Since an \nth degree polynomial has $n$ roots, $\ve{A}_{n \times n}$ is guaranteed to have $n$ real and/or complex eigenvalues, some of which may be repeated: $\lambda_1, \lambda_2, \dots, \lambda_n$.

This gives $\ve{A}\vec{u}_1 = \lambda_1 \vec{u}_1$, etc.

The spectrum of eigenvalues of a matrix $\ve{A}$ are defined formally as
\[\sigma(\ve{A}) = [ \lambda \in \mathbb{C} : \det(\ve{A} - \lambda \ve{I})=0] \]
and an eigenvalue is
\[ \lambda \in \sigma(\ve{A})\:,\]

-----------------------------\\
We'll start with an example to see how the method works for our problems. We'll look at a similar problem as before:
\begin{align*}
\nabla^2\phi(\vec{r}) &- \frac{1}{L^2}\phi(\vec{r}) = -\frac{S(\vec{r})}{D} \:, \quad \forall \vec{r} \in V \\
& \phi(\vec{r}) &= 0\:, \quad \forall \vec{r} \in \mathcal{S}
\end{align*}
Now, we introduce the eigenfuction expansion. Here, we solve a problem that looks like the diffusion equation we're solving, but is homogeneous instead of having a source. The subscript $n$ indicates the $n$th mode:
\begin{align*}
\nabla^2 \psi_n (\vec{r}) &+ B_n^2 \psi_n (\vec{r}) = 0\:, \quad \forall \vec{r} \in V  \\
%
\nabla^2 &\psi_n (\vec{r}) =  -B_n^2 \psi_n (\vec{r}) \qquad \text{Note: } \ve{A} = \nabla^2\: \text{ and }\: \lambda = -B_n^2\\
\psi_n (\vec{r}) &= 0\:, \quad \forall \vec{r} \in \mathcal{S}
\end{align*}

We will use the property that eigenfunctions form a complete set. That is, any function, including our solution, can be expressed as a linear combination of eigenfunctions:
\[
\phi(\vec{r}) = \sum_{n=1}^N c_n \psi_n\:, \quad \text{where } c_n \text{ are coefficients.}
\]
We substitute this, and then our eigenvalue relationship, into the diffusion equation while also expanding the source term:
\begin{align}
\nabla^2\sum_{n=1}^N c_n \psi_n &- \frac{1}{L^2}\sum_{n=1}^N c_n \psi_n = -\frac{1}{D} \sum_{n=1}^N S_n \psi_n \nonumber \\
%
\sum_{n=1}^N c_n &(B_n^2 + \frac{1}{L^2})\psi_n = \frac{1}{D} \sum_{n=1}^N S_n \psi_n
\label{eq:evec}
\end{align}

Next, we're going to use the orthonormality property of eigenvectors:
\[
\int_V dV\: \psi_n \psi_m = \left\{
	\begin{array}{ll}
		1  & \mbox{if } n = m \\
		0 & \mbox{if } n \neq m
	\end{array}
	\right.
\]
We will use this to find our $c_n$ by multiplying \autoref{eq:evec} by $\psi_m$ and integrating over volume:
\begin{align*}
\int_V dV\: \sum_{n=1}^N c_n &(B_n^2 + \frac{1}{L^2})\psi_n \psi_m = \int_V dV\:\frac{1}{D}\sum_{n=1}^N S_n \psi_n \psi_m \\
%
c_n &(B_n^2 + \frac{1}{L^2}) = \frac{S_n}{D} \\
c_n &= \frac{S_n / \Sigma_a}{1 + B_n^2  L^2}
\end{align*}
Noting
\[
S_n = \int_V dV\: S(\vec{r}) \psi_n
\]
We get
\[
\phi(\vec{r}) = \int_V dV\:\sum_{n=1}^N \frac{S(\vec{r}) / \Sigma_a}{1 + B_n^2  L^2} \psi_n \psi_n
\]

-------------------------------\\
Our question now is that are the $\psi_n$ and $B_n$?
We'll look at a real example to figure that out. %$S_0$ is a uniform source over $-a/2 \leq x \leq a/2$:
\begin{align*}
\frac{d^2 \phi}{dx^2} &- \frac{1}{L^2} \phi(x) = -\frac{S(x)}{D}\:, \quad -a/2 \leq x \leq a/2\\
\phi(\pm \frac{\tilde{a}}{2}) &= 0
\end{align*}
%
We're taking the source to be arbitrary, so we cannot assume symmetry. To solve, we'll take a somewhat roundabout approach to connect our problem to an eigenvalue solution. We'll again look at how to solve the similar homogeneous problem
\begin{align*}
\frac{d^2 \psi}{dx^2} &- B^2 \psi(x) = 0\:, \quad -a/2 \leq x \leq a/2\\
\psi(\pm \frac{\tilde{a}}{2}) &= 0\:,
\end{align*}
where $B^2$ is an arbitrary parameter.

We can get the homogeneous solution as a combination of trig functions:
\begin{align*}
\psi(x) &= A_1 \cos(Bx) + A_2 \sin(Bx)\\
\psi(\pm \frac{\tilde{a}}{2}) &= A_1 \cos(\frac{B \tilde{a}}{2}) \pm A_2 \sin(\frac{B \tilde{a}}{2}) = 0 \:.
\end{align*}
To get a non-trivial solution, we need
\begin{align*}
A_2 &= 0 \:, \quad A_1\cos(\frac{B \tilde{a}}{2}) = 0 \rightarrow \cos(\frac{B \tilde{a}}{2}) = 0 \text{ with } B=\frac{n \pi}{\tilde{a}} \text{ when }n \text{ is odd}\\
A_1 &= 0 \:, \quad A_2\sin(\frac{B \tilde{a}}{2}) = 0 \rightarrow \sin(\frac{B \tilde{a}}{2})  = 0 \text{ with } B = \frac{n \pi}{\tilde{a}} \text{ when }n \text{ is even}\\
\psi_n(x) &=
\left\{
	\begin{array}{ll}
		A_n \cos(\frac{n \pi x}{\tilde{a}})  & \mbox{if } n = \text{ odd} \\
		A_n \sin(\frac{n \pi x}{\tilde{a}}) & \mbox{if } n = \text{ even}
	\end{array}
	\right.
\end{align*}
%
What we are seeing here is that the eigenvalues are $B_n = \frac{n \pi}{\tilde{a}}$, and the eigenvectors are the $\psi_n$.

Note that in a symmetric problem, the sin term would drop out b/c it's not symmetric. Further, another term for the eigenvectors or eigenfucntions is \textit{normal modes} or \textit{harmonic modes}.

Also note that the $A_n$ remain undetermined. These are arbitrary, and in a real system would determine the amplitude of the flux shape. What do you think would set $A_n$ in a real system?

What now? Well, we can see clearly that our functions hold the orthogonality property. We can also see that they form a complete set. Thus, we will use our eigenfuctions to create solutions like we did above:
\begin{align*}
\phi(x) &= \sum_{n=1}^N c_n \psi_n \\
S(x) &= \sum_{n=1}^N \psi_n S_n
\end{align*}
This time our problem has defined boundaries and thus
\[
S_n = \frac{2}{\tilde{a}} \int_{-\frac{\tilde{a}}{2}}^{\frac{\tilde{a}}{2}} dx\: S(x) \psi_n
\]

To find the $c_n$ we substitute our expansion into our original equation:
\begin{align*}
\frac{d^2 }{dx^2} &\sum_{n=1}^N c_n \psi_n - \frac{1}{L^2} \sum_{n=1}^N c_n \psi_n = \frac{-1}{D}\sum_{n=1}^N \psi_n S_n\:,\\
%
\sum_{n=1}^N c_n& \bigl( B^2_n + \frac{1}{L^2}\bigr)\psi_n = \frac{1}{D}\sum_{n=1}^N \phi_n S_n
\end{align*}
We do our multiply, integrate, orthogonality trick, and we again see
\begin{align*}
c_n &= \frac{S_n / \Sigma_a}{1 + B_n^2  L^2} \\
\phi(x) &= \frac{1}{\Sigma_a} \sum_{n=1}^N \frac{S_n}{1 + B_n^2  L^2} \psi_n
\end{align*}
Only now we know $\psi_n$ and $B_n$!

\subsection*{Connection to Green's Functions}
And finally, we can see this is the same things as Green's Functions. We start by again substitute the source expansion coefficients into the flux:
\[
\phi(x) = \int_{-\frac{\tilde{a}}{2}}^{\frac{\tilde{a}}{2}} dx\: \biggl[\frac{2}{\tilde{a} \Sigma_a} \sum_{n=1}^N \frac{\psi_n(x) \psi_n(x')}{1 + B_n^2  L^2}  \biggr] S(x')
\]
Note that in this expression, the $x$ values are where we evaluate the flux; the $x'$ values are from the integral of the $c_n$ coefficients over space, where the integral is from substituting in the $S_n$ expression.

If we compare this to how we expect a Green's Function to look
\[
\phi(x) = \int_{-\frac{\tilde{a}}{2}}^{\frac{\tilde{a}}{2}} dx\: G(x,x') S(x')\:,
\]
we can see that
\[
G(x,x') = \frac{2}{\tilde{a} \Sigma_a} \sum_{n=1}^N \frac{\psi_n(x) \psi_n(x')}{1 + B_n^2  L^2}\:.
\]

This relationship between eigenfunctions and Green's Functions is a general result. The coefficients out front will differ based on the dimensionality of the problem, but the concept always holds.

\end{document}


\documentclass[a4paper]{article}

% See also
% - http://tug.ctan.org/info/latexcheat/latexcheat/latexsheet.pdf
% - http://tug.ctan.org/info/biblatex-cheatsheet/biblatex-cheatsheet.pdf

% - Compilation
% latexmk -pdf article.txt
% latexmk -lualatex article.tex

%  - Language & Fonts
% PdfLatex
\usepackage[british]{babel}
\usepackage[utf8]{inputenc}
% LuaLatex
% \usepackage{polyglossia}  % hyphenation
% \setdefaultlanguage{uk}  % or spanish
% \usepackage{fontspec}  % to load fonts
% Both
\usepackage{microtype}  % typographical improvements

%  - Math
\usepackage{amsmath} % equation, align, matricies...
% \usepackage[standard]{ntheorem}  % Theorem, Definition, Proof....
% \usepackage{amssymb} % extended symbol collection
% \usepackage{mathtools} % mathbox and \rcases
% \usepackage{centernot} % centred \not command
% \numberwithin{equation}{section} % numbering eqs by sections
% \usepackage{seqsplit} % to split big numbers

% - Floats
\usepackage{graphicx} % \includegraphics[width=\textwidth]{filename}
\graphicspath{ {images/} }
\usepackage{booktabs} % prettier tables
% \usepackage{minted} % \begin{minted}[fontsize=...]{python}
% \usepackage{epstopdf} % to use .eps images
% \usepackage[options]{algorithm2e}  # other similar packages outdated; options: ruled,vlined

% - Tikz
% \usepackage{tikz}
% \usetikzlibrary{arrows}
% \usetikzlibrary{positioning}
% \usetikzlibrary{shapes}
% \usetikzlibrary{calc}
% Custom TikZ addons
% \usetikzlibrary{crypto.symbols}  % https://www.iacr.org/authors/tikz/
% \tikzset{shadows=no}        % Option: add shadows to XOR, ADD, etc.
% \tikzstyle{int}=[draw, fill=blue!20, minimum size=2em]
% \tikzstyle{init} = [pin edge={to-,thin,black}]

% - Others
% \usepackage{url} % \url
% \usepackage[margin=1in]{geometry}  % smaller margins
% \usepackage{enumitem} % \begin{enumerate}[label=\alph*)]
% \usepackage{caption} % \caption*
% \usepackage{xspace} % automatic space after newcommand
% \usepackage{todonotes} % common options: disable
% \usepackage{csquotes,xpatch} % recommended by biblatex
% \usepackage[backend=biber,style=alphabetic]{biblatex}  % options: doi=false,isbn=false,url=false
% \addbibresource{references.bib}
% \usepackage{cite} % incompatible with biblatex!

% - Cross References (The TEXpert’s Guide to Survival)
% Use Vref (verbose reference) or Cref instead of ref
% no spaces between multiples refs, i.e. \Cref{eq1,eq2}
\usepackage{varioref}
\usepackage{hyperref}
\hypersetup{pdfauthor={Author},
           pdftitle={Title},
           % hidelinks  % for printed version
           colorlinks, % remove frame
}
\usepackage{cleveref}

% - New commands
% \newenvironment{tightcenter}{%
%   \setlength\topsep{0pt}
%   \setlength\parskip{0pt}
%   \begin{center}
% }{%
%   \end{center}
% }
% \DeclareMathOperator{\hw}{HW}
% \DeclareTextFontCommand{\review}{\bfseries\color{red}}
% \newcommand{\xor}{\ensuremath{\mathop\oplus}}
% \newcommand{\add}{\ensuremath{\mathop\boxplus}}
% \newcommand{\floor}[1]{\lfloor#1\rfloor}
% \newcommand{\ceil}[1]{\lceil#1\rceil}
% \newcommand{\code}[1]{\texttt{#1}}
% \newcommand{\ABC}{\textsc{ABC}\xspace}
% \newcommand{\inlinetodo}[2]{\todo[inline, size=\footnotesize, #1]{#2}}
% \newcommand{\inlinetodourgent}[2]{\todo[inline, size=\footnotesize, color=cyan, #1]{#2}}

% - Latex snippets
%%
% \begin{listing}[h]
% \begin{minted}{python}
%     ...
% \end{minted}
% \caption{...}
% \label{...}
% \end{listing}
%%
% \begin{figure}[h]
% \centering
% \includegraphics[width=0.5\textwidth]{...}
% \caption{...}
% \label{...}
% \end{figure}
%%
% \begin{table*}[h]
%     \centering
%     \renewcommand*{\arraystretch}{1.2}  % 1.3\end{table*}
%     \begin{tabular}{@{}lrr@{}}
%         \toprule
%         \multicolumn{2}{c}{Item} \\ \cmidrule(r){2-3}
%         Dimension & Metric1 & Metric2 \\
%         \midrule
%         A & X & 0 \\
%         B & Y & 1 \\
%         \bottomrule
%         \end{tabular}
%     \caption{...}
%     \label{...}
% \end{table*}

% - Other tips
% space between words: e.g.\ instead of e.g.
% puntuaction in equation: $[...]\,.$ or \,.
% no blank line after/before equation (after produces indent, before produces big space)
% captions should make figures self-contained

%%%%%%%%%%%%%%%%%%%%     DOCUMENT     %%%%%%%%%%%%%%%%%%%%

\author{Name}
\title{Title \\ Subtitle}
% \date{\today}

\begin{document}

    \maketitle

    %\tableofcontents

    \section{Section}

    ...

    % \printbibliography

\end{document}


\documentclass[12pt,letterpaper,twoside]{article}

\newif\ifsolution\solutiontrue   % Include the solutions
%\newif\ifsolution\solutionfalse  % Exclude the solutions

\usepackage{cme212}

\newcommand{\T}[1]{\text{\texttt{#1}}}
\newcommand{\V}[1]{\text{\textit{#1}}}

\begin{document}

{\centering \textbf{Paper Exercise 3\\ Due Tuesday, February 25th at 4:30 P.M. P.S.T. \\}}
\vspace*{-8pt}\noindent\rule{\linewidth}{1pt}

\paragraph{Question 0: Lecture 5} Our graph is undirected, but we could use it to build a
\href{https://en.wikipedia.org/wiki/Directed_graph#Definition}{\emph{directed} graph} or \emph{digraph}. A digraph's edges are \emph{ordered}
pairs of nodes $(n_i, n_j)$, rather than unordered pairs $\{n_i, n_j\}$; all
operations look like their undirected counterparts and have similar complexity.

Here's one digraph representation using our graph class.
\begin{cpp}
template <typename V>
class Digraph {
  ...
 private:
  Graph<V> g_;
};
\end{cpp}
Explain the representation by giving an abstraction function and
representation invariant. Note that \texttt{Digraph} is not
\texttt{Graph}'s friend and can only use \texttt{Graph}'s public
interface. \\

\textbf{Note:} To be concrete, we are asking: How can you use an undirected
graph to construct (or represent) a directed graph? This alludes to
the representation. Are there ``any
assumptions'' used during your construction? If so, these may be
necessary invariants.\\

\textbf{Note: } The representational invariants and the abstraction functions should not refer to the way you implemented your graph class but only to the abstract concept of an undirected graph.

\begin{solution}

\end{solution}

\paragraph{Question 1: Lecture 5} The \href{https://en.cppreference.com/w/cpp/container/vector/resize}{\texttt{vector<T>::resize}} operation extends a vector with
\emph{memory initialized} elements. (For example, after \texttt{vector<int> v;
  v.resize(20)}, \texttt{v} contains 20 zeroes in memory.) This is almost always what we
want, but it can be useful to extend a vector with \emph{uninitialized
  memory} so that we do not take up unnecessary space. Here's an example: uninitialized memory helps build a \emph{sparse
  vector}, in which elements are initialized only when first referenced. We
assume a special \texttt{garbage\_vector} type whose \texttt{resize} method does
not initialize new memory. \textbf{See next page}\\ \textbf{Note:} This question will
not completely make sense until you understand what the code is doing below!

\newpage
\begin{cpp}
template <typename T>
class sparse_vector {
  garbage_vector<size_t> position_;
  vector<size_t> check_;
  vector<T> value_;
 public:
  // Construct a sparse vector with all elements equal to T().
  sparse_vector() {}
  // Return a reference to the element at position @a i.
  T& operator[](size_t i) {
    // If out of bounds, we must re-size our array and add (uninitialized) memory!
    if (i >= position_.size())
      position_.resize(i + 1);
    // If we haven't initialized the memory yet, go ahead and do so now.
    if (position_[i] >= check_.size() || check_[position_[i]] != i) {
      position_[i] = check_.size(); // First reference to the element at position i.
      check_.push_back(i);          // We associate an index...
      value_.push_back(T());        // ...alongside a value.
    }
    return value_[position_[i]];
  }
};
\end{cpp}

An abstract \texttt{sparse\_vector} value is an \textbf{infinite} vector.

Write an abstraction function and representation invariant for
\texttt{sparse\_vector}.

\begin{solution}

\end{solution}

\paragraph{Question 2: Lecture 12} The \texttt{CME212/BoundingBox.hpp} is kind of interesting. The following code will create a bounding box that encloses our entire graph:
\begin{cpp}
template <typename V, typename E>
Box3D graph_bounding_box(const Graph<V,E>& g) {
  auto first = graph.node_begin();
  auto last  = graph.node_end();
  assert(first != last);
  Box3D box = Box3D((*first).position());
  for (++first; first != last; ++first)
    box |= (*first).position();
  return box;
}
\end{cpp}
\textbf{This will be very important for homework 4.}
Interestingly, \texttt{Box3D} also provides a constructor that takes a range of \texttt{Point}s and performs the above operation for us. So, instead, we could write
\begin{cpp}
template <typename V, typename E>
Box3D graph_bounding_box(const Graph<V,E>& g) {
  return Box3D(g.node_begin(), g.node_end());
}
\end{cpp}
except that this doesn't work because we're passing it \texttt{Node} iterators instead of \texttt{Point} iterators.
The Boost and Thrust libraries both provide ``fancy iterators'', one of which is the \texttt{transform\_iterator}. See
\href{https://github.com/thrust/thrust/tree/master/thrust/iterator}{https://github.com/thrust/thrust/tree/master/thrust/iterator}
for documentation.

Use
\href{https://github.com/thrust/thrust/blob/master/thrust/iterator/transform_iterator.h}{\texttt{thrust::transform\_iterator}}
to correct the above code that uses \texttt{Box3D}'s range constructor.

\begin{solution}

\end{solution}

\paragraph{Question 3: Lecture 12} In fact, it is possible to implement your \texttt{Graph::node\_iterator} as a \texttt{thrust::transform\_iterator}. That is, we could delete \texttt{NodeIterator} entirely and write
\begin{verbatim}
using node_iterator = thrust::transform_iterator<__, __, Node>;
\end{verbatim}
The third parameter simply explicitly states that the \texttt{value\_type} should be \texttt{Node}. Fill in the two blanks and explain your answer.

\begin{solution}

\end{solution}

\paragraph{Question 4: Lecture 10}

We may want to have multiple initialization methods for a class that basically do the same thing but have slightly different interfaces. It would be inefficient to duplicate the code in both constructors. Therefore since C++11 you can use \href{https://en.cppreference.com/w/cpp/language/initializer_list#Delegating_constructor}{delegate constructors}, where one constructor calls another.

Imagine we want to write a class to contain the scores of a test or assignment. The class will be constructed from a vector containing the scores. However depending on the assignment this might be a vector of letter grades or a vector of percentages. Instead of having to write two entire constructors we want to have one constructor delegate to another.

\textbf{(a)} Write a functor that takes in a letter grade from the list [A,B,C,D,E,F] and returns an int with the equivalent percentage of that grade.

\begin{solution}

\end{solution}

\textbf{(b)} We want to delegate to the constructor that takes in the start and end of a vector of percentages with the following interface.
\begin{cpp}
using intIter = std::vector<int>::iterator
using charIter = std::vector<char>::iterator
class Grades
{
	public:
	Grades(intIter start, intIter end){
		// normal construction - pretend this is already implemented
	}
}
\end{cpp}

Write a delegating constructor that takes in a \texttt{std::vector<char>} and your functor and delegates to the constructor above.

\begin{solution}

\end{solution}

\textbf{(c)} You could also get rid of duplicate code with an \texttt{init()} method that is called by multiple constructors. What is a potential issue with this implementation?

\begin{solution}

\end{solution}
\end{document}


\documentclass[answers,12pt]{exam}
\usepackage{xcolor}

\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument[P-]{paper}
\externaldocument[S-]{supplement}

\usepackage{upquote}
\usepackage{textcomp}
\usepackage[T1]{fontenc}

\usepackage{pdfpages}

\hypersetup{
  colorlinks=true,
  filecolor=black, % color of cross-file links. Black because they only work
                   % if the paper sits alongside the rebuttal as "paper.pdf".
  urlcolor=blue % color of external links
}

\unframedsolutions
\shadedsolutions
\renewcommand{\solutiontitle}{}

\begin{document}

\includepdf{coverletter2.pdf}

\section{Comments from Editor}

\begin{questions}
\question  In section 2.3, lines 128--129, it is written
\begin{quote}
For instance, the identity $\sqrt{t^2} = t$ holds if $t$ is nonnegative ($t \geq
0$). However, for general complex $t$, no such identity holds.
\end{quote}
The first sentence doesn't make sense unless $\sqrt{\cdot}$ is defined;
obviously it is intended to yield the nonnegative square root. The second
sentence is incorrect, so needs rewording or deleting. For complex $t$ it is
true that $\sqrt{t^2} = t$ holds if $t$ lies in the right half-plane, assuming
$\sqrt{\cdot}$ is defined to be the square root lying in the right half-plane.
\begin{solution}
We reworked the two sentences to clarify the situation. We have added a
footnote with the definition of $\sqrt z$ that SymPy uses.
\end{solution}

\question Page 7, line 186: please state in the text whether this is typed as two lower case letter o's, as opposed to being some special symbol.
\begin{solution}
We have added a note here.
\end{solution}

\question Page 10, line 315: replace ``solving'' by ``finding its zeros''.
\begin{solution}
We have fixed this.
\end{solution}

\question Page 18, line 684: replace ``is as performant as'' by ``performs as well as''. The former is not correct English.
\begin{solution}
We have fixed this.
\end{solution}

\question Reference [42]: the title and publisher appear to have run together.
\begin{solution}
We have fixed this.
\end{solution}

\question Supplement, line 1: delete ``for''.
\begin{solution}
We have fixed this.
\end{solution}

\question Supplement, line 18: ``dependends'' $\rightarrow$ ``depends''.
\begin{solution}
We have fixed this.
\end{solution}

\end{questions}

\section{Comments from Reviewer 1}
\emph{There are no additional comments from reviewer 1.}

\section{Comments from Reviewer 2}
\subsection{Basic reporting}
No comments.

\subsection{Experimental design}
No comments.

\subsection{Validity of the findings}
No comments.

\subsection{Comments for the author}
This is a great paper. Thank you for addressing my concerns.

\section{Comments from Reviewer 3}
\subsection{Basic reporting}
The structure of the paper and the supplement is now improved, compared to the original submission, and the materials are now much easier to read and comprehend.

\subsection{Experimental design}
No Comments

\subsection{Validity of the findings}
No Comments

\subsection{Comments for the author}
\subsubsection{The paper}

\begin{questions}
\question The abstract and the paper itself mention the paper's supplement in several places. I believe it would be beneficial to add a short paragraph, possibly after line 90, that would list the supplement's contents in a manner similar to that of the paper's contents (lines 83--90), with the list submodules, to make it easier for an interested reader to find their way around it.
\begin{solution}
We have added a paragraph about the supplement at the suggested location. We
have also referenced specific supplement section numbers throughout the
paper.
\end{solution}

\question In line 323, it should say ``\ldots meaning that the entries\ldots''.
\begin{solution}
We have fixed this.
\end{solution}

\question In line 673, it should say either ``poorer than that of its commercial competitors'' or ``poorer than its commercial competitors''' (ending in apostrophe).
\begin{solution}
We have used the first suggestion.
\end{solution}

\question In line 813, one ``PhD thesis'' seems to be superficial.
\begin{solution}
We have fixed this.
\end{solution}

\subsubsection{The supplement}

\question Figure 1 is hard to read. I suggest putting the labels on the outside of the loops.
\begin{solution}
The figure code is generated automatically from the category theory submodule. We
have made this clearer by changing the figure caption to ``A diagram typeset
in Xy-pic automatically by \texttt{XypicDiagramDrawer}''. We have opened
\href{https://github.com/sympy/sympy/issues/11744}{issue 11744} in our public
issue tracker for improving the label placement.
\end{solution}

\question Figure 2 has the wrong link towards SymPy Gamma's computation of $\tan(x)$
 instead of $\int \tan(x)\,dx$.
\begin{solution}
The original link does include the integral steps, since SymPy Gamma
automatically includes the integral as one of the computations when given an
expression. However, we have changed the link as suggested to a query for
``integrate tan(x)'', as this is clearer.
\end{solution}

\end{questions}
\end{document}


\documentclass[11pt]{memoir}

\usepackage[margin=1.375in]{geometry}
\input{header.tex}
%\usepackage[urw-garamond]{mathdesign}

\begin{document}
\title{Algebraic Topology}
\author{Lectures by Haynes Miller\\
Notes based on live{\TeX}ed record made by Sanath Devalapurkar\\
Images created by John Ni
}
%\date{Fall 2016 -- Spring 2017}

\frontmatter

\maketitle
\input{preface.tex}
\newpage
\tableofcontents
\newpage

\mainmatter

%The current division of labor is: John'll "work on the first part (like, most
%of 905)", and skd will start off by editing/rewriting the whole of 906.

\part{18.905: an introduction to algebraic topology}\label{905}

\chapter{Homology and CW-complexes}
\input{905-hrm-edited/18-905/905/lec-01-intro.tex}
\input{905-hrm-edited/18-905/905/lec-02-simplices.tex}
\input{905-hrm-edited/18-905/905/lec-03-categories.tex}\label{lec:3-categories}
\input{905-hrm-edited/18-905/905/lec-04-more-on-categories.tex}
\input{905-hrm-edited/18-905/905/lec-05-homotopy.tex}
\input{905-hrm-edited/18-905/905/lec-06-homotopy-invariance.tex}\label{lec:6-homotopy-invariance-of-homology}
\input{905-hrm-edited/18-905/905/lec-07-eilenberg-zilber.tex}
\input{905-hrm-edited/18-905/905/lec-08-relative-homology.tex}
\input{905-hrm-edited/18-905/905/lec-09-long-exact.tex}
\input{905-hrm-edited/18-905/905/lec-10-excision.tex}
\input{905-hrm-edited/18-905/905/lec-11-eilenberg-steenrod.tex}
\input{905-hrm-edited/18-905/905/lec-12-subdivision.tex}
\input{905-hrm-edited/18-905/905/lec-13-locality.tex}
\input{905-hrm-edited/18-905/905/lec-14-cw-complexes.tex}
\input{905-hrm-edited/18-905/905/lec-15-cw-complexes-2.tex}
\input{905-hrm-edited/18-905/905/lec-16-homology-cw-complexes.tex}
\input{905-hrm-edited/18-905/905/lec-17-RPn.tex}
\input{905-hrm-edited/18-905/905/lec-18-euler-char.tex}
\input{905-hrm-edited/18-905/905/lec-19-coefficients.tex}
\input{905-hrm-edited/18-905/905/lec-20-tensor-products.tex}
\input{905-hrm-edited/18-905/905/lec-21-tensor-and-tor.tex}
\input{905-hrm-edited/18-905/905/lec-22-more-on-tor.tex}
\input{905-hrm-edited/18-905/905/lec-23-direct-limits.tex}
\input{905-hrm-edited/18-905/905/lec-24-uct.tex}
\input{905-hrm-edited/18-905/905/lec-25-kunneth-eilenberg-zilber.tex}

\chapter{Cohomology and duality}
\input{905-hrm-edited/18-905/905/lec-26-cohomology.tex}
\input{905-hrm-edited/18-905/905/lec-27-ext-cup-product.tex}
\input{905-hrm-edited/18-905/905/lec-28-uct-products-in-cohomology.tex}
\input{905-hrm-edited/18-905/905/lec-29-cup-products-contd.tex}
\input{905-hrm-edited/18-905/905/lec-30-surfaces-bilinear-forms.tex}
\input{905-hrm-edited/18-905/905/lec-31-plethora-of-products.tex}
\input{905-hrm-edited/18-905/905/lec-32-cap-product-cech-cohomology.tex}
\input{905-hrm-edited/18-905/905/lec-33-fully-relative-cap-product.tex}
\input{905-hrm-edited/18-905/905/lec-34-cech-cohomology.tex}
\input{905-hrm-edited/18-905/905/lec-35-topological-manifolds.tex}
\input{905-hrm-edited/18-905/905/lec-36-fundamental-classes.tex}
\input{905-hrm-edited/18-905/905/lec-37-covering-spaces-poincare.tex}
\input{905-hrm-edited/18-905/905/lec-38-the-end-applications.tex}

\part{18.906 -- homotopy theory}\label{906}

\section*{Introduction}
Here is an overview of this part of the book.
\begin{enumerate}
    \item \textbf{General homotopy theory.} This includes category theory;
	because it started as a part of algebraic topology, we'll speak freely
	about it here.  We'll also cover the general theory of homotopy groups,
	long exact sequences, and obstruction theory.
    \item \textbf{Bundles.} One of the major themes of this part of the book is
	the use of bundles to understand spaces.  This will include the theory
	of classifying spaces; later, we will touch upon connections with
	cohomology.
    \item \textbf{Spectral sequences.} It is impossible to describe everything
	about spectral sequences in the duration of a single course, so we will
	focus on a special (and important) example: the Serre spectral
	sequence.  As a consequence, we will derive some homotopy-theoretic
	applications.  For instance, we will relate homotopy and homology (via
	the Hurewicz theorem, Whitehead's theorem, and ``local'' versions like
	Serre's mod C theory).
    \item \textbf{Characteristic classes.} This relates the geometric theory of
	bundles to algebraic constructions like cohomology described earlier in
	the book.  We will discuss many examples of characteristic classes,
	including the Thom, Euler, Chern, and Stiefel-Whitney classes.  This
	will allow us to apply a lot of the theory we built up to geometry.
    %\item Time permitting, there's a beautiful story that comes out (on
	%cobordism, etc).
\end{enumerate}

\chapter{Homotopy groups}
\todo[inline]{Insert an outline of the content of each lecture.}
\input{906/lec-39-limits-colimits-adjunctions.tex}
\input{906/lec-40-compactly-generated.tex}
\input{906/lec-41-basepoints.tex}
\input{906/lec-42-fiber-bundles.tex}
\input{906/lec-43-fibrations-cofibrations.tex}
\input{906/lec-44-homotopy-fibers.tex}
\input{906/lec-45-barratt-puppe.tex}
\input{906/lec-46-relative-homotopy.tex}
\input{906/lec-47-pi_1-action-hurewicz.tex}
\input{906/lec-48-examples-cw-complexes.tex}
\input{906/lec-49-relative-hurewicz.tex}
\input{906/lec-50-cellular-approximation.tex}
\input{906/lec-51-and-all-the-rest.tex}

\chapter{Vector bundles}
\input{906/lec-52-vector-bundles.tex}
\input{906/lec-53-principal-bundles.tex}
\input{906/lec-54-I-invariance.tex}
\input{906/lec-55-grassmann-model-classifying-spaces.tex}
\input{906/lec-56-ssets.tex}
\input{906/lec-57-recall.tex}
\input{906/lec-58-bundles-classifying-spaces.tex}
\input{906/lec-59-classifying-spaces.tex}

\chapter{Spectral sequences}
\input{906/lec-60-why-sseqs.tex}
\input{906/lec-61-serre-sseq.tex}
\input{906/lec-62-exact-couples.tex}
\input{906/lec-63-sseq-applications.tex}
\input{906/lec-64-edge-homomorphisms.tex}
\input{906/lec-65-serre-classes.tex}
\input{906/lec-66-mod-C-hurewicz.tex}
\input{906/lec-67-dress-sseq.tex}
\input{906/lec-68-leray-hirsch.tex}
\input{906/lec-69-integration.tex}

\chapter{Characteristic classes}
\input{906/lec-70-grothendieck-chern-classes.tex}
\input{906/lec-71-homology-of-BUn.tex}
\input{906/lec-72-chern-roots.tex}
\input{906/lec-73-steifel-whitney-classes.tex}
\input{906/lec-74-oriented-bundles.tex}

\backmatter

\nocite{*}
\bibliographystyle{alpha}
\bibliography{main}

\end{document}


\section{Conclusion}

We presented \toolname, a refinement type checker
for Haskell programs.
Specifically, we presented
a high-level overview of \toolname, through a tour of its features;
a qualitative discussion of the kinds of properties that can be checked; and
a quantitative evaluation of the approach.

\toolname users, especially the ones coming from a dependent type theory
background, should keep in mind that the refinement language is not arbitrary
haskell terms. Instead it is a restricted logical language determined by the
underlying SMT solver.
Thus, a natural question that arises is:
%%
%%Ideally, at this point,  we would like to be able to provide a crisp
%%answer to the question:
``What kinds of properties or constructs can(not) be verified by \toolname?''
%
Unfortunately, we have no such answers since the boundaries of
what is possible are constantly expanding, either by improvements
in the tool, by creatively encoding specifications~\cite{vazou13},
or by modifying the code slightly to facilitate verification.
Indeed, to appreciate the difficulty of answering this question,
replace \toolname with ``Haskell's type system".
Instead, over the course of this work we have qualitatively
circumscribed the wide space of use cases for refinement types,
and have identified some lacunae that may be addressed in future work.
%
Ultimately, we hope that with more users and experience, we will be able
identify various common specification patterns or idioms to easily
demarcate the boundary of what is possible with automatic SMT-based verification.


\documentclass[12]{scrartcl}
\usepackage{amssymb,amsmath,gensymb,dsfont,calc,multicol,fullpage}
\makeatletter
\newcommand\Aboxed[1]{
   \@Aboxed#1\ENDDNE}
\def\@Aboxed#1&#2\ENDDNE{%
   &
   \settowidth\@tempdima{$\displaystyle#1{}$}
   \setlength\@tempdima{\@tempdima+\fboxsep+\fboxrule}
   \kern-\@tempdima
   \boxed{#1#2}
}
\makeatother

\begin{document}

\title{Homework 1, Section  1.1: 3, 5, 9, 11, 16, 17, 21, 23, 26, 30}
\author{Alex Gordon}
\date{\today}
\maketitle
\section*{Homework}
\subsection*{3.}
The intersection point is (2,1)
\subsection*{5.}
1) Replace Row 2 by the sum of Row 2 and Row 3 times -4
2) Replace Row 1 by the sum of Row 1 and 3 times Row 3
\subsection*{9.}
The solution set of the original system is (16, 21, 13, 4)
\subsection*{11.}
Inconsistent
\subsection*{16.}
Consistent
\subsection*{17.}
Inconsistent
\subsection*{19.}
$h \neq 2$
\subsection*{21.}
It is augmented for every value of $h$
\subsection*{23. A}
T
\subsection*{23. B}
F
\subsection*{23. C}
T
\subsection*{23. D}
T
\subsection*{26.}
C and D are both real numbers

\end{document}


%!TEX root = ../../common/main.tex

\chapter{Introduction}
\label{ch:introduction}

With the Big Bang theory being the prevailing model to explain the earliest
known period of the universe, matter and anti-matter should have been produced
in equal quantities. To explain today's observation of a maximal asymmetry
between matter and anti-matter with complete absence of anti-matter in the
visible universe, the source of the asymmetry needs to be determined.

A possible solution was provided by Sakharov \cite{Sakharov:1967dj}. To achieve
a universal baryon asymmetry three conditions have to be fulfilled: 1) the
existence of baryon number violating processes, 2) the violation of \CSym and
\CP conservation in fundamental interactions, and 3) a deviation from the
thermal equilibrium during the history of the universe.

The non-equilibrium state is guaranteed due to the inflationary epoch of the
universe and baryon number violation processes are known as well
\cite{tHooft:1976up,Rubakov:1996vz}, thus leaving us to find a source of \CP
violation large enough to explain the existing matter-antimatter asymmetry.

Discrete global symmetries play an outstanding role in the \SM. Of particular
importance are the discrete transformations under charge conjugation $\CSym$,
parity $\PSym$, and time reversal $\TSym$. The \CPT theorem states that the \CPT
symmetry holds for any Lorentz invariant, local quantum field theory, whereas
the violation of each of the discrete symmetries $\CSym$, $\PSym$, or $\TSym$ is
still possible \cite{set:cpt}.

Lee and Yang where the first to question the general assumption that all
physical interactions are invariant even under a single transformation by
stating a possible $\PSym$ violation in weak interactions \cite{Lee:1956qn}.
Soon after, this statement was supported by the measurement of $\PSym$ violation
in the $\beta^{-}$ decay of \cobaltsixty \cite{Wu:1957my}. The experiment
revealed that the weak interaction only couples to fermions with left-handed
chirality or anti-fermions with right-handed chirality, which means that
symmetry under the $\CSym$ transformation is violated as well. Still, the
interaction seemed to behave invariant under combined $\CP$ transformations. But
already in 1964, the symmetry violation under $\CP$ transformation was observed
in the neutral kaon system and consequently established in the \SM
\cite{Christenson:1964fg}.

However, writing the source of \CP violation into the theoretical description of
the  \SM still was a challenge. The triumphant idea came from Makoto Kobayashi
and Toshihide Maskawa proposing a third quark generation as a possibility to
explain \CP violation in the framework of the electroweak theory
\cite{Kobayashi:1973fv}. The discovery of the \bquark quark
\cite{Herb:1977ek} provided enough confidence in their theory to start planning
the two \BFactories \Babar and \Belle. At the two $\elel$ colliders, PEP-II
(Stanford, CA, US) and KEKB (Tsukuba, JP), electrons and positrons were brought
to collisions at asymmetric beam energies. Both machines operated at
centre-of-mass energies of exactly the \YFourS bottonium resonance at
$\SI{10.58}{\GeV}$, producing $\B\Bbar$ meson pairs at high rates of $\num{e6}$
a day \cite{Bevan:2014iga}.

To establish \CP violation in the \SM it was necessary to extend
the measurements outside the kaon sector to the heavier \B and \D meson systems.
Predominantly built to study \CP violation in the \Bmeson system, \Babar and
\Belle had soon been successful and reported the observation of \CP violation in
decays of \Bd mesons to charmonium final states in 2001
\cite{Aubert:2001nu,Abe:2001xe}.

The \enquote{golden observable} \cite{Bevan:2014iga} of \CP violation in the \Bd
meson system is the decay-time dependent \CP asymmetry between the  \BdToJpsiKS
and \BdbarToJpsiKS decay rates
%
\begin{equation*}
    \CPAsymmetry(\obsTime) \equiv
      \frac{\Gamma\bigl(\decay{\Bdbar(\obsTime)}{\Jpsi\KS}\bigr) - \Gamma\bigl(\decay{\Bd(\obsTime)}{\Jpsi\KS}\bigr)}
           {\Gamma\bigl(\decay{\Bdbar(\obsTime)}{\Jpsi\KS}\bigr) + \Gamma\bigl(\decay{\Bd(\obsTime)}{\Jpsi\KS}\bigr)} \eqcm
\end{equation*}
%
that can be related to the angle $\beta$ of the \CKM quark mixing matrix as the
source of \CP violation in the \SM \cite{Aaij:2015vza}. In recent years, the
value of \sintwobeta was measured to a precision of below $\SI{3}{\percent}$
with a world average of $\sintwobeta = \num{0.682 +- 0.019}$, dominated by the
measurements of \Babar and \Belle \cite{Amhis:2014hma}. Taking into account
measurements of other parameters that constrain the value of \sintwobeta to
$0.711\pm^{0.017}_{0.041}$
\cite{Charles:2015gya}, a small discrepancy to the direct measurement is
observed.

The presence of this statistically insignificant but visible tension illustrates
the principle idea of precision measurements of \CKM parameters. Although, the
conditions presented by Sakharov are met in the \SM, the magnitude of \CP
violation is not large enough to sufficiently explain the baryon asymmetry.
Consequently, the source of the \CP violation has to originate from physics
beyond the \SM. One way to cope with this, is the direct search for new
particles at higher mass scales. However, this has not been very successful
until now. Another promising way is to conduct indirect searches. Quantum loop
processes may contain contributions from heavy particles even if they take place
at far lower energies than necessary to produce those directly, thus allowing to
get a peek on physics scales far above the current experimental limits.
Therefore, together with precise theory predictions, possible deviations from
the \SM can appear in precision measurements of \SM parameters.

To meet the high demands defined by a precision measurement the experimental
setup has to be customised to this very purpose. In case of decay-time dependent
measurements, the spatial and time resolution has to be excellent to resolve
production and decay vertices, which allow for an efficient and precise
reconstruction of particle trajectories and decays. Additionally the \PID has to
be very efficient, with low mis-identification rates in order to correctly
identify final state particles.

The \LHCb detector located at the \LHC at the \CERN was designed with these
requirements in mind and operates very successfully since 2009. Following its
predecessors \Babar and \Belle, the \LHCb experiment aims to study heavy flavour
physics by exploiting direct and indirect experimental techniques to their full
extent. The physics program includes \CP violation measurements in $\B$ and $\D$
meson decays
\cite{Aaij:2015tza,Aaij:2015yda,Aaij:2014uva,Aaij:2014fba,Aaij:2014dka,Aaij:2014zsa,Aaij:2014kxa},
the search for (very) rare decays \cite{CMS:2014xfa}, tests of
lepton-universality \cite{Aaij:2014ora,Aaij:2015yra}, as well as heavy flavour
spectroscopy \cite{Aaij:2014yka,Aaij:2015tga}.

The analysis presented in this thesis describes the precise determination of the
\CKM parameter \sintwobeta in a measurement of the decay-time dependent \CP
asymmetry $\CPAsymmetry(\obsTime)$ in the decay of \Bd and \Bdbar mesons into
their common $\Jpsi\KS$ final state. Flavour tagging algorithms are used to
determine the state of the \B meson at production and are therefore of critical
importance to the measurement of the \CP asymmetry. The \LHCb experiment is the
only detector capable of sophisticated flavour tagging in a hadronic environment
and sets performance benchmarks for flavour tagged \CP analyses at hadron
colliders.

The measurement is conducted on a dataset collected by the \LHCb experiment during
the first \LHC run period in 2011 and 2012. Based on a dataset corresponding to
an integrated luminosity of $\SI{3.0}{\per\femto\barn}$ collected at a
centre-of-mass energy of $\num{7}$ and $\SI{8}{\TeV}$ the measurement supersedes
a previous measurement by \LHCb \cite{Aaij:1497268} on a subset of the data
corresponding to an integrated luminosity of $\SI{1.0}{\per\femto\barn}$.

The updated analysis makes use of the larger dataset, an optimized selection,
and adds an additional flavour tagging algorithm to identify the quark content
of the \Bmeson at production. Therewith, the statistical power of the
measurement can be increased by almost a factor of $\num{6}$.

\subsubsection*{Collaboration}
The work presented in this document was only possible to achieve in close
collaboration with colleagues from the \acs{LHCb} collaboration, most notably
Frank Meier and Julian Wishahi from the local working group, they are---together
with the author---the contact authors of this analysis published as:
%
\begin{quotation}
  \fullcite{Aaij:2015vza}.
\end{quotation}

Mirco Dorigo and Ulrich Eitschberger from the flavour tagging group provided the
flavour tagging calibration measurements (\cf
\cref{sec:flavour_tagging:calibration:os,sec:flavour_tagging:calibration:ss}).
The calculation of the kaon regeneration (\cf
\cref{sec:measurement_of_sin2beta:cpv_measurement:kaon_regeneration}) was
performed by Jeroen van Tilburg from the \B to charmonium working group.

\subsubsection*{Outline}

\Cref{ch:cpv_theory} shortly recapitulates the \SM with an emphasis on flavour
physics and \CP violation in the quark sector. The nature of Yukawa interactions
and the appearance of the \CKM matrix through spontaneous symmetry breaking are
summarised. Then, the time evolution of \Bmesons including decay and flavour
oscillations is outlined. Finally, an overview of the measurement of
\CP violation in the decay of \BdToJpsiKS is given.

The \LHCb detector and its subsystems are briefly described in
\cref{ch:lhcb_experiment} with particular attention to the track reconstruction
and \acl{PID} techniques. The \LHCb trigger system is sketched and the software
stack is depicted. Also, the data taking in the first successful years
of running is summarised.

Playing an important role in this analysis, the flavour tagging algorithms
utilised at \LHCb are discussed in more detail in \cref{ch:flavour_tagging}.
After a general overview and a comparison to developments at the \BFactories,
the flavour tagging algorithms are explained. Afterwards, the calibration of the
flavour tagging output is motivated and described. The chapter closes with an
outlook on recent developments.

The main part (\cref{ch:measurement_of_sin2beta}) contains the details of the
performed measurement. The data taking and preparation is explained as well as
studies of potential background contributions. The influence of decay time
acceptance and resolution effects is briefly summarised. Before the results are
presented, the likelihood function is described. Finally, all studies of
systematic effects are collected.

The results are summarised and put into context to the global \CKM picture and
prospects for \RunTwo and the \LHCb detector upgrade are presented.


%!TEX root = ../../template.tex
\section{DOAS Tomography}%
\label{sec:doas_tomography}

In previous sections (Section~\ref{sec:doas}) we have established that
\gls{DOAS} is a widespread spectroscopic technique with particular usage
in the atmospheric research community. This technique uses either
artificial or natural light to retrieve slant column densities, the
number of molecules that interact with the said light in a given optical
path. These values are described by Equation~\ref{eq:slantColumn}, and
are indeed line integrals.

Also in a previous but different section
(Section~\ref{sec:tomographic_algorithms_and_reconstruction_techniques}),
we have seen that with enough of these integrals (which we can call
projections), we can gather enough information to depict the interior
structure of an object that we make traverse with radiation of some
kind, as long as it is measurable and its behaviour is well known.

Joining the two notions, we can get to the idea that it would be
possible to use \gls{DOAS} in a tomographic manner, so long as we use
sufficient light collection points. This has been proposed by Byer and
Shepp~\cite{Byer1979} in 1979. At the time the authors did not mention
specifically the \gls{DOAS} technique, but the assembly they propose is
essentially equivalent to one that would use this method. \gls{DOAS}
tomography was also mentioned in one of the main pieces of literature in
the field,~\cite{Platt2007}, as one of the most promising avenues
available for \gls{DOAS} progress in the future.

As a requirement for one of the courses that I chose to pursue during
the curricular part of my doctorate, I had to complete an assignment
that consisted in writing a \acrlong{sms} on the subject of \gls{DOAS}
tomography. The study is included in full in Appendix~\ref{ap:tomDoas}.
It aims at characterising the literary panorama regarding the subject
and tries to arrive at a standard application with respect to software,
algorithms and instrumentation.

This type of study has a particular methodology focused on
repeatability. Its complete explanation is out of scope of this section
and even this document, but a simplified schematic is included in
Figure~\ref{fig:sms_schematic}. A more detailed and extensive
description of this method can be found in several works available in
the literature, namely~\cite{Kitchenham2007, Kitchenham2009, Souza2019}.

\begin{figure}[htpb]
    \centering
    \includegraphics[width=.6\textwidth]{img/pdf/sms_planning.pdf}
    \caption{Simplified diagram of the \gls{sms} method. This type of
    study is focused on registering every step of the search and the
    reading  of the retrieved material, in an effort to make the process
    completely repeatable. Adapted from~\cite{Kitchenham2007}.}
    \label{fig:sms_schematic}
\end{figure}

After defining search terms and conducting the actual search, we arrived
at a total of 9 relevant papers. These were analysed under the light of
the study's main goal, which was to identify a standard \gls{DOAS}
tomography device and application.

The first identifiable pattern is the marked prevalence of active
\gls{DOAS} systems. 11 out of the 13 retrieved papers describe or
consider an active \gls{DOAS} system of some kind. As stated in
Section~\ref{sec:doas}, active \gls{DOAS} systems do have better
analytical capabilities than their passive counterparts, although that
comes at the cost of increased instrument complexity and operational
costs.

Another immediate conclusion is that there is a "dominant" study. Almost
half of the papers found originated from the BABII campaign, in which a
group of researchers set out to quantify pollution through \gls{DOAS}
tomography along a busy German motorway, in the beginning of the
21\textsuperscript{st} century~\cite{Hartl2005, Hartl2006,
Laepple2004, Pundt2005, Pundt2006, Pundt2005a, Mettendorf2005}.

All of the active \gls{DOAS} systems were purposely built for their
corresponding experiment (or group of experiments). BABII researchers
used two telescopes with around 200mm diameter and 1m focal length to
simultaneously illuminate 8 retroreflectors that were assembled onto two
towers located on each side of the road. In one of the papers associated
with this initiative, the same telescope instrumentation was used to
validate the 2D reconstruction technique that was going to be used in
the other papers. The campaign's main assembly is illustrated in
Figure~\ref{fig:babii}.

\begin{figure}[htpb]
    \centering
    \includegraphics[width=0.6\linewidth]{img/png/babii_geometry.png}
    \caption{BABII assembly geometry. In this experiment campaign, the
    telescopes illuminated retroreflecting targets that were positioned
    in two steel towers on both sides of a busy motorway in Germany,
    connecting Heidelberg to Mannheim~\cite{Pundt2005a}.}
    \label{fig:babii}
\end{figure}

Another important initiative with respect to \gls{DOAS} tomography was
the study conducted in 2016 by Stutz et al~\cite{Stutz2016}. The
approach in this case was to use a similar telescope to detect the light
emitted by a narrow interval UV LED light source (290nm) to create a
fence line monitoring system for Benzenes, Toluene and Xylene. The team
managed to apply this system in a successful manner in refineries in Los
Angeles and Houston. One of the most interesting aspects of this study
is that it details a tomographic system that could easily be
commercially deployed.

Another type of \gls{DOAS} tomography system was proposed by researchers
in the Cork Institute of Technology~\cite{ODriscoll2003,ODriscoll2003a,
Murphy2003}.  In their three papers, the authors describe \textbf{1)} a
new multipath instrument that significantly increases the amount of
projection information in this kind of application; \textbf{2)} a
tomographic reconstruction algorithm based on evolutionary algorithms;
and \textbf{3)} the application of \gls{DOAS} tomography to a simulated
urban canyon scenario. Although all three papers present technological
innovation, it would not be fair not to say that from a strictly
literary point of view, these were among the weakest retrieved by the
search process.

Regarding passive DOAS applications, the two papers we have found come
with two completely different paradigms. The first
article~\cite{Johansson2009} was written in 2009 and details the
application of a tomographic inversion algorithm to a scanning DOAS
application, designed to work with trace gas plumes like the ones above
volcanoes or power stations. The team present a system composed of two
DOAS devices, with sufficient distance with themselves as to allow
tomographic reconstruction, but sufficiently small to allow the light
path to be considered a straight line from the point of last scattering
to the detector. The authors applied an adapted version of the Lower
Third Derivative (LTD) algorithm to the projections obtained by pointing
the set of fixed DOAS apparatus towards the plume in different angles.
Besides simulations for their proposed method, the authors have also
conducted practical experiments, both over a power plant in Spain and a
volcano in Italy. Results from these experiments display a good
agreement between reality and simulation results, proving the
technique's validity.

The second Passive DOAS application is a paper published by Frins et
al.~\cite{Frins2006}. In this study, the researchers detail a particular
application in which they measure light coming from bright and
nonreflecting sun-illuminated objects in their field of view. They use
this light to retrieve column density values for a number of trace
gases. The proposed method also includes a way with which to remove the
stratospheric contribution that appears in the measured light besides
the target column. The authors discuss how radiative transfer can
influence measurements, but they also present a number of approaches to
mitigate this problem, ensuring the validity of their approach.  Besides
presenting the method, the authors also describe an experiment they
conducted by assembling and manoeuvring a DOAS system on top of a
building in Heidelberg, Germany.

\begin{figure}[htpb]
    \centering
    %left bottom right top
    \begin{subfigure}[b]{.475\textwidth}
        \centering
        \includegraphics[trim=10.8cm 19.7cm 2cm 2cm, clip, %...
        width=\textwidth]{img/pdf/frinsSchematics_p2.pdf}
        \caption{Schematic representation of Frins's
        assembly~\cite{Frins2006}.}
        \label{fig:frins_schem_1}
    \end{subfigure}
    \hfill
    \begin{subfigure}[b]{.475\textwidth}
        \centering
        \includegraphics[trim=10.8cm 22.8cm 1cm 1cm, clip, %...
        width=\textwidth]{img/pdf/frinsSchematics_p3.pdf}
        \caption{The physical principle behind Frins's
        paper~\cite{Frins2006}.}
        \label{fig:frins_schem_2}
    \end{subfigure}
    \caption{Erna Frins's paper~\cite{Frins2006} proposes a very
        relevant passive \gls{DOAS} application that can conceptually be
        employed in a \gls{DOAS} tomography scenario. In this 2006
        paper, the authors use multi-axis measurements of
        sun-illuminated targets to estimate absorption paths without
        using radiative transfer models.}
    \label{fig:ernafrins}
\end{figure}

In summary, the search has found that active tomographic \gls{DOAS} is
far more common than the passive counterpart (11 out of 13 articles
discussed this method). This preference can be explained by the fact
that the results produced by this kind of system are generally superior
to those obtained by passive methods. However, passive applications are
normally much less demanding on a technical level, and are simpler to
run and assemble.  Much as a result of this, we have also identified
that the systems used in the literature were not mobile or had a very
low mobility level which in turn caused that all the systems were
working with low projection numbers. This should be taken into account
in future research on the topic. As a final note, we would also like to
point out that there is no commercially available systems for this kind
of application, although some of the articles, like the one by Stutz in
2016~\cite{Stutz2016} detail systems which could easily be adapted to
that end.