\documentclass[12pt]{amsbook}
%\usepackage[utf8]{inputenc}

\usepackage{tikz}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\usepackage{color}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\usepackage[pdfpagelabels,hyperindex=false]{hyperref}

%%%%\usepackage{amsmidx}
\usepackage{appendix}
\usepackage{booktabs}
\usepackage[normalem]{ulem}
%%%%\makeindex{LABdriver6}
\usepackage[lastexercise]{exercise}

\newcommand{\xxj}{x^{(j)}}

\newcommand{\xxi}{x^{(i)}}
\newcommand{\bp}{\mathbb{P}}
\newcommand{\br}{\mathbb{R}}
 \newcommand{\brm}{\mathbb{R}^m}
 \newcommand{\brn}{\mathbb{R}^n}
 \newcommand{\bbrm}{$\mathbb{R}^m\,$}
 \newcommand{\bbrn}{$\mathbb{R}^n\,$}

\newcommand{\calr}{\mathcal{R}}
\newcommand{\caln}{\mathcal{N}}

\numberwithin{equation}{section}
% We'll use the equation counter for all our theorem environments, so
% that everything will be numbered in the same sequence.
%       Theorem environments
\theoremstyle{plain} %% This is the default, anyway
\newtheorem{thm}[equation]{Theorem}
\newtheorem{cor}[equation]{Corollary}
\newtheorem{lem}[equation]{Lemma}
\newtheorem{prop}[equation]{Proposition}
\theoremstyle{definition}
\newtheorem{defn}[equation]{Definition}
\newtheorem{Property}[equation]{Property}
\theoremstyle{remark}
\newtheorem{rem}[equation]{Remark}
\newtheorem{ex}[equation]{Example}
\newtheorem{notation}[equation]{Notation}
\newtheorem{terminology}[equation]{Terminology}

%\includeonly{LinearSystems,Exercises}
%\includeonly{Exercises}

%\includeonly{Eigenvectors,Exercises}
%\includeonly{Eigenvectors}
%\includeonly{PS8}

%\includeonly{GeometrySubspacestex}

%\usepackage{makeidx}
%\usepackage{robustindex}

\makeindex

\begin{document}

\section*{Exercises for Chapter 1}

\begin{Exercise}
%\begin{Exercise}[title={Computing an inverse}, difficulty = 0, label = rank1sum]
Let $A, B, C$ be given by
\begin{align*}
A =  \left[
\begin{array}{ccc}
1& 1&  3\\ \noalign{\medskip}
0& 1&  3\\ \noalign{\medskip}
1& 2   & 2
\end{array}
 \right],\,\,\, B =  \left[
\begin{array}{rrr}
2& 0&  -1\\ \noalign{\medskip}
0& 1&  3\\ \noalign{\medskip}
0& 1   & -2
\end{array}
 \right],\,\,\,
 C=  \left[
\begin{array}{rr}
0& 1\\ \noalign{\medskip}
1& 1\\ \noalign{\medskip}
-1& -1
\end{array}
 \right] ,\,\,\,
 D=  \left[
\begin{array}{rrr}
0& 1 & 3\\ \noalign{\medskip}
-1& -1   &-1
\end{array}
 \right]
\end{align*}
%\end{Exercise}
For each problem find $X$ if possble.  If X doesn't exist say why.
\begin{itemize}
\item[a)]$X =  2A+3B$
\item[b)]$ X =7A + 2C$
\item[c)]$X =  BC$
\item[d)] $X = CB$
\item[e)]$ X = (A+2B)C$
\item[f)] Without actually computing the product, what is the size of the matrix $X = DC$
\end{itemize}

\end{Exercise}

\begin{Exercise}
Show that in general $AB \ne BA $ where  $A$ and $B$ are square.  It is sufficient to provide a single counter example for $A, B \in \mathbb{R}^{2 \times 2}$.
\end{Exercise}

\begin{Exercise}
%
%\begin{Exercise}[title={Computing an inverse}, difficulty = 0, label = rank1sum]
Let $A, b, x$ be given by
\begin{align*}
A =  \left[
\begin{array}{rr}
1& 1\\ \noalign{\medskip}
1& 2
\end{array}
 \right],\,\,\, b =  \left[
\begin{array}{r}
0\\ \noalign{\medskip}
1
\end{array}
 \right],\,\,\,
 x=  \left[
\begin{array}{r}
x_1\\ \noalign{\medskip}
x_2
\end{array}
 \right]
\end{align*}
%\end{Exercise}
Write $$Ax=b$$
as a system of linear equations without matrix notation.
\end{Exercise}

\begin{Exercise}
%\begin{Exercise}[title={Computing an inverse}, difficulty = 0, label = rank1sum]
Let $A, b, x$ be given by
\begin{align*}
A =  \left[
\begin{array}{rrrr}
1& 1& 0& 3\\ \noalign{\medskip}
0& 1&  0&3\\ \noalign{\medskip}
1& 2   &-1& 2
\end{array}
 \right],\,\,\, b =  \left[
\begin{array}{r}
2\\ \noalign{\medskip}
-1\\ \noalign{\medskip}
1
\end{array}
 \right],\,\,\,
 x=  \left[
\begin{array}{r}
x_1\\ \noalign{\medskip}
x_2\\ \noalign{\medskip}
x_3\\ \noalign{\medskip}
x_4
\end{array}
 \right]
\end{align*}
%\end{Exercise}
Write $$Ax=b$$
as a system of linear equations without matrix notation.
\end{Exercise}

\begin{Exercise}
Write the linear system
$$2x_1+x_2 = 7$$
$$3x_1-x_2 = 2$$
in the form $$Ax=b$$
What  are $A, b, x$?
\end{Exercise}

\begin{Exercise}
Write the linear system
$$5x_1-4x_2 = 1$$
$$3x_1+5x_2 = 2$$
$$6x_1-4x_2 = 8$$
$$7x_1+6x_2 = 2$$
$$2x_1-4x_2 = 9$$
$$8x_1+9x_2 = 2$$
in the form $$Ax=b$$
What are $A, b, x$?
\end{Exercise}

\begin{Exercise}
Let $A, B, C \in \mathbb{R}^{m \times n}$.
Provide a mathmatical proof of the associative law of addition for matrices, i.e.,
$$(A+B)+C = A+(B+C)$$
Hint: you may use the fact that $(a+b)+c = a +(b+c) $ where $a, b, c$ are real
numbers.  Identify the $(i,j)$ component of the resulting matrix on each side of the equation
and show they are equal.
\end{Exercise}

\begin{Exercise}
The transpose of a matrix $A \in \mathbb{R}^{m\times n}$ (possibly not square) is the new matrix
$$X_{ij} = A_{ji}$$   The standard notation for this is $$X  = A^T$$  Given the matrices as defined in
Problem 1 find
\begin{itemize}
\item[a)] $A^T$
\item[b)] $B^T$
\item[c)] $C^T$
\item[d)] $D^T$
\end{itemize}
\end{Exercise}
\begin{Exercise}
The matrix $A$ is said to be symmetric if $A = A^T$.
\begin{itemize}
\item[a)] Construct an example of a symmetric matrix.
\item[b)] Can a matrix be symmetric if it is not square?
\item[c)] What is the plural of the word matrix?
\end{itemize}
\end{Exercise}

\begin{Exercise}
\begin{itemize}
\item[a)] Find the $(i,j)$ entry of the matrix
$AB$.
\item[b)] Find the $(i,j)$ entry of the matrix $(AB)^T$.
\item[c)] Find the $(i,j)$ entry of the matrix product $B^TA^T$.
\item[d)] Hence justify the equation
$(AB)^T = B^TA^T$
\item[e)] Is the matrix $XX^T$ symmetric?
\end{itemize}
\end{Exercise}

\bigskip

\begin{Exercise}[title={Scalar product}, difficulty = 0, label = exmm]
	Compute the scalar (or dot) product of the vectors
	$$u =  \left[ \begin {array}{c}
	9 \\ \noalign{\medskip}
	2 \\ \noalign{\medskip}
	-1\end {array}
	\right], \quad v=
	\left[ \begin {array}{cccc}
	0  \\ \noalign{\medskip}
	2  \\ \noalign{\medskip}
	1 \end {array}
	\right]
	$$
\end{Exercise}

\bigskip

\begin{Exercise}[title={2-norm of a vector}, difficulty = 0, label = exmm]
\Question 	Let
	$$ x =  \left[ \begin {array}{c}
	3 \\ \noalign{\medskip}
	4 \\ \noalign{\medskip}
	    	-7 \\ \noalign{\medskip}
	8\end {array}
	\right]
	$$
	Find the 2-norm $\| x \|_2$.
	\Question 	Let
	$$ x =  \left[ \begin {array}{c}
	1 \\ \noalign{\medskip}
	1 \\ \noalign{\medskip}
	1\end {array}
	\right]
	$$
	Find the 2-norm $\| x \|_2$.

	\Question 	Let
	$$ x =  \left[ \begin {array}{c}
	1/ \sqrt{3} \\ \noalign{\medskip}
	1/ \sqrt{3}\\ \noalign{\medskip}
1/ \sqrt{3}\end {array}
	\right]
	$$
	Find the 2-norm $\| x \|_2$.

\end{Exercise}

\bigskip

\begin{Exercise}[title={Angle between vectors}, difficulty = 0, label = exmm]
\Question	Compute the angle between the vectors
	$$u =  \left[ \begin {array}{c}
	1 \\ \noalign{\medskip}
	2 \\ \noalign{\medskip}
	8 \\ \noalign{\medskip}
	-1\end {array}
	\right], \quad v=
	\left[ \begin {array}{cccc}
	-1  \\ \noalign{\medskip}
    2 \\ \noalign{\medskip}
	-1  \\ \noalign{\medskip}
	3 \end {array}
	\right]
	$$
	providing your answer in both radians and degrees.
\Question
Compute the angle between the vectors
$$u =  \left[ \begin {array}{c}
1 \\ \noalign{\medskip}
2 \\ \noalign{\medskip}
0\end {array}
\right], \quad v=
\left[ \begin {array}{cccc}
0 \\ \noalign{\medskip}
0  \\ \noalign{\medskip}
3 \end {array}
\right]
$$
providing your answer in both radians and degrees.

\Question
Compute the angle between the vectors
$$u =  \left[ \begin {array}{c}
1 \\ \noalign{\medskip}
2 \\ \noalign{\medskip}
0\end {array}
\right], \quad v=
\left[ \begin {array}{cccc}
-6 \\ \noalign{\medskip}
-12  \\ \noalign{\medskip}
0 \end {array}
\right]
$$
providing your answer in both radians and degrees.

\end{Exercise}

\bigskip

\begin{Exercise}[title={A simple sum}, difficulty = 0, label = exmm]
Let
$$A =  \left[ \begin {array}{cccc}
9  & 8  & 6 & 7 \\ \noalign{\medskip}
2  & 2  & 7 & 8 \\ \noalign{\medskip}
-1  & 3  & 1 & 1\end {array}
 \right]
+
 \left[ \begin {array}{cccc}
0  & 1  & 6 & 7 \\ \noalign{\medskip}
2  & 2  & 2 & 8 \\ \noalign{\medskip}
1  & -3  & 0 & 1\end {array}
 \right]
$$
Find $A$.
\end{Exercise}

\begin{Exercise}[title={More addition}, difficulty = 0, label = exmm]
\Question
Let
$$a =  \left[ \begin {array}{c}
1   \\ \noalign{\medskip}
2   \\ \noalign{\medskip}
-2  \\ \noalign{\medskip}
1   \end {array}
 \right] $$
and $$
b =  \left[ \begin {array}{c}
0   \\ \noalign{\medskip}
0    \\ \noalign{\medskip}
5   \\ \noalign{\medskip}
-1   \end {array}
 \right]
$$
Find $a+b$.

\Question Let
$$u =  \left[ \begin {array}{ccccc}
e  & 2  & -4 & 0 & -1  -1   \end {array}
 \right] $$
and $$
v =  \left[ \begin {array}{ccccc}
\pi  & 1  &1  &0 &0-1   \end {array}
 \right]
$$
Find $u+v$.

\Question Let
$$A =  \left[ \begin {array}{ccc}
\sqrt{2}  & 8  & 6  \\ \noalign{\medskip}
2  & 1  & 7  \\ \noalign{\medskip}
-12  & 1  & 1 \\ \noalign{\medskip}
1  & 0  & -1 \end {array}
 \right] $$
and $$
B =  \left[ \begin {array}{cccc}
0  & 1  & 2  \\ \noalign{\medskip}
2  & -1  & 4  \\ \noalign{\medskip}
-2  & 2  & 2  \\ \noalign{\medskip}
1  & -1  & 1 \end {array}
 \right]
$$
Find $A+B$.
\end{Exercise}

\bigskip

\begin{Exercise}[title={A simple product}, difficulty = 0, label = exmm]
\Question	Let
	$$M =  \left[ \begin {array}{ccc}
	2  & 1  & 3 \\ \noalign{\medskip}
	1  & -1  & 4 \end {array}
	\right], \quad N=
	\left[ \begin {array}{cc}
	2  & 2 \\ \noalign{\medskip}
	1  & -1\end {array}
	\right]
	$$
\Question	Find the product $NM$.  Which of the products $MN$, $MM$ and $NN$ make sense?
\end{Exercise}

\begin{Exercise}[title={Matrix Multiplication}, difficulty = 0, label = exmm]
	Let
	$$A = \left( \begin{array}{rrrr}
	1 & -2 & 1 & 1\\
	2 & 2 & -3 &0\\
	1 & 2 & 1 &-1\end{array} \right)$$
	$$B = \left( \begin{array}{rrr}
	9 & 8 & 6 \\
	2 & 2 & 7\\
	1 & 3 & 1 \\
	-1 &2 &0\end{array} \right)$$
	Compute the product $AB$.
\end{Exercise}
\bigskip

\begin{Exercise}[title={Matrix Multiplication}, difficulty = 0, label = exmm]
	Let
	$$A = \left( \begin{array}{rrrr}
	-1 & 2 & 0 & -1\\
	3 & -4 & 2 &1\end{array} \right)$$
	$$B = \left( \begin{array}{rrr}
	-4 & 1 \\
	1 & 2\\
	1 & 1 \\
	1 &-7\end{array} \right)$$
	Compute the product $AB$.
\end{Exercise}
\bigskip

\bigskip

\begin{Exercise}[title={$AB \ne BA$}, difficulty = 0, label = exmm]
Let
$$A = \left( \begin{array}{rr}
1 & 0\\
2 & 2 \end{array} \right)$$
$$B = \left( \begin{array}{rr}
2 & 1\\
1 & 1 \end{array} \right)$$
\Question Find $AB$.
\Question Find $BA$.
\end{Exercise}
\bigskip

\bigskip

\begin{Exercise}[title={$AB \ne BA$}, difficulty = 0, label = exmm]
Let
$$A = \left( \begin{array}{rr}
-1 & 2\\
0 & 1 \end{array} \right)$$
$$B = \left( \begin{array}{rr}
9 & -6\\
4 & -2 \end{array} \right)$$
\Question Find $AB$.
\Question Find $BA$.
\end{Exercise}
\bigskip

\index{vector!position}
\begin{Exercise}[title={Position vectors}, difficulty = 0, label = exmm]
The representation of an $n$-tuple $x$ as a position vector involves drawing a line with
arrow fron the origin ${\mathbf{0}}$ to $x$.
Let
$$x = \left( \begin{array}{r}
1 \\
2 \end{array} \right), \quad
y = \left( \begin{array}{r}
-1 \\
3 \end{array} \right)
$$
\Question Draw the position vectors associated with the points $x$ and $y$.
\Question Compute $w = 3x-2y$ and plot this position vector.
\end{Exercise}
\bigskip

\index{vector!position}
\begin{Exercise}[title={Position vectors}, difficulty = 0, label = exmm]
Consider the vector starting at the point $(3,2)$ and ending at $(-2,1)$.
\Question Express this vector in terms of two position vectors, i.e.,
vectors that have the origin as an end point.
\Question Draw the three vectors.
\end{Exercise}

\bigskip
\begin{Exercise}[title={Transpose again}, difficulty = 0, label = 3T]
	Show that
	$$(ABC)^T = C^TB^TA^T$$
	What restrictions are there on the sizes of the matrices $A, B, C$?

	%Solution:
	%$$A^T(A^{-1})^T = (A^{-1}A)^T = I$$
	%$$(A^{-1})^TA^T = (AA^{-1})^T = I$$

\end{Exercise}

\end{document}


\subsection{Utility Functions}\label{utilfns}
\begin{frame}[fragile]{mapArr, zipWithArr, listApp}
From \cite{programming_with_arrows}, we have:
\begin{lstlisting}[frame=htrbl]
mapArr :: ArrowChoice arr => arr a b -> arr [a] [b]
\end{lstlisting}

zipWithArr lifts any arrow \code{arr (a, b) c} to an arrow \code{arr ([a], [b]) [c]}:
\begin{lstlisting}[frame=htrbl]
zipWithArr :: ArrowChoice arr => arr (a, b) c -> arr ([a], [b]) [c]
zipWithArr f = (arr $ \(as, bs) -> zipWith (,) as bs) >>>
	mapArr f
\end{lstlisting}
listApp converts a list of arrows \code{[arr a b]} to a new arrow \code{arr [a] [b]}:
\begin{lstlisting}[frame=htrbl]
listApp :: (ArrowChoice arr, ArrowApply arr) =>
	[arr a b] -> arr [a] [b]
listApp fs = (arr $ \as -> (fs, as)) >>> zipWithArr app
\end{lstlisting}
with the \code{ArrowApply} that defines \code{app :: arr (arr a b, a) c}.
\end{frame}


\chapter{\proj Geometric Registration}
\label{ch_register}
\index{registration}
% \chapterhead{Programs}
\markright{Geometric registration}

\section{Introduction}
Image registration is a procedure which determines
the best spatial fit between two or more images that overlap the same
scene, and were acquired at the same or at a different time, by identical or
different sensors.
Thus, registration is required for  processing a new set of data
in such a way that its
image under an appropriate transform is in a proper geometrical
relationship with the previous set of data.
\bigskip

Several digital techniques have been used for automatic registration of
images such as cross-correlation, normal cross-correlation and minimum
distance criteria.
The advantage of the wavelet transform is that it produces both
spatial and frequency domain information which allow the study of
the image by frequency bands \cite{reg:djamdji1,reg:djamdji2,reg:djamdji3}. \\

An automatic image registration procedure can be helpful for several
applications:
\begin{enumerate}
\item Comparison between two images obtained at the same wavelength.
\item Comparison between two images obtained at different wavelengths.
\item Pixel field of view distortion estimation.
\end{enumerate}
 \bigskip

The geometrical correction is usually performed by three operations:
\begin{itemize}
\item The measure of a set of well-defined ground control points (GCPs), which are
      features well located both in the input image and in the reference image.
\item The determination of the warping or deformation model, by specifying a
      mathematical deformation model defining the relation between the
      coordinates $(x,y)$ and $(X,Y)$ in the reference and input image respectively.
\item The construction of the corrected image by output-to-input mapping.
\end{itemize}

\bigskip
The main difficulty lies in the automated localization of the corresponding
GCPs, since the accuracy of their determination will affect the overall
quality of the registration.  In fact, there are always ambiguities in
matching two sets of points, as a given point corresponds to a small region
{\em D}, which takes into account the prior geometric uncertainty between
the two images and many objects could be contained in this region.
\bigskip

 One property of the wavelet transform is to have a sampling step proportional
to the scale.  When we compare the images in the wavelet transform space,
we can choose a scale corresponding to the size of the region {\em D}, so
that no more than one object can be detected in this area, and the matching
is done automatically.

\section{Deformation model}%Polynomial Transformation
Geometric correction requires a spatial transformation to invert an unknown
distortion function.  A general model for characterizing misregistration
between two sets of remotely sensed data is a pair of bivariate polynomials
of the form:
\begin{eqnarray*}
x_i = \displaystyle{ \sum^{N}_{p=0} \sum^{N-p}_{q=0} a_{pq}
X^{p}_{i} Y^{q}_{i} = Q(X_{i}, Y_{j}) } \\
y_i = \displaystyle{ \sum^{N}_{p=0} \sum^{N-p}_{q=0} b_{pq}
X^{p}_{i} Y^{q}_{i} = R(X_{i}, Y_{j}) }
\end{eqnarray*}
where $(X_{i},Y_{i})$ are the coordinates of the $i^{th}$ GCP in the
reference image, $(x_{i},y_{i})$ the corresponding GCP in the input
image and $N$ is the degree of the polynomial.

Usually, for images taken
under the same {\em imaging direction}, polynomials of degree one or two
are sufficient as they can model most of the usual deformations like shift,
scale, skew, perspective and rotation (see Table 3.1).

We then compute the unknown parameters
($(N+1)(N+2)/2$ for each polynomial) using the least mean square
estimator. \\

\begin{table}[h]
\begin{center}
\begin{tabular}{l|c} \hline
Shift       & $x  =  a_0 + X$                        \\
            & $y  =  b_0 + Y$                        \\ \hline
Scale       & $x  =  a_1 X$                          \\
            & $y  =  b_2 Y$                          \\ \hline
Skew        & $x  =  X + a_2 Y$                      \\
            & $y  =  Y$                              \\ \hline
Perspective & $x  =  a_3 X Y$                        \\
            & $y  =  Y$                              \\ \hline
Rotation    & $x  =   \cos \theta X + \sin \theta Y$ \\
     	    & $x  =  -\sin \theta X + \cos \theta Y$ \\ \hline
\end{tabular}
\caption{Some common deformations.}
\end{center}
\label{table:deformations}
\end{table}

\section{Image registration: mr\_fusion}
\index{mr\_fusion}
Program {\em mr\_fusion} performs the geometrical registration
of two images having the same size, and same resolution. Four deformation
models are available (``-d" option). The program may fail to register the image
when not enough control points are detected. In this case, the user can try
another deformation model which may be more adapted to his data, or modify
the noise model parameters. Here the noise model is only used for structure
detection. If the image contains strong features, the threshold parameter
``-s"
can be set at a greater value. Hence, the registration will be performed only
from the strongest feature of the image. The number of scales is also very
important. Indeed, the maximum distance between two pixels of the same point
in the two images  must be less than or equal to the size of the wavelet at the
last scale. The number of scales can be fixed either using
directly the ``-n" option,
or using the ``-D" option.
By choosing the latter, the user gives the maximum distance
between two pixels of the same point, and the program calculates automatically
the correct number of scales.

{\bf
\begin{center}
 USAGE: mr\_fusion option image\_ref image\_in image\_out
\end{center}}
Options are:
\begin{itemize}
\baselineskip=0.4truecm
\itemsep=0.1truecm
\item {\bf [-p]} \\
Poisson Noise. Default is no Poisson component (just Gaussian).
\item {\bf [-g SigmaNoise]} \\
SigmaNoise = Gaussian noise standard deviation. Default is automatically estimated.
\item {\bf [-c gain,sigma,mean]} \\
See section~\ref{sect_support}.
\item {\bf [-n number\_of\_scales]} \\
Number of scales used in the multiresolution transform. Default is 4.
\item {\bf [-s NSigma]} \\
Thresholding at NSigma * SigmaNoise. Default is 5.
\item{\bf [-r res\_min]} \\
Minimum resolution for the reconstruction.
The registration procedure is stopped at scale res\_min and
the resulting deformation model is used to register the input image.
Default value is 1.
\item{\bf [-D dist\_max]} \\
Maximum estimated distance between two identical points in both images.
This value is used to estimate the number of scales for the wavelet transform.
% \item{\bf [-l]} \\
%  Sub-scene and scene registration:
%  the sub-scene is considered to be part of a larger scene.
% image\_in is registered, and the resulting deformation model is used to
% register the larger scene.
\item{\bf [-i Interpolation type]} \\
Type of interpolation:
\begin{itemize}
\baselineskip=0.4truecm
\item  0: Zero order interpolation -- nearest neighbor.
\item  1: First order interpolation -- bilinear.
\item  2: Second order interpolation -- bicubic.
\end{itemize}
Default is 2.
\item{\bf [-d DeforModel] } \\
Type of registration deformation model: \\
The type of polynomial model used for the geometrical registration. Three
types
are available:
      \begin{itemize}
      \baselineskip=0.4truecm
      \itemsep=0.1truecm
      \item 0: Polynomial of the first order of type I:
            \begin{eqnarray}
            x^{'} & = & aX - bY + c_x \\
            y^{'} & = & bX + aY + c_y
            \end{eqnarray}
      \item 1: Polynomial of the first order of type II:
            \begin{eqnarray}
             x^{'} & = & aX + bY + c \\
             y^{'} & = & dX + eY + f
            \end{eqnarray}
      \item 2: Polynomial of the second order:
            \begin{eqnarray}
            x^{'} & = & aX^{2} + bY^{2} + cXY + dX + eY + f \\
            y^{'} & = & gX^{2} + hY^{2} + iXY + jX + kY + l
            \end{eqnarray}
      \item 3: Polynomial of the third order.
      \end{itemize}
Default is 1.
\item{\bf [-o]} \\
Manual Options specifications:\\
A few options are provided in order to have more control on the procedure.
Using manual options, the following parameters can be fixed by the user
for each scale:
\begin{itemize}
\baselineskip=0.4truecm
\item Matching distance: \\
      The distance used for the matching procedure. The procedure looks for each control
      point candidate in the reference image which is the corresponding control point
      candidate in the input image within a radius of {\em Matching distance}.
\item Threshold level: \\
      The threshold level used for thresholding the wavelet transform.
\item Type of registration deformation model (same as option -d).
\item Type of interpolation (same as option -i).
\end{itemize}
The available manual options are the following:
\begin{itemize}
\baselineskip=0.4truecm
\itemsep=0.1truecm
\item 0:  Everything is taken care of by the program.
\item 1:  The matching distance is specified manually for each resolution.
\item 2:  The threshold level is specified manually for each resolution  and for
      both the reference image and the input image.
\item 3:  The type of deformation model is specified manually for each resolution.
\item 4:  The matching distance, the Threshold level and the Type of deformation model
      are specified manually for each resolution.
\item 5:  The matching distance, the threshold level, the type of deformation model
      and the type of interpolation are specified manually for each resolution.
\end{itemize}
The default is none (0).
\item{\bf [-w]} \\
The following files are written to  disk:
\begin{itemize}
\baselineskip=0.4truecm
\item deform\_model.txt: contains the calculated coefficients of the
deformation model, allowing us to calculate the coordinates in the
second image of a given point from its coordinates in the reference image.
\item scale\_j\_control\_points.dat: contains the set of control points for
 each scale. The first line contains the number of control points, and all
 other lines the values Xr,Yr,Xi,Yi,
 where  Xr and Yr are the coordinates of the control point in the reference
 image (origin is (0,0)), and  Xi and Yi are the coordinates of the
 corresponding control point in the input image (second image).
 \item xx\_grill\_in: an artificial image which contains a ``grilled'' image.
 \item xx\_grill\_out: the resulting image after applying the deformation
 model to the artificial one.
\end{itemize}
The default is none.
\end{itemize}

\begin{figure}[htb]
\centerline{
\vbox{
\hbox{
\psfig{figure=ch5_dec_ngc.ps,bbllx=1.8cm,bblly=7cm,bburx=19.2cm,bbury=24.3cm,width=8cm,height=8cm}
\psfig{figure=ch5_diff_ngc_dec.ps,bbllx=1.8cm,bblly=7cm,bburx=19.2cm,bbury=24.3cm,width=8cm,height=8cm}
}
\hbox{
\psfig{figure=ch5_rec_ngc.ps,bbllx=1.8cm,bblly=7cm,bburx=19.2cm,bbury=24.3cm,width=8cm,height=8cm}
\psfig{figure=ch5_diff_ngc_rec.ps,bbllx=1.8cm,bblly=7cm,bburx=19.2cm,bbury=24.3cm,width=8cm,height=8cm}
}
}}
\caption{Synthetic image (upper left) and difference between the original
and the synthetic image (upper right). Registered image (bottom left)
and difference between NGC2997 and the registered image (bottom right). }
\label{fig_ngc_register}
\end{figure}

A strong distortion was applied to the galaxy NGC2997 (see
Figure \ref{fig_ngc}).
A synthetic image was made by shifting it by 5 and 10 pixels
in each axis direction. Then this image
was rotated by 10 degrees and Gaussian noise was added.
Figure \ref{fig_ngc_register} shows the synthetic image
(upper left panel), and also the difference
between the original image and the synthetic one (upper right panel).
Figure \ref{fig_ngc_register} (bottom left and right) shows the
corrected image and the residual between the original image
and the corrected image.
The two images have been correctly -- and automatically -- registered.
\subsubsection*{Example:}
\begin{itemize}
\item mr\_fusion -n 6 -s 10 -d 1 ngc2997.fits  dec\_ngc  register\_ima\\
Register the image dec\_ngc on ngc2997, with a 10 sigma detection, 6 scales,
and using the first order deformation model of type 2. The
result is presented
in Figure \ref{fig_ngc_register}.
\end{itemize}

\clearpage
\newpage

If the deformation model is not sophisticated enough to resolve a specific
problem, the result will certainly not be correct, but the user can still
use the CGP points which do not depend on any model.


\section{Weak law of large numbers}


\chapter[Black Holes]{Black Holes}\label{chapter:pbhs}
This chapter provides background information on black holes

\section{History}

\section{Theory}
Einstein's equation (in natural units, i.e. $c, h = 1$) is:
\begin{equation}
G_{\mu\nu} = 8\pi T_{\mu\nu}
\end{equation}
The unique static, spherically-symmetric solution to Einstein's equation is the Schwarszchild metric
Schwarszchild metric
\subsection{Hawking Radiation}
In the classical treatment, black holes have no temperature and do not emit blackbody radiation; intuitively, energy cannot escape a black hole because the worldlines of particles inside the event horizon are trapped within Schwarschild radius $r=2GM$.
In the 1970s, however, it was noted that black holes appear to exhibit many of the same properties as classical thermodynamic systems.
The black hole area theorem is one example: during black hole mergers, the total black hole surface area is nondecreasing in much the same way that the Second Law of thermodynamics states that the entropy of a closed system is nondecreasing.
Further work by Bekenstein in 1972 led to the following analogies between black holes and thermodynamic quantities:
\begin{center}
\begin{tabular}{ccc}
Entropy & $\longleftrightarrow$ & Surface Area\\
Temperature & $\longleftrightarrow$ & Surface Gravity $\kappa$\\
Energy & $\longleftrightarrow$  & Mass\\
\end{tabular}
\end{center}
Black hole thermodynamics remains an area of active research, and recent work has added new terms to this list.
As an example, in anti-deSitter space the geometrical volume of a Schwarszchild black hole is equal to the thermodynamic volume associated with it.

However, the work of Hawking and Beckenstein in the 1970s led to the understanding that black holes are really cool.
The Hawking temperature of a black hole is given by:
\begin{equation}
T = \frac{\hbar c^3}{8\pi k_B GM}
\end{equation}

As the black hole emits radiation, it loses mass and becomes hotter.
This process continues until the entirety (or nearly so- see Section X) of the black hole mass is emitted as Hawking radiation.

\section{Primordial Black Holes}
Black holes formed via stellar collapse cannot be smaller than approximately 2 solar masses.
\subsection{Formation Mechanisms}
See Halzen et al etc
\subsection{Constraints on Dark Matter}
Stuff from Carr et al, Kusenko et al

\subsection{Prospects for detection}
For a description of the $\gamma$-ray spectrum of small black holes, see Appendix \ref{chapter:pbh_spectrum}.


\subsubsection{I}
\input{Q3/Q3_c_I}
\subsubsection{II}
\input{Q3/Q3_c_II}


\documentclass{article}

\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{amsfonts}
\usepackage{syntax}
\usepackage{stmaryrd}
\usepackage{mathpartir}
\usepackage{tipa}

%
% Basic Document Settings
%

\topmargin=-0.45in
\evensidemargin=0in
\oddsidemargin=0in
\textwidth=6.5in
\textheight=9.0in
\headsep=0.25in

\linespread{1.1}

\pagestyle{fancy}
\chead{Globally Ordered Type System}
\lfoot{\lastxmark}
\cfoot{\thepage}

\renewcommand\headrulewidth{0.4pt}
\renewcommand\footrulewidth{0.4pt}

\setlength\parindent{30pt}

\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Zt}{$\Z$}

% Create a relational rule
% [#1] - Additional mathpartir arguments
% {#2} - Name of the rule
% {#3} - Premises for the rule
% {#4} - Conclusions for the rule
\newcommand{\relationRule}[4][]{\inferrule*[lab={\sc #2},#1]{#3}{#4}}

\newcommand{\rel}[1]{\ensuremath{\llbracket {#1} \rrbracket}}
\newcommand{\ttt}{\texttt}
\newcommand{\transform}{\rightsquigarrow}
\newcommand{\proj}{\pi}
\newcommand{\ttuple}{(\tau_1, \ldots, \tau_n)}
\newcommand{\etuple}{(e_1,\ldots,e_n)}
\newcommand{\bool}{\mathrm{bool}}
\newcommand{\integer}{\mathrm{int}}
\newcommand{\option}{\mathrm{option}}
\newcommand{\uoption}[1]{(\bool,#1)}
\newcommand{\opt}[1]{\texttt{opt-#1}}
\newcommand{\varOf}[1]{\texttt{varOf}(#1)}

\begin{document}
\section*{Globally Ordered Type Systems}
A globally ordered type system is similar to an ordered type system, in that it specifies certain variables as ``ordered'', and aims to ensure that each variable is used exactly once, in the order that they were defined. However, unlike a ``normal'' ordered type system, the set of ordered variables is determined in advance -- all variables declared during the program itself are considered to be unordered. Since all ordered variables have global scope, this means we can refer to a singular order throughout the program.

Specifically, a globally ordered type system is defined with respect to an ordered set $G = \{g_1, \dots, g_n\}$ of \emph{global variables}. Our goal is to enforce that $g_1$ is always used before $g_2$, $g_2$ before $g_3$, and so on.
The \emph{types} in a globally ordered type system specify which global variables have been used so far. The system contains $n+1$ base types $\tau_0, \tau_1, \dots, \tau_n$. If an expression has type $\tau_i$, that signifies that all $g_j$ with $j <= i$ have been used; if $i < n$, this means that we expect $g_{i+1}$ to be the next global variable used.

Convention: we use the symbols $\tau_i$ to represent the specific types $\tau_0, \dots, \tau_n$. The symbol $\tau$ with a non-integer subscript (or no subscript) denotes any type.

A major benefit of this system over regular ordered type systems is that functions which use the globally ordered variables can be defined ``out-of-order'', and have a type signature that specifies when they may be used. For the moment, we will consider a non-functional (i.e. dpt-like) language, in which function are defined only in declarations and there are no higher-order functions. For simplicity, we still restrict our language to have only single-argument functions (but allow multiple arguments to be passed in via tuples).

As a result, our system also contains function types $\tau_i \rightarrow \tau_j$ where $i < j$, as well as a special ``polymorphic'' function type $\alpha \rightarrow \alpha$ for functions which do not use global variables.

   $\tau$ $::=$ \\
	 \indent\ \ \ \textpipe\ $\tau_0$ \textpipe\ $\tau_1$ \textpipe\ \dots \textpipe\ $\tau_n$\\
	 \indent\ \ \ \textpipe\ $\tau_i \rightarrow \tau_j$\\
	 \indent\ \ \ \textpipe\ $\alpha \rightarrow \alpha$

\section*{A Sample Language}
To explore this system in practice, we'll write up some rules for applying it to a simple dpt-like language, defined below.

\begin{grammar}
  <prog> ::= <decl> \alt <decl>; <prog>

  <decl> ::=
  def $\tau$ f(x_1, \dots, x_n) \{<statement>\}
  \alt <statement>

  <statement> ::=
  if <expr> then <statement> else <statement>
  \alt let x = <expr>
  \alt <statement>; <statement>
  \alt <expr>

  <expr> ::=
  <value>
  \alt x
  \alt <expr>, <expr>
  \alt f <expr>

  <value> ::=
  true \alt false \alt \Zt
  \alt <value>, <value>

\end{grammar}

Note that in this system we track two kinds of variables: function variables $f$ which may only be bound to functions, and regular variables $x$ which may not be bound to functions. Also note that we expect function definitions to be annotated with their input type here, but in practice we can easily infer it.

Note that a globally ordered type system says nothing about the ``actual'' types of the values in the program. It is \emph{only} concerned with checking the order of the global variables. That said, it can be freely used alongside a regular type inference algorithm, and so we assume that all expressions we consider are well-typed in the conventional sense.

Our rules will define a three place relation $\Gamma, \tau_i \vdash e \colon \tau$. Note that the $\Gamma$ context here only stores information about function variables, since they're the only relevant ones.
Note also that we include in the context a type telling us which global variables have been used so far. Our intention is that a program $p$ should be ``well-typed'' iff $\emptyset, \tau_0 \vdash p \colon \tau_n$.

We also have a very similar relation for declarations of the form $\Gamma, \tau_i \vdash e \colon \Gamma', \tau$.

When writing rules, we use the convention that the metavariable $x$ matches all \emph{non-global} variables. We will always denote global variables using symbols of the form $g_i$. We use the metavariable $v$ for values and $e$ for expressions

To start out, let's write the high-level rules:

\begin{mathpar}
  \relationRule{prog-single}{
   \Gamma, \tau_i \vdash d\ \colon \Gamma', \tau_j
  }{
          \Gamma, \tau_i \vdash d\ \colon \tau_j
  }

	\relationRule{prog}{
   \Gamma, \tau_i \vdash d\ \colon \Gamma', \tau_j\\
   \Gamma', \tau_j \vdash p\ \colon \tau_k
	}{
          \Gamma, \tau_i \vdash d; p\ \colon \tau_k
	}
\end{mathpar}

\begin{mathpar}
  \relationRule{decl-def}{
   \Gamma, \tau_k \vdash s\ \colon \tau_j
  }{
          \Gamma, \tau_i \vdash \texttt{def}\ \tau_k\ f(x_1, \dots, x_n) \{s\} \colon \Gamma[f := \tau_k \rightarrow \tau_j], \tau_i
  }

	\relationRule{decl-statement}{
     \Gamma, \tau_i \vdash s\ \colon \tau_j
	}{
     \Gamma, \tau_i \vdash s\ \colon \Gamma, \tau_j
	}
\end{mathpar}

Now we can write rules governing statements. These are pretty straightforward.

\begin{mathpar}
  \relationRule{statement-if}{
     \Gamma, \tau_i \vdash e\ \colon \tau_j\\
     \Gamma, \tau_j \vdash s_1\ \colon \tau_k\\
     \Gamma, \tau_j \vdash s_2\ \colon \tau_k
	}{
     \Gamma, \tau_i \vdash \texttt{if } e \texttt{ then } s_1 \texttt{ else } s_2\ \colon \tau_k
	}

  \relationRule{statement-let}{
     \Gamma, \tau_i \vdash e\ \colon \tau_j
	}{
     \Gamma, \tau_i \vdash \texttt{let } x\ =\ e\ \colon \tau_j
	}

  \relationRule{statement-seq}{
     \Gamma, \tau_i \vdash s_1\ \colon \tau_j\\
     \Gamma, \tau_j \vdash s_1\ \colon \tau_k
	}{
     \Gamma, \tau_i \vdash s_1;s_2\ \colon \tau_k
	}
\end{mathpar}

Finally, we can write some expr rules that actually make changes to the output type. The first few cases are easy: evaluating a value or non-global variable doesn't use any global variables.

\begin{mathpar}
	\relationRule{value}{
   \
	}{
          \Gamma, \tau_i \vdash v\ \colon \tau_i
	}

	\relationRule{local variable}{
   \
	}{
          \Gamma, \tau_i \vdash x\ \colon \tau_i
	}
\end{mathpar}

On the other hand, when we evaluate a global variable, our output type increases.

\begin{mathpar}
	\relationRule{global variable}{
   \
	}{
          \Gamma, \tau_i \vdash g_i\ \colon \tau_{i+1}
	}
\end{mathpar}

Evaluating a tuple is nothing new; it's just a sequencing operation like we've seen before.

\begin{mathpar}
	\relationRule{tuple}{
          \Gamma, \tau_i \vdash e_1\ \colon \tau_j\\
          \Gamma, \tau_j \vdash e_2\ \colon \tau_k
	}{
          \Gamma, \tau_i \vdash e_1, e_2\ \colon \tau_k
	}
\end{mathpar}

Finally, we can actually use our function types (and $\Gamma$!).

\begin{mathpar}
	\relationRule{app}{
			 \tau_i \vdash e \colon \tau_j\\
       \Gamma[f] = \tau_j \rightarrow \tau_k
	}{
       \tau_i \vdash f\ e \colon \tau_k
	}

  \relationRule{app}{
  		 \tau_i \vdash e \colon \tau_j\\
       \Gamma[f] = \alpha \rightarrow \alpha
  }{
       \tau_i \vdash f\ e \colon \tau_j
  }
\end{mathpar}

And that's that!

\subsection{Functional Languages}
Extending this to languages with function values and higher-order functions isn't difficult, but it is somewhat less elegant. The problem we run into is expressions which return a function value and also use a global variable; for example,
\texttt{let f = let x = g1 in (fun y -> x + y)}.
Currently, our typing relation can either return a function type or a return a base type indicating which global variables have been used, \emph{but not both}. So we would need to extend the typing relation to return both.

I guess we could also just have two typing rules for function expressions.

\begin{mathpar}
\relationRule{fun1}{
    \
}{
     \tau_i \vdash \texttt{fun } \tau_j\ x \rightarrow e\ \colon \tau_i
}

\relationRule{fun2}{
    \tau_j \vdash e\ \colon \tau_k
}{
     \tau_i \vdash \texttt{fun } \tau_j\ x \rightarrow e\ \colon \tau_j \rightarrow \tau_k
}
\end{mathpar}

In fact, the first rule could be viewed as just the value rule. Hell, it might even work. It would be hella sketchy though.

\section*{Weak Globally Ordered Type System}
It's pretty easy to see how we could convert this to a weakly-ordered type system (in which each ordered variable may be used at most once, instead of exactly once) just by inserting some inequalities into the rules. More interesting, though, is the observation that this corresponds to adding subtyping, with the base rule

\begin{mathpar}
	\relationRule{subtyping}{
			 i < j
	}{
      	\tau_i <: \tau_j
	}
\end{mathpar}

and all other standard subtyping rules (refl, trans, function subtyping.)

\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:


%!TEX root = soutenance_lei_2018.tex
\subsection{Mapping of the heat flux of an insulated small container by infrared thermography}
\frame{\tableofcontents[currentsection,currentsubsection]}

\begin{frame}{ATP test}
    the overall coefficient of heat transfer ($K$) is defined as:
    \begin{equation*}
        K = \frac{W}{S\cdot \Delta \theta}
    \end{equation*}
    $W$: Power \\
    $\Delta \theta$: a  steady  temperature  difference\\
    $S$ is the mean surface of the equipment:
    \begin{equation*}
        S = \sqrt{S_i \cdot S_e}
    \end{equation*}
\end{frame}

\begin{frame}{Theory \& Methods}
    Symbolically Ohm’s law:
    \begin{equation*}
        I = \frac{\Delta V}{R_e}
    \end{equation*}
    \pause
    Analogy to an electrical circuit, Fourier’s law can be written similarly as
    \begin{equation*}
        q = \frac{\Delta T}{R_t}
    \end{equation*}

    \pause
    \begin{figure}
        \centering
        \includegraphics[scale=0.55]{img/ch2/Therm_Res.png}
        % \caption{Overall thermal resistance of the roll-container}
        % \label{Therm_Res}
    \end{figure}

    \centering
    \begin{minipage}[c]{0.8\textwidth}
        $\theta_i$: inside temperature,  $\theta_{wi}$: internal wall temperature\\
        $\theta_e$: outside temperature, $\theta_{we}$: external wall temperature
    \end{minipage}

\end{frame}

\begin{frame}{Theory \& Methods}
    Heat flux computation:\\
    by a thermal flux meter in a reference zone:
    \begin{equation*}
        q_{ref} = \frac{\theta_{we}(x_r,y_r)-\theta_e}{1/h_e}
    \end{equation*}
    which gives that:
    \begin{equation*}
        h_e = \frac{q_{ref}}{\theta_{we}(x_r,y_r)-\theta_e}
    \end{equation*}
    then:
    \pause
    \begin{equation*}
        q(x,y) = \frac{q_{ref}}{\theta_{we}(x_r,y_r)-\theta_e}(\theta_{we}(x,y)-\theta_e)
    \end{equation*}
    where $\theta_{we}(x,y)$ is the temperature at each point of the external surface.
\end{frame}

\begin{frame}{Experimental Setup}
Roll-container:
    \begin{figure}[!htbp]
        \centering
        \includegraphics[scale=0.08]{img/ch2/DSC_0191.jpg}
        \includegraphics[scale=0.08]{img/ch2/DSC_0189.jpg}
        \caption{The roll container used for the test [outside and inside]}
        % \label{box}
    \end{figure}
\end{frame}

\begin{frame}{Results}
Values from heat flux meter:
    \begin{figure}
        % \centering
        \hspace*{-18pt}
        \includegraphics[scale=0.275]{img/ch2/It_project_2014_QProfile.png}
        \includegraphics[scale=0.275]{img/ch2/It_project_2014_TProfile.png}
        % \caption{Data from thermal flux meter (heat flux and temperature profiles)}
        % \label{flux_meter}
    \end{figure}
    \centering
    \small{Mean values (steady condition) are $q_r=9.73\; W/m^2$ and $T_r = 7.83\; ^\circ$C.}
\end{frame}

\begin{frame}{Results--\small{Thermal raw images}}
    \begin{figure}
        \vspace*{-5pt}
        \centering
        \includegraphics[scale=0.25]{img/ch2/IR_front_m.jpg}
        \hspace{5pt}
        \includegraphics[scale=0.25]{img/ch2/IR_back_m.jpg}
        \includegraphics[scale=0.25]{img/ch2/IR_left_m.jpg}
        \hspace{5pt}
        \includegraphics[scale=0.25]{img/ch2/IR_right_m.jpg}
        \includegraphics[scale=0.25]{img/ch2/IR_top.jpg}
        \vspace*{-5pt}
        \caption{\footnotesize{The temperature map of the roll container (front, rear, left, right and top surfaces)}}
        % \label{Q_box}
    \end{figure}
\end{frame}

\begin{frame}{Results--\small{Image correction}}
    Several image geometrical corrections exit, while an easier way to realize is to apply the \alert{homography} technique from computer vision.\\
    \pause
    Briefly, the planar homography relates the transformation between two planes (up to a scale factor):
    \begin{equation*}
        s\begin{bmatrix}
        x'\\y'\\1
        \end{bmatrix}
        =H \begin{bmatrix}
        x\\y\\1
        \end{bmatrix}
        = \begin{bmatrix}
        h_{11} & h_{12} & h_{13}\\h_{21} & h_{22} & h_{23}\\h_{31} & h_{32} & h_{33}
        \end{bmatrix}
        \begin{bmatrix}
        x\\y\\1
        \end{bmatrix}
    \end{equation*}
It is generally normalized with $h_{33}=1$
\end{frame}

\begin{frame}{Results--\small{Homography}}
    \begin{figure}[ht]
        \centering
        \includegraphics[scale=0.45]{img/ch2/homography_perspective_correction.jpg}
    \end{figure}
    \pause
    In our case, the ratio between the length and the width of the roll container is known. Once the projective transformation matrix in images has been obtained, a bilinear interpolation with the projective transformation matrix into the raw images will be performed.

    Recall:
        \begin{equation*}
            q(x,y) = \frac{q_r}{\theta_{we}(x_r,y_r)-\theta_e}(\theta_{we}(x,y)-\theta_e)
        \end{equation*}
\end{frame}

\begin{frame}{Results--\small{Heat flux map}}
    \begin{figure}
        \vspace*{-5pt}
        \centering
        \includegraphics[scale=0.25]{img/ch2/Q_front_m.jpg}
        \hspace{5pt}
        \includegraphics[scale=0.25]{img/ch2/Q_back_m.jpg}
        \hspace*{5pt}
        \includegraphics[scale=0.25]{img/ch2/Q_left_m.jpg}
        \hspace{5pt}
        \includegraphics[scale=0.25]{img/ch2/Q_right_m.jpg}
        \includegraphics[scale=0.25]{img/ch2/Q_top.jpg}
        \vspace*{-5pt}
        \caption{\footnotesize{The heat flux map of the roll container (front, rear, left, right and top surfaces)}}
        % \label{Q_box}
    \end{figure}
\end{frame}

\begin{frame}{Results--\small{Vehicle results}}
    \begin{figure}
        \vspace*{-5pt}
        \centering
        \includegraphics[scale=0.25]{img/ch2/IR_truck_lt_m}
        \hspace{3pt}
        \includegraphics[scale=0.25]{img/ch2/IR_truck_rt_m}
        % \vspace{3pt}
        \includegraphics[scale=0.25]{img/ch2/IR_truck_bk11_m}
        \hspace{6pt}
        \includegraphics[scale=0.25]{img/ch2/IR_truck_bk12_m}
        \includegraphics[scale=0.25]{img/ch2/IR_truck_tp_m}
        \vspace*{-5pt}
        \caption{\footnotesize{The temperature map of the refrigerated vehicle (left, right, rear1, rear2 and top surfaces)}}
    \end{figure}
\end{frame}

\begin{frame}{Discussion}
    \begin{itemize}[<+->]
    \pause
    \large
        \item Thermal resistance model works well
        \item Homography application offers good results in roll-container
        \item The convective heat transfer coefficient not constant around the roll-container surfaces
        \item Unable to apply homography in large size of vehicle panel
        \item Thermal reflection in vehicle results
    \end{itemize}
\end{frame}


\documentclass{memoir}
\usepackage{notestemplate}

%\logo{~/School-Work/Auxiliary-Files/resources/png/logo.png}
%\institute{Rice University}
%\faculty{Faculty of Whatever Sciences}
%\department{Department of Mathematics}
%\title{Class Notes}
%\subtitle{Based on MATH xxx}
%\author{\textit{Author}\\Gabriel \textsc{Gress}}
%\supervisor{Linus \textsc{Torvalds}}
%\context{Well, I was bored...}
%\date{\today}

%\makeindex

\begin{document}

% \maketitle

% Notes taken on

\section{Subspaces}
\begin{defn}[Subspace]
Let $(V,F,+,\cdot )$ be a vector space. A subset $U \subseteq V$ is a subspace if $(U,F,+,\cdot )$ is itself a vector space under the same operations as \(V\).
\end{defn}

\begin{lemma}[Conditions for subspaces]
 $U \subseteq V$ is a subspace if and only if
\begin{itemize}
	\item $\overline{0}$ is still in $U$
	\item  $U$ is closed under addition: if $u,v \in U$ then $u+v \in U$
	\item $U$ is closed under scalar multiplication;  if $v \in U$ and $\lambda \in F$ then $\lambda \cdot v \in U$
\end{itemize}
\end{lemma}
The three conditions ensure that the additive identity of $V$ is in $U$, and that both addition and scalar multiplication make sense in U.

%If $u \in U$ then $(3) \implies (-1)\cdot u\in U\implies-u\in U$, therefore $U$ contains additive inverses.
%Remaining axioms are inherited from V, such as associativity.
%\begin{figure}[ht]
%    \centering
%    \incfig{figure-1}
%    \caption{Visual of subspaces}
%    \label{fig:visual_of_subspaces}
%\end{figure}

\begin{exmp}[Example of subspace]
Let $F = \R$ and $ V = \left\{f \mid  f:(0,3)\to \R \right\} $. Let
\begin{align*}
U = \left\{ f \in V \mid f \text{ differentiable, } f'(2) = 0 \right\} \subseteq V .
\end{align*}
Then \(U\subset V\) is a subspace.
\end{exmp}

\begin{proof}[Proof of Example]
The zero vector of V is $\overline{0}:(0,3)\to \R$ defined by $\overline{0}:x\mapsto  0$. The zero vector is differentiable and zero at $x=2$, so the zero vector is in our set U.\\

Now we want to show that $U$ is closed under addition. Let $f,g \in U$. By the linearity of differentiation, $(f+g)$ is differentiable, and so satisfies the first property of U. If $f'(2)=0$ and $g'(2)=0$, then $\frac{d}{dx}(f(x)+g(x))\mid_{x=2} = 0 + 0 = 0$\\

Finally, we want to show that U is closed under scalar multiplication. Let $f\in U$ and $\lambda \in \R$. Consider $\lambda \cdot f(x)$. Because $\lambda$ is a scalar, we know that $\lambda \cdot f(x)$ is still differentiable. Moreover, the derivative of the new function is simply $\lambda \cdot f'(x)$, and at $x = 2$, $\lambda \cdot f'(2) = \lambda \cdot 0 = 0$ and so U is still closed under scalar multiplication.
\end{proof}

% \printindex
\end{document}


\documentclass[]{article}
\RequirePackage{amsmath}

\usepackage{graphicx}
%\graphicspath{{./figures/}}
\usepackage{amssymb}
\usepackage{color}
\usepackage{hyperref}
\usepackage{algorithm}
\usepackage{algpseudocode}
\bibliographystyle{IEEEtran}

\newcommand{\knote}[1]{\textcolor{green}{A: {#1}}}
\newcommand{\dnote}[1]{\textcolor{red}{D: {#1}}}
\newcommand{\vk}[1]{\textcolor{blue}{V: {#1}}}
\newcommand{\lnote}[1]{\textcolor{cyan}{L: {#1}}}
\newcommand{\Name}{$Autolykos$}
\def\Let#1#2{\State #1 $:=$ #2}
\def\LetRnd#1#2{\State #1 $\gets$ #2}

\newcommand{\pk}{\mathsf{pk}}
\newcommand{\sk}{\mathsf{sk}}

\begin{document}
    \title{\Name: The Ergo Platform PoW Puzzle}

    \author{Alexander Chepurnoy, Vasily Kharin, Dmitry Meshkov}

    \date{April 6, 2019\\v1.0}
    \maketitle

    %    \begin{abstract}
    %        This document contains the full description of \Name~-- the PoW protocol that is going to be used in Ergo platform.
    %    \end{abstract}

    \section{Introduction}

    Security of Proof-of-Work blockchains relies
    on multiple miners trying to produce new blocks by
    participating in PoW puzzle lottery, and the network is secure if the
    majority of them are honest. However, the reality becomes much more complicated
    than the original one-CPU-one-vote idea from the Bitcoin whitepaper\cite{nakamoto2008bitcoin}.

    The first threat to decentralization came from mining pools -- miners tend
    to unite in mining pools.
    Regardless of the PoW algorithm number of pools controlling more then 50\% of
    computational power is usually quite small: 4 pools in Bitcoin, 2 in Ethereum, 3 in ZCash, etc.
    This problem led to the notion of non-outsourceable puzzles~\cite{miller2015nonoutsourceable,daian2017piecework}.
    These are the puzzles constructed in such a way that if a mining pool outsources the puzzle
    to a miner, miner can recover pool's private key and steal the reward with a non-negligible probability.
    However the existing solutions either have too large solution size (kilobyte is already
    on the edge of acceptability for distributed ledgers) or very specific and
    can not be modified or extended in any way without breaking non-outsourceability.

    The second threat to cryptocurrencies decentralization is that ASIC-equipped miners are
    able to find PoW solutions orders of magnitude faster and more efficiently
    than miners equipped with the commodity hardware. In order to reduce the
    disparity between the ASICs and regular hardware, memory-bound computations
    where proposed in~\cite{dwork2003memory}. The most interesting practical
    examples are two
    asymmetric memory-hard PoW schemes which require significantly less memory
    to verify a solution than to find it~\cite{biryukov2017equihash,ethHash}.
    Despite the fact that ASICs already exist for both of them~\cite{ETHAsics,EquihashAsics},
    they remain the only asymmetric memory-hard PoW algorithms in use.

    In this paper we propose \Name{} --- new asymmetric memory-hard non-outsourceable PoW puzzle.
    In Section~\ref{puzzle} we provide a full
    specification of \Name, while in Section~\ref{discussion} we discuss its
    properties. Few auxiliary algorithms are placed in~\nameref{appendix}.

    \section{Ergo PoW puzzle}
    \label{puzzle}

    The proposed scheme requires following components:
    \begin{enumerate}
        \item Cyclic group $\mathbb{G}$ of prime order~$q$ with fixed generator~$g$
        and identity element~$e$.
        Secp256k1 elliptic curve is used for this purposes.
        \item Number of elements $k$ required in the solution. Value $k=32$ is used in
        implementation.
        \item Number $N$ of elements in the list
        $R\subset\mathbb{Z}/q\mathbb{Z}$ to be stored in miner's memory.
        Value $N=2^{26}$ is used in implementation.
        \item Hash function $H$ which returns the values in $\mathbb{Z}/q\mathbb{Z}$.
        Particular implementation is based on Blake2b256 and is described in Alg.\ref{alg:H}.
        \item Hash function $genIndexes$ which returns a list of numbers from
        $0\dots(N-1)$ of size $k$.
        It is based on Blake2b256 and is described in Alg.\ref{alg:genIndexes}.
        \item Target interval parameter $b$, that is recalculated via difficulty adjustment rules.
        \item Constant message $M=[0,\dots,1023].flatMap(i => Longs.toByteArray(i))$ that is used to enlarge message size and increase elements calculation time.
    \end{enumerate}

    \Name{} is based on one list $k$-sum problem: miner should find
    $k$ elements from the pre-defined list $R$ of size $N$, such that
    $\sum_{j \in J} r_{j} - sk = d$ is in the interval $\{-b,\dots,0,\dots,b\mod q\}$.
    In addition, we require set of element indexes $J$ to be obtained
    by one-way pseudo-random function $genIndexes$. This prevents optimizations as
    soon as it is hard to find such a seed,
    that $genIndexes(seed)$ returns the desired indexes.

    Thus we assume that the only option for miner is to use the simple brute-force algorithm~\ref{alg:prove} to
    create a valid block.

    \begin{algorithm}[H]
        \caption{Block mining}
        \label{alg:prove}
        \begin{algorithmic}[1]
            \State \textbf{Input}: upcoming block header hash $m$, key pair $pk=g^{sk}$
            \State Generate randomly a new key pair $w=g^x$
            \State Calculate $r_{i \in [0,N)}=H(j||M||pk||m||w)$
            \While{$true$}
            \LetRnd{$nonce$}{$\mathsf{rand}$}
            \Let{$J$}{$genIndexes(m||nonce)$}
            \Let{$d$}{$\sum_{j \in J}{r_j} \cdot x - sk \mod q$}
            \If{$d < b$}
            \State \Return $(m,pk,w,nonce,d)$
            \EndIf
            \EndWhile
        \end{algorithmic}
    \end{algorithm}

    Note that although the mining process utilizes private keys, solution itself
    only contains public keys. Solution verification can be performed by Alg.~\ref{alg:verify}.

    \begin{algorithm}[H]
        \caption{Solution verification}
        \label{alg:verify}
        \begin{algorithmic}[1]
            \State \textbf{Input}: $m,pk,w,nonce,d$
            \State require $d < b$
            \State require $pk,w\in \mathbb{G}$ and $pk,w \ne e$
            \Let{$J$}{$genIndexes(m||nonce)$}
            \Let{$f$}{$\sum_{j \in J} H(j||M||pk||m||w)$}
            \State require $w^f = g^dpk$
        \end{algorithmic}
    \end{algorithm}

    \section{Discussion}
    \label{discussion}

    First, notice that in Algorithm~\ref{alg:prove} we refer to construction
    $f(m,nonce,w,pk)=\sum_{j\in genIndexes(m||nonce)} H(j||M||pk||w)$ as a hash
    function. Public key plays a role of commitment. Therefore, the pair
    $(pk,d)$ is a Schnorr signature with a public key $w$ over the message
    $(m,nonce)$ with a hash function $f$. If one denotes $e$ the corresponding
    value of $f$, and pass to more common notations:
    $e=f(m,nonce,w,w^eg^{-d})$. The puzzle consists in trying
    different nonces and keys in order for signature to satisfy
    $d\in\{-b,\dots,0,\dots,b\}$. Security follows from the security of Schnor
    signatures, and outsourcing the puzzle is equivalent to outsourcing the
    signature (or parts of signature creation routine). The only difference from
    conventional setup is the design of function $f$. It must be constructed in such
    a way that efficient massive evaluations with different nonces require
    allocating large amount of memory (benefitting from data reuse), whereas
    single evaluation on verifier's side can be done ``on fly''.

    To achieve this, algorithm~\ref{alg:prove} requires to keep the whole list $R$ during the main loop.
    Every pre-calculated hash occupies 32 bytes, so the whole list of $N$ elements
    occupies $N \cdot 32 = 2 Gb$ of memory.
    For sure, a miner can recalculate these elements ``on fly'' during the main loop and
    thus reduce memory requirements.
    However in such a case the number of calls of $H$ will significantly grow up~(e.g.
    assuming GPU hashrate $G = 2^{30} H/s$~\cite{gpuHashrate} and block interval $t=120~s$,
    every element will be used $(G / N) \cdot k \cdot t = 3 \cdot 10^4$ times on average.)
    reducing miner's efficiency and profit.

    While list $R$ is quite big, it's filling consumes quite a lot of time: our initial implementation~\cite{ergoMiner}
    consumed ~25 seconds on Nvidia GTX 1070 to fill list $R$. This part, however, may be sufficiently
    optimized if miner in addition stores a list of unfinalized hashes $u_{i \in [0,N)}=H(i||M||pk$
    in memory, consuming 5 more Gigabytes of it. In such a case this work to calculate unfinalized hashes should
    be done only once during mining initialization while finalizing them and filling the list $R$
    for the new header will only consume few milliseconds~(for about 50 ms on Nvidia GTX 1070).

    The protocol is quite efficient in terms of solution size and verification time: it consists of 2 public keys of
    size 32 bytes, number $d$ that is at most 32 bytes
    (but contains a lot of leading zeros in case of the small target $b$) and an
    8-bytes long nonce. Header verification requires verifier to calculate 1 $genIndexes$
    hash, $k$ hashes $H$ and perform two exponentiations in the group. Reference
    Scala implementation~\cite{ergoGit} allows verifying block header in 2
    milliseconds on Intel Core i5-7200U, 2.5GHz.

    \bibliography{references}

    \section*{Appendix}
    \label{appendix}

    Implementation of hash function $H$ which returns the values in $\mathbb{Z}/q\mathbb{Z}$:

    \begin{algorithm}[H]
        \caption{Numeric hash}
        \label{alg:H}
        \begin{algorithmic}[1]
            \Function{H}{$input$}
            \Let{$validRange$}{$(2^{256} / q) \cdot q$}
            \Let{$hashed$}{$Blake2b256(input)$}
            \If{$hashed < validRange$}
            \State \Return $hashed.mod(q)$
            \Else
            \State \Return $H(hashed)$
            \EndIf
            \EndFunction
        \end{algorithmic}
    \end{algorithm}

    Implementation of hash function $genIndexes$ which returns a list of size $k$ with numbers in $0\dots (N-1)$:

    \begin{algorithm}[H]
        \caption{Index generator}
        \label{alg:genIndexes}
        \begin{algorithmic}[1]
            \Function{genIndexes}{$seed$}
            \Let{$hash$}{$Blake2b256(seed)$}
            \Let{$extendedHash$}{$hash||hash$}
            \State \Return $(0\dots{k-1}).map(i => extendedHash.slice(i,i+4).mod(N))$
            \EndFunction
        \end{algorithmic}
    \end{algorithm}

\end{document}


\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\vspace{-1em}

Electricity systems are facing the pressure to change in response to the effects of new technology, particularly the proliferation of renewable technologies (such as solar PV systems and wind generation) leading to the retirement of traditional generation technologies that provide stabilising inertia.
These changes create an imperative to consider potential future market structures to facilitate the participation of distributed energy resources (DERs; such as EVs and batteries) in grid operation.
However, this gives rise to general questions surrounding the ethics of market structures and how they could be fairly applied in future electricity systems. Particularly the most basic question ``how \textit{should} electricity be valued and traded'' is fundamentally a moral question without any easy answer.
We give a survey of philosophical attitudes around such a question, before presenting a series of ways that these intuitions have been cast into mathematics, including: the Vickrey-Clarke-Groves mechanism, Locational Marginal Pricing, the Shapley Value, and Nash bargaining solution concepts.

We compared these different methods, and attempted a new synthesis that brought together the best features of each of them; called the `Generalised Neyman and Kohlberg Value' or the GNK-value for short.
The GNK value was developed as a novel bargaining solution concept for many player non-cooperative transferable utility generalised games, and thus it was intrinsically flexible in its application to various aspects of powersystems.
We demonstrated the features of the GNK-value against the other mathematical solutions in the context of trading the immediate consumption/generation of power on small sized networks under linear-DC approximation, before extending the computation to larger networks.
The GNK value proved to be difficult to compute for large networks but was shown to be approximable for larger networks with a series of sampling techniques and a proxy method.
The GNK value was ethically compared to other mechanisms with the unfortunate discovery that it allowed for participants to be left worse-off for participating, violating the ethical notion of `euvoluntary exchange' and `individual rationality'; but was offered as an interesting innovation in the space of transferable utility generalised games notwithstanding.

For sampling the GNK value, there was a range of new and different techniques developed for stratified random sampling which iteratively minimise newly derived concentration inequalities on the error of the sampling.
These techniques were developed to assist in the computation of the GNK value to larger networks, and they were evaluated in the context of sampling synthetic data, and in computation of the Shapley Value of cooperative game theory.
These new sampling techniques were demonstrated to be comparable to the more orthodox Neyman sampling method despite not having access to stratum variances.


\documentclass[a4paper]{IEEEtran}
\usepackage[cmex10]{amsmath}
\usepackage{cite}
%\usepackage{multicol}
%\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage[colorlinks=false, hidelinks]{hyperref}

\interdisplaylinepenalty=2500
\setlength{\IEEEilabelindent}{\IEEEilabelindentB}

\markboth{640--402 Quantum Mechanics B: Energy Levels and Spectrum of Hydrogenic Atoms}{}

%\title{ \large{ \textsc{640-402 Quantum Mechanics B -- Assignment } }\\[1mm]
%       \huge{{\bf \sffamily Energy Levels and Spectrum of \\ Hydrogenic Atoms}} }
\title{Energy Levels and Spectrum of Hydrogenic Atoms}
\author{ Michael Papasimeon\\ 16 April, 1998} % \\
\date{April 16, 1998}

\newcommand{\ket}[1]{| #1 \rangle}
\newcommand{\bra}[1]{\langle #1 |}
\newcommand{\element}[3]{\bra{#1} #2 \ket{#3}}

\renewcommand{\sectionmark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}

%\lhead[\fancyplain{}{\it\thepage}]%
%      {\fancyplain{}{\it\rightmark}}
%\rhead[\fancyplain{}{\it\leftmark}]%
%      {\fancyplain{}{\it\thepage}}
%\cfoot{}

\begin{document}
\maketitle
\thispagestyle{plain}

\begin{abstract}
	This paper describes the energy levels and spectrum of hydrogenic atoms.
	The effects of relativistic corrections and spin-orbit coupling are taken
	into account to show the fine structure of hydrogenic atoms. In addition,
	nuclear effects giving rise to hyperfine structure and quantum
	electrodynamic effects giving rise to the Lamb shift are also discussed.
	The spectrum of hydrogenic atoms is discussed in the radio, infra-red,
	visible, UV and X-Ray regions.
\end{abstract}

%\tableofcontents
%\newpage

%\begin{multicols}{2}

%\setcounter{page}{1}

\section{Introduction}
    \IEEEPARstart{A} hydrogenic atom is one with a nucleus of charge $Z$ and a single electron.
    Therefore the physics of Hydrogen ($\mathsf{H}$) with $Z = 1$, singly ionised
    Helium ($\mathsf{He^+}$) with $Z = 2$, doubly ionised Lithium ($\mathsf{Li^{++}}$)
    and so forth, is essentially the same. The quantum mechanics of the Hydrogen atom
    is applicable to other atoms which only have a single electron. A study of the
    spectrum of hydrogen was one of the earliests tests of quantum mechanics.

\section{Schr\"odinger Equation}

    \subsection{Energy Levels}
    A hydrogenic atom can be thought of as an electron with charge ($-e$) moving around
    the spherically symmetric Coulomb potential of the nucleus which has charge $Z$.
    The Hamiltonian for this atomic system can then be written down as
    \begin{equation}
        H = \frac{\bf{p}^2}{2\mu} - \frac{Ze^2}{4 \pi \epsilon_0 r}.
    \end{equation}
    where the first term corresponds to the kinetic energy of the electron, and
    the second term corresponds to the Coulombic attraction between the electron and
    the nucleus. The momentum of the electron is $\bf{p}$, $Z$ is the number of protons
    in the nucleus, $r$ is the distance between the electron and the nucleus, $e$ is
    the fundamental electric charge on an electron or proton and $\mu$ is
    the reduced mass of the system given by
    \begin{equation}
        \mu = \frac{Mm}{M + m}
    \end{equation}
    The problem reduces to solving the time independent Schr\"odinger equation
    for the above Hamiltonian.
    \begin{equation}
    \left[ \frac{{\bf p}^2}{2\mu} - \frac{Ze^2}{4 \pi r}\right] \psi_{nlm} = E_n \psi_{nlm}
    \end{equation}
    Solving for this equation gives the energy levels of hydrogenic atoms $E_n$, and
    and corresponding wavefunctions $\psi_{nlm}$. The energy levels only depend on the
    principle quantum number $n$, whereas the wavefunctions also depend on the
    orbital angular momentum quantum number $l$ ($l = 0, 1, ... n - 1$) and
    magnetic quantum number $m$ ($m = -l, -l + 1, ... , +l - 1, +l$).
    The wavefunctions of hydrogenic atoms are given by
    \begin{equation}
        \psi_{nlm}({\bf r}) = \psi_{nlm}(r,\theta,\phi)
                           = R_{nl}(r) Y_{lm}(\theta, \phi)
    \end{equation}
    where $R_{nl}(r)$ are the radial wavefunctions and $Y_{lm}(\theta, \phi)$ are
    spherical harmonics. The corresponding energy levels of hydrogenic atoms are
    given by
    \begin{equation}
        E_n = - \frac{1}{2} \mu c^2 \frac{Z^2 \alpha^2}{n^2}
    \end{equation}
    where $\alpha$ is the fine structure constant
    ($ \alpha = e^2 / (4 \pi \epsilon_0 \hbar c) $).
    Since the energy levels depend only on the principle quantum number $n$, we see
    that the energy levels are degenerate for different values of $l$ and $m$ at a
    given value of $n$.

    Figure~\ref{fig:hydrogen-energy} shows the energy levels for the case when $Z = 1$ (Hydrogen).
    The degeneracy in $l$ can be seen for the different values of $n$.
    The energy levels shown are known as the gross structure of atomic hydrogen.

    \begin{figure}[!t]
        \centering
        \includegraphics[width=\columnwidth]{levels.eps}
        \caption{Energy Levels of Hydrogen Atoms}
        \label{fig:hydrogen-energy}
    \end{figure}

    \subsection{Rydberg States}
    A highly excited hydrogenic atom, that is one with a large principal quantum
    number $n$ is said to be known as a \emph{Rydberg Atom}, or to be in a
    \emph{Rydberg State}.
    Table~\ref{tbl:rydberg} compares some properties of a hydrogen atom in a $n=1$ state
    and one in a $n=100$ state.

    \begin{table}
        \caption{Bohr orbit radius and binding energy for Hydrogen atoms in
                 the ground state $n=1$ and Rydberg state $n=100$}
        \label{tbl:rydberg}
        \centering
        \begin{tabular}{p{4cm}rr} \hline
            {\bf Quantity}               & $\mathbf{n = 1}$          & $\mathbf{n = 100}$ \\ \hline \hline
            Bohr Orbit Radius [m]        &  $5.3 \times 10^{-11}$    & $5.3 \times 10^{-7}$ \\
            Binding Energy $|E_n|$ [eV]  &  $-13.6 \times 10^0$      & $1.36 \times 10^{-3}$ \\ \hline
        \end{tabular}
    \end{table}

    The Rydberg Atom with $n = 100$, is of an extremely large size -- approximately the size
    of a simple bacteria. However, such an atom has a very small ionisation energy and hence
    the electron is very weakly bound.

    \subsection{Hydrogenic Spectrum}
    Figure~\ref{fig:spectrum} shows the spectrum of atomic hydrogen as predicted by the
    Bohr model of the atom and by Schr\"odinger's equation. As can be seen there
    are a number of series of spectral lines -- Lyman, Balmer, Paschen and Brackett.

    \begin{figure*}[!t]
        \centering
        \includegraphics[width=0.7\textwidth]{spectrum}
        \caption{Spectrum of Atomic Hydrogen}
        \label{fig:spectrum}
    \end{figure*}

    The hydrogen series appear close together in the electromagnetic spectrum.
    For example, the Lyman Series is in the Ultra-Violet (UV) Region, the Balmer
    series is in the Visible-UV region and the Paschen, Brackett and Pfund series
    are in the Infra-Red (IR) Region.

     \begin{table}
        \centering
        \caption{Lyman, Balmer and Paschen Spectral Lines}
        \label{tbl:spectral-lines}
        \centering
        \begin{tabular}{cc} \hline
            \multicolumn{2}{c}{\bf Lyman Series (Ultra Violet Region)} \\ \hline
            Spectral Line & Wavelength (\AA) \\ \hline
            Ly$_{\alpha}$     &   1216    \\
            Ly$_{\beta}$      &   1026    \\
            Ly$_{\gamma}$     &   972.5   \\
            Ly$_{\delta}$    &   949.7   \\ \hline

            \multicolumn{2}{c}{\bf Balmer Series (Visible--Ultra Violet Region)} \\ \hline
            Spectral Line & Wavelength (\AA) \\ \hline
            H$_{\alpha}$     &   6563    \\
            H$_{\beta}$      &   4861    \\
            H$_{\gamma}$     &   4340   \\ \hline

            \multicolumn{2}{c}{\bf Paschen Series (Infra Red Region)} \\ \hline
            Spectral Line & Wavelength (\AA) \\ \hline
            P$_{\alpha}$     &   18751    \\
            P$_{\beta}$      &   12818    \\  \hline

        \end{tabular}
    \end{table}

    %The schematic spectral diagram below shows the Balmer series of atomic
    %hydrogen. It shows the positions of the spectral lines in the electromagnetic
    %spectrum.

    %\begin{figure}[!t]
    %    \centering
    %    \includegraphics[width=\columnwidth]{balmer}
    %    \caption{Balmer Spectrum for Atomic Hydrogen}
    %    \label{fig:balmer}
    %\end{figure}

\section{Fine Structure}
    Although the energy levels for hydrogenic atoms shown above agree qualitatively with
    experiment, very precise measurements of the hydrogen spectrum reveal the existence
    a finer structure which can not be explained with the Hamiltonian used above.
    Experiments reveals that some of the energy levels are split into many smaller levels
    and therefore many of the degeneracies are lifted.

    The fine structure of the energy levels of hydrogenic atoms are due to relativistic
    effects and the spin of the electron which were not taken into account in the previous
    section. We can obtain an estimate on how much the energy levels are shifted, by
    using perturbation theory if we assume the the relativistic and spin effects are
    small. We can treat the Hamiltonian, energy eigenfunctions and energy levels as
    the unperturbed case and use first order perturbation theory for the perturbing
    components of the Hamiltonian. The Schr\"odinger equation is then of the following
    form

    \begin{equation}
        \left[ H_0 + H'_1 + H'_2 + H'_3 \right] \psi_{nlm} = E \psi_{nlm}
    \end{equation}

    where $H_0$ corresponds to the unperturbed Hamiltonian used in the previous section,
    and $H'_1$, $H'_2$ and $H'_3$ correspond to small perturbations involving relativistic
    corrections to the kinetic energy, the effect of spin-orbit coupling and the Darwin
    interaction. These three perturbations are described individually below.
    The process then involves determining the shift in energy to first order for
    each of the perturbing terms in the Hamiltonian. The unperturbed Schr\"odinger
    equation needs to be slightly modified in order to treat perturbing Hamiltonians
    which take the spin of the electron into account. The modified `unperturbed`
    equation is given by
    \begin{equation}
        H_0 \psi_{nlm_l m_s }^{(0)} = E_{n}^{(0)} = \psi_{nlm_l m_s}^{(0)}
    \end{equation},
    where $E_{n}^{(0)}$ are the Schr\"odinger energy eigenvalues (with $\mu = m$) and
    the zero order wave functions $\psi_{nlm_l m_s}^{(0)}$ are modified two component
    wave functions (also known as Pauli wave functions or spin-orbitals) given by
    \begin{equation}
        \psi_{nlm_l m_s}^{(0)}(q) = \psi_{nlm_l}^{(0)}({\bf r}) \chi_{\frac{1}{2},m_l}
    \end{equation}.
    The parameter $q$ represents the combined spin and space coordinate, and
    $\chi_{\frac{1}{2},m_l}$ are two component spinors (spin eigenfunctions for
    particle of spin one half). For spin-up ($m_s = +1/2$) and spin-down ($m_s = -1/2$),
    the normalised spinors are denoted by
    \begin{equation}
        \chi_+ = \left( \begin{array}{c}
                    1 \\ 0
                 \end{array} \right)
        \hspace{5mm} \mathrm{and} \hspace{5mm}
        \chi_- = \left( \begin{array}{c}
                    0 \\ 1
                 \end{array} \right)
    \end{equation}
    Since the unperturbed Hamiltonian does not depend on the spin variable, the
    Pauli wavefunctions are separable in the spin and coordinate variables.
    To describe the state of an electron in a hydrogenic atom, we now have the four
    quantum number $n$, $l$, $m_l$ and $m_s$. As a result of this, each of the
    unperturbed energy levels are $E_n$ are $2n^2$ degenerate.

    Finally the new perturbed energy levels to first order are given by
    \begin{equation}
        E = E_{n}^{(0)} + \Delta E'_1 + \Delta E'_2 + \Delta E'_3
    \end{equation}
    where $\Delta E'_{(k)}$ is the energy shift resulting from the $k'$th perturbation.

	\subsection{Relativistic Correction to the Kinetic Energy}
	\begin{equation}
		H'_1 = - \frac{p^4}{8m^3c^2}
	\end{equation}
    Since relativistic effects were not taken into account previously, the
    perturbing Hamiltonian $H'_1$ represents the relativistic correction
    to the kinetic energy of the electron.
    Using first order perturbation theory the energy shift is given by
    \begin{equation}
        \Delta E'_1 = \left \langle nl m_l m_s
                        \left|
                            \frac{-p^4}{8m^3 c^2}
                        \right|
                      nl m_l m_s \right \rangle
    \end{equation}
    \begin{equation}
        \Delta E'_1 = -E_n \frac{Z^2 \alpha^2}{n^2}
                        \left[ \frac{3}{4}  - \frac{n}{l + \frac{1}{2}} \right]
    \end{equation}

	\subsection{Spin Orbit Interaction}
	\begin{equation}
		H'_2 = \frac{1}{2m^2c^2} \frac{1}{r} \frac{dV}{dr} {\bf L} \cdot {\bf S}
	\end{equation}
    This perturbation corresponds to the shift in the energy as a result of the interaction
    between the internal spin of the electron and it's orbital angular momentum as it
    orbits the nucleus. Since the potential $V(r) = -Ze^2/(4 \pi \epsilon_0 r)$ for
    a hydrogenic atom, the perturbing Hamiltonian becomes
    \begin{equation}
        H'_2 = \frac{1}{2m^2c^2} \frac{Ze^2}{4\pi \epsilon_0 r^3} {\bf L} \cdot {\bf S}
    \end{equation}
    The energy shift for this perturbing Hamiltonian using first order perturbation theory is
    \begin{equation}
        \Delta E'_2 = -E_n \frac{Z^2 \alpha^2}{2nl(l + \frac{1}{2})(l + 1)}
        \left\{
            \begin{array}{ll}
                l       \mbox{,} &  j = l + \frac{1}{2} \\
                -l - 1  \mbox{,} &  j = l - \frac{1}{2}
            \end{array}
        \right.
    \end{equation}

	\subsection{Darwin Interaction}
	\begin{equation}
		H'_3 = \frac{\pi\hbar^2}{2m^2c^2} \left( \frac{Ze^2}{4\pi\epsilon_0} \right) \delta(\bf{r})
	\end{equation}
    The Darwin term does not act on the spin variable and only applies when
    the orbital angular moment is zero ($l=0$).
    The shift energy from the Darwin term is given by
    \begin{equation}
        \begin{array}{ll}
        \Delta E'_3 = -E_n \frac{Z^2 \alpha^2}{n} , & l = 0
        \end{array}
    \end{equation}

    \subsection{Fine Structure Energy Levels to First Order}
    Based on the energy levels obtained for hydrogenic atoms from the Schr\"odinger equation,
    and the energy shifts obtained from the three perturbation when relativistic and
    spin effects are taken into account we get
    \begin{equation}
        E_{nj} = E_n + \Delta E'_1 + \Delta E'_2 + \Delta E'_3.
    \end{equation}
    Now subtracting from the binding energy $E = mc^2 - E_{nj}$
    \begin{equation}
        E = mc^2 \left[ 1 - \frac{(Z \alpha)^2}{2n^2} - \frac{(Z \alpha)^4}{2n^3}
                        \left(
                            \frac{n}{j + \frac{1}{2}} - \frac{3}{4}
                        \right)
                    \right]
    \end{equation}
    This result is valid if the perturbation is small, and therefore it begins to break down
    for hydrogenic atoms with large atomic numbers $Z$.

    \subsection{Dirac Equation}
    The equation which provides the correct energy eigenvalues and eigenstates for
    the fine structure of hydrogenic atoms is the Dirac equation.
    For a Hydrogenic atom that Dirac equation can be written as:
    \begin{equation}
        \left[ c \mathbf{\alpha} \cdot \mathbf{p} +
               \beta m c^2 - \frac{Ze^2}{4 \pi \epsilon_0 r}
        \right] \psi = E \psi
    \end{equation}
    where $\psi$ is a 4-component spinor.
    The Dirac equation takes special relativistic effects and the spin of the electron
    (or any spin-$\frac{1}{2}$ particle) into account, and gives the following solutions for the energy
    eigenvalues for hydrogenic atoms.
    \begin{equation}
        E_{nj}^{Dirac} = \frac{mc^2}
        {
            \sqrt
            {
                1 + \frac{(Z \alpha)^2}
                {
                    n - j - \frac{1}{2} +
                    \sqrt
                    {
                        \left(j + \frac{1}{2}\right)^2 - (Z \alpha)^2
                    }
                }
            }
        }
    \end{equation}
    Expanding the above equation in a series we obtain
    \begin{equation}
        E = mc^2 \left[
            1 - \frac{(Z\alpha)^2}{2n^2} - \frac{(Z\alpha)^4}{2n^2}
                    \left(
                        \frac{1}{j + \frac{1}{2}} - \frac{3}{4n}
                    \right)
                        - ...
                 \right]
    \end{equation}
    This can be seen to agree with the result obtained previously using the perturbation
    theory for the first few terms.

\section{Hyperfine Structure}
    Until now, the nucleus of hydrogenic atoms has been treated as a point charge.
    effectively of infinite mass. However, precise spectroscopic measurements
    of hydrogenic atoms reveal some very small effects on the energy levels which
    cannot be explained if the nucleus is treated in this way. These effects are
    known as \emph{hyperfine effects} because they are much smaller then the fine
    structure effects predicted by the Dirac equation. The hyperfine effects can
    be grouped into two types.

    \begin{enumerate}
        \item Hyperfine structure effects give rise to splittings in energy levels
        \item Isotope shifts slightly shift the energy levels and can usually be
              detected by observing the differences between two or more
              different isotopes.
    \end{enumerate}

    Hyperfine structure effects arise from the electric multipole moments of the
    nucleus which can interact with the electromagnetic field produced at the
    nucleus by the electrons. The two main multipole moments are the magnetic
    dipole moment associated with the spin of the nucleus and the electric quadrupole
    moment due to the departure of the spherical charge distribution in the nucleus.
    Perturbation theory can be used to determine the shift in the energy these
    two multipole effects will have.

    \subsection{Magnetic Dipole Interaction}
    The perturbation which describes the interaction of the nuclear magnetic dipole
    moment consists of two expressions depending on the orbital angular momentum $l$.
    For the case of $l \neq 0$ we have
    \begin{equation}
        H'_{MD} = \frac{2\mu_0}{4 \pi \hbar} g_I \mu_B \mu_N \frac{1}{r^3}
                   {\bf G} \cdot {\bf I}
    \end{equation}
    where
    \begin{equation}
        {\bf G} = {\bf L} - {\bf S} + 3 \frac{({\bf S} \cdot {\bf r}) {\bf r}}{r^2}
    \end{equation}
    and the total spin of the atom (nucleus and electron) is given by
    \begin{equation}
        {\bf F} = {\bf I} + {\bf J}.
    \end{equation}
%    This perturbation gives the following first order shift in the energy,
%    \begin{equation}
%        \Delta E_{MD} = \frac{C}{2} [ F(F+1) - I(I+1) - j(j+1)]
%    \end{equation}
%    where
%    \begin{equation}
%        C = \frac{\mu_0}{4\pi} 2g_I \mu_B \mu_N \frac{l(l+1)}{j(j+1)}
%            \frac{Z^3}{a_{\mu}^{3} n^3 l (l + l/2)(l+1)}
%    \end{equation}
    For the case when $l = 0$, the perturbation is given by
    \begin{equation}
        H'_{MD}  =  \frac{\mu_0}{4\pi} 2g_I \mu_B \mu_N \frac{8 \pi}{3}
               \delta({\bf r}) {\bf S} \cdot {\bf I}.
    \end{equation}

    \subsection{Electric Quadrupole Interaction}
    The interaction Hamiltonian between the electric quadrupole moment of the
    nucleus and the electrostatic potential create by an electron at the nucleus is
    given (in atomic units) by
    \begin{equation}
        H'_{EQ} = B \frac{\frac{3}{2}{\bf I} \cdot {\bf J} (2{\bf I}\cdot {\bf J} + 1) -
                        {\bf I}^2 {\bf J}^2} {2I(2I-1)j(2j-1)}
    \end{equation}

    \subsection{Hyperfine Spectrum}
    The magnetic dipole and electric quadrupole interactions above correspond to
    a total hyperfine energy shift of
    \begin{equation}
        \Delta E = \frac{C}{2}K + \frac{B}{4}
                   \frac{\frac{3}{2}K(K+1)-2I(I+1)j(j+1)}{I(2I-1)j(2j-1)}
    \end{equation}
    where $B$ is the quadrupole coupling constant given by
    \begin{equation}
        B = Q \left \langle \frac{\partial^2 V}{\partial z^2} \right \rangle
    \end{equation}
    and
    \begin{equation}
        K = F(F+1) - I(I+1) - j(j+1)
    \end{equation}
    \begin{equation}
         C = \frac{\mu_0}{4\pi} 2g_I \mu_B \mu_N \frac{l(l+1)}{j(j+1)}
            \frac{Z^3}{a_{\mu}^{3} n^3 l (l + l/2)(l+1)}
    \end{equation}

    \begin{figure*}[!t]
        \centering
        \includegraphics[angle=-90,width=0.7\textwidth]{all.eps}
        \caption{Energy Levels for Hydrogen Atom for $n=1$ and $n=2$}
        \label{fig:split}
    \end{figure*}

    Figure~\ref{fig:split} shows the splittings of the different energy
    in a Hydrogen atom for n = 1 and n = 2. The diagram is not to scale and
    are magnified form the left to the right. The diagram qualitatively shows
    the effect on the Bohr/Schr\"odinger energy from the various corrections
    such as the Dirac fine structure, the Lamb Shift (described in the
    next section) and the hyperfine structure.

    \subsection{21 cm Line of Atomic Hydrogen}
    The energy level splitting diagram in Figure~\ref{fig:split} shows that the ground state of
    the hydrogen atom splits into two hyperfine levels with the total angular
    momentum of the atom being $F=0$ and $F=1$.
    The difference in energy between these two levels is 1420 MHz which corresponds
    to a wavelength of $\lambda \approx $ 21 cm. The probability of a transition
    occurring between these two levels is very low and occurs on average only
    once every few million years. However, there is a large amount of hydrogen gas
    in the galaxy allowing radio telescopes easily detect this 21 cm transition and
    therefore allow the mapping of hydrogen in the galaxy.

\section{Lamb Shift}
    Investigation of the fine structure of hydrogenic atoms using spectroscopic techniques
    in the 1930's showed that there were small differences between the observed spectra
    and the theoretical predictions made by the Dirac equation.
    For example, according to the Dirac equation the $2s_{1/2}$ and the $2p_{1/2}$ states
    coincide at the same energy level. Observations showed that the $2s_{1/2}$ was shifted
    slightly upwards by about 0.03 cm$^{-1}$.
    A very accurate measurement of the shift was made in 1947 by Lamb and Retherford using
    microwave techniques to stimulate a direct radio-frequency transition between the
    $2s_{1/2}$ and the $2p_{1/2}$ levels. This small shift of energy levels became known
    as the Lamb shift.

    \begin{figure}[!ht]
        \centering
        \includegraphics[width=\columnwidth]{lamb.eps}
        \caption{The Lamb Shift}
        \label{fig:lamb}
    \end{figure}

    The physics of the Lamb shift are described in the theory of quantum electrodynamics,
    in which radiative corrections to the Dirac equation are obtained by taking into
    account the interaction of a quantised electromagnetic field with an electron.
    The Lamb shift arises because of the zero point energy of a quantised electromagnetic
    field is non zero, similar to the zero point energy of a quantum harmonic oscillator.
    In a vacuum, fluctuations of the zero point energy of the quantised radiation field
    act on the electron. The effect of the electron is to cause it to oscillate rapidly
    about some equilibrium position. As a result of this oscillatory motion, the electron
    does not appear to be point charge -- instead the electron charge is slightly smeared
    at in a sphere of some small radius. When the electron is bound by an electric field
    as it is in an atom, the potential it experiences is slightly different to that
    experienced by the electron in it's mean position. Therefore electrons which are
    most sensitive to short distance modifications such as those in the ground state
    are raised in energy with respect to other states to which the shift is much smaller.

    \section{References}
    \begin{enumerate}
        \item \emph{Physics of Atoms and Molecules}, Bransden and Joachain
        \item \emph{Quantum Mechanics of One- and Two-Electron Atoms},
                    Bethe and Salpeter
        \item \emph{Intermediate Quantum Mechanics}, Bethe
        \item \emph{Advanced Quantum Mechanics}, Sakurai
        \item \emph{The Spectrum of Atomic Hydrogen - Advances}, Series
        \item \emph{Quantum Mechanics}, Merzbacher
        \item \emph{Modern Physics}, Serway, Moses and Moyer
    \end{enumerate}

%\end{multicols}
\end{document}