\section{Multifragmentation process simulation.}

\hspace{1.0em}The initial information for calculation of
multifragmentation stage consists from the atomic mass number $A$,
charge $Z$ of residual (e. g. after cascade) nucleus and its excitation
energy $U$.  At high excitation energies $U/A > 2$ \ MeV the
multifragmentation mechanism, when nuclear system can eventually breaks
down into fragments, becomes the dominant. Later on the excited primary
fragments propagate independently in the mutual Coulomb field and
undergo de-excitation.  Detailed description of multifragmentation
mechanism and model can be found in review \cite{BBIMS95}.

\subsection{Multifragmentation probability.}

\hspace{1.0em}The probability of a breakup channel $b$ is given by the
expression (in the so-called microcanonical approach \cite{BBIMS95},
\cite{Botvina87}):
\begin{equation}
\label{MFS1}W_b(U,A,Z)=\frac{1}{\sum_{b}\exp [S_b(U,A,Z)]} \exp [S_b(U,A,Z)],
\end{equation}
where $S_b(U,A,Z)$ is the entropy of a multifragment state corresponding
to the breakup channel $b$. The channels $\{b\}$ can be parametrized by
set of fragment multiplicities $N_{A_f,Z_f}$ for fragment with atomic
number $A_f$ and charge $Z_f$. All partitions $\{b\}$ should satisfy
constraints on the total mass and charge:
\begin{equation}
\label{MFS2}\sum_{f}N_{A_f,Z_f}A_f = A
\end{equation}
and
\begin{equation}
\label{MFS3}\sum_{f}N_{A_f,Z_f}Z_f = Z.
\end{equation}
It is assumed \cite{Botvina87} that thermodynamic equilibrium is
established in every channel, which can be characterized by the channel
temperature $T_b$.

The channel temperature $T_b$ is determined by the equation constraining
the average energy $E_b(T_b, V)$ associated with partition $b$:
\begin{equation}
\label{MFS4}E_b(T_b, V)= U+E_{ground} = U+M(A,Z),
\end{equation}
where $V$ is the system volume, $E_{ground}$ is the ground state (at
$T_b = 0$) energy of system and $M(A,Z)$ is the mass of nucleus.

To calculate mass $M(A,Z)$ of the initial nucleus and mass $M(A_b,Z_b)$
of the nucleus after emission of fragment $b$ the so-called Cameron's
liquid drop model formula \cite{CAM57},
 which includes shell and pairing effects corrections.

Acording to the conventional termodinamical formulae the average energy
of a partitition $b$ is expressed through the system free energy $F_b$
as
\begin{equation}
\label{MFS5}E_b(T_b, V)= F_b(T_b,V) +T_bS_b(T_b,V).
\end{equation}
Thus, if the free energy $F_b$ of a partition $b$ is known, we can find
the channel temperature $T_b$ from Eqs. ($\ref{MFS4}$) and ($\ref{MFS5}$),
then the entropy $S_b = -dF_b/dT_b$ and hence, decay probability $W_b$
defined by Eq. ($\ref{MFS1}$) can be calculated.

Calculation of the free energy is based on the use of the liquid-drop
description of individual fragments \cite{Botvina87}.  The free energy
of a partition $b$ can be splitted into several terms:
\begin{equation}
\label{MFS6}F_b(T_b,V) =  \sum_{f}F_f(T_b,V) + E_{C}(V),
\end{equation}
where $F_f(T_b,V)$ is the average energy of an individual fragment
including the volume
\begin{equation}
\label{MFS7} F^V_f = [-E_0 - T^2_b/\epsilon(A_f)]A_f,
\end{equation}
surface
\begin{equation}
\label{MFS8}F^{Sur}_f = \beta_0[(T_c^2 - T^2_b)/(T_c^2 + T^2_b)]^{5/4}A_f^{2/3}
= \beta(T_b)A_f^{2/3},
\end{equation}
symmetry
\begin{equation}
\label{MFS9}F^{Sim}_f = \gamma(A_f - 2Z_f)^2/A_f,
\end{equation}
Coulomb
\begin{equation}
\label{MFS10}F^{C}_f = \frac{3}{5}\frac{Z_f^2e^2}{r_0A_f^{1/3}}
[1 - (1+ \kappa_{C})^{-1/3}]
\end{equation}
and translational
\begin{equation}
\label{MFS11}F^{t}_f = -T_b\ln{(g_fV_f/\lambda^3_{T_b})} +
T_b\ln{(N_{A_f,Z_f}!)}/ N_{A_f,Z_f}
\end{equation}
terms  and the last term
\begin{equation}
\label{MFS12} E_{C}(V)=\frac{3}{5}\frac{Z^2e^2}{R}
\end{equation}
is the Coulomb energy of the uniformly charged sphere with charge $Ze$
and the radius $R = (3V/4\pi)^{1/3}= r_0A^{1/3}(1 + \kappa_{C})^{1/3}$,
where $\kappa_{C} = 2$ \cite{Botvina87}.

Parameters $E_0 = 16$ \ MeV, $\beta_0 = 18$\ MeV, $\gamma = 25$ \ MeV
are the coefficients of the Bethe-Weizsacker formula at $T_b = 0$.
$g_f=(2S_f+1)(2I_f+1)$ is a spin $S_f$ and isospin $I_f$ degeneracy
factor for fragment ( fragments with $A_f > 1$ are treated as the
Boltzmann particles), $\lambda_{T_b} = (2\pi h^2/m_N T_b)^{1/2}$ is the
thermal wavelength, $m_N$ is the nucleon mass, $r_0 = 1.17$ \ fm,
$T_c=18$ \ MeV is the critical temperature, which corresponds to the
liquid-gas phase transition. $\epsilon(A_f) = \epsilon_0[1 + 3/(A_f-1)]$
is the inverse level density of the mass $A_f$ fragment and
$\epsilon_0=16$ \ MeV is considered as a variable model parameter, whose
value depends on the fraction of energy transferred to the internal
degrees of freedom of fragments \cite{Botvina87}. The free volume $V_f
=\kappa V=\kappa\frac{4}{3}\pi r_0^4 A$ available to the translational
motion of fragment, where $\kappa \approx 1$ and its dependence on the
multiplicity of fragments was taken from \cite{Botvina87}:
\begin{equation}
\label{MFS13}\kappa =[1 + \frac{1.44}{r_0A^{1/3}}(M^{1/3} - 1)]^{3} - 1.
\end{equation}
For $M = 1$ $\kappa = 0$.

However, the light fragments with $A_f < 4$, which have no excited
states, are considered as elementary particles characterized by the
empirical masses $M_f$, radii $R_f$, binding energies $B_f$, spin
degeneracy factors $g_f$ of ground states.  They contribute to the
translation free energy and Coulomb energy.

\subsection{ Direct simulation of the low multiplicity multifragment
disintegration.}

\hspace{1.0em}At comparatively low excitation energy (temperature)
system will disintegrate into a small number of fragments $M \leq 4$ and
number of channel is not huge. For such situation a direct
(microcanonical) sorting of all decay channels can be performed. Then,
using Eq. ($\ref{MFS1}$), the average multiplicity value $<M>$ can be
found.  To check that we really have the situation with the low
excitation energy, the obtained value of $<M>$ is examined to obey the
inequality $<M> \leq M_0$, where $M_0 = 3.3$ and $M_0 = 2.6$ for $A \sim
100$ and for $A \sim 200$, respectively \cite{Botvina87}.  If the
discussed inequality is fulfilled, then the set of channels under
consideration is belived to be able for a correct description of the
break up. Then using calculated according Eq. ($\ref{MFS1}$)
probabilities we can randomly select a specific channel with given
values of $A_f$ and $Z_f$.

\subsection{ Fragment multiplicity distribution.}

\hspace{1.0em}The individual fragment multiplicities $N_{A_f,Z_f}$ in
the so-called macrocanonical ensemble \cite{BBIMS95} are distributed
according to the Poisson distribution:
\begin{equation}
\label{MFS14} P(N_{A_f,Z_f}) = \exp{(-\omega_{A_f,Z_f})}
\frac{\omega_{A_f,Z_f}^{N_{A_f,Z_f}}}{N_{A_f,Z_f}!}
\end{equation}
with mean value $<N_{A_f,Z_f}>=\omega_{A_f,Z_f}$ defined as
\begin{equation}
\label{MFS15} <N_{A_f,Z_f}> =g_fA_f^{3/2}\frac{V_f}{\lambda^3_{T_b}}
\exp{[\frac{1}{T_b}(F_f(T_b,V)-F^{t}_f(T_b,V) - \mu A_f - \nu Z_f)]},
\end{equation}
where $\mu$ and $\nu$ are chemical potentials. The chemical potential
are found by substituting Eq. ($\ref{MFS15}$) into the system of
constraints:
\begin{equation}
\label{MFS16}\sum_{f}<N_{A_f,Z_f}>A_f = A
\end{equation}
and
\begin{equation}
\label{MFS17}\sum_{f}<N_{A_f,Z_f}>Z_f = Z
\end{equation}
and solving it by iteration.

\subsection{ Atomic number distribution of multifragmentation products.}

\hspace{1.0em}Fragment atomic numbers $A_f > 1$ are also distributed
according to the Poisson distribution \cite{BBIMS95} (see
Eq. ($\ref{MFS14}$)) with mean value $<N_{A_f}>$ defined as
\begin{equation}
\label{MFS18} <N_{A_f}> = A_f^{3/2}\frac{V_f}{\lambda^3_{T_b}}
\exp{[\frac{1}{T_b}(F_f(T_b,V)-F^{t}_f(T_f,V) - \mu A_f - \nu <Z_f>)]},
\end{equation}
where calculating  the  internal free energy
$F_f(T_b,V)-F^{t}_f(T_b,V)$  one has to substitute $Z_f
\rightarrow <Z_f>$. The average  charge $<Z_f>$ for fragment having atomic
number $A_f$ is given by
\begin{equation}
\label{MFS19}<Z_f(A_f)> = \frac{(4\gamma + \nu)A_f}{8\gamma + 2[1 - (1 +
\kappa)^{-1/3}]A_f^{2/3}}.
\end{equation}

\subsection{ Charge distribution of multifragmentation products.}

\hspace{1.0em}At given mass of fragment $A_f > 1$ the charge $Z_f$
distribution of fragments are described by Gaussian
\begin{equation}
\label{MFS20} P(Z_f(A_f))\sim \exp{[-\frac{(Z_f(A_f) -
<Z_f(A_f)>)^2}{2(\sigma_{Z_f}(A_f))^2}]}
\end{equation}
with dispertion
\begin{equation}
\label{MFS21}\sigma_{Z_f(A_f)} = \sqrt{\frac{A_fT_b}
{8 \gamma + 2[1 - (1 +\kappa)^{-1/3}]A_f^{2/3}}}
\approx \sqrt{\frac{A_fT_b}{8 \gamma}}.
\end{equation}
and the average charge $<Z_f(A_f)>$ defined by Eq. ($\ref{MFS17}$).

\subsection{ Kinetic energy distribution of multifragmentation products.}

\hspace{1.0em}It is assumed \cite{Botvina87} that at the instant of the
nucleus break-up the kinetic energy of the fragment $T^{f}_{kin}$ in the
rest of nucleus obeys the Boltzmann distribution at given temperature
$T_b$:
\begin{equation}
\label{MFS22} \frac{dP(T^{f}_{kin})}{dT^{f}_{kin}}\sim \sqrt{T^{f}_{kin}}
\exp{(-T^{f}_{kin}/T_b)}.
\end{equation}
Under assumption of thermodynamic equilibrium the fragment have
isotropic velocities distribution in the rest frame of nucleus. The
total kinetic energy of fragments should be equal $\frac{3}{2}MT_b$,
where $M$ is fragment multiplicity, and the total fragment momentum
should be equal zero. These conditions are fullfilled by choosing
properly the momenta of two last fragments.

The initial conditions for the divergence of the fragment system are
determined by random selection of fragment coordinates distributed with
equal probabilities over the break-up volume $V_f = \kappa V$. It can be
a sphere or prolongated ellipsoid. Then Newton's equations of motion are
solved for all fragments in the self-consistent time-dependent Coulomb
field \cite{Botvina87}.  Thus the asymptotic energies of fragments
determined as result of this procedure differ from the initial values by
the Coulomb repulsion energy.

\subsection{ Calculation of the excitation energies of
multifragmentation products.}

\hspace{1.0em}The temparature $T_b$ determines the average excitation
energy of each fragment:
\begin{equation}
\label{MFS23} U_{f}(T_b) = E_f(T_b) - E_f(0) =  \frac{T_b^2}{\epsilon_0}A_f +
[\beta(T_b) - T_b \frac{d\beta(T_b)}{dT_b} - \beta_0]A^{2/3}_f,
\end{equation}
where $E_f(T_b)$ is the average fragment energy at given temperature
$T_b$ and $\beta(T_b)$ is defined in Eq. ($\ref{MFS8}$).  There is no
excitation for fragment with $A_f < 4$, for $^{4}He$ excitation energy
was taken as $U_{^{4}He} = 4T^2_b/\epsilon_o$.

\subsection{ MC procedure.}

\hspace{1.0em}Thus the Monte Carlo calculation of characteristics of
multifragmentation fragments can be outlined as following:

\begin{enumerate}
\item Perform direct simulation of the
 low multiplicity multifragment disintegration using Eq. ($\ref{MFS1}$)
 and find average multiplicity value $<M>$.  Examine that the found
 $<M>$ is really small, i.e.  $<M> \leq M_0$ and, using calculated
 according Eq. ($\ref{MFS1}$) probabilities, randomly select a specific
 channel with given values of $A_f$ and $Z_f$. Then proceed to the step
 (5).  If the obtained value of $<M> > M_0$ then proceed to the step
 (2).

\item Sample the atomic numbers of fragment $A^i_f$, where $1 \leq A^i_f
\leq A$ according to the Poisson distribution Eq. ($\ref{MFS12}$) with mean value
$<N_{A_f}>$ defined by Eq. ($\ref{MFS16}$).

\item For choosen $A^i_f$ randomly in accordance with
Gaussian distribution Eq. ($\ref{MFS18}$) with the dispersion  defined by Eq.
($\ref{MFS19}$) and the average defined
by Eq. ($\ref{MFS17}$) select the fragment charge $Z^i_f$,
where $0 \leq Z^i_f \leq Z$.

\item Repeat the sampling of $A^i_f$
(step (2)) and $Z^i_f$ (step (3)) $i$ times
until
for all fragments the atomic numbers and charges will be defined. If the
sum of nucleons and charge of all fragments exceed the values $A$ and $Z$,
 then the procedure should be repeated starting from $i = 1$ at the step (2).

\item For
choosen $A_f, Z_f$ randomly according to the Boltzmann distribution
Eq. ($\ref{MFS20}$) determine fragment kinetic energies $T^{f}_{kin}$
 at the instant of the nucleus break-up in the rest of nucleus system.
Then define fragment velocities and momenta under assumption of
isotropic
velocities distribution in the rest frame of nucleus.
By choosing properly the momenta of two last fragments
fullfill the energy-momentum constraints.
By random selection of fragment coordinates distributed with equal
probabilities over the break-up volume $V_f = \kappa V$ determine
the initial conditions for the divergence of the fragment system after
the break-up instant. Solve the Newton's
equations of motion all fragments in the self-consistent
time-dependent Coulomb field to define the
 the asymptotic energies of fragments.

\item Calculate excitation energies of fragments using Eqs. ($\ref{MFS21}$).

\item Perform evaporation or Fermi break-up for the excited fragments.

\end{enumerate}


\documentclass{article}
\usepackage[pagebackref,letterpaper=true,colorlinks=true,pdfpagemode=none,urlcolor=blue,linkcolor=blue,citecolor=blue,pdfstartview=FitH]{hyperref}

\usepackage{amsmath,amsfonts}
\usepackage{graphicx}
\usepackage{color}

\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{0pt}
\setlength{\textwidth}{6.0in}
\setlength{\topmargin}{0in}
\setlength{\textheight}{8.5in}

\setlength{\parindent}{0in}
\setlength{\parskip}{5px}

%\input{macrosblog}

%%%%%%%%% For wordpress conversion

\def\more{}

\newif\ifblog
\newif\iftex
\blogfalse
\textrue

\usepackage{ulem}
\def\em{\it}
\def\emph#1{\textit{#1}}

\def\image#1#2#3{\begin{center}\includegraphics[#1pt]{#3}\end{center}}

\let\hrefnosnap=\href

\newenvironment{btabular}[1]{\begin{tabular} {#1}}{\end{tabular}}

\newenvironment{red}{\color{red}}{}
\newenvironment{green}{\color{green}}{}
\newenvironment{blue}{\color{blue}}{}

%%%%%%%%% Typesetting shortcuts

\def\B{\{0,1\}}
\def\xor{\oplus}

\def\P{{\mathbb P}}
\def\E{{\mathbb E}}
\def\var{{\bf Var}}

\def\N{{\mathbb N}}
\def\Z{{\mathbb Z}}
\def\R{{\mathbb R}}
\def\C{{\mathbb C}}
\def\Q{{\mathbb Q}}
\def\eps{{\epsilon}}

\def\bz{{\bf z}}

\def\true{{\tt true}}
\def\false{{\tt false}}

%%%%%%%%% Theorems and proofs

\newtheorem{exercise}{Exercise}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{example}{Example}
\newtheorem{remark}[theorem]{Remark}
\newenvironment{proof}{\noindent {\sc Proof:}}{$\Box$} %\medskip}
%%%%%%%%% I added
\newtheorem{assumption}{Assumption}
%%%%%%%%

\begin{document}
%title:  The simplest LQG problem
We are going to provide an explicit solution for the LQG problem
in one dimensional setting. This will go over HJB and Ricatti equations.

\more

\section {Problem setting}
We fix
$$\ell (a)  = \frac 1 2 a^{2} \hbox{ and } g(x) = \frac 1 2 x^{2}.$$
The controlled process is given by
$$d X_{t} = q(t) dt + dW(t),$$
where $q(\cdot)$ is an adapted control process
and $W(\cdot)$ is a standard Brownian motion.

The value function is given by
$$v(t, x) = \sup_{q(\cdot)} \mathbb E^{x, t}
[ \int_{t}^{T} - \ell (q(s)) ds - g(X(T))].$$

Our goal is to solve for $(v, \hat q(\cdot))$, where $\hat q(\cdot)$ is the optimal control.

\section{Analysis}
The first attempt is to write down HJB equation and try to solve it due
to the following verification theorem.
\begin{proposition}
 \label{p:170810-01}
\end{proposition}
If $u \in C^{2,1}$ solves HJB(u) equation
$$  \left\{
\begin{array}
 {ll}
 \partial_{t} u + \frac 1 2 \partial_{xx} u + H(\partial_{x} u)= 0, &
 \hbox{ on }
\mathbb R\times (0, T),
\\
u(T, x) = - g(x) &
\hbox{ on } \mathbb R,
\end{array} \right .
$$
then $u = v$ and $\hat q(t) = \partial_{x} u (X_{t}, t)$. In the above, $H$ is
the Legendre transform of $\ell$, i.e.
$$H(p) = \sup_{q} (q \cdot p - \ell(q)) = \frac 1 2 p^{2}.$$

\begin{proof}
 later ??
\end{proof}

Next, we shall search for $\partial_{x} u$. To do that, we differentiate
HJB(u) by $\partial_{x}$,
and substitute $w = \partial_{x} u$ to obtain HJB(w),
$$ \left\{
\begin{array}
 {ll}
 \partial_{t} w + \frac 1 2 \partial_{xx} w + w \partial_{x}w = 0,
 &\hbox{ on }
\mathbb R\times (0, T),
\\
w(T, x) = - g'(x) &\hbox{ on } \mathbb R,
\end{array}
\right.
$$
The above equation can lead to adjoint process in terms of Backward SDE,
which is crucial in stochastic maximum principle.
However, we shall not get into BSDE in this problem, and use it directly in
this below.

From the form of $w(T, x) = - x$, we bravely guess $$w(t, x) = \phi(t) x$$ for
some negative $\phi(t)$, and plug into HJB(w)
$$\phi' + \phi^{2}  = 0, \hbox{ on } (0, T), \hbox{ and } \phi(T) = -1.$$
This is called Ricatti equation. We can explicitly write for $\phi$ and $w$ as
\begin{equation}
 \label{eq:170810-phi}
\phi(t) = - \frac{1}{1 + T -t}, \hbox{ and } w(x, t) = - \frac{x}{1 + T -t } = \partial_{x} u.
\end{equation}
This means $\phi$ is explicitly solvable,
but we do not need the explicit form until the end. Starting from $w = \phi x$,
we can write $u$ by
$$u(x, t) = \psi(t) + \int_{0}^{x} w(y, t) dy = \psi(t) + \frac 1 2 \phi(t) x^{2}.$$
Plugging this form into HJB, it yields
$$\psi'(t) + \frac 1 2 \phi(t) = 0, \hbox{ and } \psi(T) = 0.$$
Now we invoke explicit $\phi$ to obtain $\psi$ as
\begin{equation}
 \label{eq:170810-psi}
 \psi(t) = - \frac 1 2 \ln ( 1 + T - t).
\end{equation}

One can easily verify verification theorem, and reach the following answer.
\begin{proposition}

\end{proposition}
Let $\tau:= T - t$. Then, the value and optimal control are given as
$$v(x, t) =  \frac{- x^{2}}{2(1+ \tau)} - \frac 1 2 \ln (1 + \tau),
\
\hat q(t) = \frac{-1}{1+ \tau} \hat X_{t}.$$
In particular, the optimal trajectory
$\hat X$ follows O-U process, i.e.
$$d \hat X_{t} = \frac{-1}{1+ \tau} \hat X_{t} dt + dW_{t}, \ \hat X_{0} = x.$$
Therefore, $\hat X_{T}^{x, 0} \to 0$ in $L^{2}$ if $T \to \infty$, i.e.
$$\lim_{T\to \infty}  \mathbb E^{x,0} (\hat X_{T})^{2} = 0.$$
See Example 1 of
\href{https://01law.wordpress.com/2017/07/25/ornstein-uhlenbeck-process/#more-883}{[here]}
about O-U process.

\begin{remark}

\end{remark}
\begin{enumerate}
 \item HJB(w) is Burger's equation.
\end{enumerate}

\end{document}


\documentclass[11pt]{article}
\usepackage{listings}
\usepackage{color}

\lstset{frame=tb,
language=R,
keywordstyle=\color{blue},
alsoletter={.}
}
\newcommand{\numpy}{{\tt numpy}}    % tt font for numpy

\topmargin -.5in
\textheight 9in
\oddsidemargin -.25in
\evensidemargin -.25in
\textwidth 7in

\begin{document}

% ========== Edit your name here
\author{Francesco Penasa}
\title{Biological resources - lect 4 - lab 1}
\maketitle

\medskip

% ========== Begin answering questions here
\section{Matrix} % (fold)
rectangular table of data of the same type
\label{sec:matrix}
\begin{lstlisting}[language=R]
# matrix (vector, nrow, ncol) [row, colmn] dimnames == names of row and column
matrix(1:9, nrow = 3, ncol =3, dimnames = list(c(``X'', ``Y'', ``Z''), c(``A'', ``B'', ``C'')))

# update names
colnames(x) = c(``a'',``b'',``c'')
rownames(x) = c(``a'',``b'',``c'')

# update rows or columns
cbind(c(1,2,3),c(4,5,6))
rbind(c(1,2,3),c(4,5,6))

# change the dim of a vector of a matrix
dim(x) <- c(2,3)
\end{lstlisting}

\begin{lstlisting}[language=R]
m <- cbind(c(1,2,3), c(1,2,3), c(1,2,3))
v <- c(2,4,6)

m*2   # scalar product
m*v   # scalar product
m*m   # scalar product
v*m   # scalar product
m%*%v # dot product
m%*%m # dot product
\end{lstlisting}

\section{Lists} % (fold)
\label{sec:lists}
ordered collection of data or arbitrary types
\begin{lstlisting}[language=R]
doe <- list("john", 28, F)
doe

doe <- list(name="john", age=28, married=F)
doe$name

unlist(doe)
doe
\end{lstlisting}

\section{Data Frames} % (fold)
\label{sec:data_frames}
data frame, excel table.
Rectangular table with rows and columns BUT data within each column has the same type. but different columns may have different types.
\begin{lstlisting}[language=R]
d <- data.frame(n1 = c(3,2,1), n2=c("a","b", "c"), n3=c(T,T,F))
d
class(d)
typeof(d)

# to access use parenthesis, using index or the name
d[3,2]
d["1", "n2"] # first row and second column
d[,"n2"] # just the second column

# to keep the structure, be careful about the DROP!
d[,2, drop=FALSE]
d["1" , , drop=FALSE]

# more complex subsetting
m[1:2, c(1,3)]
m[which(m[,1] > 1), ]

# update values through subsetting
d [1,1] <- 5
d [1,] <- c(5, "S", FALSE)

# access list elem
doe[1] = "you"
doe$name = "yourmother"
\end{lstlisting}

\section{Levels} % (fold)
\label{sec:levels}
Careful about levels!
\begin{enumerate}
	\item \textit{character} is your basic string data structure.
	\item \textit{factor} is something important for statistics.
\end{enumerate}

\begin{lstlisting}[language=R]

\end{lstlisting}

\section{Program time} % (fold)
\label{sec:program_time}
\subsection{Branching} % (fold)
\label{sub:branching}
\begin{lstlisting}[language=R]
x <- c(1,2,3)
if (any(x>2)){
	x <- x+1
} else {
	x <- x+2
}
\end{lstlisting}
% subsection branching (end)

\subsection{Loops} % (fold)
\label{sub:loops}
\begin{lstlisting}[language=R]
for(i in 1:10){
	print(i*i)
}

i <- 1
while(i<=5){
	print(i*i)
	i = i+ sqrt(i)
}
\end{lstlisting}

\begin{lstlisting}[language=R]
# apply, sapply, lapply
x <- matrix(1:9, nrow = 3, ncol =3, dimnames = list(c("X", "Y", "Z"), c("A", "B", "C")))

# apply(arr, margin, fct)

# sum all rows
apply(x, 1, sum)

# sum all columns
apply(x, 2, sum)

# lapply: generization for lists
lapply

# sapply: create a data structure that it is the simplest as possible
li <- list("t", "s", "q")
sapply(li, toupper)
li

fct <- function(x){ return(c(x, x*x, x*x*x))}
sapply(1:5, fct)
\end{lstlisting}
% subsection loops (end)

\section{Import data} % (fold)
\label{sec:import_data}
\begin{lstlisting}[language=R]
x <- read.delim("filename.txt")
write.table(x, file="s")

# read csv
csv <- read.csv(file)
\end{lstlisting}

\paragraph{String manipulation} % (fold)
\label{par:string_manipulation}

\begin{lstlisting}[language=R]
lines <- readLines("Table.txt")
strsplit(lines[[1]], "\t")

writeLines(x, "~/Test.txt", sep="\t")
\end{lstlisting}

\section{Storing data} % (fold)
\label{sec:storing_data}

\begin{lstlisting}[language=R]
save(x, file="x.RData")
\end{lstlisting}

% section storing_data (end)

\section{Plot} % (fold)
\label{sec:plot}
plot()
\begin{lstlisting}[language=R]
x <- seq(-pi, pi, -.1)
plot(x, sin(x))

x <- c(1, 3, 5, 7, 10, 4, 1)
barplot(x)

x <- c(1, 3, 5, 7, 10, 4, 1)
y <- c(1, 3, 5, 7, 10, 4, 1)+3
boxplot(x, y)

# scatter plot
plot(x,y)

# ggplot to see more
\end{lstlisting}

% section plot (end)

\section{Basic statistic in R} % (fold)
\label{sec:basic_statistic_in_r}
\paragraph{Qualitative data} % (fold)
\label{par:qualitative_data}
\begin{lstlisting}[language=R]
# import package
library(MASS)
# watch dataset head
head(painters)

# project the distribution of elements
table(painters$School)

pie(table(painters$School))

# complicate this, count the occurencies of the compose the data
table(painters$School, painters$Composition)
\end{lstlisting}

\paragraph{Quantitative} % (fold)
\label{par:quantitative}
\begin{lstlisting}[language=R]
library(MASS)
head(faithful, n=3)

duration = faithful$eruption
stuff...

plot(faithful$eruptions, faithful$waiting)
\end{lstlisting}

\paragraph{Statistic tools} % (fold)
\label{par:statistic_tools}
\begin{enumerate}
	\item mean
	\item median
	\item quartile
	\item ...
	\item ...
\end{enumerate}

\begin{lstlisting}[language=R]
# perform correlation coefficient
cor.test(faithful$eruptions, faithful$waiting)
\end{lstlisting}

\paragraph{Probability distributions} % (fold)
\label{par:probability_distributions}
\begin{lstlisting}[language=R]
# normal distribution
vals <- rnorm(1200, mean=72, sd=15.2)
hist(vals)
\end{lstlisting}

% paragraph probability_distributions (end)

% paragraph statistic_tools (end)

% paragraph quantitative (end)

% section basic_statistic_in_r (end)

\paragraph{help} % (fold)
\label{par:help}
help(function)
? function
\texttt{cran} official repository
\texttt{bioonductor} biology related repository
% paragraph help (end)
\end{document}
\grid
\grid


%  -*- coding: utf-8 -*-
% !TEX program = xelatex

\documentclass{article}

\newtheorem{thm}{Theorem}[section]

\begin{document}

\title{A Simple LaTeX Article}
\author{JaxEdit Project}
\date{January 12th, 2013}
\maketitle

\tableofcontents

\section[Introduction]{Long Introduction}

We have the Cauchy-Schwarz inequality:
  \[ \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \]
where $a_k$ and $b_k$ are real numbers, for any $k$.

\section{Calculus}

\begin{thm}
If we have the following conditions:
\begin{enumerate}
\item $f(x)$ is continuous on $[a,b]$,
\item $f(x)$ is differentiable on $(a,b)$,
\item $f(a)$ and $f(b)$ are equal,
\end{enumerate}
Then there exists $\xi\in(a,b)$ such that $f'(\xi)=0$.
\end{thm}

\end{document}


\vfill \eject
\par
\section{Multithreaded Solution of $A X = Y$
         using an $LU$ factorization}
\label{section:LU-MT}
\par
The only computations that are multithreaded are the factorization
and forward and backsolves.
Therefore, this section will describe only the differences between
the serial driver in Section~\ref{section:LU-serial-driver} and the
multithreaded driver whose complete listing is found in
Section~\ref{section:LU-MT-driver}.
This section will refer the reader to subsections in
Section~\ref{section:LU-serial} for the parts of the code where the
two drivers are identical.
\par
The shared memory parallel version of {\bf SPOOLES} is implemented
using thread based parallelism.
The multi-threaded code uses much of
the serial code --- the basic steps are the same and use
the serial methods.
The usage of {\bf SPOOLES} for communicating
the data for the problem and reordering the linear system
is identical in the serial and multi-threaded versions.
Only the numeric factorization and solve steps are
parallelized using threads.
What is different between the serial and threaded versions of the
numeric computations is how the computations are scheduled.
\par
While the storage for the factor matrices lies in one global
{\tt FrontMtx} object, all processes access the data in a disjoint way.
During the factorization, front $J$ is {\it owned} by one process
that is responsible for factoring the front and computing its updates
to all other fronts.
In other words, only the process that owns
front $J$ performs computations with that data.
During the solve, all $L_{J,I}$, $D_{I,I}$ and $U_{I,J}$
submatrices are stored in the front matrix object,
but the computations with them are mapped to different threads,
i.e., each thread {\it owns} a subset of the factor submatrices,
and performs computations with it.
We will now begin to work our way through the program
found in Section~\ref{section:LU-MT-driver}
to illustrate the use of {\bf SPOOLES} to solve a system
of linear equations using multithreaded factor and solves.
\par
\subsection{Reading the input parameters}
\label{subsection:MT:input-data}
\par
This step is identical to the serial code, as described in
Section~\ref{subsection:serial:input-data}, with the exception
that {\tt nthread}, the number of threads, is also input.
\par
\subsection{Communicating the data for the problem}
\label{subsection:MT:communicating-data}
\par
This step is identical to the serial code, as described in
Section~\ref{subsection:serial:communicating-data}
\par
\subsection{Reordering the linear system}
\label{subsection:MT:reordering}
This step is identical to the serial code, as described in
Section~\ref{subsection:serial:reordering}
\par
\subsection{Non-numeric work}
\label{subsection:MT:non-numeric}
This step is identical to the serial code, as described in
Section~\ref{subsection:serial:non-numeric}, with one addition.
We need to map factor computations to threads.
The {\tt ownersIV} vector object
specifies which thread {\it owns} a front.
The {\bf SPOOLES} library has four ways to do this.
Two are of academic interest --- the wrap map and the balanced map
-- for these maps yield too much interaction between the threads.
The subtree-subset map is suited for extremely well balanced front
trees from nested dissection orderings.
The domain decomposition map is more robust over a range of
orderings, and this is what we recommend, as we see in the code
fragment below.
\begin{verbatim}
if ( nthread > (nfront = FrontMtx_nfront(frontmtx)) ) {
   nthread = nfront ;
}
cumopsDV = DV_new() ;
DV_init(cumopsDV, nthread, NULL) ;
ownersIV = ETree_ddMap(frontETree, type, symmetryflag, cumopsDV, 1./(2.*nthread)) ;
\end{verbatim}
The first step is to ensure that each thread has a front to own,
decreasing the number of threads if necessary.
We then construct the owners map using the front tree object.
The {\tt cumopsDV} object is a double precision vector object
whose length is the number of threads.
On return from the map call, it contains the number of factor
operations that will be performed by each thread when pivoting for
stability is not enabled.
\par
\subsection{The Matrix Factorization}
\label{subsection:MT:factor}
\par
During the factorization and solves, the threads access data
and modify the state of the {\tt FrontMtx} and {\tt SubMtxManager}
objects in a concurrent fashion,
so there must be some way to control this access for critical
sections of code.
Inside each of the two objects we have placed a {\tt Lock} object.
The {\bf SPOOLES} {\tt Lock} object is little more than a wrapper
around a mutual exclusion lock.
It provides a simple abstract interface so that other objects which
contain locks need not know about the particular thread package we use,
be it Solaris threads, or POSIX threads, or another.
\par
To notify the {\tt FrontMtx} and {\tt SubMtxManager} objects that
they must have a lock, their initialization method calls differ
slightly from the serial version.
See Section~\ref{subsection:serial:factor} for a
discussion of the similar features.
The code fragment below shows their initialization calls.
\par
\begin{verbatim}
frontmtx   = FrontMtx_new() ;
mtxmanager = SubMtxManager_new() ;
SubMtxManager_init(mtxmanager, LOCK_IN_PROCESS, 0) ;
FrontMtx_init(frontmtx, frontETree, symbfacIVL, type, symmetryflag,
              FRONTMTX_DENSE_FRONTS, pivotingflag, LOCK_IN_PROCESS,
              0, NULL, mtxmanager, msglvl, msgFile) ;
\end{verbatim}
The difference is that the {\tt SubMtxManager} and {\tt FrontMtx}
objects are initialized with a {\tt LOCK\_IN\_PROCESS} flag instead
of a {\tt NO\_LOCK} flag.
The scope of the mutual exclusion lock is for threads within the
same process, not across the system.
\par
The numeric factorization is performed by the
{\tt FrontMtx\_factorInpMtx()} method.
The code segment from the sample program for the numerical
factorization step is found below.
\begin{verbatim}
chvmanager = ChvManager_new() ;
ChvManager_init(chvmanager, LOCK_IN_PROCESS, 1) ;
DVfill(10, cpus, 0.0) ;
IVfill(20, stats, 0) ;
rootchv = FrontMtx_MT_factorInpMtx(frontmtx, mtxA, tau, droptol, chvmanager, ownersIV,
                                   lookahead, &error, cpus, stats, msglvl, msgFile) ;
ChvManager_free(chvmanager) ;
\end{verbatim}
Note that the {\tt ChvManager} is also locked.
There are two additional parameters in the calling sequence of
the multithreaded factorization.
\begin{itemize}
\item
The {\tt ownersIV} object maps the fronts to threads.
\item
The {\tt lookahead} parameter controls the flow of execution during
the factorization.
Since the threads work cooperatively to compute the factor
matrices, there is idle time while one thread waits on another.
The {\tt lookahead} parameter controls the ability of the thread to
look past the present idle point and perform work that is not so
immediate.
Unfortunately, while a thread is off doing this work, it may block
a thread at a more crucial point.
When {\tt lookahead = 0}, each processor tries to do only
``immediate'' work.
Moderate speedups in the factorization have been for values of {\tt
lookahead} up to the number of threads.
For nonzero {\tt lookahead} values, the amount of working storage
can increase, sometimes appreciably.
\end{itemize}
The post-processing of the factorization is exactly the same as the
serial code.
Note, this step can be trivially parallelized, but is not done at
present.
\par
After the post-processing step, the {\tt FrontMtx} object contains
the $L_{J,I}$, $D_{I,I}$ and $U_{I,J}$ submatrices.
What remains to be done is to specify which threads own which
submatrices, and thus perform computations with them.
This is done by constructing a {\it ``solve--map''} object,
as we see below.
\begin{verbatim}
solvemap = SolveMap_new() ;
SolveMap_ddMap(solvemap, symmetryflag, FrontMtx_upperBlockIVL(frontmtx),
               FrontMtx_lowerBlockIVL(frontmtx), nthread, ownersIV,
               FrontMtx_frontTree(frontmtx), seed, msglvl, msgFile) ;
\end{verbatim}
This object also uses a domain decomposition map, the only solve map
that presently found in the {\bf SPOOLES} library.
\par
\subsection{The Forward and Backsolves}
\label{subsection:MT:solve}
\par
The parallel solve is remarkably similar to the serial solve,
as we see with the code fragment below.
\begin{verbatim}
mtxX = DenseMtx_new() ;
DenseMtx_init(mtxX, type, 0, 0, neqns, nrhs, 1, neqns) ;
DenseMtx_zero(mtxX) ;
FrontMtx_MT_solve(frontmtx, mtxX, mtxY, mtxmanager, solvemap, cpus, msglvl, msgFile) ;
DenseMtx_permuteRows(mtxX, newToOldIV) ;
\end{verbatim}
The only difference between the serial and multithreaded solve
methods is the presence of the solve--map object in the latter.
\par
\subsection{Sample Matrix and Right Hand Side Files}
\label{subsection:MT:input-files}
\par
The multithreaded driver uses the same input files as found in
Section~\ref{subsection:serial:input-files}.


\documentclass[main.tex]{subfiles}
\begin{document}

\subsection{Covariance of the Dirac Equation}

\marginpar{Sunday\\ 2020-3-29, \\ compiled \\ \today}

How do these new spinors transform under Lorentz transformations?

We suppose that for a general Lorentz transformation \(\Lambda \) we will have something in the form
%
\begin{align}
\psi^{\prime } (x') = S(\Lambda ) \psi (x)
\,,
\end{align}
%
where \(S(\Lambda )\) is a \(4 \times 4\) matrix, belonging to the \emph{spinorial representation of the Lorentz group}.
We do this because if we were to simply impose \(\psi^{\prime }(x^{\prime }) = \psi (x)\) we get a contradiction, so the equation is not covariant.

Now, let us see what we must require of the matrices \(S(\Lambda )\) so that the Dirac equation holds in the new frame as well as in the old.
When we do the computation, recall that the \(\gamma^{\mu }\) matrices are \emph{not} a 4-vector, despite the position of the index: they need not be transformed using a \(\Lambda \) matrix; better put, they are a set of 4 Lorentz scalars

So, we must have
%
\begin{subequations}
\begin{align}
\qty(i \slashed{\partial}' - M) \psi^{\prime } (x') &=
\qty(i \gamma^{\mu } \tensor{\Lambda }{_{\mu }^{\nu }} \partial_{\nu } -M) S(\Lambda ) \psi (x)
\\
&= S(\Lambda ) \qty[i \tensor{\Lambda }{_{\mu }^{\nu }} S^{-1}(\Lambda )
\gamma^{\mu } S(\Lambda ) \partial_{\nu } - M ] \psi (x)  \\
&=S(\Lambda ) \qty[i \slashed{\partial} - M] \psi (x)
\,,
\end{align}
\end{subequations}
%
where we used the following:
\begin{enumerate}
  \item the matrix \(S(\Lambda )\) is constant with respect to the spatial coordinates, since the Lorentz transformation is fixed, so we can bring it outside of the derivative \(\partial_{\nu }\);
  \item the matrices \(\gamma^{\mu }  \) and \(S(\Lambda )\) do not commute \emph{a priori}, so if we wish to bring the equation in the form \(S(\Lambda ) \times \qty[\text{old-coordinates Dirac eq}]\) we cannot simply commute them, instead we multiply by \(\mathbb{1} = S S^{-1}\) on the left;
  \item we impose the condition
  %
  \begin{align}
  \tensor{\Lambda }{_{\mu }^{\nu }} S^{-1}(\Lambda ) \gamma^{\mu } S(\Lambda ) \overset{!}{=} \gamma^{\nu }
  \,
  \end{align}
  %
  in order to find the expression we need in order for the equation to be covariant, since as long as the matrix \(S(\Lambda )\) is nondegenerate the equation \(S(\Lambda ) \qty[i \slashed{\partial} - M] \psi =0\) has the same solutions as the Dirac equation.
\end{enumerate}

If we multiply by an inverse Lorentz matrix on both sides we can bring this equation into the form
%
\begin{align} \label{eq:spinorial-representation-definition}
S^{-1}(\Lambda ) \gamma^{\mu } S(\Lambda ) = \tensor{\Lambda }{^{\mu }_{\nu }} \gamma^{\nu }
\,,
\end{align}
%
so we can say that the Dirac equation is covariant as long as we find some matrices \(S(\Lambda )\) satisfying these conditions.
Do note that while this looks like a vector transformation law, the \(\gamma^{\mu }\) matrices do not transform under Lorentz transformations: what we are stating is that it is equivalent to apply a Lorentz matrix to them and to transform them as spinorial matrices.

In a way, we are asking the transformation laws for spinors and vectors to be compatible.

\subsubsection{Explicit realization of the spinorial representation}

In order to do this, we consider infinitesimal Lorentz transformations,
%
\begin{align}
\tensor{\Lambda }{^{\mu }_{\nu }} = \tensor{ \delta }{^{\mu }_{\nu }} + \tensor{\omega}{^{\mu}_{\nu }}
\,,
\end{align}
%
where \(\omega_{\mu \nu } = \omega_{[\mu \nu ]}\) is an antisymmetric tensor.\footnote{The fact that \(\omega \) must be antisymmetric may be derived by imposing the condition \(\eta_{\mu \nu } = \tensor{\Lambda }{_{\mu }^{\alpha }} \tensor{\Lambda }{_{\nu }^{\beta }} \eta_{\alpha \beta }\), with the perturbed \(\Lambda \) we wrote above.}

A rank-2 antisymmetric tensor in 4 dimensions has 6 degrees of freedom: these physically correspond to three rotations and three boosts.

A rather general ansatz looks like:
%
\begin{align}
S(\Lambda ) = \mathbb{1} - \frac{i}{2} \omega_{\mu \nu } \Sigma^{\mu \nu }
\,,
\end{align}
%
where \(\Sigma^{\mu \nu }\) is the set of the generators of the spinorial representation of the Lorentz group. For fixed \(\mu \) and \(\nu \), these are matrices in the spinor space: if we write all the indices explicitly, they look like \(\Sigma^{\mu \nu }_{\aleph \beth}\).

This means that to each possible basis Lorentz transformation of spacetime (think boost or rotation) we are associating a \(4 \times 4\) basis spinor transformation matrix.
This is what finding a representation of the group means: for each element of the Lorentz group we are finding a transformation matrix.

Do note, however, that we are only working at linear order in \(\omega_{\mu \nu }\), so we are not looking yet at a representation of the whole group, instead we are only considering elements which are close to the identity.
So, we can insert this expression for \(S(\Lambda )\) into the relation between the \(S(\Lambda )\) and \(\Lambda \), equation \eqref{eq:spinorial-representation-definition}, using the fact that to first order \(S = \mathbb{1} + \epsilon \) is the inverse of \(S^{-1} = \mathbb{1} - \epsilon \) we have, to first order in \(\omega \):
%
\begin{subequations}
\begin{align}
\qty(\mathbb{1} + \frac{i}{2} \omega_{\rho \sigma } \Sigma^{\rho \sigma }) \gamma^{\mu } \qty(\mathbb{1} - \frac{i}{2} \omega_{\alpha \beta } \Sigma^{\alpha \beta }) &= \gamma^{ \mu} +\tensor{\omega}{^{\mu }_{\nu }} \gamma^{\nu } \\
\gamma^{\mu } + \frac{i}{2} \omega_{\rho \sigma } \Sigma^{\rho \sigma } \gamma^{ \mu } - \frac{i}{2} \gamma^{\mu }\omega_{\alpha \beta } \Sigma^{\alpha \beta } &= \gamma^{\mu } + \omega_{\sigma \nu } \eta^{\mu \sigma } \gamma^{\nu }  \\
-\frac{i}{2} \omega_{\rho \sigma } \qty[\gamma^{\mu }, \Sigma^{\rho \sigma }] &= \omega_{\sigma \nu } \eta^{\mu [\sigma } \gamma^{\nu ]}  \\
\qty[\gamma^{\mu }, \Sigma^{\rho \sigma }] &= i \qty(\eta^{\mu \rho } \gamma^{\sigma } - \eta^{\mu \sigma } \gamma^{\rho })
\,,
\end{align}
\end{subequations}
%
where we antisymmetrized the indices in \(\eta^{\mu \rho } \gamma^{\sigma }\) since they are multiplied by the antisymmetric tensor \(\omega_{\rho \sigma }\), so any symmetric part would not contribute to the equation.
We also used the fact that \(\omega_{\rho \sigma } \) is proportional to the identity in the spinor space.

\begin{claim}
This is satisfied by
%
\begin{align}
\Sigma^{\mu \nu } = \frac{i}{4} \qty[\gamma^{\mu }, \gamma^{\nu }] = \frac{1}{2} \sigma^{\mu \nu }
\,,
\end{align}
\end{claim}

\begin{proof}
We plug the definitions in:
%
\begin{subequations}
\begin{align}
\qty[\gamma^{\mu }, \Sigma^{\rho \sigma }] &= \frac{i}{4} \qty(\gamma^{\mu } \gamma^{\rho} \gamma^{\sigma } - \gamma^{\mu } \gamma^{\sigma } \gamma^{\rho } - \gamma^{ \rho } \gamma^{\sigma } \gamma^{\mu } + \gamma^{ \sigma } \gamma^{ \rho } \gamma^{ \mu })  \\
i \qty(\eta^{\mu \rho } \gamma^{\sigma } - \eta^{\mu \sigma } \gamma^{\rho }) &= \frac{i}{2} \qty(\gamma^{\mu} \gamma^{\rho } \gamma^{\sigma } + \gamma^{\rho } \gamma^{\mu } \gamma^{\sigma } -\gamma^{\mu } \gamma^{\sigma }\gamma^{\rho } - \gamma^{\sigma } \gamma^{\mu } \gamma^{ \rho } )
\,,
\end{align}
\end{subequations}
%
where we used the anticommutation relations \(\qty{\gamma^{\mu }, \gamma^{\nu }} = 2 \eta^{\mu \nu }\).
Then, we must check whether these two expression are equal, that is, whether
%
\begin{subequations}
\begin{align}
\frac{1}{2} \qty( \mu  \rho \sigma  - \mu  \sigma  \rho  -  \rho  \sigma  \mu  +  \sigma   \rho   \mu ) &\overset{?}{=}
\mu \rho  \sigma  + \rho  \mu  \sigma  -\mu  \sigma \rho  - \sigma  \mu   \rho   \\
&=  \qty{\mu, \rho }\sigma - \qty{\mu , \sigma } \rho
\,,
\end{align}
\end{subequations}
%
where we only write the indices of the \(\gamma \)s for clarity.

We can now use the identity:
%
\begin{subequations}
\begin{align}
[\mu , \rho \sigma ] &= \mu \rho \sigma - \rho \sigma \mu  \\
&= \mu \rho \sigma + \rho \mu \sigma - \rho \mu \sigma - \rho \sigma \mu \marginnote{Added and subtracted}  \\
&= \qty{\mu, \rho } \sigma - \rho \qty{\mu, \sigma }
\,.
\end{align}
\end{subequations}

Note that in our convention there is no division by 2 in the commutator and anticommutator.
Then, we can recognize these in the initial claim: we find
%
\begin{subequations}
\begin{align}
\frac{1}{2} \qty( \mu  \rho \sigma  - \mu  \sigma  \rho  -  \rho  \sigma  \mu  +  \sigma   \rho   \mu )
&= \frac{1}{2} \qty(\qty[\mu, \rho \sigma ] - \qty[\mu, \sigma \rho ])  \\
&= \frac{1}{2} \qty(\qty{\mu, \rho } \sigma - \rho \qty{\mu, \sigma } -
\qty{\mu, \sigma } \rho + \sigma \qty{\mu, \rho })  \\
&= \qty{\mu, \rho } \sigma - \qty{\mu, \sigma } \rho
\,,
\end{align}
\end{subequations}
%
since the anticommutators \(\qty{\mu, \sigma }\) are proportional to the metric \(\eta^{\mu \sigma }\), which is proportional to the identity in the spinorial space, which commutes with the gamma matrices, so \(\qty{\mu , \sigma }\) commutes with any gamma matrix.
\end{proof}

Up until now we have worked ``near the identity'' of our transformation group; if we want to extrapolate these results to general transformations we may use the exponential map, which gives us relations in the form
%
\begin{subequations}
\begin{align}
S(\Lambda ) &= \exp( -\frac{i}{2} \omega_{\mu \nu } \Sigma^{\mu \nu })  \\
S^{-1} (\Lambda ) &= \exp(\frac{i}{2} \omega_{\mu \nu } \Sigma^{\mu \nu })
\,.
\end{align}
\end{subequations}
%

\subsection{Dirac conjugate spinor}

We want to define a notion of a conjugate spinor, starting from what we know about hermitian conjugate operators: we start by taking the Hermitian conjugate of the Dirac equation,
%
\begin{align}
\qty[\qty(i \slashed{\partial} -M) \psi ]^\dag = - i \psi ^\dag \qty(i \gamma^{\mu \dag} \overleftarrow{\partial}_{\mu } + M )
\,,
\end{align}
%
where the result follows from the fact that the adjoint of a product is the product of the reverse-ordered adjoints, while the notation \(\overleftarrow{\partial}_{\mu }\) means that the derivative operator is acting on what is on its left.

In order to simplify this, we employ the following facts: \((\gamma^{0})^2 = \mathbb{1}\), and
%
\begin{align} \label{eq:gamma-matrices-identity}
\gamma^{0} \gamma^{\mu \dag} \gamma^{0} = \gamma^{\mu }
\,.
\end{align}

\begin{proof}
For \(\gamma^{0}\) the result is immediate, since it is self adjoint: \(\gamma^{0} = \gamma^{0, \dag}\), so the expression reduces to \(\qty(\gamma^{0})^3 = \qty(\gamma^{0})^2 \qty(\gamma^{0}) = \gamma^{0}\).

Then let us consider \(\gamma^{i}\): since they are block matrices of the Pauli matrices, which are self-adjoint and which have determinant \(-1\), we have:
%
\begin{subequations}
\begin{align}
\gamma^{i \dag} = \left[\begin{array}{cc}
0 & \sigma_{i} \\
- \sigma_{i} & 0
\end{array}\right] ^\dag =
\left[\begin{array}{cc}
0 & - \sigma_{i} \\
\sigma_{i} & 0
\end{array}\right] = - \gamma^{i}
\,,
\end{align}
\end{subequations}
%
therefore we need to prove that \(\gamma^{0} \gamma^{i} \gamma^{0} = -\gamma^{i}\):
%
\begin{subequations}
\begin{align}
\left[\begin{array}{cc}
1 & 0 \\
0 & -1
\end{array}\right]
\left[\begin{array}{cc}
0 & \sigma_{i} \\
-\sigma_{i} & 0
\end{array}\right]
\left[\begin{array}{cc}
1 & 0 \\
0 & -1
\end{array}\right] &=
\left[\begin{array}{cc}
1 & 0 \\
0 & -1
\end{array}\right]
\left[\begin{array}{cc}
0 & -\sigma_{i} \\
- \sigma_{i} & 0
\end{array}\right]  \\
&=
\left[\begin{array}{cc}
0 & - \sigma_{i} \\
\sigma_{i} & 0
\end{array}\right]
\,.
\end{align}
\end{subequations}
\end{proof}

With these results, we can use the manipulation
%
\begin{subequations}
\begin{align}
\psi ^\dag \gamma^{\mu \dag} \overleftarrow{\partial}_{\mu } &=
\psi ^\dag \gamma^{0} \gamma^{0} \gamma^{\mu \dag} \gamma^{0} \gamma^{0} \overleftarrow{\partial}_{\mu }  \\
&= \psi ^\dag \gamma^{0} \gamma^{\mu } \overleftarrow{\partial}_{\mu } \gamma^{0}
\,,
\end{align}
\end{subequations}
%
which holds since the matrix \(\gamma^{0}\) is constant.
We also define \(\overline{\psi} = \psi ^\dag \gamma^{0}\), so that the whole equation reads
%
\begin{align}
\overline{\psi} \qty(i \slashed{\partial} + M ) =0
\,,
\end{align}
%
where we removed the \(\gamma^{0}\) at the right, since the equation multiplied by it is equivalent to the one which is not.

Now, in order to see how \(\overline{\psi}\) transforms under a Lorentz transformation we use the following facts:
\begin{enumerate}
  \item \(\psi' (x' ) = S(\Lambda ) \psi (x)\) and
  \item \(\gamma^{0} S ^\dag (\Lambda ) \gamma^{0} = S^{-1}(\Lambda )\).
\end{enumerate}

\begin{proof}
Let us first work to first order:
we know that \(S(\Lambda )\) is written as
%
\begin{align}
S(\Lambda )=   \exp( -\frac{i}{2} \omega_{\mu \nu } \Sigma^{\mu \nu })
\approx \mathbb{1} - \frac{i}{2} \omega_{\mu \nu } \Sigma^{\mu \nu }
\,,
\end{align}
%
so its adjunct is
%
\begin{align}
S ^\dag (\Lambda ) = \exp( \frac{i}{2} \omega_{\mu \nu } \Sigma^{\mu \nu \dag}) \approx \mathbb{1} + \frac{i}{2} \omega_{\mu \nu } \Sigma^{\mu \nu \dag}
\,,
\end{align}
%
so when we multiply it from the left and right by \(\gamma^{0}\) it goes through everything, and we are left with
%
\begin{align}
\gamma^{0} \Sigma^{\mu \nu \dag} \gamma^{0} \overset{?}{=}
\Sigma^{\mu \nu }
\,,
\end{align}
%
since the expression for \(S^{-1}(\Lambda )\) differs from that of \(S(\Lambda )\) only for a sign in the exponent, but we picked up a sign when taking the adjunct.
Recall that the explicit expression of the \(\Sigma \) matrices is
%
\begin{align}
\Sigma^{\mu \nu } = \frac{i}{4} \qty[\gamma^{\mu }, \gamma^{\nu }]
\,,
\end{align}
%
so we can show directly that
%
\begin{subequations}
\begin{align}
\gamma^{0} \Sigma^{\mu \nu \dag} \gamma^{0} &=
\frac{i}{4} \gamma^{0} \gamma^{\mu \dag}  \gamma^{\nu\dag } \gamma^{0 }
-\frac{i}{4} \gamma^{0} \gamma^{\nu\dag }  \gamma^{\mu \dag} \gamma^{0 } \\
&=
\frac{i}{4} \gamma^{0} \gamma^{\mu \dag} \gamma^{0} \gamma^{0} \gamma^{\nu\dag } \gamma^{0 }
-\frac{i}{4} \gamma^{0} \gamma^{\nu\dag }  \gamma^{0} \gamma^{0} \gamma^{\mu \dag} \gamma^{0 }  \\
&= \frac{i}{4} \qty[\gamma^{\mu } \gamma^{\nu }] = \Sigma^{\mu \nu }
\,.
\end{align}
\end{subequations}

We have worked to first order until now, but the result we found actually works up to any order, since in the full expression of the exponential we will have terms proportional to
%
\begin{align}
\frac{1}{n!} \qty(\omega_{\mu \nu } \Sigma^{\mu \nu \dag})^{n}
\,,
\end{align}
%
so if we multiply on both sides by \(\gamma^{0}\) we get something like (we omit the indices for simplicity)
%
\begin{align}
\frac{1}{n!} \omega^{n} \gamma^{0} \Sigma^{\dag n} \gamma^{0} =
\frac{1}{n!} \omega^{n} \gamma^{0} \Sigma^\dag \gamma^{0} \gamma^{0} \Sigma^\dag  \dots \gamma^{0} \gamma^{0} \Sigma^\dag \gamma^{0} =
\frac{\omega^{n}}{n!}\prod_{n} \qty(\gamma^{0} \Sigma^{\dag} \gamma^{0})
= \frac{\omega^{n}}{n!} \Sigma^{n}
\,,
\end{align}
%
so the reasoning extends to arbitrary orders in the expansion of the exponential.
\end{proof}

Using these results, we can show that the conjugate spinor \(\overline{\psi} = \psi ^\dag \gamma^{0}\) transforms like:
%
\begin{subequations} \label{eq:dirac-conjugate-spinor-transformation}
\begin{align}
\overline{\psi}' (x') &= \psi^{\prime \dag} \gamma^{0}  \\
&= \qty(S(\Lambda ) \psi ) ^\dag \gamma^{0}  \\
&= \psi ^\dag S ^\dag (\Lambda ) \gamma^{0} \\
&= \psi ^\dag \gamma^{0} \gamma^{0} S ^\dag (\Lambda ) \gamma^{0} \\
&= \overline{\psi} S^{-1}(\Lambda )
\,.
\end{align}
\end{subequations}

\subsection{Continuity equation}

We can apply the same strategy we used in the KG case: if we multiply the Dirac equation by \(\overline{\psi}\) on the left and the conjugate equation by \(\psi \) on the right, we get
%
\begin{align}
\overline{\psi} \qty(i \slashed{\partial} - M ) \psi &= 0 &
\overline{\psi} \qty(i \overleftarrow{\slashed{\partial}} + M ) \psi &= 0
\,.
\end{align}

if we sum them, the \(M \overline{\psi} \psi  \) terms cancel, so we have
%
\begin{subequations}
\begin{align}
0 &= \overline{\psi} \qty(i \overleftarrow{\slashed{\partial}} + i \slashed{\partial}) \psi   \\
&= i \qty( (\partial_{\mu }\overline{\psi}) \gamma^{\mu } \psi   + \overline{\psi} \gamma^{\mu }\partial_{\mu } \psi)  \\
&= \partial_{\mu } \qty(\overline{\psi} \gamma^{\mu } \psi )
\,,
\end{align}
\end{subequations}
%
so we have the conserved current \(\overline{\psi} \gamma^{ \mu } \psi   = J^{\mu }\).
Its corresponding charge density is \(\rho = J^{0}= \overline{\Psi} \gamma^{0} \psi = \psi ^\dag \psi \).

This looks like a positive definite conserved charge, so it could be interpreted as a probability.
In fact, this is not the case, as we shall see in the future.

\subsection{Bilinear forms and Lorentz transformations}

Our observables can not still carry spinorial indices: all the spinorial indices must be saturated in the expression for an observable, since we can only observe scalars in the spin tensor algebra.

For instance, \(\overline{\psi} \psi \) is the dot product of two spinors, so it carries no indices.
It is a scalar under Lorentz transformations, since \(\overline{\psi}\) transforms with a \(S^{-1}\) while \(\psi \) transforms with an \(S\).

\(\overline{\psi} \gamma^{\mu } \psi \) is instead a vector under Lorentz transformations: it transforms like
%
\begin{align}
\overline{\psi} \gamma^{\mu } \psi \rightarrow
\overline{\psi} S^{-1}(\Lambda ) \gamma^{\mu } S(\Lambda  ) \psi
= \overline{\psi} \tensor{\Lambda }{^{\mu }_{\nu }} \gamma^{\nu } \psi
\,,
\end{align}
%
where we used the property shown in equation \eqref{eq:spinorial-representation-definition}.

So, everything we are doing is covariant when we are discussing observables.

\end{document}


\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage[USenglish]{babel}
\usepackage[nodayofweek,level]{datetime}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{intersections,arrows.meta}
\usepackage{pgfplots}
\usepackage[scr]{rsfso}
\usepackage{array}
\usepackage{centernot}
\usepackage{stackengine}
\usepackage{graphics,graphicx}
\usepackage{pstricks,pst-node,pst-tree}
\usetikzlibrary{arrows, automata}
\hbadness=10001 %gets rid of "\hfill underfull" warning
\stackMath

\usepackage{tikz,pgfplots}

\pgfplotsset{compat=1.10}
% Uncomment to use "fillbetween" function
% otherwise leave commented because
% the red highlighting is annoying
%\usepgfplotslibrary{fillbetween}

% Change for each new hw week
\newcommand{\dueDate}{\formatdate{1}{12}{2017}} % day/month/year
\newcommand{\hwNum}{9}

\begin{document}

\selectlanguage{USenglish}
%------------------------ Title Code ------------------------
\title{Homework: Week \hwNum}
\author{Joseph Ismailyan}
\date{}
\maketitle
\begin{flushleft}
Math 100 \\
Due: \dueDate \\
Professor Boltje \\
MWF 9:20a-10:25a
\end{flushleft}

%------------------------ Begin Page 1 ------------------------
\begin{minipage}[t]{0.40\textwidth}

\section*{Section 11.0 }
\subsection*{2.}
\[
R=
\{(1,1), (1,2),(1,3),(1,4),(1,5)
\]
\[
\newline\quad\quad,(1,6),(2,2),(2,4),(2,6),(3,3)
\]
\[
\newline,(3,6),(4,4),(5,5),(6,6)
\}
\]
\begin{tikzpicture}[
> = stealth, % arrow head style
shorten > = 1pt, % don't touch arrow head to node
auto,
node distance = 2cm, % distance between nodes
semithick % line style
]

\tikzstyle{every state}=[
draw = black,
thick,
fill = white,
minimum size = 4mm
]

\node[state] (2) {$2$};
\node[state] (1) [right of=2] {$1$};
\node[state] (6) [above of=1] {$6$};
\node[state] (4) [below of=1] {$4$};
\node[state] (3) [right of=1] {$3$};
\node[state] (5) [below of=3] {$5$};

\path[->] (1) edge  (3);
\path[->] (1) edge  (4);
\path[->] (1) edge  (5);
\path[->] (1) edge  (6);

\draw[->] (1) to [out=140,in=33]  (2);

\draw[->] (2) to [out=270,in=180]  (4);
\draw[->] (2) to [out=90,in=180]  (6);

\draw[->] (3) to [out=90,in=0]  (6);

\draw [->] (2) edge [loop left] (2);
\draw [->] (4) edge [loop below] (4);
\draw [->] (3) edge [loop right] (3);
\draw [->] (5) edge [loop right] (5);
\draw [->] (6) edge [loop above] (6);
\draw [->] (1) edge [loop left] (1);

\end{tikzpicture}

\end{minipage}
% Creates verticle line
\hfill\vline\hfill
\begin{minipage}[t]{0.45\textwidth}

\subsection*{12.}
$ y\leq x $. The relation is $ \leq $.

\section*{Section 11.1}
\subsection*{14.}
Suppose $ x\in A $. Since $ R $ is symmetric, then $ xRa $ and $ aRx $, then since $ R $ is transitive then $ xRx $.

\section*{Section 11.2}
\subsection*{2.}

\[
R=
\{(a,a),(b,b),(c,c),(d,d),(e,e)
\]
\[
\newline\quad\quad,(a,d),(d,a),(b,c),(c,b),(e,d)
\]
\[
\newline,(d,e),(a,e),(e,a)
\}
\]

\end{minipage}
\pagebreak

%------------------------ End Page 1 ------------------------

%------------------------ Begin Page 2 ------------------------

\begin{minipage}[t]{0.40\textwidth}

\subsection*{10.}
\textbf{Proposition}: Suppose $ R $ and $ A $ are two equivalence relations on a set $ A $. Prove that $ R\cap S $ is also an equivalence relation.
\newline\textit{Proof.} Suppose $ (x,y)\in R\cap S $ is not an equivalence relation. Then $ (x,y)\in R $ and $ (x,y)\in S $. $ R $ and $ S $ are equivalence relations therefore  $ (x,y)\in R\cap S $ is an equivalence relation, but we said  $ (x,y)\not\in R\cap S $, a contradiction.

\subsection*{12.}
\textbf{Proposition}: Suppose $ R $ and $ S $ are equivalence relations on a set $ A $, then $ R\cup S $ is also an equivalence relation on A.
\newline\textit{Proof.} Let $ R=\{(a,a),(b,b),(c,c),(a,b),(b,a)\} $ and $ S=\{(a,a),(b,b),(c,c),(b,c),(c.b)\} $. Then $ R\cup S=$  $ \{(a,a),(b,b),(c,c),(a,b),(b,a),$  $(b,c),(c.b)\}$.
Now observe that $ (a,b)\in R \land (a,b)\in S \centernot\implies (a,b)\in R\cup S$. So $ R\cup S $ is not transitive, therefore it is not an equivalence relation.

\end{minipage}
% Creates verticle line
\hfill\vline\hfill
\begin{minipage}[t]{0.45\textwidth}

\subsection*{14.}
To show $ S $ is an equivalence relation, we must show that it's reflexive, symmetric, and transitive. To show it's reflexive, we choose an $ x\in A $ and $ n=1 $, Then $ x_1=x $ so then $ xRx $ since R is reflexive, thus $ xSx $. Now suppose $ xSy $. Then, by definition, there are elements $ x_1, x_2,...,x_n\in A$ such that $ xRx_1, x_1Rx_2,...,x_nRy $. Since $ R $ is symmetric, $ yRx_n,... x_2Rx_1, x_1Rx $, so $ ySx $. Now suppose $ xSy $ and $ ySz $. Since $ xSy $ then $ xRa, aRa_1,...a_nRy$. Since $ ySz then yRb, bRb_1,...,b_mRz $ so $ xRa,...,a_nRy,yRb1,...,b_mRz $ so $ xSz $. Now to show that $ R\subseteq S$, suppose $ (x,y)\in\mathbb{R} $. Since $ xRy, xSy $ by definition $ xSy\implies(x.y)\in S $. To show $ S $ is the smallest equivalence relation on $ A $, assume $ T $ is an equivalence relation on $ A $ containing $ R $. Suppose $ (x,y)\in S $. So $ xSy $ is $ xRx_1,...,x_nRy $ so $ xTx_1,...,x_nTy $ so $ xTx $ which shows that $ S $ is a subset of $ T $.

\section*{Section 11.3}
\subsection*{2.}
The partitions of set $ A $ are:\\
$ \{\{a\}, \{b\}, \{c\}\}, $\\
$ \{\{a,b\},\{c\}\} $,\\
$ \{\{a\},\{b,c\}\} $,\\
$ \{\{a,c\},\{b\}\} $,\\
$ \{\{a,b,c\}\} $.

\end{minipage}
\pagebreak

%------------------------ End Page 2 ------------------------

%------------------------ Begin Page 3 ------------------------

\begin{minipage}[t]{0.40\textwidth}

\subsection*{4.}
\textit{Proof.} Suppose $ x\in A $. Let $ X\in P $, such that $ x\in X $. Then by definition, $ xRx $. Then suppose $ xRy $ for some $ x,y\in A $, then by definition there exists a $ X\in P $ such that $ x,y\in X $. In particular, it also means $ y,x\in X $ so $ yRx $. Now suppose $ xRy $ and $ xRz $ for some $ x,y,z\in A $. Then by definition, there exists $ X_1,X_2\in P $ such that $ x,y\in X_1 $ and $ y,z\in X_2 $. Since $ P $ is a partition of $ A $, $ y $ can only be in one part, therefore $ X_1=X_2 $. Thus $ x,z\in X  \rightarrow  xRz $. Let $ X\in P $ be a part of the partition. Then by definition $ xRy $ for any two $ x,y\in X $. Also, given $ a\in X $ and $ b\in A-X $ then by definition $ a $ and $ b $ are not related. Thus $ X $ is an equivalence class of R. Since every element of $ A $ is in exactly one of the parts of $ P $, there are no equivalence classes besides the ones from the partition, thus $ P $ is the set of equivalence classes of $ R $.

\section*{Section 11.4}
\subsection*{4.}

\begin{tabular}{|c|c|c|c|c|c|c|}
	\hline
	+   & [0] & [1] & [2] & [3] & [4] & [5]\\
	\hline
	[0] & [0] & [1] & [2] & [3] & [4] & [5]\\
	\hline
	[1] & [1] & [2] & [3] & [4] & [5] & [0]\\
	\hline
	[2] & [2] & [3] & [4] & [5] & [0] & [1]\\
	\hline
	[3] & [3] & [4] & [5] & [0] & [1] & [2]\\
	\hline
	[4] & [4] & [5] & [0] & [1] & [2] & [3]\\
	\hline
	[5] & [5] & [0] & [1] & [2] & [3] & [4]\\
	\hline
\end{tabular}

\begin{tabular}{|c|c|c|c|c|c|c|}
	\hline
	$ \cdot $   & [0] & [1] & [2] & [3] & [4] & [5]\\
	\hline
	[0] & [0] & [0] & [0] & [0] & [0] & [0]\\
	\hline
	[1] & [0] & [1] & [2] & [3] & [4] & [5]\\
	\hline
	[2] & [0] & [2] & [4] & [0] & [2] & [4]\\
	\hline
	[3] & [0] & [3] & [0] & [3] & [0] & [3]\\
	\hline
	[4] & [0] & [4] & [2] & [0] & [4] & [2]\\
	\hline
	[5] & [0] & [5] & [4] & [3] & [2] & [1]\\
	\hline
\end{tabular}

\end{minipage}
% Creates verticle line
\hfill\vline\hfill
\begin{minipage}[t]{0.45\textwidth}

\subsection*{6.}
No, because in $ \mathbb{Z}_6 $, for example, $ [a] $ could be $ [3] $ and $ [b] $ could be $ [4] $ which would be $ [4]\cdot[3]=[12]=[0] $. As long as $ [a]\cdot[b] $ results in a multiple of $ 6 $ then the result will be $ [0] $.

\subsection*{8.} By definition, $ [a]=[a'] $ is $ a\equiv a'\pmod n $ so $ n|a-a' \rightarrow a-a'=nk, k\in\mathbb{Z}$. Similarly, $ [b]=[b'] $ is  $ b\equiv b'\pmod n $ so $ n|b-b' \rightarrow b-b'=nm, m\in\mathbb{Z}$. Then we can say $ a=a'+nk $ and $ b=b'+nm $. If we add them together, we get $ a+b=(a'+b')+nk+nm \rightarrow (a+b)-(a'+b')=n(k+m)\rightarrow (a+b)-(a'+b')=nh, h=(k+m)\in\mathbb{Z}$. Therefore $ n|(a+b)-(a'+b')\rightarrow (a+b)\equiv(a'+b')\pmod n $. Therefore in $ \mathbb{Z}_n $, $ [a+b]=[a'+b'] $.

\end{minipage}
\pagebreak

%------------------------ End Page 4 ------------------------

\end{document}


\documentclass[main.tex]{subfiles}
\begin{document}

\section{Sheet 4}

\subsection{Riemann tensor computations}

\subsubsection{LIF form} \label{sec:LIF-form-Riemann-tensor}

In the LIF, we have \(g_{\mu \nu } = \eta_{\mu \nu }\) and \( g_{\mu \nu , \alpha }=0\). Therefore, the Christoffel symbols are all zero.
In the explicit expression of the Riemann tensor, which looks like \(R = \partial \Gamma  + \Gamma \Gamma\) we can drop the second term and keep only the derivatives of the Christoffel symbols, which are nonzero since they depend on the second derivatives of the metric.

If the Christoffel symbols are zero, the computation of the curvature tensor is significantly easier, since we do not have the \(\Gamma \Gamma \): we just need to account for the terms \(\partial \Gamma \). The computation gives:
%
\begin{subequations}
\begin{align}
  R^{\mu }_{\nu \rho \sigma }
  &=  2 \partial_{[\rho }\Gamma^{\mu }_{\sigma ] \nu}  \\
  &= 2 \partial_{[\rho } \qty(\frac{1}{2} g^{\mu \alpha } \qty(g_{\alpha |\sigma ], \nu } + g_{\alpha \nu  , |\sigma  ]} - g_{\nu  |\sigma], \alpha }))  \\
  &= g^{\mu \alpha }\qty(g_{\alpha [\sigma |, \nu | \rho      ]} + \cancelto{}{g_{\alpha \nu, [\sigma \rho]}}-g_{\nu [\sigma |, \alpha | \rho  ]})
\,,
\end{align}
\end{subequations}
%
where a term was cancelled since it contained the antisymmetrization of partial derivatives, which commute.

So, if we lower the index of the (1, 3) Riemann tensor we get the desired expression for the all-lower (0, 4) Riemann tensor:
%
\begin{equation}
  R_{\mu \nu \rho \sigma} = g_{\mu [\sigma |, \nu |\rho ]} - g_{\nu  [\sigma |, \mu | \rho ]}
\,.
\end{equation}

\subsubsection{Ricci tensor and scalar}

The Ricci tensor is given by:
%
\begin{equation}
  R_{\mu \nu } = R^{\alpha }_{\mu \alpha \nu }
  = g^{\alpha \beta }R_{\alpha \mu \beta \nu }
  = g^{\alpha \beta }\qty(g_{\alpha [\nu|, \mu | \beta ]} - g_{\mu [\nu|, \alpha | \beta ]})
\,.
\end{equation}
%
% where we can simplify all the antisymmetric terms in \(\alpha \beta \), since they are contracted with a symmetric tensor.

% Now, of the four terms in the sum one simplifies immediately: we know that the Frobenius norm of the metric is constant: \(g^{\alpha \beta }g_{\alpha \beta } \equiv 4\), so if we expand we get \(0=\frac[i]{1}{2} (g^{\alpha \beta }g_{\alpha \beta })_{,\nu \mu } = g^{\alpha \beta }g_{\alpha \beta , \nu \mu } + g^{\alpha \beta }\,_{,\nu }g_{\alpha \beta , \mu }\), but the first derivatives of the metric vanish in the LIF so we only keep the first term, therefore \(g^{\alpha \beta }g_{\alpha \beta , \nu \mu }=0\).

So we have
%
\begin{subequations}
    \begin{align}
    R_{\mu \nu }
    &= \frac{1}{2} g^{\alpha \beta }\qty(
      g_{\alpha \nu , \mu \beta }
      -g_{\alpha \beta , \mu \nu }
      - g_{\mu \nu , \alpha \beta }
      + g_{\mu \beta , \alpha \nu }
    )  \\
    &= \frac{1}{2} g^{\alpha \beta }\qty(
      2 g_{\alpha (\nu , \mu ) \beta }
      - g_{\mu \nu , \alpha \beta }
      - g_{\alpha \beta , \mu \nu }
    )  \\
    &= g_{\alpha (\nu , \mu )}\,\!^{\alpha }
    - \frac{1}{2} \square g_{\mu \nu }
    - \frac{1}{2} g^{\alpha \beta }g_{\alpha \beta , \mu \nu }
    \label{eq:Ricci-tensor-LIF}
\,,
\end{align}
\end{subequations}
%
where\footnote{All the indices after the comma are derivatives, even when they become upper.} the square \(\square\) denotes the D'alambert operator, \(\square = \partial_{\beta }\partial^{\beta } = g^{\alpha \beta }\partial_{\alpha }\partial_{\beta }\).

The Ricci scalar, on the other hand, is given by
%
\begin{equation} \label{eq:ricci-scalar-LIF}
  R = g^{\mu \nu }R_{\mu \nu }
  =  g^{\mu \nu }g_{\alpha (\nu , \mu )}\,\!^{\alpha }
  - \frac{1}{2} \qty( g^{\mu \nu }\square g_{\mu \nu }
  + g^{\alpha \beta } \square g_{\alpha \beta } )
  = (\tensor{g}{_{\alpha \nu }^{, \alpha \nu }}
   -g^{\mu \nu } \square g_{\mu \nu })
\,,
\end{equation}
%
where we identified the two terms containing the metric contracted with its dalambertian, since they are equal up to a relabeling of indices.
% where the last term vanished since \(\square \qty(g^{\mu \nu }g_{\mu \nu })=0\), and while expanding we get twice \(g^{\mu \nu }\square g_{\mu \nu }\) since the first derivatives are zero.

We neglected the symmetrization in the first term since when contracting with the metric the indices \(\mu \nu \) are automatically symmetrized.

\subsubsection{LIF identities}

%
\begin{subequations}
\begin{align}
  \nabla_{\alpha }\qty(R^{ \alpha }_{\beta } - \frac{R}{2} \delta^{\alpha }_{\beta }) &=  \partial_{\alpha }\qty(g^{\alpha \lambda }R_{\lambda \beta } - \frac{R}{2} \delta^{\alpha }_{\beta })  \\
  &= \eta^{\alpha \lambda }R_{\lambda \beta, \alpha} - \frac{1}{2} R_{,\beta } \label{eq:contracted-Bianchi-LIF}
\,,
\end{align}
\end{subequations}
%
since in the LIF the metric is the Minkowski one, and the Christoffel symbols are zero therefore \(\nabla_{\alpha }= \partial_{\alpha }\).

\subsubsection{Contracted Bianchi identities}

The first term is
%
\begin{equation}
  \eta^{\beta \mu }R_{\mu \nu, \beta } =
  \eta^{\beta \mu }\qty(2
  \tensor{g}{_{\alpha (\nu , \mu )}^{,\alpha }}
  - \square g_{\mu \nu }
  - g^{\alpha \beta }g_{\alpha \beta, \mu \nu }
  )_{, \beta}
\,,
\end{equation}
%
which we can expand out: the Minkowski metric raises the derivative with respect to \(x^{\beta }\) and turns it into a derivative with respect to \(x_{\mu }\), and we can also expand the Dalambertian and the symmetrization: we get
%

%
\begin{subequations}
\begin{align}
  \eta^{\beta \mu } R_{\mu \nu , \beta } &=
  \tensor{g}{_{\alpha \nu , \mu }^{ \alpha \mu }}
  + \tensor{g}{_{\alpha \mu , \nu }^{ \alpha \mu }}
  - \tensor{g}{_{\mu \nu, \alpha }^{ \alpha \mu }}
  - g^{\alpha \beta }\tensor{g}{_{\alpha \beta , \mu \nu }^{\mu }} \label{eq:bianchi-identities-computation-step} \\
  &=   + \tensor{g}{_{\alpha \mu , \nu }^{ \alpha \mu }}
  - \qty(g^{\alpha \beta } \square g_{\alpha \beta })_{,\nu } \\
  &= \partial_{\nu }\qty( \tensor{g}{_{\mu \alpha}^{,\mu \alpha }} - g^{\alpha \beta }\square g_{\alpha \beta })
\,,
\end{align}
\end{subequations}
%
since, up to a relabeling of indices, the first and third term in \eqref{eq:bianchi-identities-computation-step} are equal.

The derivative \(\partial_{\nu }R\), on the other hand, is twice that:
%
\begin{equation}
  \partial_{\nu }R = \partial_{\nu }\qty(2 \tensor{g}{_{\mu \alpha }^{, \mu \alpha }} - 2 g^{\alpha \beta }\square g_{\alpha \beta })
\,,
\end{equation}
%
as can be directly gathered from \eqref{eq:ricci-scalar-LIF}.

Therefore, the quantity in \eqref{eq:contracted-Bianchi-LIF} is zero.

\subsubsection{Alternative expression}

Since the metric is covariantly constant, we can just bring it inside the derivative:
%
\begin{equation}
  0 = g^{\beta \mu }\nabla_{\alpha }\qty(\tensor{R}{^{\alpha }_{\mu }} - \frac{1}{2} R \delta^{\alpha }_{\mu })
  = \nabla_{\alpha }\qty(R^{\alpha \beta } - \frac{1}{2} R g^{\alpha \beta })
\,.
\end{equation}
%

These are called the \emph{Contracted Bianchi identities}, and can be alternatively derived from the Bianchi identities of the Riemann tensor, \(R_{\mu \nu [\rho \sigma ; \alpha ]} = 0\).

\subsection{Properties of the Ricci tensor}

\subsubsection{Symmetry generality}

The fact that \(T^{\mu \nu } = T^{\nu \mu }\) is frame invariant could be derived plainly from the fact that it is a tensor equation; to be more explicit we can say that under a change of coordinates with Jacobian matrix \(\Lambda \) we have \(\widetilde{T}^{\mu \nu } = \tensor{\Lambda }{^{\mu }_{\alpha }} \tensor{\Lambda }{^{\nu }_{\beta }} T^{\alpha \beta }\); when written in components like this the Jacobians commute, therefore we can just interchange them for both \(\widetilde{T}^{\mu \nu }\) and \(\widetilde{T}^{\nu \mu }\) to recover their equality.

\subsubsection{Symmetry of the Ricci tensor.}

The expression \eqref{eq:Ricci-tensor-LIF} is manifestly symmetric: part of it is explicitly symmetrized, part is proportional to the metric, which is symmetric.

Therefore, the Ricci tensor is symmetric in any frame.

\subsection{Weak field Einstein equations}

We consider the \emph{weak field} case, when \(g_{\mu \nu }= \eta_{\mu \nu } + h_{\mu \nu }\) with \(\abs{h_{\mu \nu }} \ll 1 \). We will then neglect second and higher order terms in \(h_{\mu \nu }\).

\subsubsection{The gravitational potential}
\label{sec:weak-field-gravitational-potential}

We want to work towards Newton's equation, which is \(\nabla^2 \Phi = 4 \pi G_N \rho \), where \(\Phi \) is the gravitational potential.
What defines the gravitational potential is\footnote{In the lecture notes this is solved differently: instead of finding the gravitational potential from the equation of geodesic motion, there it is found by identification of the gravitational redshift.} its effect on test masses: they accelerate with \(\vec{a} = - \vec{\nabla} \Phi \).

What is the relativistic equivalent of this?
A particle in GR follows a geodesic, a curve without proper acceleration.
Proper acceleration is a four-vector defined by \(a^{\mu }=u^{\nu }\nabla_{\nu } u^{\mu }\). If the four-velocity of a particle is \(u^{\mu }\), then for it the equation of geodesic motion reads:
%
\begin{equation}
  0 = a^{\mu }= u^{\nu }\partial_{\nu }u^{\mu } + \Gamma^{\mu }_{\nu \alpha }u^{\nu} u^{\alpha }
\,,
\end{equation}
%
which can be written in terms of derivatives with respect to proper time:
%
\begin{equation}
  0 = \dv[2]{x^{ \mu }}{s} + \Gamma^{\mu }_{\nu \alpha } u^{\nu } u^{\alpha }
\,.
\end{equation}

If the speeds are much less than that of light, this can be approximated: \(s \approx t\), and the only terms which contributes to order 0 in \(v\) in the Christoffel symbol sum is the one with \(u^{0} u^{0}\approx 1\): in the end then we get for the spatial components:
%
\begin{equation}
  0 = \dv[2]{x^{i}}{t} + \Gamma^{i}_{00}
\,,
\end{equation}
%
so we can see that the main contribution in the low-speed limit to the (coordinate!) acceleration of the particle are the symbols \(\Gamma^{i}_{00}\).
The expression for these in terms of the perturbed metric is:
%
\begin{equation} \label{eq:weak-field-Christoffel}
  \Gamma^{i}_{00}
  = \frac{1}{2} \eta^{i \alpha } \qty(2 h_{\alpha 0, 0} - h_{00, \alpha })
  = -\frac{1}{2} \tensor{h}{_{00}^{,i}}= -\frac{1}{2} \vec{\nabla}^{i} h_{00}
\,,
\end{equation}
%
if we assume stationarity of the metric (which is justified if we are treating a problem such as the gravitational pull on a body on the surface of the Earth) at least up to first order in \(h\).

Putting everything together: we found that
%
\begin{equation}
  \dv[2]{x^{i}}{t} = \frac{1}{2}\vec{\nabla}^{i}h_{00}
\,,
\end{equation}
%
but the equation which defines the gravitational field is
%
\begin{equation}
  \dv[2]{x^{i}}{t} = - \vec{\nabla}^{i} \Phi
\,,
\end{equation}
%
therefore, in the low-gravitational field and low-speed limit, we must identify \(h_{00} = -2 \Phi \).

\subsubsection{Reframing the EFE}

We can contract the EFE with the inverse metric, recalling that \(g^{\mu \nu }g_{\mu \nu }= 4\), to get \(-R = 8 \pi G_N T\). Therefore, they can be reframed by substituting the curvature scalar term with the trace of the stress-energy tensor:
%
\begin{equation}
  R_{\mu \nu } = 8 \pi G_N \qty(T_{ \mu \nu }- \frac{1}{2} T g_{\mu \nu })
\,.
\end{equation}

This will aid us by reducing the number of difficult curvature tensors to compute.

In the low-speed, weak-field limit matter has negligible pressure and is mostly just travelling in the time direction. Therefore, we approximate the stress energy tensor as that of noninteracting dust: \(T^{\mu \nu } = \rho u^{\mu } u^{\nu }\). In our frame matter is almost stationary, therefore we have that \(T_{00} \approx T^{00} \eta_{00} \eta_{00} \approx \rho\).
The trace of the curvature tensor is instead approximately \(T \approx T^{00 } \eta_{00} \approx - \rho\).

In the end, the 00 component of the equations reads:
%
\begin{equation}
  R_{00 } = 8 \pi G_N \qty(\rho - \frac{1}{2} (-\rho) \eta_{00 } ) = 4 \pi G_N \rho
\,.
\end{equation}
%

Now we only need to show that \(R_{00 } = \nabla^2 \Phi \).

\subsubsection{The derivatives in the curvature tensor}

The component we need to calculate is \(R_{00 } = R^{\mu }_{0 \mu 0} = R^{i}_{0i0}\) by antisymmmetry.

Let us recall here the general expression for the Riemann tensor:
%
\begin{equation}
  R^{\mu }_{\nu \rho \sigma } =
  2 \Gamma^{\mu }_{[\nu| \sigma, |\rho]} + 2 \Gamma^{\alpha }_{\sigma [\nu} \Gamma^{\mu }_{\rho ] \alpha }
\,.
\end{equation}

In our case, this simplifies to
%
\begin{equation}
  R^{i}_{0i0} =
  \Gamma^{i}_{00, i}
  - \Gamma^{i}_{i0, 0}
  + \Gamma^{\alpha }_{00} \Gamma^{i}_{i \alpha }
  - \Gamma^{\alpha }_{0i} \Gamma^{i}_{0 \alpha }
\,.
\end{equation}
%

The second term contains time derivatives, which we decided to neglect by dealing with the stationary case.
The third and fourth term are of second order in \(h\).

The only remaining term is the first one: using the expression \eqref{eq:weak-field-Christoffel} and the identification \(h_{00} = -2 \Phi \), it is
%
\begin{equation}
  R_{00} = \Gamma^{i}_{00, i} = \qty(-\frac{1}{2}\partial^{i}h_{00})_{,i} = \partial_{i}  \partial^{i} \Phi
\,,
\end{equation}
%
which is what we wanted to prove.

\end{document}