\section{Introduction}
\label{s:intro}

In this work, we successfully replicated the results of the article \textit{A Neurodynamical Model for Working Memory}\supercite{bib:NeurodynamicalModel} written by Razvan Pascanu and Herbert Jaeger.
This replication has been done using Python, and the code is available on \href{https://github.com/theoboraud/ESN}{GitHub}\supercite{bib:githubRepo}.
In their article, they propose (1) a way to implement working memory and (2) a way to characterise working memory states. \\
\\
(1) First, they implemented a working memory model in the form of a Recurrent Neural Network (RNN), more precisely an Echo State Network (ESN).
In their model, working memory corresponds to special output units trained to maintain information through feedback connections.
Their model had been trained to predict the next character in a sequence randomly generated depending on a context, and to maintain this context in working memory in order to help the prediction. We replicated the same model, trained it to solve mostly the same task and obtained comparable results. \\
\\
(2) They characterised the working memory states of their model by defining a notion of attractors for input driven dynamical systems.
In autonomous dynamical systems the memory states could have been characterised for instance by the stable fixed points of the dynamic.
However with inputs, these points are transformed into blobs stable against input that does not aim to change the memory state.
In our replication we also obtained qualitatively the same result.
However in the paper they go further and propose a method to automatically find the attractors of an input driven dynamical system.
They applied this method only to a toy model and not to the working memory model so we did not implement that part. \\
\\
In \textbf{Section~\ref{s:method}} we give all the implementation details of the model and the tasks it aims to solve.
We also highlight the few details that were missing in the paper and that we had to make a choice on in order to reproduce the results.
Then, in \textbf{Section~\ref{s:result}}, we compare the results we obtain to their results in the former article, to see whether or not we had been able to successfully replicate the experiments.

\section{Methods}
\label{s:method}

\subsection{Model}
\label{s:model}

Their model is a slightly modified Echo State Network, a special kind of Recurrent Neural Network where only the readout weights are trained.
\textbf{Figure \ref{fig:architecture}} illustrates and sums up the overall architecture of the model.
It is composed of a recurrent internal layer of size $\mathbf{N}$, a.k.a. reservoir, $\mathbf{K}$ input, $\mathbf{L}$ normal output units that are not fed back to the reservoir, and $\mathbf{WM}$ additional special output units.
They call the latter the Working Memory units (or WM-units).
These WM-units have a recurrent trainable connection to other WM-units (including themselves), and a feedback connection to the reservoir units.

In the following we use the following notations to describe the dynamic of their model:
\begin{itemize}
    \item Input units activations $\mathbf{u}$, with weights matrix $\mathbf{W^{in}}$ for input connections;
    \item Internal units activations $\mathbf{x}$, with weights matrix $\mathbf{W}$ for internal connections;
    \item Output units activations $\mathbf{y}$, with weights matrix $\mathbf{W^{out}}$ for output connections;
    \item WM-units activations $\mathbf{m}$, with weights matrix $\mathbf{W^{mem}}$ for connections from the input units, the reservoir and the WM-units to the WM-units;
    \item Weights matrix $\mathbf{W^{b}}$ for the feedback connections from the WM-units to the reservoir.
\end{itemize}

Given these notations, the dynamic of their model is as follow:
\begin{itemize}
    \item Eq. (\ref{eq:xn+1}) represents the dynamic of the internal units. This dynamic involves at the same time the state of the internal units given their previous state, the previous state of the WM-units and the actual state of input units. We use $\mathbf{}{f}$ to subsume its activation functions, which are the hyperbolic tangent in this model.
    \begin{equation} \label{eq:xn+1}
        x(n+1) = f(W^{in}u(n+1) + Wx(n) + W^{b}m(n))
    \end{equation}

    \item Eq. (\ref{eq:mn+1}) represents the dynamic of the WM-units. This dynamic involves the state of the WM-units given the actual state of input and internal units, and the actual state of the WM-units. The sharp threshold function $\mathbf{f^{m}}$ is the activation function for the WM-units, and is given by Eq. (\ref{eq:fm}), while $\mathbf{W^{mem}}$ is computed by linear regression during the step 1 of the model \textit{Training} phase as shown in Eq. (\ref{eq:Wmem}).
    \begin{equation} \label{eq:mn+1}
        m(n+1) = f^{m}(W^{mem}(u(n+1), x(n+1)))
    \end{equation}

    \item Eq. (\ref{eq:fm}) is the sharp threshold function used as the activation function of the WM-units.
    \begin{equation} \label{eq:fm}
        f^{m} = \begin{cases}
            -0.5 \; \; x\leq 0. \\
            +0.5 \; \; x>0. \end{cases}
    \end{equation}

    \item Eq. (\ref{eq:yn+1}) represents the dynamic of the output units. This dynamic involves the state of the output units given the actual state of input and internal units. $\mathbf{f^{out}}$ is the activation function of the output units, and is the Identity function, while $\mathbf{W^{out}}$ will be computed by linear regression during the step 2 of the model \textit{Training} phase as shown in Eq. (\ref{eq:Wout}).
    \begin{equation} \label{eq:yn+1}
        y(n+1) = f^{out}(W^{out}(u(n+1), x(n+1)))
    \end{equation}

    \item Eq. (\ref{eq:Wmem}) is the equation to compute the weights matrix for WM-units using linear regression. The activations of the reservoir, the input and the target of the WM-units are all stored in matrix $\mathbf{H}$, $\mathbf{M_{target}}$ is the target of the WM-units, and $\dagger$ stands for the pseudo-inverse.
    \begin{equation} \label{eq:Wmem}
        W^{mem} = (H^{\dagger} \cdot M_{target})^T\\
    \end{equation}

    \item Eq. (\ref{eq:Wout}) is the equation to compute the weights matrix for output units using linear regression. The activations of the reservoir and the input units are all stored in matrix $\mathbf{G}$, $\mathbf{Y_{target}}$ is the target of the output units, and $\dagger$ stands as before for the pseudo-inverse.
    \begin{equation} \label{eq:Wout}
        W^{out} = (G^{\dagger} \cdot f^{out^{-1}}(Y_{target}))^T\\
    \end{equation}

\end{itemize}

When the model starts, the weights are initialized as stated:
\begin{itemize}
    \item We have $\mathbf{K}=13$, $\mathbf{N}=1200$, $\mathbf{L}=65$ and $\mathbf{WM}=6$.
    \item $\mathbf{W^{in}}$ is of size $\mathbf{N \times K}$, with 10\% of which are +0.5, 10\% are -0.5, and the rest is 0.
    \item $\mathbf{W}$ is of size $\mathbf{N \times N}$, with only 12000 random non-zero connections, which will randomly either take the value +0.1540 or -0.1540.
    \item $\mathbf{W^{b}}$ is of size $\mathbf{N \times WM}$, where every weight is either +0.4 or -0.4.

\end{itemize}

\begin{figure}[h]
    \centering
    \includegraphics[width = \linewidth]{data/Architecture.png}
    \caption{Model architecture. See \textbf{Section~\ref{s:model}} for further details.}
    \label{fig:architecture}
\end{figure}

\subsection{Input generation}

Pascanu and Jaeger also describe the method they used to generate the input of the model.
The input consists of a constant bias (-0.5) and a column of 12 pixels of an image.
Each column of 12 pixels of the image is given as input to the network one after the other. \\
\\
This image represents a sequence of characters, i.e. curly brackets (opened or closed) or 65 other ASCII symbols (e.g. letters in lower cases, numbers...).
To each of these characters we associate a number that is its position in an alphabet sequence (see \textbf{Table~\ref{tab:alphabet}}).
For the sake of simplicity, in the following we say character $i$ for the $i$-th character in that sequence.
The sequence of characters is generated randomly using different 7 Markov Chains, and the Markov Chain used depends on the current curly bracket level.
More precisely, the next character is either:
\begin{itemize}
    \item an open (resp. closed) curly bracket thus increasing (resp. decreasing) the current bracket level by 1 to a maximum (resp. minimum) of 6 (resp. 0)
    \item or generated with a Markov chain given the last character that was not a curly bracket
\end{itemize}
Given that the next character is not a curly bracket, if the current bracket level is $\mathit{j}$, the next character after $\mathit{i}$ will either be:
\begin{itemize}
    \item $\mathit{i} + \mathit{j} + 1$ modulo 65 with probability $0.8$;
    \item any of the 64 other characters from the alphabet with probability $\frac{0.2}{64} = 0.003125
$.
\end{itemize}
During the training phase, the probability for the next character to be an open (resp. closed) curly bracket is 0.15.
Whereas in the testing phase it is 0.03, which forces the WM-unit to maintain the current bracket level for a longer time. \\
\\
The sequence is transformed into an image by displaying and concatenating each of its characters.
The characters are displayed using a randomly selected font and then uniformly randomly stretched between 6, 7 or 8 pixels in width.
Finally a salt-and-pepper noise of amplitude 0.1 and probability 1 is added to the whole image.\\
\\
See \textbf{Table \ref{tab:sequence_example}} to observe an example of input sequence generated from the alphabet in \textbf{Table \ref{tab:alphabet}} in \textbf{Section \ref{s:input_gen2}}.

\subsection{Task}

The aim of the WM-units is to keep track of the current bracket level. When the current bracket level is $\mathit{k}$, the $\mathit{k}$ first WM-units should be at +0.5, whereas the remaining ones should be at -0.5. \\
\\
The aim of the output units is to predict the next character in the sequence when the current character is not a curly bracket.
The prediction for the next character should be made in the middle of receiving the current character. If character $i$ should be predicted, then all the output units but the $i$-th one should be set to 0 whereas the $i$-th one should be 1. \\

\begin{figure}[h]
    \centering
    \includegraphics[width = \linewidth]{data/Sequence_img.png}
    \caption{Input and target outputs of the network. The first row represents the image input sent to the network columns by columns; the second is the target values for WM-units, with each white rows representing the time steps on which the corresponding WM-units has a value of 0.5, and in black when its value is -0.5 (a.k.a. white when the corresponding bracket level has been reached, and black when not); the third one is the target output, with 65 black pixels (value 0) at the middle of the character representation, and the next predicted character represented by a white pixel (value 1) depending of its location in the alphabet (see \textbf{Table \ref{tab:alphabet}}).}
    \label{fig:archi tecture}
\end{figure}

\subsection{Training and testing}

As they did, we train $W^{mem}$ and $W^{out}$ separately with different input sequences.
First we train $W^{mem}$ using teacher forcing and then we train $W^{out}$.
We use a sequence of 10000 characters to train $W^{mem}$, and of 49000 characters to train $W^{out}$.
The teacher signal for training $W^{mem}$ is defined at all times whereas for training $W^{out}$ it is defined only in the middle of characters that are not curly brackets.
Finally we test the model with a 35000 characters long sequence.
As an error on the bracket level would propagate and create more errors, each time the model makes a mistake on the bracket level in the WM-units we count it and correct it.
These errors are classified between \textit{false positives} (i.e. the network detects a bracket when there is none) and \textit{false negatives} (i.e. the network fails to detect a bracket).
The errors made by the output units are also counted but not corrected. The error rate of prediction is then computed given the number of characters the network failed to predict correctly and the total length of the sequence.

\subsection{Attractors}

Following the instructions in the original article, we run the WM model 7 times, each time with a different sequence with no bracket, and forcing the WM-unit to a fixed bracket level (\textit{k} = 0 for the first, \textit{k} = 1 for the second, etc...). Each sequence has a length of 6500 characters, for about 45,000 network updates in total. We collect in each case both the reservoir states and the input units. Then, every sets of reservoir states (resp. input vectors) are concatenated, and their first principal components (or PCs) are computed. Finally, for each of the 7 original sets, the first PC of the inputs is plotted against the first two PCs of the reservoir states.

\subsection{Implementation choices}

In the original article very few parts were unclear. Pascanu and Jaeger briefly explain how they choose to generate the input, but did not specify the exact method and tools they used to implement it. This subsection aims at listing out the choices we made and the tools we used to obtain similar results than the original paper.

\subsubsection{Language and libraries}

Since the language used for the former model was not specified, we decide to use Python (3.7.4) to implement our model.
The article did not specify which tools they used to transform their symbolic sequence into an image.
Thus, we choose to use the libraries \href{https://pillow.readthedocs.io/en/stable/}{\textit{PIL}}, \href{https://github.com/rougier/freetype-py}{\textit{FreeType}} and \href{https://www.scipy.org/}{\textit{SciPy}} for this purpose.

\subsubsection{Input sequence alphabet}
\label{s:input_gen2}

In the original paper Pascanu and Jageger did not specify which exact characters they used for their 65 symbols, and therefore not the exact order of this alphabet. For this, we decide to create our own, as shown on \textbf{Table \ref{tab:alphabet}}. We can observe in \textbf{Table \ref{tab:sequence_example}} an input sequence example in order to further understand the behaviour of the input generation algorithm with our alphabet.

\begin{table}[!ht]
    \centering
    \begin{tabular}{|c|}
        \hline
        \textbf{Alphabet sequence order} \\ \hline \hline
        abcdefghijklmnopqrstuvwxyz0123456789\ !"\#\$\%\&'()*+,.-\_/:;<=>?@€|$[]$§\\ \hline % abcdefghijklmnopqrstuvwxyz0123456789 !\"#$%&'()*+,.-_/:;<=>?@|€[]§
    \end{tabular}
    \caption{Order of alphabet for data generation.}
    \label{tab:alphabet}
\end{table}

\begin{table}[!ht]
    \centering
    \begin{tabular}{|c|}
        \hline
        \textbf{Input sequence example} \\ \hline \hline
        abc\{eg\textcolor{red}{0}24\{7\{!\textcolor{red}{o}sw0\textcolor{red}{-}\}:=\{\{\textcolor{red}{f}kp\\ \hline
    \end{tabular}
    \caption{Example of input sequence. Each character in red corresponds to a randomly chosen character which does not depend on the current character and the memory states (with a probability of 20\%). Use \textbf{Table \ref{tab:alphabet}} to understand how the input is selected 80\% of the time depending on the bracket level (i.e. when the characters are in black).}
    \label{tab:sequence_example}
\end{table}

\subsubsection{Font}

We have not been able to find the fonts used in the original model (\textit{FreeMono}, \textit{FreeMono Bold}, \textit{FreeMono Oblique} and FreeMono Bold Oblique of \href{https://gimp.software/2018/11/13/download-gimp-2-3-6/}{Gimp 2.3.6}).
Therefore, we try in the first place to use these \href{https://www.fontspace.com/gnu-freefont/freemono}{\textit{FreeMono}} (classic, oblique, bold and bold oblique) fonts.
However, as we encounter more errors than in the original paper, we use the \href{https://fonts.google.com/specimen/Inconsolata}{\textit{Incosolata}} (regular and bold) fonts distributed by Google, which give far better results.

\begin{figure}[h]
    \centering
    \includegraphics[width = \linewidth]{data/input_freemono.png}
    \includegraphics[width = \linewidth]{data/input_inconsolata.png}
    \caption{Images example of a sequence using 2 different set of fonts. The first image is computed using \textit{FreeMono}, the second is using \textit{Inconsolata}.}
    \label{fig:input_imgs}
\end{figure}

\subsubsection{Noise}

Pascanu and Jaeger did not specify in the original the probability of the salt-and-pepper noise. Thus, we tried a salt-and-pepper noise of amplitude 0.1, and probability 1. \\

\subsubsection{Warm up in Principal Component Analysis}

We can observe that for each memory state the first few points do not necessarily gather with their cluster. Thus, the first 100 time steps are removed from display only for clarity purposes.

\section{Results}
\label{s:result}

\subsection{Network}
According to the former article, the experiment has been run over 30 runs for the network.
We assume that each time, it uses different randomly generated training and testing sequences, and reservoir, input and feedback weights. Those 30 runs are then used to compute mean and standard deviation of different performance measures. In the following Tables we use the color light green for the \textit{FreeMono}\footnote{Seed used for results using \textit{FreeMono}: \textit{1639617780}} fonts (first row on result tables), dark green for \textit{Inconsolata}\footnote{Seed used for results using \textit{Inconsolata}: \textit{3939310522}} (second row), and black for their former results (third row). \\
\\
First, as they did in the original paper we inspect the WM-units performance.
We dissociate the errors made by the WM-units into false negative errors (when the network did not recognize a curly bracket as such) and false positive errors (when the network detects the character as a curly bracket while it is not).
These errors are counted, and then transformed into three different percentages, depending on the number of curly brackets in the sequence, the number of characters, or the number of time steps (i.e. length of the input image in pixels). The \textbf{Table \ref{tab:errors_wm}} shows the results obtained. \\
\\

\begin{table}[!ht]
    \centering
    \begin{tabular}{|C{23mm}|C{20mm}|C{22mm}|C{24mm}|C{24mm}|}
        \hline
        Type of error & Number of errors & Percentage of curly brackets ($\%$) & Percentage of characters ($\%$) & Percentage of time steps ($\%$) \\
        \hline
        \multirow{3}{*}{false negatives} & \textcolor{mygreen}{$54.7 \pm 6.6$} & \textcolor{mygreen}{$3.01 \pm 0.35$} & \textcolor{mygreen}{$0.16 \pm 0.020$} & \textcolor{mygreen}{$0.022 \pm 0.003$} \\
        & \textcolor{mygreen2}{$0.2 \pm 0.4$} & \textcolor{mygreen2}{$0.01 \pm 0.02$} & \textcolor{mygreen2}{$0 \pm 0.001$} & \textcolor{mygreen2}{$0 \pm 0$} \\
        & $7.2 \pm 6.5$ & $0.34 \pm 0.30$ & $0.02 \pm 0.018$ & $0.003 \pm 0.002$ \\ \hline

        \multirow{3}{*}{false positives} & \textcolor{mygreen}{$1252.6 \pm 48.5$} & \textcolor{mygreen}{$68.97 \pm 2.44$} & \textcolor{mygreen}{$3.77 \pm 0.148$} & \textcolor{mygreen}{$0.511 \pm 0.020$} \\
        & \textcolor{mygreen2}{$97.2 \pm 34.5$} & \textcolor{mygreen2}{$5.37 \pm 1.89$} & \textcolor{mygreen2}{$0.29 \pm 0.104$} & \textcolor{mygreen2}{$0.040 \pm 0.014$} \\
        & $59.8 \pm 21.6$ & $2.84 \pm 1.02$ & $0.17 \pm 0.061$ & $0.024 \pm 0.008$ \\ \hline

        \multirow{3}{*}{total} & \textcolor{mygreen}{$1307.3 \pm 49.3$} & \textcolor{mygreen}{$71.98 \pm 2.44$} & \textcolor{mygreen}{$3.94 \pm 0.151$} &  \textcolor{mygreen}{$0.534 \pm 0.020$} \\
        & \textcolor{mygreen2}{$97.4 \pm 34.6$} & \textcolor{mygreen2}{$5.37 \pm 1.89$} & \textcolor{mygreen2}{$0.29 \pm 0.104$} & \textcolor{mygreen2}{$0.040 \pm 0.014$} \\
        & $67.0 \pm 22.9$ & $3.18 \pm 1.09$ & $0.19 \pm 0.065$ & $0.027 \pm 0.009$ \\ \hline

    \end{tabular}
    \caption{Number of erroneous WM states obtained by the ESN, averaged over 30 runs. Colour light green is used for results using \textit{FreeMono} as font, dark green for \textit{Inconsolata}, and black for the original results.}
    \label{tab:errors_wm}
\end{table}

Then we look at the characters falsely identified as curly brackets. The \textbf{Table \ref{tab:false_positives}} shows how the characters highlighted in the original experiment are falsely identified as curly brackets.

\begin{table}[!ht]
    \centering
    \begin{tabular}{|C{15mm}|C{32mm}|C{32mm}|C{32mm}|}
        \hline
        Character & Number of times the character is in testing sequences & Number of times the counter increased & Number of times the counter decreased \\ \hline \hline

        \multirow{3}{*}{"("} & \textcolor{mygreen}{$508.7 \pm 23.8$} & \textcolor{mygreen}{$128.07 \pm 14.08$} & \textcolor{mygreen}{$3.8 \pm 2.0$} \\
        & \textcolor{mygreen2}{$514.2 \pm 23.7$} & \textcolor{mygreen2}{$93.40 \pm 34.50$} & \textcolor{mygreen2}{$0 \pm 0$} \\
        & $499.5 \pm 22.3$ & $21.5 \pm 10.1$ & $0 \pm 0$ \\ \hline

        \multirow{3}{*}{")"} & \textcolor{mygreen}{$516.7 \pm 19.7$} & \textcolor{mygreen}{$12.10 \pm 4.21$} & \textcolor{mygreen}{$3.9 \pm 1.7$} \\
        & \textcolor{mygreen2}{$516.8 \pm 18.2$} & \textcolor{mygreen2}{$0 \pm 0$} & \textcolor{mygreen2}{$0.3 \pm 0.7$}\\
        & $502.4 \pm 18.6$ & $0 \pm 0$ &  $0.5 \pm 0.2$ \\ \hline

        \multirow{3}{*}{"["} & \textcolor{mygreen}{$513.1 \pm 18.8$} & \textcolor{mygreen}{$191.83 \pm 28.71$} & \textcolor{mygreen}{$3.8 \pm 1.6$} \\
        & \textcolor{mygreen2}{$507.9 \pm 15.6$} & \textcolor{mygreen2}{$0 \pm 0$} & \textcolor{mygreen2}{$0 \pm 0$}\\
        & $496.2 \pm 22.8$ & $5.8 \pm 5.1$ & $6.0 \pm 5.4$ \\ \hline

        \multirow{3}{*}{"]"} & \textcolor{mygreen}{$509.6 \pm 18.3$} & \textcolor{mygreen}{$9.53 \pm 3.58$} & \textcolor{mygreen}{$3.0 \pm 1.4$}\\
        & \textcolor{mygreen2}{$514.4 \pm 18.3$} & \textcolor{mygreen2}{$0.13 \pm 0.34$} & \textcolor{mygreen2}{$0 \pm 0$}\\
        & $501.3 \pm 15.1$ & $0.05 \pm 0.03$ & $6.0 \pm 5.4$ \\ \hline

        \multirow{3}{*}{"@"} & \textcolor{mygreen}{$507.0 \pm 20.8$} & \textcolor{mygreen}{$10.13 \pm 2.84$} & \textcolor{mygreen}{$3.9 \pm 2.1$} \\
        & \textcolor{mygreen2}{$508.8 \pm 22.5$} & \textcolor{mygreen2}{$0 \pm 0$} & \textcolor{mygreen2}{$0 \pm 0$} \\
        & $492.7 \pm 21.3$ & $25.1 \pm 14.1$ & $0.2 \pm 0.1$ \\ \hline

        \multirow{3}{*}{other} & \multirow{3}{*}{-} & \textcolor{mygreen}{$656.23 \pm 30.19$} & \textcolor{mygreen}{$226.2 \pm 22.5$} \\
        & & \textcolor{mygreen2}{$3.13 \pm 2.03$} & \textcolor{mygreen2}{$0.2 \pm 0.6$} \\
        & & $0.05 \pm 0.04$ & $0.6 \pm 0.5$ \\ \hline
    \end{tabular}
    \caption{Trigger characters for false positives, averaged over 30 runs. Colour light green is used for results using \textit{FreeMono} as font, dark green for \textit{Inconsolata}, and black for the original results.}
    \label{tab:false_positives}
\end{table}

As in the former article, we measure the average absolute value of $\mathbf{W^{mem}}$ weights over the 30 runs, which can be observed in \textbf{Table \ref{tab:wmem}}. \\
\\

\begin{table}[!ht]
    \centering
    \begin{tabular}{|c|C{35mm}|}
        \hline
        \begin{tabular}[c]{@{}c@{}}considered weights\end{tabular} & \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}average absolute value\end{tabular}}\\ \hline \hline

        \multirow{3}{*}{input to WM-units weights} &
        \textcolor{mygreen}{$0.3395 \pm 0.2975$} \\
        & \textcolor{mygreen2}{$0.2834 \pm 0.2445$} \\
        & $0.2327 \pm 0.1813$ \\ \hline

        \multirow{3}{*}{reservoir to WM-units weights} &
        \textcolor{mygreen}{$0.0971 \pm 0.0920$} \\
        & \textcolor{mygreen2}{$0.0852 \pm 0.0782$} \\
        & $0.0667 \pm 0.0591$ \\ \hline

        \multirow{3}{*}{WM-units to WM-units weights} &
        \textcolor{mygreen}{$0.9217 \pm 0.6893$} \\
        & \textcolor{mygreen2}{$0.7003 \pm 0.5436$} \\
        & $0.5825 \pm 0.5627$ \\ \hline

    \end{tabular}
    \caption{Average learned output weights of the ESN over 30 runs. Colour light green is used for results using \textit{FreeMono} as font, dark green for \textit{Inconsolata}, and black for the original results.}
    \label{tab:wmem}
\end{table}

As we can see in \textbf{Tables \ref{tab:errors_wm} and \ref{tab:false_positives}}, by using the \textit{FreeMono} font we obtain way more errors in the WM-unit than in the original paper. However by using the \textit{Inconsolata} font we obtain similar results. \\
\\
Finally, we compute the average error rate for the prediction made in the output units. We count only the errors in the middle of the presentation of a character that is not a curly bracket, as the target is defined only during these time steps.
Over the 30 runs, with the \textit{Freemono} font we find an error rate of \textbf{26.02 $\pm$ 0.32\%}, for \textbf{24.83 $\pm$ 0.27\%} in the former article. With the \textit{Inconsolata} font we obtain an error rate of \textbf{22.22 $\pm$ 0.25\%}. These three results are very similar. \\
\\
It is important to note that, during our various testing, and as in the original model, the network never changes the WM-units to an invalid state or by increasing or decreasing the counter by more than one, attesting their assumption that any error would be the result of misclassification of a character (as expected), and not any other subprocesses of the WM-units.

\subsection{Attractors}

As in the original paper, for both \textit{Freemono} and \textit{Inconsolata} font we can see clusters of points in the first two principal components(see dark projection in \textbf{Figure \ref{fig:PCA}}). Each of this cluster seems to be an attractor (as they defined in the original paper) associated to a memory state. It is stable against the characters that are not curly brackets, and the curly brackets makes it move from one to the other.

\begin{figure}[h]
    \centering
    \includegraphics[width = .45\linewidth]{data/FreeMono_PCA.png}
    \includegraphics[width = .45\linewidth]{data/Inconsolata_PCA.png}
    \caption{Principal Component Analysis results. Each coloured column represents the several reservoir states for each memory states in the form of attractors, with \textit{FreeMono} results on the left, and \textit{Inconsolata} on the right. For each memory states we do not display the first 100 points. We can observe that the points for the different working memory states are clustered much more clearly than in the original article, spanning a much larger range. However, being only a quantitative difference, the results stay very similar from the original}
    \label{fig:PCA}
\end{figure}

\section{Conclusion}

Considering the original tools were not sourced, we needed to use our own tools, whether it be for the language, the fonts but also for the input generation, which could easily justify the differences between the original results and the ones found in this replication. However, these differences also highlight the fact that this model is really modular and consistent, giving similar results despite the differences in fonts and error rates. \\
\\
In the end, we consider that we have been able to successfully replicate the result obtained by Pascanu and Jaeger in \textit{A Neurodynamical Model for Working Memory}.
%With the same ESN-based model (i.e. mainly composed of random connections)
Very few information were missing in the original paper, such as the input generation methods from string to image they used, a more precise definition of the noise they added or the ASCII characters alphabet they used.


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

\marginpar{Wednesday\\ 2021-11-10, \\ compiled \\ \today}

Regarding books, the course is a synthesis of several topics, so many books cover them but they also include lots of other material.

For plasma physics, ``Plasma physics for astrophysics'' by Russel M.\ Kulsrud.

For transport, ``Astrophysics of cosmic rays''.

\section{Basics of plasma physics}

From the microphysical point of view, cosmic rays are just electric charges moving in a plasma, which they in turn  affect.

Loosely, a plasma is ionized gas; however the interstellar medium is also at temperatures of \SI{e4}{K} to \SI{e6}{K}, this is also true for the intergalactic medium, which has a much lower density and similar temperatures,

This also applies to the medium in clusters, which has a higher temperature, of the order of \SI{e8}{K} but lower densities, \SI{e-3}{cm^{-3}}.

Magnetic fields are sourced by currents, which cosmic rays affect.
Electric fields, on the other hand, are ``short-circuited'' since the conductivity is very large.

If it is difficult to have an electric field, how can particles be accelerated?
We will simply assume that cosmic rays, which are non-thermal, exist.

First, though, we will try to understand how the plasma works, then we will look at the non-thermal particles, and finally we will put them together.

For simplicity, let us consider a plasma made of protons (with density \(n_i\)) and electrons (with density \(n_e\)).
Maxwell' equations will read
%
\begin{subequations}\label{eq:maxwell}
\begin{align}
\vec{\nabla} \cdot \vec{E} &= 4 \pi \zeta  \\
\vec{\nabla} \cdot \vec{B} &= 0  \\
\vec{\nabla} \times \vec{E} &= - \frac{1}{c} \pdv{\vec{B}}{t}  \\
\vec{\nabla} \times \vec{B} &= \frac{4 \pi }{c} \vec{J} + \frac{1}{c} \pdv{\vec{E}}{t}
\,,
\end{align}
\end{subequations}
%
where \(\zeta = n_i e - n_e e\), while the current reads \(\vec{J} = n_i e \vec{v}_i - n_e e \vec{v}_e\).

The interactions between these will be Coulomb ones.
At thermal equilibrium, we will have charge neutrality, so \(n_i = n_e = n_0\).

\paragraph{Screening}

Suppose we add a positive charge in a neutral medium, at \(\vec{r} = 0\).
Then, the divergence of \(\vec{E}\) will be
%
\begin{align} \label{eq:electric-field-perturbation}
\vec{\nabla} \cdot \vec{E} = 4 \pi n_i e - 4 \pi n_e e + 4 \pi e \delta (\vec{r})
\,,
\end{align}
%
where the tilde means that the densities are perturbed.

We will assume that the perturbation induced by this is small. The potential energy drop of a particle at a distance \(d\) from another is \(e^2 / d\), so if we assume \(e^2 / d \ll k_B T\) the thermal background remains fixed, and is not ``broken'' by Coulomb interactions.
The typical distance between particles will be \(d \sim n_0^{-1/3}\), so the weak perturbation condition will read \(e^2 n_0^{1/3} \ll k_B T\).

What we want to do now is to solve this equation \eqref{eq:electric-field-perturbation} for the electric field.

In order to do so, we need to discuss the dependence of the phase space distribution on the energy of each particle, which we call \(\epsilon \).
At zeroth order, we will have
%
\begin{align}
\widetilde{n}_i = n_0 \exp(- \frac{\epsilon}{k_B T})
\,,
\end{align}
%
which we assume, on mesoscopic scales, to average out to \(\expval{e^{- \epsilon / k_B T}} = 1\).
In the following discussion we apply this mesoscopic approximation by setting \(\epsilon \equiv k_B T\), but we do leave in the external perturbation to the potential.

The external potential will perturb the energy \(\epsilon \) by \(e \varphi \) where \(\varphi \) is the electric potential, so
%
\begin{subequations}
\begin{align}
\widetilde{n}_i &= n_0 \exp(\frac{- \epsilon + e \varphi }{k_B T})  \\
\widetilde{n}_e &= n_0 \exp(\frac{- \epsilon - e \varphi }{k_B T})
\,,
\end{align}
\end{subequations}
%
and we can use \(\vec{E} = - \vec{\nabla} \varphi \): then, for \(r \neq 0\) we will have
%
\begin{align}
\vec{\nabla}^2 \varphi =
- 4 \pi e n_0 \exp(- \frac{\epsilon }{k_B T})
\exp( - \frac{e \varphi }{k_B T})
+ 4 \pi e n_0 \exp(- \frac{\epsilon }{k_B T}) \exp( \frac{e \varphi }{k_B T})
\,,
\end{align}
%
which we can expand up to linear order:
%
\begin{subequations}
\begin{align}
\vec{\nabla}^2 \varphi &=
- 4 \pi e n_0 \exp(- \frac{\epsilon }{k_B T})
\qty( \exp(- \frac{e \varphi }{k_B T}) - \exp(\frac{e \varphi }{k_B T}))  \\
&\approx
- 4 \pi e n_0 \exp(- \frac{\epsilon }{k_B T})
\qty(1 - \frac{e \varphi }{k_BT} - 1 - \frac{e \varphi }{k_B T})  \\
&=
8 \pi e \underbrace{n_0 \exp(- \frac{\epsilon }{k_B T})}_{ = n_0 }
\frac{e }{k_B T} \varphi
\,.
\end{align}
\end{subequations}

The prefactor had the dimensions of an inverse square length; further, we include the exponential \(e^{- \epsilon / k_BT}\) into the unperturbed density \(n_0 \).

\begin{extracontent}
We are being a bit cavalier in the distinction between the phase space density \(f(\vec{x}, \vec{p})\) and the spatial number density \(n(\vec{x})\).

Roughly speaking, the first is defined so that its integral over all of \(\dd[3]{x} \dd[3]{p}\) yields the total number of particles, while for the second the integral need only be done over \(\dd[3]{x}\).
We can recover the number density by integrating the phase space density: specifically, the correct normalization in natural units reads
%
\begin{align}
n(\vec{x}) = \frac{g}{(2 \pi )^3} \int f(\vec{x}, \vec{p}) \dd[3]{p}
\,,
\end{align}
%
where \(g\) is the number of helicity states of the particle at hand.

The isotropic Maxwellian phase space distribution (which approximates both the Bose-Einstein and Fermi ones) reads \(f(\vec{x}, \vec{p}) = \exp(- \epsilon (\vec{p}) / k_B T)\), where \(\epsilon (\vec{p}) = \sqrt{m^2 + \vec{p}^2}\) is the energy corresponding to the momentum \(\vec{p}\).

The way the specific integral is computed for this density does not really matter (and is actually rather complicated in general), but we call the result \(n_0 \) --- it is independent of \(\vec{x}\), since the phase space density is as well.

Now, we insert an external potential energy term to the \emph{phase space} density, mapping \(\epsilon \to \epsilon + U(\vec{x})\) (which for us will be \(U(\vec{x}) = - e \varphi (\vec{x})\)). The integral then reads
%
\begin{align}
n(\vec{x}) = \frac{g}{(2 \pi )^3} \int \exp(- \frac{\epsilon }{k_B T}) \exp(- \frac{U(\vec{x})}{k_B T}) \dd[3]{p} = n_0 \exp(- \frac{U(\vec{x})}{k_B T})
\,.
\end{align}
\end{extracontent}

We define the \textbf{Debye length}
%
\begin{align}
\lambda _D = \qty(\frac{k_B T}{8 \pi n_0 e^2})^{1/2}
\,,
\end{align}
%
in terms of which (with the assumption of spherical symmetry for our problem) the equation reads
%
\begin{align}
\nabla^2\varphi = \frac{1}{r^2} \pdv{r} \qty(r^2 \pdv{\varphi }{r})
= \frac{1}{\lambda _D^2} \varphi
\,,
\end{align}
%
which is solved by looking at \(f = r \varphi \): then,
%
\begin{align}
\dv[2]{f}{r} = \frac{f}{\lambda _D^2}
\,,
\end{align}
%
which means \(f = A \exp(- r / \lambda _D)\) (we discard the unphysical, exponentially diverging solution).
Inserting back our particle boundary condition to fix \(A\), we get
%
\begin{align}
\varphi = \frac{e}{r} \exp(- \frac{r}{\lambda _D})
\,.
\end{align}

This is physically meaningful: there is a \textbf{screening effect} on charges, on length scales of \(\lambda _D\).

For this to happen, however, we need to have enough charges to screen the inserted one: the number of particles in the Debye volume, \(\sim n_0 \lambda _D^3\), must be much larger than 1.
In a way, this is also a mesoscopic statistical requirement.

This can be written as
%
\begin{align}
n_0 \frac{(k_BT)^{3/2}}{( 8 \pi e^2)^{3/2} n_0^{3/2}}
= \frac{(k_BT)^{3/2}}{( 8 \pi e^2)^{3/2} n_0^{1/2}}
\gg 1
\,,
\end{align}
%
which shows that, counter-intuitively, this condition is easier to fulfill for under-dense plasmas.

The path length for Coulomb scattering, \(\lambda _C\), should be much larger than both \(\Delta r \approx n^{-1/3}\) (the separation between particles) and \(\lambda _D\).

It can be estimated by
%
\begin{align}
\lambda _C = \frac{1}{n_0 \sigma _C} = \frac{(k_B T)^2}{n_0 e^{4}} \gg n^{-1/3}
\,,
\end{align}
%
where \(e^2 / b = k_B T\) gives us a limit for the Coulomb interaction length, therefore \(\sigma _C \approx b^2 \approx (e^2 / k_B T)^2\).

\begin{extracontent}
It can be shown that \(\lambda _C \gg \lambda _D\) is equivalent to the condition that many particles should be contained in a single Debye length: the condition reads
%
\begin{align}
\lambda _C = \frac{(k_B T)^2}{n_0 e^{4}} &\gg \sqrt{\frac{k_B T}{8 \pi n_0 e^2}} = \lambda _D   \\
(8 \pi)^2 n_0 \qty(\frac{k_B T}{8 \pi n_0 e^2})^2 &\gg  \qty( \frac{k_BT}{ 8 \pi n_0 e^2})^{1/2}  \\
\lambda _D^3 &\gg \frac{1}{(8 \pi )^2 n_0 }
\,.
\end{align}
\end{extracontent}

Collective effects dominate the dynamics of a plasma, while the effect of a single charge quickly becomes negligible.

\paragraph{Propagation modes in a plasma}

We will now do an exercise in perturbation theory: which perturbations are allowed, beyond electromagnetic waves?
Certain modes are ``allowed'', in that they do not die out.

A lot of interesting physics come from the fact that each particle interacts with the collection of all the others.

Perturbations which are unstable are interesting, but they break our perturbative approach.

The fields in Maxwell's equations \eqref{eq:maxwell} are assumed to start out at zero in the unperturbed configuration.

The current \(J\) is given by the Generalized Ohm's law:
%
\begin{align}
J_r = \sigma_{rs} E_s
\,,
\end{align}
%
where the proportionality constant \(\sigma _{rs}\) is the \emph{conductivity tensor} (whose components are, roughly, 1 over resistance).

It is also convenient to define the displacement current \(\vec{D}\) by:
%
\begin{align}
\frac{4 \pi \vec{J}}{c} + \frac{1}{c} \pdv{\vec{E}}{t} = \frac{1}{c} \pdv{\vec{D}}{t}
\,,
\end{align}
%
which means that the current can be recovered by
%
\begin{align}
\vec{J} = \frac{1}{4 \pi } \qty(\pdv{\vec{D}}{t} + \pdv{\vec{E}}{t})
\,.
\end{align}

The idea is to decompose the perturbation in Fourier modes:
%
\begin{align}
 \vec{E} \to \widetilde{E}_k (\vec{k}, \omega ) \exp(- i \omega t + i \vec{k} \cdot \vec{r})
\,.
\end{align}

The full expression for the electric field is a superposition of these modes, but we can look at them just one at a time.
This simplifies things: time derivatives become \(i \omega \), curls become \(\vec{k} \times \) and so on.

The current reads, with this as well as Ohm's law,
%
\begin{align}
\widetilde{J} _r = \frac{- i \omega }{4 \pi } \qty(\widetilde{D}_r - \widetilde{E}_r) = \sigma_{rs} E_s
\,.
\end{align}

The displacement field is therefore
%
\begin{align}
\widetilde{D}_r
= \frac{4 \pi }{ i \omega } \qty(\frac{i \omega }{ 4 \pi } \widetilde{E}_r - \sigma_{rs} E_s) = \widetilde{E}_r
+ i \frac{4 \pi }{\omega } \sigma_{rs} \widetilde{E}_s
= \mathbb{K}_{rs} \widetilde{E}_s
\,,
\end{align}
%
where \(\mathbb{K}_{rs} = \delta_{rs} + (4 \pi i / \omega ) \sigma_{rs}\) is called the \textbf{Dielectric tensor}.

What we are trying to do is to write a \emph{dispersion relation}, \(F(\vec{k}, \omega ) E = 0\).

Now we move to Lenz's law: we take another curl, to get
%
\begin{subequations}
\begin{align}
\vec{\nabla} \times (\vec{\nabla} \times \vec{E}) &= - \frac{1}{c} \pdv{}{t} \qty(\vec{\nabla} \times \vec{B})   \\
&= - \frac{1}{c} \pdv{}{t} \qty( \frac{1}{c}\pdv{\vec{D}}{t})  \\
&= - \frac{1}{c^2} \pdv[2]{\vec{D}}{t}  \\
[- \vec{k} \times (\vec{k} \times \widetilde{E})]_r &= + \frac{\omega^2}{c^2} \widetilde{D}_r = \frac{\omega^2}{c^2} \mathbb{K}_{rs} \widetilde{E}_s
\,.
\end{align}
\end{subequations}

We are almost done: the only issue here is that \(\mathbb{K}_{rs}\) contains the conductivity tensor \(\sigma_{rs}\).

Supposing for simplicity  that our plasma is non-relativistic, we have the EoM
%
\begin{align}
m_e \dv{v_e}{t} = - e E \implies
- i \omega m_e \widetilde{v}_e = - e \widetilde{E}
\,,
\end{align}
%
but the current \(\vec{J}\) is \(\vec{J} = - e n_e \vec{v}_e\), so \(\widetilde{J}_r = - (n e^2 / \omega m_e) \widetilde{E}_r\), therefore the conductivity reads
%
\begin{align}
\sigma_{rs} = \frac{i n e^2}{\omega m_e} \delta_{rs}
\,,
\end{align}
%
so we can write out the dielectric tensor explicitly:
%
\begin{align}
\mathbb{K}_{rs} = \delta_{rs} \qty[ 1 - \qty(\frac{\omega_p}{\omega })^2]
\qquad \text{where} \qquad
\omega_p = \sqrt{\frac{ 4 \pi n_e e^2}{m_e}}
\,
\end{align}
%
is called the plasma frequency.
% This is a \textbf{high-pass filter}!

We have found our dispersion relation:
%
\begin{align}
\vec{k} \times \qty(\vec{k} \times \vec{E})
+ \qty(\frac{\omega^2 - \omega _p^2}{c^2}) \widetilde{E} = 0
\,.
\end{align}

Let us separate out \emph{longitudinal perturbations}, which have \(\vec{k} \propto \vec{E}\), from \emph{transverse} ones, since we are always able to write \(\vec{E} = \vec{E}_\parallel + \vec{E}_\perp\).

In the \textbf{longitudinal case},
%
\begin{align}
(\omega^2 - \omega _p^2) E_{\parallel} = 0
\,,
\end{align}
%
which means that the propagation must happen exactly at the plasma frequency: these are called \textbf{Langmir waves}, or plasma waves.
In the transverse case, we get
%
\begin{align}
\qty[ - k^2 c^2 + (\omega^2 - \omega _p^2)] E_\perp = 0
\,.
\end{align}

The pulsation must be
%
\begin{align}
\omega^2 = \omega _p^2 + c^2 k^2
\qquad \text{or} \qquad
k^2 = \frac{\omega^2 - \omega^2_p}{c^2}
\,.
\end{align}

If \(\omega > \omega _p\), then \(k^2 > 0 \): these are allowed perturbations, which indeed exhibit oscillatory behavior.

Actually, we can compute their group velocity
%
\begin{align}
v_g = \pdv{\omega }{k} = c \qty(1 - \frac{\omega_p^2}{\omega^2})^{1/2}
\,,
\end{align}
%
which shows that if \(\omega \gg \omega _p\) the speed is close to \(c\).

If \(\omega < \omega _p\), on the other hand, \(k\) is imaginary.
The solution corresponding to exponential growth is unphysical (for one, there is no mechanism providing the energy for the magnitude of the oscillation to exponentially grow), so we only look at the exponentially damped solutions.

They are exponentially damped over a scale \(\abs{\vec{k}}^{-1} = c / \omega _p\).
This is the \textbf{skin depth} of the plasma, the largest distance a perturbation can penetrate in the plasma if it oscillates too slowly.

This characteristic wavelength's ratio to the Debye length reads
%
\begin{align}
\frac{\lambda _{\text{skin depth}}}{ \lambda _{\text{Debye}}}
= \sqrt{\frac{m_e c^2}{4 \pi n_e e^2} \frac{8 \pi n_e e^2}{k_B T}}
= \sqrt{\frac{2 m_e c^2}{k_B T}} \gg 1
\,,
\end{align}
%
since the plasmas we are considering are typically non-relativistic.

\paragraph{An example: fast radio bursts}

Fast radio bursts are like \(\gamma \)-ray bursts in the radio band.
These are relatively high-frequency, around \SI{1.4}{GHz}.
We do not really know what their sources are; some were false positives due to microwave ovens making lunch, but others were certified to be true detections.

We know of one which came from a galaxy \(L \sim \SI{1}{Gpc}\) away, and which had a dispersion of about \(\Delta \omega \sim \SI{300}{MHz}\).

Photons of different frequencies arrived at different times, with a spread of about \SI{300}{ms}.

We are in the second case (\(\vec{k} \perp \vec{E}\)) since they are EM waves.
The group velocity is, again
%
\begin{align}
v_g = c \qty[ 1 - \qty(\frac{\omega _p}{\omega})^2]^{1/2}
\,,
\end{align}
%
and we can assume (we will check \emph{a posteriori}) that \(\omega \gg \omega _p\).

The time difference will be
%
\begin{subequations}
\begin{align}
\Delta t &= \frac{L}{v_g (\omega)} - \frac{L}{v_g (\omega + \Delta \omega )}
\approx \frac{L}{v_g(\omega )} \frac{1}{v_g(\omega )}\pdv{v_g}{\omega } \Delta \omega  \\
&\approx \frac{L}{c^2} \underbrace{c \frac{\omega _p^2}{\omega^3}}_{\approx \pdv*{v_g}{\omega }} \Delta \omega \\
\omega _p &\approx \sqrt{\frac{ c \omega^3 \Delta t}{L \Delta \omega }}
\,,
\end{align}
\end{subequations}
%
but we know that
%
\begin{align}
\omega _p^2 = \frac{ 4 \pi n_e e^2}{m_e}
\,.
\end{align}

This allows us to measure \(\omega _p \sim \SI{5.2}{Hz}\), and therefore also the density, which comes out to be \(n_e \sim \SI{8.2e-09}{cm^{-3}}\).
% This corresponds with the \(\Omega _b\) from CMB observations (?)

\begin{extracontent}
How well does this match the baryon density computed from the CMB?
The computation goes
%
\begin{align}
\underbrace{\underbrace{\frac{\omega _p^2 m_e}{4 \pi e^2}}_{n_e} m_p}_{\rho _{\text{plasma}}} \times \frac{1}{\Omega _{0b} \rho _c} \approx 0.03
\,.
\end{align}

Therefore, from this observation we can estimate that about \SI{3}{\percent} of baryonic matter is in the ISM.

This can be generalized a bit: maybe, not all the path \(L\) from the source to here had this much plasma in it.
Suppose, for simplicity's sake, that a fraction \(\alpha \) of the path was constituted by uniform-density plasma.

Then, our estimate for \(\omega _p\) will be multiplied by a factor \(\alpha^{-1/2}\), while our estimate for \(n_e\) will be multiplied by \(\alpha^{-1}\).
On the other hand, in the estimate for \(\rho _{\text{plasma}}\), averaged over the whole universe, will need to be shifted by some factor.

If the path we were looking at is a fair sample for the population (not a given, but let's approximate as such), then about a fraction \(\alpha \) of the universe is filled with this plasma --- this precisely cancels the correction to our estimate, so it all works out.

This is done in a better way through the measurement of several pulsars for which we have more accurate distance measurements.
\end{extracontent}

\todo[inline]{Check: the frequency given was \(\nu \), not \(\omega \)!}

\end{document}


\chapter{Identical particles}
\section{Introduction}
\textbf{Identical particles}\\
Particle having same intrinsic properties (mass, charge, spin) as known as identical particles. There are two types of identical particles i.e.
\begin{enumerate}
	\item Classical identical particle(Distiquishable particles)\\
	Volume available for a gas molecule at NTP is $\sim 10^{-25} \mathrm{~m}^{3}$ and volume of single gas molecule $\sim 10^{-30} \mathrm{~m}^{3}$ So, we can identify every molecule of the gas. Hence, gas molecules are distinguishable.
	\item Quantum identical particle(indistiquishable)
	Volume available for each electron taking part in conduction within the metals is $\sim 10^{-28} \mathrm{~m}^{3}$ but the volume of a single electron is $\sim 10^{-27} \mathrm{~m}^{3}$. This shows that the electron wave functions overlap considerably and hence cannot be identified separately, i.e. they are indistinguishable.
\end{enumerate}
\begin{note}
	For a system of 'n' indistinguishable particles say electrons, we may be able to specify their positions, but it is not possible to say which electron is at a particular position. Therfore, interchanging the coordinates of any two electrons does not change the Hamiltonian. In other words, the Hamiltonian of the system is symmetric in coordinates of the particles i.e.
	$$
	\hat{H}\left(x_{1}, x_{2}, x_{3} \ldots \ldots x_{i}, x_{i+1}, \ldots x_{n}\right)=\hat{H}\left(x_{1}, x_{2}, x_{3} \ldots \ldots x_{i+1}, x_{i}, \ldots x_{n}\right)
	$$
	\end{note}
\textbf{Particle exchange operator}\\
$\text { This operator exchanges the particle in pair (both position and spin co-ordinates). }$
\begin{note}
	$\text { (i) Particle exchange operator is a hermitian operator. }$\\
	(ii) Since particles are indistinguishable, any operator representing a physical property of the sys tem must be symmetric w.r.t the particle exchange. Therefore, any operator representing a physical property commute with the particle exchange operator.
\end{note}
\subsection{ Symmetric wave function:}
A wave function is said to be symmetric if interchange of any pair of particles leaves the wave function unchanged.
$$
\psi_{\mathrm{s}}(1,2, \ldots . \mathrm{i}, \mathrm{j} \ldots \mathrm{N})=\psi_{\mathrm{s}}(1,2 \ldots \ldots . \mathrm{j}, \mathrm{i}, \ldots . . \mathrm{N})
$$
The particles having symmetric wave function obey BE statistics and known as bosons.
Example: Photons (spin 1), neutral helium (spin 0), $\alpha$-particle (spin 0), deutron (spin 1)\\
\subsection{ Anti-symmetric wave function:}
A wave function is said to be anti-symmetric if interchange of any pair of particle changes the signof the wave function.
$$
\psi_{\mathrm{a}}(1,2, \ldots \ldots . \mathrm{i}, \mathrm{j}, \ldots \ldots \mathrm{N})=-\psi_{\mathrm{a}}(1,2, \ldots \ldots . \mathrm{j}, \mathrm{i} \ldots . . \mathrm{N})
$$
The particles having anti-symmetric wave functions are known as fermions and follow FD statistics. Example: Electron, protons, neutrons, muons (spin $1 / 2$ ), $\Omega$ particle (spin $3 / 2$ )
\section{Symmetrization postulate}
The state of the system containing $\mathrm{N}$ identical particles, are either totally symmetric or totally anti symmetric under the exchange of any pair of particles and the states with mixed symmetry do not exist.
\begin{note}
	(i) Bosons have symmetric wave functions and Fermions have anti-symmetric wave functions\\
	(ii) Wave function of a system of identical bosons is totally symmetric and of a system of identical fermions is totally anti-symmetric.

	The total wave function corresponding to a system containing of $\mathrm{N}$ identical particles consisting of two parts (a) space part and (b) spin part, i.e.
	Therefore,
	$$
	\psi_{\text {total }}=\psi_{\text {space }} \times \chi_{\text {spin }}
	$$
	Therefore\\
	(i) Both space part and spin part of total wave function of a system of identical bosons will be either symmetric or anti-symmetric.
	$$
	\psi_{s, f e r m i o n}=\left\{\begin{array}{l}
	\psi_{s}(\text { space }) \times \chi_{a}(\text { spin }) \\
	\psi_{a}(\text { space }) \times \chi_{s}(\text { spin })
	\end{array}\right.
	$$
	(ii) any one of the space part and spin part of total wave function of a system of identical fermions will be symmetric and other one is anti-symmetric.
	$$
	\psi_{s, j e r m i o n}=\left\{\begin{array}{l}
	\psi_{s}(\text { space }) \times \chi_{a}(\text { spin }) \\
	\psi_{a}(\text { space }) \times \chi_{s}(\text { spin })
	\end{array}\right.
	$$
	\end{note}
	\textbf{Composite particle:}\\
Consider a system of identical composite particles where each particle is composed of two or more identical particles. Spin of each composite particles can be obtained by adding the spin of its constituents. If total spin of the composite particles is half-integer, then the particle will behave as a fermion. If total spin of the composite particles is integer, then the particle will behave as a boson.\\
\textbf{example} \\
(i) A system of $\mathrm{N}$ identical $\mathrm{H}$ atoms. Each $\mathrm{H}$ atom consists of 1 proton and 1 electron (spin $\mathrm{I} / 2$) Therefore each H atom has spin 1 and it will behave as a boson.So the system of N identical H atoms will have symmetric wavefunction\\
(ii) ${ }^{4} \mathrm{He}$ (two protons and two meutrons) has integer spin and will behave as boson.\\
(iii)$^3He$(2 proton and 1 neutron) has half integral spin and will behave as fermion
\section{Symmetric and anti symmetric wavefunction(space part)}
For a system of ' $n$ ' non-interacting distinguishable particles, the wave function can be written as
$$
\psi\left(\vec{r}_{1}, \vec{r}_{2}, \vec{r}_{3} \ldots \ldots \ldots \vec{r}_{n}\right)=\psi_{1}\left(\vec{r}_{1}\right) \cdot \psi_{2}\left(\vec{r}_{2}\right) \cdot \psi_{3}\left(\vec{r}_{3}\right) \ldots \ldots \ldots \psi_{n}\left(\vec{r}_{n}\right)
$$
But, for a system of ' $n$ ' non-interacting indistinguishable particles, the wave function will be different.
Example:
Consider a system of 2 non-interacting indistinguishable particles, in which one particle is in state 1 and the other particle is in state 2. Since, the particles are distinguishable, therefore the possible eigenfunctions are $\psi_{1}\left(\vec{r}_{1}\right) \psi_{2}\left(\vec{r}_{2}\right)$ and $\psi_{1}\left(\vec{r}_{2}\right) \psi_{2}\left(\vec{r}_{1}\right)$ and both are equal probable. The symmetric and anti-symmetric combinations for the wave function of the system of 2 particles will be
$$
\begin{aligned}
&\psi_{s}\left(\vec{r}_{1}, \vec{r}_{2}\right)=\frac{1}{\sqrt{2}}\left[\psi_{1}\left(\vec{r}_{1}\right) \psi_{2}\left(\vec{r}_{2}\right)+\psi_{1}\left(\vec{r}_{2}\right) \psi_{2}\left(\vec{r}_{1}\right)\right] \\
&\psi_{a}\left(\vec{r}_{1}, \vec{r}_{2}\right)=\frac{1}{\sqrt{2}}\left[\psi_{1}\left(\vec{r}_{1}\right) \psi_{2}\left(\vec{r}_{2}\right)-\psi_{1}\left(\vec{r}_{2}\right) \psi_{2}\left(\vec{r}_{1}\right)\right]
\end{aligned}
$$
If both the particles are in the same state, then $\psi_{a}\left(\vec{r}_{1}, \vec{r}_{2}\right)=0$ i.e. two identical fermions cannot occupy the same state. This is known as 'Pauli's exclusion principle'.\\
In general, if we take a system of $\mathrm{N}$ identical non-interacting indistinguishable particles and each particle is in a different state, then there will be $N !$ different type possible eiegenfunctions having same value of energy. The degenaracy arises due to the exchange of indistingushable particles and known as exchange degenaracy. The symmetric and anti-symmetric combinations for the wave function of the system of $\mathrm{N}$ particles will be\\
$$\begin{aligned}
	&\psi_{S}\left(\vec{r}_{1}, \vec{r}_{2}, \ldots \ldots . \vec{r}_{N}\right)=\frac{1}{\sqrt{N !}} \sum_{P} \hat{P}\left[\psi_{1}\left(\vec{r}_{1}\right) \psi_{2}\left(\vec{r}_{2}\right) \psi_{3}\left(\vec{r}_{3}\right) \ldots \ldots \ldots \psi_{n}\left(\vec{r}_{N}\right)\right] \\
	&\psi_{a}\left(\vec{r}_{1}, \vec{r}_{2}, \ldots \ldots . \vec{r}_{N}\right)=\frac{1}{\sqrt{N !}}\left|\begin{array}{llll}
		\psi_{1}\left(\vec{r}_{1}\right) & \psi_{1}\left(\vec{r}_{2}\right) & \ldots \ldots \ldots \ldots & \psi_{1}\left(\vec{r}_{N}\right) \\
		\psi_{2}\left(\vec{r}_{1}\right) & \psi_{2}\left(\vec{r}_{2}\right) & \ldots \ldots \ldots \ldots & \psi_{2}\left(\vec{r}_{N}\right) \\
		\vdots & & & \\
		\psi_{N}\left(\vec{r}_{1}\right) & \psi_{N}\left(\vec{r}_{2}\right) & \ldots \ldots \ldots \ldots & \psi_{N}\left(\vec{r}_{N}\right)
	\end{array}\right|
\end{aligned}$$
\section{Symmetric and anti symmetric wavefunction(spin part)}
Spin functions for two-electron system:
Two electrons each having spin $1 / 2$ i.e. $s_{1}=\frac{1}{2}, s_{2}=\frac{1}{2}$, then the total spin of two electrons will be
$$
s=\left|s_{1}+s_{2}\right| \ldots \ldots\left|s_{1}-s_{2}\right|=1,0
$$
and corresponding magnetic spin quantum number will be $m_{s}=1,0,-1,0$
Therefore, the possible spin states will be $\left|s, m_{s}\right\rangle \equiv|0,0\rangle,|1,1\rangle,|1,0\rangle,|1,-1\rangle$ and given as follows:\\
\textbf{Symmetric Triplet state:}\\
$$
\begin{aligned}
|1,1\rangle &=|\uparrow \uparrow\rangle=|\alpha \alpha\rangle=\left|\frac{1}{2}, \frac{1}{2}\right\rangle\left|\frac{1}{2}, \frac{1}{2}\right\rangle \\
|1,-1\rangle &=|\downarrow \downarrow\rangle=|\beta \beta\rangle=\left|\frac{1}{2},-\frac{1}{2}\right\rangle\left(\frac{1}{2},-\frac{1}{2}\right\rangle \\
|1,0\rangle &=\frac{1}{\sqrt{2}}[|\uparrow \downarrow\rangle+|\downarrow \uparrow\rangle]=\frac{1}{\sqrt{2}}[|\alpha \beta\rangle+|\beta \alpha\rangle] \\
&=\frac{1}{\sqrt{2}}\left[\left|\frac{1}{2}, \frac{1}{2}\right\rangle\left\langle\frac{1}{2},-\frac{1}{2}\right\rangle+\left|\frac{1}{2},-\frac{1}{2}\right\rangle\left\langle\frac{1}{2}, \frac{1}{2}\right\rangle\right]
\end{aligned}
$$
\textbf{Anti-symmetric Singlet state:}
$$
\begin{aligned}
|0,0\rangle &=\frac{1}{\sqrt{2}}[|\uparrow \downarrow\rangle-|\downarrow \uparrow\rangle]=\frac{1}{\sqrt{2}}[|\alpha \beta\rangle-|\beta \alpha\rangle] \\
&\left.=\frac{1}{\sqrt{2}}\left[\left|\frac{1}{2}, \frac{1}{2}\right\rangle\left|\frac{1}{2},-\frac{1}{2}\right\rangle-\left|\frac{1}{2},-\frac{1}{2}\right\rangle\left|\frac{1}{2}, \frac{1}{2}\right\rangle\right]\right]
\end{aligned}
$$
For a system of $N$ identical non-interacting indistinguishable particles each having spin 's', total number of possible spin states is $(2 s+1)^{N}$.
\begin{exercise}
Example 1. $N$ non interacting bosons are in an infinite potential well defined by $V(x)=0$ for $0<x<a$; $V(x)=\infty$ for $x<0$ and for $x>a$. Find the ground state energy of the system. What would be the ground state energy if the particles are fermions.
	\end{exercise}
\begin{answer}
	The energy eigenvalue of a particle in the infinite square well is given by
	$$
	E_{n}=\frac{\pi^{2} \hbar^{2} n^{2}}{2 m a^{2}}, \quad n=1,2,3, \ldots
	$$
	As the particles are bosons, all the $\mathrm{N}$ particles will be in the $n=1$ state in the ground state configuration. Hence, the ground state energy of the configuration will be
	$$
	E=\frac{N \pi^{2} \hbar^{2}}{2 m a^{2}}
	$$
	If the particles are fermions, a state can have only two of them, one spin up and the other spin down.\\
	xilaal Part Therefore, the lowest $\mathrm{N} / 2$ states will be filled. The total ground state energy will be
	$$
	\begin{aligned}
	E &=2 \frac{\pi^{2} \hbar^{2}}{2 m a^{2}}\left[1^{2}+2^{2}+3^{3}+\ldots+(N / 2)^{2}\right] \\
	&=\frac{\pi^{2} \hbar^{2}}{m a^{2}} \frac{1}{6}\left[\frac{N}{2}\left(\frac{N}{2}+1\right)\left(2 \frac{N}{2}+1\right)\right] \\
	&=\frac{\pi^{2} \hbar^{2}}{24 m a^{2}} N(N+1)(N+2)
	\end{aligned}
	$$
\end{answer}
\begin{exercise}
 Consider two noninteracting electrons described by the Hamiltonian
	$$
	H=\frac{p_{1}^{2}}{2 m}+\frac{p_{2}^{2}}{2 m}+V\left(x_{1}\right)+V\left(x_{2}\right)
	$$
	where $V(x)=0$ for $0<x<a ; V(x)=\infty$ for $x<0$ and for $x>a$. If both the electrons are in the same spin state, what is the lowest energy and eigenfunction of the two-electron system?
	\end{exercise}
\begin{answer}
	As both the electrons are in the same spin state, the possible combinations of spin part of the wave functions will be $|\uparrow \uparrow\rangle$ or $|\downarrow \downarrow\rangle$, both being symmetric. Since, the system contains two electrons (fermions), then the total wave function of the sytem will be anti-symmetric. Hence the space function must be antisymmetric. Therefore, both electrons cannot be in the same state. So, ground state energy will corresponds to $n_{1}=1, n_{2}=2$\\
	Ground state energy $\left(n_{1}=1, n_{2}=2\right)=\frac{\pi^{2} \hbar^{2}}{2 m a^{2}}+\frac{4 \pi^{2} \hbar^{2}}{2 m a^{2}}=\frac{5 \pi^{2} \hbar^{2}}{2 m a^{2}}$\\
	Since, the electrons are indistinguishable, therefore the antisymmetric combination for the space part is
	$$
	\frac{1}{\sqrt{2}}\left[\psi_{1}\left(\vec{r}_{1}\right) \psi_{2}\left(\vec{r}_{2}\right)-\psi_{1}\left(\vec{r}_{2}\right) \psi_{2}\left(\vec{r}_{1}\right)\right]
	$$
\end{answer}
\begin{exercise}
	Example 3. Sixteen noninteracting electrons are confined in a potential $V(x)=\infty$ for $x<0$ and $x>0 ; V(x)=0$, for $0<x<a$.\\
	(i) What is the energy of the least energetic electron in the ground state?\\
	(ii) What is the energy of the most energetic electron in the ground state?\\
	(iii) What is the Fermi energy $E_{f}$ of the system?
	\end{exercise}
\begin{answer}
	(i) The least energetic electron in the ground state is given by $E_{1}=\frac{\pi^{2} \hbar^{2}}{2 m a^{2}}$.\\
	(ii) In the given potential, the energy eigenvalue
	$$
	E_{n}=\frac{\pi^{2} \hbar^{2} n^{2}}{2 m a^{2}}, \quad n=1,2,3, \ldots
	$$
	As two electrons can go into each of the states $n=1,2,3, \ldots$, the highest filled level will have $n=8$ and its energy will be
	$$
	E_{8}=\frac{\pi^{2} \hbar^{2} 8^{2}}{2 m a^{2}}=\frac{32 \pi^{2} \hbar^{2}}{m a^{2}}
	$$
	(iii)The energy of the highest filled state is the Fermi energy $E_{F}$ Hence,
	$$
	E_{F}=\frac{32 \pi^{2} \hbar^{2}}{m a^{2}}
	$$
\end{answer}

\newpage
\begin{abox}
	Practice set 1
	\end{abox}
\begin{enumerate}
	\begin{minipage}{\textwidth}
		\item Consider a particle in a one dimensional potential that satisfies $V(x)=V(-x) .$ Let $\left|\psi_{0}\right\rangle$ and $\left|\psi_{1}\right\rangle$ denote the ground and the first excited states, respectively, and let $|\psi\rangle=\alpha_{0}\left|\psi_{0}\right\rangle+\alpha_{1}\left|\psi_{1}\right\rangle$ be a normalized state with $\alpha_{0}$ and $\alpha_{1}$ being real constants. The expectation value $\langle x\rangle$ of the position operator $x$ in the state $|\psi\rangle$ is given by
		\exyear{NET DEC 2011}
	\end{minipage}
	\begin{tasks}(2)
		\task[\textbf{A.}] $\alpha_{0}^{2}\left\langle\psi_{0}|x| \psi_{0}\right\rangle+\alpha_{1}^{2}\left\langle\psi_{1}|x| \psi_{1}\right\rangle$
		\task[\textbf{B.}]$\alpha_{0} \alpha_{1}\left[\left\langle\psi_{0}|x| \psi_{1}\right\rangle+\left\langle\psi_{1}|x| \psi_{0}\right\rangle\right]$
		\task[\textbf{C.}]$\alpha_{0}^{2}+\alpha_{1}^{2}$
		\task[\textbf{D.}]$2 \alpha_{0} \alpha_{1}$
	\end{tasks}
\begin{minipage}{\textwidth}
	\item Consider a system of two non-interacting identical fermions, each of mass $m$ in an infinite square well potential of width $a$. (Take the potential inside the well to be zero and ignore spin). The composite wavefunction for the system with total energy $E=\frac{5 \pi^{2} \hbar^{2}}{2 m a^{2}}$ is
	\exyear{NET JUNE 2014}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{2}{a}\left[\sin \left(\frac{\pi x_{1}}{a}\right) \sin \left(\frac{2 \pi x_{2}}{a}\right)-\sin \left(\frac{2 \pi x_{1}}{a}\right) \sin \left(\frac{\pi x_{2}}{a}\right)\right]$
	\task[\textbf{B.}]$\frac{2}{a}\left[\sin \left(\frac{\pi x_{1}}{a}\right) \sin \left(\frac{2 \pi x_{2}}{a}\right)+\sin \left(\frac{2 \pi x_{1}}{a}\right) \sin \left(\frac{\pi x_{2}}{a}\right)\right]$
	\task[\textbf{C.}]$\frac{2}{a}\left[\sin \left(\frac{\pi x_{1}}{a}\right) \sin \left(\frac{3 \pi x_{2}}{2 a}\right)-\sin \left(\frac{3 \pi x_{1}}{2 a}\right) \sin \left(\frac{\pi x_{2}}{a}\right)\right]$
	\task[\textbf{D.}]$\frac{2}{a}\left[\sin \left(\frac{\pi x_{1}}{a}\right) \cos \left(\frac{\pi x_{2}}{a}\right)-\sin \left(\frac{\pi x_{2}}{a}\right) \cos \left(\frac{\pi x_{2}}{a}\right)\right]$
\end{tasks}
\begin{minipage}{\textwidth}
	\item The state vector of a one-dimensional simple harmonic oscillator of angular frequency $\omega$, at time $t=0$, is given by $|\psi(0)\rangle=\frac{1}{\sqrt{2}}[|0\rangle+|2\rangle]$, where $|0\rangle$ and $|2\rangle$ are the normalized ground state and the second excited state, respectively. The minimum time $t$ after which the state vector $|\psi(t)\rangle$ is orthogonal to $|\psi(0)\rangle$, is
	\exyear{NET DEC 2017}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{\pi}{2 \omega}$
	\task[\textbf{B.}]$\frac{2 \pi}{\omega}$
	\task[\textbf{C.}]$\frac{\pi}{\omega}$
	\task[\textbf{D.}]$\frac{4 \pi}{\omega}$
\end{tasks}
\end{enumerate}
\colorlet{ocre1}{ocre!70!}
\colorlet{ocrel}{ocre!30!}
\setlength\arrayrulewidth{1pt}
\begin{table}[H]
	\centering
	\arrayrulecolor{ocre}

	\begin{tabular}{|p{1.5cm}|p{1.5cm}||p{1.5cm}|p{1.5cm}|}
		\hline
		\multicolumn{4}{|c|}{\textbf{Answer key}}\\\hline\hline
		\rowcolor{ocrel}Q.No.&Answer&Q.No.&Answer\\\hline
		1&\textbf{b}&2&\textbf{a}\\\hline
		3&\textbf{a}&&\\\hline
	\end{tabular}
\end{table}
\newpage
\begin{abox}
	Practice set 2
	\end{abox}
\begin{enumerate}
\begin{minipage}{\textwidth}
	\item Consider the wavefunction $\psi=\psi\left(\vec{r}_{1}, \vec{r}_{2}\right) \chi_{s}$ for a fermionic system consisting of two spinhalf particles. The spatial part of the wavefunction is given by
	$$
	\psi\left(\vec{r}_{1}, \vec{r}_{2}\right)=\frac{1}{\sqrt{2}}\left[\phi_{1}\left(\vec{r}_{1}\right) \phi_{2}\left(\vec{r}_{2}\right)+\phi_{2}\left(\vec{r}_{1}\right) \phi_{1}\left(\vec{r}_{2}\right)\right]
	$$
	where $\phi_{1}$ and $\phi_{2}$ are single particle states. The spin part $\chi_{s}$ of the wavefunction with spin states $\alpha(+1 / 2)$ and $\beta(-1 / 2)$ should be
	\exyear{GATE 2013}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}]$\frac{1}{\sqrt{2}}(\alpha \beta+\beta \alpha)$
	\task[\textbf{B.}]$\frac{1}{\sqrt{2}}(\alpha \beta-\beta \alpha)$
	\task[\textbf{C.}]$\alpha \alpha$
	\task[\textbf{D.}] $\beta \beta$
\end{tasks}
\begin{minipage}{\textwidth}
	\item The ground state and first excited state wave function of a one dimensional infinite potential well are $\psi_{1}$ and $\psi_{2}$ respectively. When two spin-up electrons are placed in this potential which one of the following with $x_{1}$ and $x_{2}$ denoting the position of the two electrons correctly represents the space part of the ground state wave function of the system?
	\exyear{GATE 2014}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $\frac{1}{\sqrt{2}}\left[\psi_{1}\left(x_{1}\right) \psi_{2}\left(x_{1}\right)-\psi_{1}\left(x_{2}\right) \psi_{2}\left(x_{2}\right)\right]$
	\task[\textbf{B.}]$\frac{1}{\sqrt{2}}\left[\psi_{1}\left(x_{1}\right) \psi_{2}\left(x_{2}\right)+\psi_{1}\left(x_{2}\right) \psi_{2}\left(x_{1}\right)\right]$
	\task[\textbf{C.}]$\frac{1}{\sqrt{2}}\left[\psi_{1}\left(x_{1}\right) \psi_{2}\left(x_{1}\right)+\psi_{1}\left(x_{2}\right) \psi_{2}\left(x_{2}\right)\right]$
	\task[\textbf{D.}]$ \frac{1}{\sqrt{2}}\left[\psi_{1}\left(x_{1}\right) \psi_{2}\left(x_{2}\right)-\psi_{1}\left(x_{2}\right) \psi_{2}\left(x_{1}\right)\right]$
\end{tasks}
\begin{minipage}{\textwidth}
	\item $\psi_{1}$ and $\psi_{2}$ are two orthogonal states of a spin $\frac{1}{2}$ system. It is given that
	$\psi_{1}=\frac{1}{\sqrt{3}}\left(\begin{array}{l}1 \\ 0\end{array}\right)+\sqrt{\frac{2}{3}}\left(\begin{array}{l}0 \\ 1\end{array}\right)$, where $\left(\begin{array}{l}1 \\ 0\end{array}\right)$ and $\left(\begin{array}{l}0 \\ 1\end{array}\right)$ represent the spin-up and spin-down states, respectively. When the system is in the state $\psi_{2}$ its probability to be in the spin-up state is
	\exyear{GATE 2014}
\end{minipage}
\begin{minipage}{\textwidth}
	\item For a spin $\frac{1}{2}$ particle, let $|\uparrow\rangle$ and $|\downarrow\rangle$ denote its spin up and spin down states respectively. If $|a\rangle=\frac{1}{\sqrt{2}}(|\uparrow\rangle|\downarrow\rangle+|\downarrow\rangle|\uparrow\rangle)$ and $|b\rangle=\frac{1}{\sqrt{2}}(|\uparrow\rangle|\downarrow\rangle-|\downarrow\rangle|\uparrow\rangle)$ are composite states of two such particles, which of the following statements is true for their total spin $S ?$
	\exyear{GATE 2018}
\end{minipage}
\begin{tasks}(2)
	\task[\textbf{A.}] $S=1$ for $|a\rangle$ and $|b\rangle$ is not an eigenstate of the operator $\hat{S}^{2}$
	\task[\textbf{B.}]$|a\rangle$ is not an eigenstate of the operator $\hat{S}^{2}$ and $S=0$ for $|b\rangle$
	\task[\textbf{C.}]$S=0$ for $|a\rangle$, and $S=1$ for $|b\rangle$
	\task[\textbf{D.}]$S=1$ for $|a\rangle$, and $S=0$ for $|b\rangle$
\end{tasks}
\begin{minipage}{\textwidth}
	\item Let $\left|\psi_{2}\right\rangle=\left(\begin{array}{c}1 \\ 0\end{array}\right),\left|\psi_{2}\right\rangle=\left(\begin{array}{c}0 \\ 1\end{array}\right)$ represent two possible states of a two-level quantum system. The state obtained by the incoherent superposition of $\left|\psi_{1}\right\rangle$ and $\left|\psi_{2}\right\rangle$ is given by a density matrix that is defined as $\rho \equiv c_{1}\left|\psi_{1}\right\rangle\left\langle\psi_{1}\left|+c_{2}\right| \psi_{2}\right\rangle\left\langle\psi_{2}\right| .$ If $c_{1}=0.4$ and $c_{2}=0.6$, the matrix element $\rho_{22}$ (rounded off to one decimal place) is
	\exyear{GATE 2018}
\end{minipage}
\end{enumerate}
\colorlet{ocre1}{ocre!70!}
\colorlet{ocrel}{ocre!30!}
\setlength\arrayrulewidth{1pt}
\begin{table}[H]
	\centering
	\arrayrulecolor{ocre}

	\begin{tabular}{|p{1.5cm}|p{1.5cm}||p{1.5cm}|p{1.5cm}|}
		\hline
		\multicolumn{4}{|c|}{\textbf{Answer key}}\\\hline\hline
		\rowcolor{ocrel}Q.No.&Answer&Q.No.&Answer\\\hline
		1&\textbf{b}&2&\textbf{d}\\\hline
		3&\textbf{2/3}&4&\textbf{d}\\\hline
		5&\textbf{0.6}&&\\\hline
	\end{tabular}
\end{table}


\documentclass[revision-guide.tex]{subfiles}
% !TEX = xelatex
%% Current Author:
\setcounter{chapter}{19}
\begin{document}
\raggedbottom
\chapter{Astronomy and cosmology}
\begin{content}
    \item standard candles
    \item stellar radii
    \item Hubble's law
    \item the Big Bang theory
    \item the age of the Universe
\end{content}
\spec{understand the term luminosity}
\spec{ recall and use the inverse square law for radiant flux intensity $F$ in terms of the luminosity $L$ of the source
\begin{equation}
  F = \frac{L}{4\pi d^2}
\end{equation}
}
Stars are described as LUMINOUS because they emit electromagnetic waves.

The LUMINOSITY of a luminous (``hot'') object is defined as the amount
of electromagnetic wave energy emitted by the object per second i.e. it
is the emission Power of the object and is thus measured in Watts (W).
It is a measure of the absolute ``brightness'' of the object.

FLUX (F) is Power per unit area (an Intensity). For a spherical emitter
of radius R (and thus surface area of $ 4\pi R^{2}$), this
means that $F = \frac{L}{4\pi d^2}$.

\spec{understand the need to use standard candles to help determine distances to galaxies}

Standard Candles are types of stars or galaxies for which the Luminosity
(the absolute brightness) can be determined directly from observations.
By measuring the observed brightness and comparing it to the absolute
brightness of the object, it is possible to determine how far away that
object is.

The best-known and most widely used Standard Candles are Cepheid
Variables and Type 1a Supernovae.

Cepheid Variables (named after the star Delta Cephei) pulsate and vary
in brightness with a frequency that is related to the star's Luminosity.
The periods of some Cepheids have been measured as a few days, others a
few months. Once the absolute brightness has been found from the
observed period of the pulsation, it can be compared with the brightness
the star appears to have as observed from the Earth and hence the
distance can be determined.

Type 1a supernovae occur when one of the stars (a white dwarf) in a
binary system gains mass, becomes unstable and catastrophically explodes
emitting vast quantities of light and other electromagnetic energy in
the process. The maximum absolute brightness achieved is related to the
rate at which the emission fades (the so-called Light Curve). Thus,
again, once the absolute brightness is known, a comparison with how
bright the object appears to be from the Earth will yield its distance.
Because they are so bright, these objects can be easily seen in distant
galaxies, so that distances well beyond the limits of the Milky Way can
be established.
\spec{recognise and use Wien's displacement law
\begin{equation}
  \lambda_{\text{max}} \propto  \frac{1}{T}
\end{equation}
to estimate the peak surface temperature of a star either graphically or algebraically}

Black bodies of a particular temperature T will emit radiation over a
range of wavelengths (a radiation distribution known as a Planck Curve):

\begin{figure}[h]
\includegraphics{figs/chapt-20/media/image1.png}
\caption{Planck curves}
\label{plank-curves}
\end{figure}

The distribution peaks at a wavelength λ\textsubscript{max} which is
determined by the reciprocal of the absolute temperature T of the
object. This is known as Wien's Displacement Law. The constant of
proportionality has a value of 2.90 x 10\textsuperscript{-3} m K:

\[\lambda_{max} = \frac{2.90 \times 10^{-3}} {T}\]

The greater the temperature, the larger the area under the curve,
suggesting that more radiation is being emitted altogether, consistent
with the Stefan-Boltzmann relation. Refer to Figure \ref{plank-curves} and consider the T
= 8000 K and the T = 6000 K graphs. The area beneath the T = 8000 K
graph is (8000/6000)\textsuperscript{4} times that beneath the T = 6000
K graph, i.e. 3.16 times greater.

The Sun's photosphere is at a temperature of a little under 6000 K;
notice that the Planck Curve for this temperature peaks at a wavelength
lying in the visible part of the electromagnetic spectrum.

Wien's Displacement Law enables astronomers to determine the temperature
of a star from observations of the light (and other radiation) emitted
by that star.
\spec{recognise and use Stefan's law for a spherical body
\begin{equation}
  L = 4\pi \sigma r^2 T^4
\end{equation}
}

The Stefan-Boltzmann Law (sometimes simply called Stefan's Law) states
that the Flux from a hot object is proportional to the fourth power of
the absolute temperature, T. Strictly speaking, this applies only to
idealised radiation emitters (referred to as ``black bodies''); the
constant of proportionality is the Stefan-Boltzmann constant, $\sigma$, which
has a value of 5.67 x 10\textsuperscript{-8} W m\textsuperscript{-2}
K\textsuperscript{-4}:

\[F = \sigma T^{4}\]

Therefore, for an emitted with surface area A, the Luminosity will be
given by

\[L =\sigma A T^{4}\]

and in the case of a spherical emitter (such as a star) of radius R,
this becomes

\[L = 4 \pi R^{2} \sigma T^{4}\]

\spec{use Wien's displacement law and Stefan’s law to estimate the radius of a star}

Having determined the temperature, T, one can then use the
Stefan-Boltzmann relation to determine the Luminosity, L. This is a
measure of the actual amount of radiation being emitted by the star. By
measuring the actual amount of radiation received per second per unit
area (i.e. the flux, F), one can then calculate how big the star must be
(the surface area from which the radiation is being emitted) in order to
produce that amount of Flux.

\begin{example}
\emph{Worked example: Proxima Centauri, the nearest star to the Sun}

Data:

Parallax angle = 0.8 seconds of arc

Peak wavelength, λ\textsubscript{max} = 967 nm

Flux measured at Earth = 3.56 x 10\textsuperscript{11} W
m\textsuperscript{-2}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
  Calculate the distance to Proxima Centauri.
\item
  Calculate its surface temperature.
\item
  Calculate the Flux at the star's surface
\item
  Hence calculate the radius of the star.
\end{enumerate}

\answer

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
  D (in parsecs) = 1 / angle of parallax in seconds of arc = 1.25 pc =
  \emph{3.85 x 10\textsuperscript{16} m}
\item
  From Wien's Displacement Law, T = 2.90 x 10\textsuperscript{-3} m K /
  967 x 10\textsuperscript{-9} m = 3000 K
\item
  From Stefan's Law, F = $\sigma$ T\textsuperscript{4} = 5.67 x
  10\textsuperscript{-8} x 8.10 x 10\textsuperscript{13} = \emph{4.6 x
  10\textsuperscript{6} W m\textsuperscript{-2}}
\item
  Flux measured at a distance of 3.85 x 10\textsuperscript{16} m is 3.56
  x 10\textsuperscript{-11} W m\textsuperscript{-2}.

  So, F\textsubscript{at Earth} / F\textsubscript{star's surface} =.
  (radius of star)\textsuperscript{2} / (distance to
  star)\textsuperscript{2}
\end{enumerate}

\begin{itemize}
\item
  Radius of star = \emph{1.07 x 10\textsuperscript{8} m}
\end{itemize}

\end{example}

\spec{understand that the successful application of Newtonian mechanics and gravitation to the Solar System and beyond indicated that the laws of physics apply universally and not just on Earth}

Newton's law of Universal Gravitation states that two masses, M and m,
whose centres are separated by a distance r, will mutually attract with
a gravitational force given by

\[F = \frac{G M m }{ r^{2}}\]

where G, the Universal Gravitational Constant, = 6.67 x
10\textsuperscript{-11} N m\textsuperscript{2} kg\textsuperscript{-2}.

One of the great triumphs of the law was to demonstrate consistency with
Kepler's Laws of Planetary Motion, formulated empirically some 70 years
earlier. Kepler's Laws state that the planets move about the Sun in
elliptical orbits and whilst Newton's Law can be applied to such orbits,
for simplicity we consider a planet moving in a circular orbit. If the
radius of the orbit is r, then from rotational mechanics, the planet
will experience a constant centripetal force of $mv^{2}/r$.
This origin of this force is the gravitational attraction given by
Newton's equation and by equating the two formulae it is possible to
show that

\begin{equation}
T^{2} = \frac{4 \pi^{2} r^{3}}{ G M}
\end{equation}

i.e. that T\textsuperscript{2} α r\textsuperscript{3} as stated by
Kepler's 3\textsuperscript{rd} Law. Newton's Law, when combined with his
Laws of Motion, was applied to other objects observed to be in
gravitational orbits with great success. The movements of planetary
satellites, binary star systems, galactic spiral arms and even clusters
of galaxies themselves have all been shown to be consistent with the
relationships. Famously, the relationships demonstrated orbital
irregularities in the motion of the planet Uranus, high led to the
discovery of the planet Neptune beyond it. Similar anomalous behaviour
in the rotations of spiral galaxies observed by Vera Rubin has led to
the speculation of the existence of Dark Matter.

\begin{example}

From the orbital data for the Earth, calculate the mass of the Sun
(assuming a circular orbit).

\answer

Radius of Earth's orbit = 150 x 10\textsuperscript{6} km

Orbital period of earth = 1 year = 3.2 x 10\textsuperscript{7} s

\begin{itemize}
\item
  From Kepler's 3\textsuperscript{rd} Law (above), \emph{M = 1.96 x
  10\textsuperscript{30} kg}
\end{itemize}

\end{example}
\spec{recognise and use
\begin{equation}
  \frac{\Delta \lambda}{\lambda} \approx \frac{\Delta f}{f} \approx \frac{v}{c}
\end{equation}
 for a source of electromagnetic radiation moving relative to an observer}

 When a source of waves moves away from an observer (in a stationary
 medium), the observer will receive waves of a longer wavelength (and
 thus lower frequency) than those emitted by the source. If the source
 moves towards the observer then the observed wavelength is shorter
 (frequency is higher). This is called Doppler Shift. For example, with
 sound waves this can be perceived as a change in the pitch of the
 emitted sound.

 The greater the speed of the source, v, the greater the change in the
 wavelength $\Delta \lambda$ (or frequency, $\Delta f$, whichever is being measured) of the
 waves received by the observer in which c is the velocity of the emitted waves (a relationship strictly
 only true for if c is much greater than v).

 The dark lines observed in the visible light spectra of stars and
 galaxies are caused by the absorption of specific frequencies (colours)
 by elements present in those objects, enabling astronomers to determine
 their composition. In the 1920s, Edwin Hubble discovered that the
 absorption lines for distant galaxies were shifted towards the red end
 of the colour (emission) spectrum. This Red Shift indicated that the
 galaxies were moving away (receding) from the Earth. But there were two
 particular features of his discovery that made a special impact:

 \begin{enumerate}
 \def\labelenumi{\alph{enumi})}
 \item
   Galaxies were receding in all directions.
 \item
   The more distant the galaxy, the higher its recessional velocity.
 \end{enumerate}

 (The distances to the galaxies were established using Standard Candles,
 especially Cepheid Variables.)

\spec{state Hubble's law and explain why galactic redshift leads to the idea that the Universe is expanding and to the Big Bang theory}

These observations have led to the conclusion that the universe began
with a Big Bang and what Hubble observed was the expansion of space
itself. A helpful picture is that of the infinite scaffolding by M C
Escher (Figure \ref{mcescher}):

\begin{figure}[h]
\begin{center}
\includegraphics{figs/chapt-20/media/image2.jpeg}
\end{center}
\caption{M C Escher drawing}
\label{mcescher}
\end{figure}

No matter which junction you view from, if each scaffold pole is
expanding, junctions in all directions will appear to recede. Note that,
in effect, the junctions themselves do not move: the space in between
them does. Also, more distant junctions (with more expanding poles
between them and the observer) will appear to recede with greater
speeds.

In such a model, the speed of ``recession'' (expansion) is proportional
to the distance of the observed galaxy and observations are by and large
consistent with this:

$ V = H_{o} d$

in which the constant of proportionality, H\textsubscript{o,} is known
as the Hubble Constant, the value of the gradient of the graph of v
plotted against d (Figure \ref{hubble-law}):

\begin{figure}[h]
\includegraphics[width=\textwidth]{figs/chapt-20/media/image3.jpeg}
\caption{Hubble's Law}
\label{hubble-law}
\end{figure}

Recent measurements (see graph) suggest a value of H\textsubscript{o} of
a little over 67 km s\textsuperscript{-1} Mpc\textsuperscript{-1}

Given that, in the observable universe, the greatest distance from which
radiation could be received is given by the speed of light x the age of
the universe, it follows that the age of the universe will be given by
1/H\textsubscript{o}. For the value of H\textsubscript{o} quoted, this
equates to an age of

When measuring the red shifts of distant galaxies, the calculated
velocities thus more properly indicate the rate at which the intervening
space is stretching. The value of Δλ/λ (or Δf/f) is called the
Cosmological Red Shift, z, indicating that the space has expanded by a
factor of 1 + z in order to produce the observed Doppler Shift.

The quasar 3C273 was the first object of its kind to be identified. So
called because they were star-like but much more luminous
(``quasi-stellar objects'') they are now known to consist of
supermassive black holes that draw in a huge disc of orbiting gas,
causing large emissions of radiation across a wide range of wavelengths.
Their spectra exhibit large red shifts.

\begin{example}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
  One emission line in the spectrum of 3C273 appears at a wavelength of
  475.0 nm; in the laboratory the same line is measured at 410.2 nm.
  Calculate the recessional velocity of the quasar.
\item
  Using the value of H\textsubscript{0} quoted above, hence calculate
  the distance of 3C273.
\end{enumerate}

\answer

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
  Δλ = 475.0 -- 410.2 nm = 64.8 nm.
\end{enumerate}

From Doppler equation, Δλ/λ = v/c, this gives v = 4.74 x
10\textsuperscript{7} ms\textsuperscript{-1} or \emph{4.74 x
10\textsuperscript{4} km s\textsuperscript{-1}}.

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\item
  Assume a value of H\textsubscript{0} of 67 km s\textsuperscript{-1}
  Mpc\textsuperscript{-1}.
\end{enumerate}

\begin{itemize}
\item
  d = 4.74 x 10\textsuperscript{4} km s\textsuperscript{-1} / 67 km
  s\textsuperscript{-1} Mpc\textsuperscript{-1} = \emph{707 Mpc.}
\end{itemize}

\end{example}
\spec{explain how microwave background radiation provides empirical support for the Big Bang theory}
\spec{understand that the theory of the expanding Universe involves the expansion of space-time and does not imply a pre-existing empty space into which this expansion takes place or a time prior to the Big Bang}
\spec{recall and use the equation
\begin{equation}
  v \approx H_0 d
\end{equation}
for objects at cosmological distances}
\spec{derive an estimate for the age of the Universe by recalling and using the Hubble time
\begin{equation}
  t = \frac{1}{H_0}
\end{equation}
}
In the 1940s, George Gamow suggested that the observed ratio of hydrogen
to helium in the universe could be explained by assuming the universe
was much hotter and denser a long time ago, consistent with the idea of
a Big Bang origin stemming from Hubble's work. His theory predicted the
existence of a ``leftover'' radiation which was eventually discovered by
chance in 1965. This is today known as the Cosmic Microwave Background
Radiation and it has the biggest cosmological red shift. It was produced
when the early universe had cooled down to about 3000K, low enough for
electrons to combine with protons to produce atoms, a process resulting
in the emission of photons of wavelengths around 1 mm. Because of
cosmological expansion, the wavelength is now a thousand times bigger
(millimetres) and the temperature a thousand times smaller, about 3 K.

Refinements to the Big Bang model have included a period of Inflation
very early on which gave rise to the eventual clumping of matter, which
accounts for the later existence of stars and galaxies (and planets and
humans). The Cosmic Background Explorer satellite revealed such clumping
(measured as tiny temperature fluctuations in the background radiation)
and further evidence is still being sought to confirm Inflation as a
part of the model.

\begin{figure}[h]
\includegraphics[width=\textwidth]{figs/chapt-20/media/image4.jpeg}
\caption{COBE satellite image}
\end{figure}
\end{document}


\par
\chapter{{\tt Iter}: Iterative Methods}
\par
{\tt Iter} is composed of 5 Krylov space iterative methods, PCG (Preconditioned Conjugate
Gradients),  BiCGStab,  TFQMR, and BGMRES (Block GMRES),
and MLBiCGStab.
(For references, see top comments in codes.)
The intent of these methods is to provide the user of {\bf SPOOLES} with an
 easy way to evaluate the effectiveness of the approximate factorizations belonging
to the {\tt FrontMtx} object.  To further facilitate the evaluation we have included
a single call {\tt driver} that can run anyone of the methods we have provided with the
type of preconditioner desired.  For each iterative method we allow for left and right
preconditioning.  Also, for each method, except BGMRES, we allow for real or
complex matrices.
\par
Because our intent was to provide a simple means to test the effectiveness of the
preconditioners, these implementations are not parallel (neither shared or distributed
memory).  However, they were intentionally written to be consistent in style and form
so that they could be easily adapted to exploit the parallelism that is in {\bf SPOOLES}.
All iterative methods use the basic structure {\tt DenseMtx} for handling the intermediate
vectors and performing the matrix multiplications and system solves.  By doing this
we have also anticipated the eventual movement to block iterative methods and the
{\tt DenseMtx} structure can remain the basic structure.  There are a few basic
utilities that have been added, which are discribed in this section, upon which the
iterative methods were built.  These are provided to aid the experienced {\bf SPOOLES}
user with an ability to develop additional iterative methods, as seen fit.