\documentclass[journal]{IEEEtran}

\usepackage [utf8] {inputenc}
\usepackage [english] {babel}
\usepackage [final] {microtype}
\usepackage {amssymb}
\usepackage {amsmath}
\usepackage {amsfonts}
\usepackage {graphicx}
\usepackage {dblfloatfix}
\usepackage {csquotes}
\usepackage {mathtools}
\usepackage {float}
\usepackage {hyperref}
\usepackage {listingsutf8}
\usepackage{chngcntr}

\renewcommand {\a} {\alpha}
\renewcommand {\b} {\beta}
\newcommand {\g} {\gamma}
\newcommand {\G} {\Gamma}
\newcommand {\h} {\eta}
\renewcommand {\d} {\delta}
\newcommand {\e} {\varepsilon}
\newcommand {\f} {\varphi}
\renewcommand {\l} {\lambda}
\newcommand {\s} {\sigma}
\renewcommand {\i} {\iota}
\renewcommand {\th} {\vartheta}
\newcommand {\z} {\zeta}
\renewcommand {\O} {\Omega}
\renewcommand {\o} {\omega}
\newcommand {\D} {\cdot}
\newcommand {\Adj} {\dagger}
\newcommand {\Tr} {\intercal}

\newcommand {\m} [1] {\( #1 \)}
\newcommand {\V} [1] {\underline {#1}}
\newcommand {\M} [1] {\underline {\underline {#1}}}
\newcommand {\T} [1] {\tilde {#1}}
\newcommand {\RB} [1] {\left( #1 \right)}
\newcommand {\SB} [1] {\left[ #1 \right]}
\newcommand {\CB} [1] {\left\{ #1 \right\}}
\newcommand {\DB} [1] {\left[ \! \left[ #1 \right] \! \right]}
\newcommand {\Fl} [1] {\left \lfloor #1 \right \rfloor}
\newcommand {\Cl} [1] {\left \lfloor #1 \right \rfloor}
\newcommand {\Nm} [1] {\left \vert #1 \right \vert}
\newcommand {\VNm} [1] {\left \Vert #1 \right \Vert}
\newcommand {\R} [1] {\sqrt {#1}}
\newcommand {\Min} [1] {\underset {#1} {\mathrm {min}}\;}
\newcommand {\IP} [1] {\left \langle #1 \right \rangle}
\newcommand {\Stack} [1] {\startsubstack #1 \stopsubstack}
\newcommand {\Disp} [1] {
   \begin {align*}
      #1
   \end {align*}
}

\begin{document}

\title{Dantzig Selector Applied on mm-Wave MIMO Channel Estimation and and Error Analysis}

\author{Tzu-Yu Jeng \\
        Hsuan-Jung Su%
\thanks{Hsuan-Jung Su is with the Department
of Electrical Engineering, National Taiwan University.}
\thanks{Manuscript received April 1, 2020; revised April 1, 2021.}}

\markboth{IEEE Journal of whatever,~Vol.~0, No.~0, June~2020}%
{Jeng and Su: Dantzig Selector Applied on mm-Wave MIMO Channel Estimation}

\maketitle

\begin{abstract}
Multiple-input multiple-output communication systems in the millimeter-wave band are gradually being adopted.
A larger antennae array makes channel estimation more difficult.
Meanwhile, hybrid beamforming, which utilizes fewer RF chains, is applied too, so that new estimation methods have to be designed.
This can be seen as a compressive sensing problem, for which Orthogonal Matching Pursuit is usually used.

We consider a single user, hybrid structure with a uniform linear array with both precoders and combiners on each side.
We generate random beamforming matrices and use Dantzig Selector to estimate the channel in the space frequency domain.
Then, we give a quantitative bound (which holds for high probability) on the expected error norm.
To reduce the complexity, we cast it as a linear program, and suggest the basis pursuit denoising form.
Numerical results show that DS gives a superb regularization, especially when the sample is less sufficient and the noise level is higher.
We therefore propose that DS may be used, when the number of RF chains is more limited or when fewer stages of estimation are possible.
\end{abstract}

\begin{IEEEkeywords}
channel estimation, compressive sensing, sparsity, Dantzig Selector, regularization, restricted isometry
\end{IEEEkeywords}

\begin {figure*} [!b]
\centering
\includegraphics [width = \textwidth] {system.png}
\caption {Schematic diagram of the hybrid beamforming system we consider.}
\end {figure*}

\section{Introduction}

\subsection {Background}

Multiple-input multiple-output (MIMO) communication systems will be part of the 5G specification.
With a large number of antennae on both transmitter and receiver ends, MIMO is expected to provide a large signal gain.
Parallel and redundant transmission of data improves the error-correcting ability, and beamforming improves the signal level.
The millimeter wave (mm-wave) is adopted, since its smaller wavelength (and thus higher frequency) makes wider bands available.
Moreover the antennae may be closer-spaced, allowing us to increase their number \cite {RSM13}.
However, because of a larger antennae array and of larger noise corruption in higher frequency, estimation of MIMO channel state information gives rise to higher complexity, and hence higher hardware overhead and power consumption.
Indeed, RF chains are more expensive and power-consuming, so there is growing attention on hybrid beamforming, where there are not fewer RF chain than the antennae.

If we consider a slow varying MIMO channel for simplicity, in terms of a channel representation, to estimate the channel is to determine the parameters of the representation.
It amounts to invert a linear system whose dimension is the number of antennae, for which conventional training-based algorithms are not very effective.
Fortunately, physical evidence has suggested that mm-wave channel are poor in scattering \cite {ALS14}, which reduces the number of paths, and compressive sensing techniques may be used.
Generally speaking, compressive sensing aims to reconstruct an underdetermined linear system, when the sparsity of solution guarantees successful recovery for most cases.
In our settings for hybrid beamforming structure, a way of generating the sensing matrix and pilot vectors in the estimation stage has to be devised and justified.

\subsection {Literature}

Compressive sensing approaches can be divided into two categories, the convex programming approach and the greedy approach \cite {RDD18}.
We will discuss one from each in more detail: Dantzig Selector and Orthogonal Matching Pursuit.
For the the convex programming approach, Dantzig Selector (DS) is one of the earlier method, and it recovers the sparse signal with expected error norm bounded with overwhelming probability, and near optimality \cite {CaT07}.
DS is an minimization problem on \m {\ell_1}-norm, with \m {\ell_\infty}-constraint, which may be recast as a linear program, so that techniques from convex optimization may be used.
For our purpose in MIMO channel estimation, physical evidences suggest that mm-wave channels are sparse in the number of paths.
Bajwa et.\ al.\ \cite {BHS10} used DS to estimate the time-dependent single-antenna channel response,
and in the accompanying note \cite {BHR08} they justified that \m {X} has RIP for overwhelming probability.
Some later results show that Least absolute shrinkage and selection operator (Lasso) and DS have similar behavior \cite {AsR10}.
Lian, Liu and Lau applied Lasso on MIMO with an analog combiner \cite {LLL17};
Destino, Juntti, and Nagaraj used an adaptive Lasso \cite {DJN15};
Vlachos, Alexandropoulos, and Thompson \cite {VAT19} used Lasso on hybrid beamforming with an additional random spatial sampling device.
These formulations rely on joint optimization on the estimated channel and the sensing matrix, which can result in high complexity.

On the other hand, OMP has since been commonly used for channel estimation.
Alkhateeb, Leus, and Heath Jr.\ \cite {ALH15} examined the trade-off between number of measurement and accuracy for an all-phase-shifter beamforming matrix based on nonuniform fixed set of angles.
Hu, Wang, and He \cite {HWH13} applied OMP to estimate path delay of OFDM subcarriers.
Lee, Gil, and Lee \cite {LGL16} considered a hybrid system, where the hybrid beamforming matrix serves as sensing matrix.
Gao, Dai, and Wang \cite {GDW15} proposed a variant of OMP which there is the assumption of spatially common sparsity.
For the performance guarantee of OMP, Cai, Wang, and Xu \cite {CWX10} gave a new bound on performance of OMP under assumption of low coherence of columns.
Cai and Wang \cite {CaW11} extended the study to DS and other convex programs for sparse recovery, and Ben-Haim et.\ al.\ \cite {BEE10} refined their bounds, concluding that OMP is better for low SNR scenario, and DS is better for high SNR.

\subsection {Contribution}

Due to the constraint of hybrid structure, the designs which use fully digital beamforming cannot be directly applied, and the designs which use only analog beamforming might not be optimal.
Indeed, if DS is shown to be optimal \cite {CaT07}, then if we can overcome the problem of complexity among other difficulties, it may turn out to outperform greedy methods, and is even necessary for less ideal situations.

In this treatise, we consider a hybrid structure with a uniform linear array with both precoders and combiners on each side.
We shall generate random beamforming matrices, and use DS to estimate the channel in the space frequency domain.
To the best of our knowledge, the sensing matrix with i.i.d.\ entries in both analog and digital stages has not been discussed on the literature.
We shall see that in our proposed method, the effective sensing matrix has RIP for high probability, which may serve as the sensing matrix for DS,
for which we give a quantitative bound, holding for high probability, on the expected error norm.
Numerical results show that DS is superior to other methods for our problem.
Since DS is more accurate, it can be used when the sample is less sufficient and the noise level is higher, where it might be the case that only DS can recover successfully.
Considering its higher complexity, we remark that it can be cast as a linear program, and the basis pursuit denoising form may be used.

It appears that, for a given number of sampling, DS recovers better than OMP, except perhaps in high noise scenario.
Moreover, our setting is more general than Alkhateeb, Leus, and Heath Jr.\ \cite {ALH15} with only an analog combiner,
and our random generation of sensing matrix is simpler than Lee, Gil, and Lee \cite {LGL16},
and we do not rely on additional assumptions on sparsity as in Gao, Dai, and Wang \cite {GDW15}.

Our work is also an improvement to Bajwa et.\ al.\ \cite {BHS10}.
First, while their method takes many time slices, for our case a few time slices suffice, since the channel is time independent.
Second, with the further constraint of hybrid beamforming, the channel matrix is downsampled, it is unclear whether their guarantee for successful signal recovery is still valid.
Third, generating random sequences can lead to high complexity \cite {LGL16}, and we instead use random beamforming matrices.

In addition, it seems that with the same threshold, DS recovers better than Lasso, except perhaps in low noise scenario.
Again, our proposed method is more general than Lian, Liu and Lau \cite {LLL17} with only an analog combiner,
and our sensing matrix is generated more simply than in Destino, Juntti, and Nagaraj \cite {DJN15},
and we do not require special devices as in Vlachos, Alexandropoulos, and Thompson \cite {VAT19}.
Overall, it is clear that DS leads to a relatively better regularization than OMP and Lasso.

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

\section{System model}

\subsection {Channel model}

We use an underline like \m {\V {v}} for vectors, two underlines like \m {\M {M}} for matrices.
A dagger \m {\dagger} stands for Hermitian, and \m {\intercal} for transpose.
A subscript with brackets like \m {\M {M} _{\SB{1,2}}} is its corresponding entry.

For simplicity we suppose uniform linear arrays, for which the response would be,
\Disp {
\V {a} \RB {\psi', N}
= \frac {1} {\R {N}} \sum_{n_h=0}^{N-1} \mathsf {e} ^{\mathsf {i} n_h \psi'} \V {u} _{n_h}
\in \mathbb {C} ^ {N}
}
And consider the virtual representation of the MIMO channel, \cite {ALS14},
\Disp {
\M {H}
=\sum_{l=0} ^{L-1}
\a_l
\V {a} \RB { 2\pi \frac {d_{\mathrm {arr}}} {\l _{\mathrm {arr}}} \sin \f_l', N_{H,r}}
\V {a} \RB { 2\pi \frac {d_{\mathrm {arr}}} {\l _{\mathrm {arr}}} \sin \th_l', N_{H,t}}^\dagger
}
The physical meaning of \m {\f_l'} is the \m {l}-th angle of incidence of departure electronic wave, and \m {\th_l'}, the \m {l}-th angle of arrival wave, and \m {d_{\mathrm {arr}}} is the distance between two adjacent antennae.

\subsection {System model}

We consider hybrid beamforming at both the transmitter and receiver ends, as shown in Figure 2.
Each end consists of both digital and analog precoders and combiners.
In the transmitter end, there are (seeing towards the receiver end), the digital precoder \m {\M {F} _B \in \mathbb {C} ^{N_B \D N_B}} and the analog precoder \m {\M {F} _R \in \mathbb {C} ^{N_{H,t} \D N_B}}.
Similarly, in the receiver end, there are (seeing towards the transmitter end) the digital combiner \m {\M {W} _B \in \mathbb {C} ^{N_B \D N_B}} and the analog combiner \m {\M {W} _R \in \mathbb {C} ^{N_B \D N_{H,r}}}.
Recall that analog precoders may only have values of unity magnitude.
\Disp {
\Nm {\RB {\M {F} _R} _{\SB {n_H, n_{R,t}}}}
= &1, \\
\Nm {\RB {\M {W} _R} _{\SB {n_{R,r}, n_H}}}
= &1,
}
where we assume \m {N_{H,t}, N_{H,r} \gg N_B}.

Since we restrict our discussion to a short interval of time, the noise term may be simply taken as a matrix \m {\M {Z} \in \mathbb {C} ^{N_B \D N_B}} with each entry being i.i.d.\ standard normal.
Let us introduce the effective channel
\Disp {
\M {Y}
:=\M {W} _B \M {W} _R \RB {\M {H} \M {F} _R \M {F} _B +\M {Z}}
}
Our task then amounts to recovering \m {\M {H}}, and generating \m {\M {W} _R}, \m {\M {W} _B}, \m {\M {F} _R}, and \m {\M {F} _B}.

\subsection{Proposed method}

Let vec stand for vectorization of matrices along each column, and \m {\otimes} for Kronecker product.
Then it is more appealing to write
\Disp {
\V {h}
:= &\mathrm {vec} \RB {\M {H}} \\
\V {y}
:= &\mathrm {vec} \RB {\M {Y}} \\
\V {z}
:= &\mathrm {vec} \RB {\M {W} _B \M {W} _R \M {Z}} \\
\M {Q}
:= &\RB {\M {F} _B^\intercal \M {F} _R^\Tr} \otimes \RB {\M {W} _B \M {W} _R} \\
}
to formulate the problem as a linear system:
\Disp {
\V {y}
=\M {Q} \V {h} +\V {z}
}

At this stage, it is not obvious that \m {\V {h}} must be sparse, so we apply discrete Fourier transform matrix \m {\M {K}} on both sides.
Indeed, if we write
\Disp {
\M {G}
=\M {K}^\dagger _r \M {H} \M {K} _t
}
then
\Disp {
\M {Y}
=\M {W} _B \M {W} _R \M {K} _r \D \M {G} \D \M {K}^\dagger _t \M {F} _R \M {F} _B
+\M {W} _B \M {W} _R \M {Z}
}
Now, set
\Disp {
\M {P}
:= &\RB {\M {F} _B^\intercal \M {F} _R^\intercal \M {K}^\ast _t} \otimes \RB {\M {W} _B \M {W} _R \M {K} _r} \\
\V {g}
:= &\mathrm {vec} \RB {\M {G}}
}
Accordingly
\Disp {
\V {y}
=\M {P} \V {g} +\V {z}
}

In short, our algorithm can be summarized more succinctly as below.
\begin {itemize}
\item Let \m {\g_{\mathrm {DS}} \geq 0} be given.
\item Input \m {\M {F} _B \in \mathbb {C} ^{N_R \D N_B}},
\m {\M {F} _R \in \mathbb {C} ^{N_{H,t} \D N_R}},
\m {\M {W} _R \in \mathbb {C} ^{N_R \D N_{H,r}}},
\m {\M {W} _B \in \mathbb {C} ^{N_B \D N_R}},
and \m {\M {Y} \in \mathbb {C} ^{N_B \D N_B}}.
\item Find \m {\M {P} \in \mathbb {C} ^{N_B ^2 \D N_{H,t} N_{H,r}}}, \m {\V {y} \in \mathbb {C} ^{N_B ^2}} as in above.
\item Compute the convex program
\Disp {
\hat {\V {g}}
\leftarrow \begin {cases}
\Min {\V {g}' \in \mathbb {C} ^{N_{H,t} N_{H,r}}} & \VNm {\V {g}'} _1 \\
\mathrm {subject} \; \mathrm {to} \quad & \VNm {\M {P}^\dagger \RB {\V {y} -\M {P} \V {g}'}} _\infty \leq \g_{\mathrm {DS}} \\
\end {cases}
}
\item Convert \m {\hat {\V {g}}} back to the space domain, namely
\Disp {
\hat {\M {G}}
\leftarrow \mathrm {vec}^{-1} \RB {\hat {\V {g}}}
}
\item Recover the estimated \m {\hat {\M {H}}}, as
\Disp {
\hat {\M {H}}
\leftarrow \M {K} _r \hat {\M {G}} \M {K}^\dagger _t
}
\item Output \m {\hat {\M {H}}}.
\end {itemize}

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

\section{Error Analysis}

Let \m {\hat {\V {g}}} be the Dantzig Selector, and let the sparsity level \m {S} be fixed.
Split \m {\V {g}} into two parts: \m {\V {g} _{\SB{\mathcal {A}}}}, the largest-magnitude \m {s} components of \m {\V {g}}, \m {\V {g} _{\SB{\mathcal {B}}}} the next \m {s} largest-magnitude components of \m {\V {g}}, and \m {\V {g} _{\SB{\mathcal {C}}}} are the components complement to \m {\V {g} _{\SB{\mathcal {A}}}}.
For example, if \m {\V {g} =\IP {-1,3,-4,2,8}}, and \m {S=2}, then \m {\V {g} _{\SB{\mathcal {A}}} =\IP {0,0,-4,0,8}}, \m {\V {g} _{\SB{\mathcal {B}}} =\IP {0,3,0,2,0}}, and \m {\V {g} _{\SB{\mathcal {C}}} =\IP {-1,3,0,2,0}}.
In this section, the subscripts \m {\mathcal {A}, \mathcal {B}, \mathcal {C}} will bear analogous meaning.

We hope that \m {\VNm {\V {g} _{\SB{\mathcal {C}}}} _1} is small.
If so, we shall substitute the quantity into the expected square error of DS, thus generalizing to the almost-sparse case.
Recall that \m {\M {G}} is just the vectorization of \m {\V {g}}, and is the function of \m {\V {a}}, so we seek to establish that \m {\V {a}} is almost sparse.
We define, similarly, \m {\V {a} _{\SB{\mathcal {A}}}} and \m {\V {a} _{\SB{\mathcal {C}}}}, with sparsity level \m {s} different from \m {S}.
If \m {N} is large, we may forget for a moment that \m {s} is an integer.

\subsection {Sparsity of channel}

To simplify expressions, define
\Disp {
\f_l
= &2\pi \frac {d_{\mathrm {arr}}} {\l_{\mathrm {arr}}} \sin \f_l'
  \; \mathrm {mod}\; \RB {2\pi} \\
\th_l
= &2\pi \frac {d_{\mathrm {arr}}} {\l_{\mathrm {arr}}} \sin \th_l'
  \; \mathrm {mod}\; \RB {2\pi}  \\
\V {b} \RB {\f}
= &\M {K}^\Adj \V {a} \RB {\f}
}

\textbf {Proposition 1}
Let \m {\f} be given.
Then, for any random instance of \m {\f},
\Disp {
\VNm {\V {b} \RB {\f} _{\SB{\mathcal {C}}}} _1
\leq \frac {2} {\pi} \log N
}

To show this, introduce
\Disp {
\psi \RB {\f, n_H}
:=\RB {
   \f \; \mathrm {mod}\; \frac {2\pi} {N}
   + \RB {\frac {2 n_H} {N} + 1} \pi
} \;
\mathrm {mod}\; \RB {2\pi}
- \pi
}
By using suitable remainder terms to estimate the Maclaurin series,
\Disp {
\frac {\Nm {\sin \RB {N \psi'/2}}} {\Nm {\sin \RB {\psi' /2}}}
\leq &B \RB {\psi'}
:= \frac {48} {\Nm {\psi'^2 -24} \Nm {\psi'}}, \\
}
Then, a simple verification shows
\Disp {
\VNm {\V {b} \RB {\f} _{\SB{\mathcal {C}}}} _1
\leq \frac {1} {N}
\VNm {
\RB {
   \sum_{n_H' =0}^{N -1}
      B \RB {\psi \RB {\f, n_H'}}
      \V {u} _{n_H'}
} _{\SB{\mathcal {C}}}
} _1
}
Or, if we carry out the integral and drop \m {s},
\Disp {
\VNm {\V {b} \RB {\f} _{\SB{\mathcal {C}}}} _1
\leq &\frac {1} {N} \D \frac {N} {2\pi} \D 2 \int_{\pi s/N}^{\pi} B \RB {\psi} ^2 d \psi \\
= &\frac {48} {N \pi^3}
\int _{s /N} ^1 \frac {1} {\RB {24/\pi^2 -x^2} ^2 x^2} dx \\
\leq &\frac {2} {\pi} \log N
}

\textbf {Proposition 2}
The bound
\Disp {
\VNm {\M {g} _{\SB{\mathcal {C}}}} _1
\leq \frac {1} {3} L \RB {\log N_{H,t} + \log N_{H,r}} ^2
}
holds for probability \m {p}, with
\Disp {
1 -p
\leq 2 \exp \RB {- \frac {9L} {\pi}}
}
This is proved by using Proposition 1 with triangle inequality, and bound the sample mean by Hoeffding inequality.

% % % % % % % % % % % % % % % %

\subsection {Generating beamforming matrices}

To investigate \m {\VNm {\M {F} _B \V {u}} _2} (respectively for \m {\M {W} _B}), for \m {\V {u}} is a unit vector, we need a large deviation result for i.i.d.\ sum of chi-square random variables \cite {LaM00}, as below.

\textbf {Proposition 3}
It holds that
%
\Disp {
\Nm {\VNm {\M {F} _B \V {u}} _2 ^2 - 1}
\geq \d_s
}
for probability \m {p}, with
\Disp {
1 -p
\leq 2 \mathsf {e} ^{-N_R \R {\d_s} /4}
}

To investigate \m {\VNm {\M {F} _B \V {u}} _2} (respectively for \m {\M {W} _B}), we apply a bound for the failure probability of a DFT submatrix with \m {\d_s} RIP, in Haviv and Regev, ``The restricted isometry property of subsampled Fourier matrices'' \cite {KlM17}, and drop lower ordered terms as below,

\textbf {Proposition 4}
Suppose
\Disp {
N_R
\geq \frac {s} {\d_s^2} \RB {\log s}^2 \log N_{H,t}
}
Then \m {\M {F}_R} (respectively \m {\M {W} _R}) has \m {\d_s} RIP for probability \m {p}, with
\Disp {
1 -p
\leq \RB {\frac {\d_s} {N_{H,t} s}} ^{1/3}
}

Since both \m {\M {F}_B^\Tr \M {F}_R^\Tr} and \m {\M {W}_B \M {W}_R} are \m {\d_s} RIP, it does appear (if we ignore the sparsity constraint) that \m {\M {P}} has approximately \m {2\d_s} RIP.
However, it remain to show that their Kronecker product still has RIP.

Nevertheless, notice that if angles \m {\th_l} (respectively \m {\f_l}) are exactly the multiples of \m {2 \pi / N_{H,t}} (respectively \m {2 \pi / N_{H,r}}), then for some \m {S}-sparse \m {\V {d}'} and unitary \m {\M {U}},
\Disp {
&\VNm {\M {W} _B \M {W} _R \M {H} \M {F} _R \M {F} _B} _2 \notag \\
= &\VNm {
   \M {W} _B \M {W} _R \M {K} _r \M {U} \D
   \mathrm {diag} \SB {\mathrm {abs} \SB {\V {d}'}} \D
   \M {U} ^\dagger \M {K} _t ^\dagger \M {F} _R \M {F} _B} _2 \notag \\
= &\VNm {
   \M {W} _B \M {W} _R \M {K} _r \M {U}
   \R {\mathrm {abs} \SB {\V {d}'}}} _2 \D
   \VNm {\M {F} _B ^\dagger \M {F} _R ^\dagger \M {K} _t \M {U}
   \R {\mathrm {abs} \SB {\V {d}'}}} _2 \notag \\
\eqsim &\VNm {\M {G}} _2 \RB {1 +2\d_s}
}
Thus, even we cannot make sure that \m {\M {P}} is \m {\d_s} RIP with respect to all possible \m {\V {g}}'s, at least \m {\M {P}} has RIP with respect to relevant values of \m {\V {g}} for which the channel is sparse.

% % % % % % % % % % % % % % % %

\subsection {Bound for expected error norm}

Set for short \m {\V {d} = \hat {\V {g}} - \V {g}}.
And for convenience, let \m {N_h = N_{H,t} N_{H,r}}.
%
To bound \m {\VNm {\V {d}} _2}, we illustrate that \m {\V {g}} can be seen as sparse, and for that purpose we generously bound \m {\d_{S}} by \m {1}.
We shall see below that it suffices to set
\Disp {
\g
= \R {2 \log N_h}
}

The propositions below are taken from \cite {CaT07} and modified slightly according to our settings.

\textbf {Proposition 5}
\Disp {
\VNm {\V {d} _{\SB{\mathcal {C}}}} _1
\leq \VNm {\V {d} _{\SB{\mathcal {A}}}} _1
+\VNm {\V {g} _{\SB{\mathcal {C}}}} _1
}

\textbf {Proposition 6}
\Disp {
\VNm {\M {P}^\dagger \M {P} \V {d}} _\infty
\leq 2 \R {2 \log N_h}
}
for probability \m {p}, with
\Disp {
1 -p
\leq N_h^{-1}.
}

\textbf {Proposition 7}
\Disp {
\VNm {\V {d}} _2
\leq \VNm {\V {d} _{\SB {\mathcal {AB}}}} _2 + \frac {1} {\R {S}} \VNm {\V {d} _{\SB{\mathcal {C}}}} _1
}

\textbf {Proposition 8}
\Disp {
\VNm {\V {d} _{\SB{\mathcal {AB}}}} _2
\leq \frac {1} {1- \R{2} \d_{S}} \VNm {P _{\SB {\mathcal {AB}}}^\intercal P d} _2
+ \frac {\R{3} \d_{S}} {\RB {1- \R{2} \d_{S}} \R {S}} \VNm {d_{\SB{\mathcal {C}}}} _1
}

Finally, we shall show the proposed bound.
For simplicity, set \m {S = Ls^2}, thus \m {S =L \log N_h}.
And, for concreteness, suppose \m {\d_S \leq 1/8}.

\textbf {Theorem 9}
Let \m {\V {y}}, \m {\M {P}}, \m {\V {g}}, \m {\hat {\V {g}}}, \m {\V {d}} be defined as above.
Then it holds that
\Disp {
\VNm {\V {d}} _2
\eqsim \mathcal {O} \RB {\R {L} \R {\log N_h}^3}
}
for probability \m {p}, with
\Disp {
1 -p
\eqsim \mathcal {O} \RB {\mathsf {e} ^{-N_R \R {\d_s} /4}}
}

To show this, by the definition of truncation, by \m {\ell_p} norm inequality, by Proposition 6,
\Disp {
\VNm {\M {P} _{\SB {\mathcal {AB}}}^\intercal \M {P} \V {d}} _2
\leq &\VNm {\M {P}^\intercal \M {P} \V {d}} _2 \\
\leq &\R {S} \VNm {\M {P}^\intercal \M {P} \V {d}} _\infty \\
\leq &2.83 \R {L} \log N_h
}
By \m {\ell_p}-norm inequality, by the definition of truncation, by Proposition 8, and by above,
\Disp {
\VNm {\V {d} _{\SB{\mathcal {A}}}} _1
\leq &\R {S} \VNm {\V {d} _{\SB{\mathcal {A}}}} _2 \\
\leq &\R {S} \VNm {\V {d} _{\SB{\mathcal {AB}}}} _2 \\
\leq &3.44 L \R {\log N_h}^3
+0.262 \VNm {\V {d} _{\SB{\mathcal {C}}}} _1
}
Then, substituting this and Proposition 2 above into Proposition 5, we get
\Disp {
\VNm {\V {d} _{\SB{\mathcal {C}}}} _1
\leq 5.12 L \RB {\log N_h}^2
}
Now Proposition 8 becomes
\Disp {
\VNm {\V {d} _{\SB{\mathcal {AB}}}} _2
\leq 3.44 \R {L} \log N_h + 1.35 \R {L} \R {\log N_h} ^3
}
Finally, by plugging \m {\VNm {\V {d} _{\SB{\mathcal {AB}}}} _2} and \m {\VNm {\V {d} _{\SB{\mathcal {C}}}} _1} into Proposition 7, we get
\Disp {
\VNm {\V {d}} _2
\leq 4.79 \R {L} \R {\log N_h}^3
}
Therefore, we set \m {\chi = \R {L} \R {\log N_h}^3}, so that \m {\VNm {\V {d}} _2 = \mathcal {O} \RB {\chi}}, as claimed.
The failure probability is taken from Proposition 3.

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

\section{Simulation}

\subsection{Settings}

First, complex numbers have to be recorded as the real and imaginary parts, to speed up calculation.
Let \m {\mathcal {R}} denote the representation of complex vectors and matrices by real vectors and matrices.
With definitions \m {\tilde {\V {y}} = \mathcal {R} \RB {\V {y}}},
\m {\tilde {\V {g}} = \mathcal {R} \RB {\V {g}}},
\m {\tilde {\M {P}} = \mathcal {R} \RB {\M {P}}},
\m {\tilde {\V {z}} = \mathcal {R} \RB {\V {z}}},
we have by construction
\Disp {
\V {\tilde {y}}
= \M {\tilde {P}} \V {\tilde {g}} +\V {\tilde {z}}
}

To do convex optimization, we choose the Python library CVXPY.
Considering its high complexity, there are several possible methods.
First of all, it is equivalent to a linear program.
Moreover, we may apply DS more than once to better estimate the nonzero components:
We apply DS for the first time, and we extract largest components of the estimated vector, then apply Moore–Penrose inverse to get the returned solution, before scrambling back the resulting indices to the original ones.
In doing such successive estimation, it is possible to have more than one stage of extraction \cite {CaT07}.

Alternatively, in our investigation, we cast DS into a basis pursuit denoising form, for suitable \m {\l} \cite {BoV04} as below.
\Disp {
\Hat {\V {g}}
\leftarrow \Min {\V {g}' \in \mathbb {C} ^{N_{H,t} N_{H,r}}}
\RB {\VNm {\V {g}'} _1 + \l \VNm {\M {P}^\Adj \RB {\V {y} -\M {P} \V {g}'}} _\infty}
}
However, there is no simple way to determine the value of \m {\l} in advance.
We have tried \m {\l = N_{H,t} N_{H,r} / \g_{\mathrm {DS}}} in the simulation.

In addition to DS, we shall simulate OMP for three different stop conditions, Lasso, and Moore Penrose pseudoinverse (marked as LS which stands for least square).
Each data point for DS and Lasso is repeated for \m {256} times, and taken arithmetic average.
Other methods are repeated for more times: OMP for \m {4 \D 256} times, LS for \m {12 \D 256} times.

Let \m {1/\s} be the SNR, which takes value starting with \m {2^{-2}}, and being multiplied by powers of \m {\R {2}}, for \m {6} values.
We take \m {N_B} to be \m {2, 4, 6}, respectively.
Three series of plots are simulated.
The first series for \m {N_{H,t} = 3 N_B} and \m {N_{H,r} = 3 N_B}.
The second series for \m {N_{H,t} = 3 N_B} and \m {N_{H,r} = 4 N_B}.
The third series for \m {N_{H,t} = 4 N_B} and \m {N_{H,r} = 3 N_B}.
Unfortunately, this is very far from achieving the ideal values for which our approximation is valid, and this may be part of the reason the result is not as successful as expected.

Other parameters are fixed in these experiments.
The number of grid of quantization of phase shifters is \m {16}.
The number of paths \m {L = \lfloor \R {N_{H,t} N_{H,r}} / 2 \rfloor}.
The ratio of the wavelength of carrier over the antenna spacing, \m {\l _{\mathrm {ant}} / d _{\mathrm {ant}} = 1 / 2}.

Denote the threshold for DS to be \m {\g_{\mathrm {DS}}}, and similar threshold of Lasso to be \m {\g_{\mathrm {Lasso}}}.
We set \m {\g_{\mathrm {DS}} = 2 \log \RB {N_{H,t} N_{H,r}}} as suggested in \cite {CaT07}.
For sake of comparison, \m {\g_{\mathrm {Lasso}} = \g_{\mathrm {DS}}}.

For OMP, we consult Cai and Wang \cite {CaW11} for \m {\ell _2}-norm condition in their Theorem 7, and \m {\ell _\infty}-norm condition in their Theorem 8.
We take \m {\h_{\mathrm {OMP}} = \R {2 \log \RB {N_{H,t} N_{H,r}}}} for \m {\infty}-norm condition, \m {\h_{\mathrm {OMP}} = \R {3 N_B}} for 2-norm condition.

For Lasso, \m {\l _{\mathrm {Lasso}}} is also crucial to the performance, but cannot be obtained in advance.
Thus, for sake of comparison, we set the same threshold for Lasso and DS.
In view of the fact that \m {\VNm {g} _1 \leq 2 N_{H,t} N_{H,r} \VNm {g} _\infty}, we tentatively set \m {\l _{\mathrm {DS}} =  N_{H,t} N_{H,r} / \g _{\mathrm {DS}}} and \m {\l _{\mathrm {Lasso}} =  1 / \g _{\mathrm {Lasso}}}.
Still, there may be other values of \m {\g} (or \m {\l}) for which DS and Lasso are both better.

For performance metric, we also follow Lee, Gil, and Lee \cite {LGL16} to use
\Disp {
\tilde {\chi}
=\RB {
   \frac {\log_2 {\VNm {\V {h} -\hat {\V {h}}} _2}}
   {\log_2 {\VNm {\V {h}}_2}}
} _{\mathsf {avg}},
}
However, we remark that when \m {\VNm {\V {h}}_2} is small, this can blow up.
Indeed, since we did not consider a definite a channel model in this treatise, \m {\T {\chi}} may not necessarily be proportional to the channel capacity.

\subsection {Result}

In the following, we plot for different values and ratios of \m {N_B, N_{H,t}, N_{H,r}}.
We fix \m {N_R = \RB {3/2} N_B}, and with \m {6} sets of observation.

\begin {figure} [H]
\includegraphics [width = 0.45 \textwidth]
{error-small-more-tall-six-usual.png}
\caption {\m {N_B = 2, N_{H,t} = 6, N_{H,r} = 8}, error.}
\end {figure}

\begin {figure} [H]
\includegraphics [width = 0.45 \textwidth]
{error-small-more-wide-six-usual.png}
\caption {\m {N_B = 2, N_{H,t} = 8, N_{H,r} = 6}, error.}
\end {figure}

\begin {figure} [H]
\includegraphics [width = 0.45 \textwidth]
{error-medium-more-tall-six-usual.png}
\caption {\m {N_B = 4, N_{H,t} = 12, N_{H,r} = 16}, error.}
\end {figure}

\begin {figure} [H]
\includegraphics [width = 0.45 \textwidth]
{error-medium-more-wide-six-usual.png}
\caption {\m {N_B = 4, N_{H,t} = 16, N_{H,r} = 12}, error.}
\end {figure}

\begin {figure} [H]
\includegraphics [width = 0.45 \textwidth]
{error-big-more-tall-six-usual.png}
\caption {\m {N_B = 6, N_{H,t} = 24, N_{H,r} = 18}, error.}
\end {figure}

\begin {figure} [H]
\includegraphics [width = 0.45 \textwidth]
{error-big-more-wide-six-usual.png}
\caption {\m {N_B = 6, N_{H,t} = 18, N_{H,r} = 24}, error.}
\end {figure}

\subsection {Discussion}

From the simulation, DS outperforms other methods in most of the datasets.
With low noise, \m {\tilde {\chi} _{\mathrm {DS}} \approx \tilde {\chi} _{\mathrm {OMP}} \leq \tilde {\chi} _{\mathrm {Lasso}} \leq \tilde {\chi} _{\mathrm {LS}}},
although sometimes \m {\tilde {\chi} _{\mathrm {DS}} \geq \tilde {\chi} _{\mathrm {OMP}}}.
With high noise, \m {\tilde {\chi} _{\mathrm {DS}} \approx \tilde {\chi} _{\mathrm {Lasso}} \leq \tilde {\chi} _{\mathrm {OMP}} \leq \tilde {\chi} _{\mathrm {LS}}}.
although sometimes \m {\tilde {\chi} _{\mathrm {DS}} \geq \tilde {\chi} _{\mathrm {Lasso}}}.
LS is so much poorer that it is not a main contender.
These trends is true with different number of stages, and with the case \m {N_B = N_R}.
In general, we can say that overall, DS gives a better regularization for both low noise and high noise scenario, and in most cases, DS is even better than both of them.

Differing thresholds does not to seem have much effect on OMP and DS.
Meanwhile for Lasso, where a suitable threshold may improve the accuracy, but a excessively tight threshold may also result in a overfitting, and blowing up for high signal cases.
Increasing the number of stages obviously improves the estimation for all methods.

Unfortunately, we report that CVXPY sometimes gives overflowing values, some of them as large as \m {10^{11}}.
This probably indicates some typical-looking output may in fact be unreliable.
Therefore we have discarded outputs larger than a given threshold, for instance \m {10^4}, and simply return the answer to be a Moore–Penrose inverse.

\m {\chi} is not shown in the figure, because the big O bound is much larger than \m {\tilde {\chi}}.
It is possible that the nonsparsity of \m {\V {g}} undermines the analysis in chapter 3, despite our attempts to account for that effect.
It is curious to see whether for very large \m {N_H}, whether \m {\tilde {\chi}} and \m {\chi} will be asymptotically close.

\subsection {Complexity}

We discuss the complexity of DS, Lasso, and OMP.
For DS, suppose a linear program has an \m {N} dimensional variable and \m {M} inequality constraints, then its complexity is \m {\mathcal {O} \RB {N^2 M}}, assuming the Dantzig simplex method is used \cite {BoV04}.
For our case, that would be \m {\mathcal {O} \RB {4 N_h ^2 \D 8 N_h} = \mathcal {O} \RB {N_h ^3}}.

Alternatively, suppose Newton method is used.
Here, we have self-concordance for linear program \cite {BoV04}.
Let \m {\V {g} _0} denote the starting value of \m {\V {g}'}, and \m {\V {g} ^{\star}} the the point of convergence.
Then the number of Newton steps, which we take to be the complexity, is bounded by \cite {BoV04}
\Disp {
N_{\mathrm {Newton}}
\propto \RB {\VNm {\V {g}_0 -\V {g} ^{\star}}_1
+ \log_2 \log_2 \frac {1} {\e}}
}

Assume that, at the start the iteration, the Moore–Penrose inverse is close to the initial value of \m {\V {g}_0}, namely
%
\Disp {
\V {g}_0
=\V {g}_{\mathrm {LS}}
= \RB {\M {P} ^\dagger \M {P}} ^{-1} \M {P} ^\dagger \V {y}
}
And suppose that, in view of restricted isometry, \m {\M {P}} has unity-normed, almost orthogonal columns, so that
\m {\M {P} ^\dagger \M {P} \approx I _{N_h}}
Moreover, assume that \m {\V {g} ^\star \approx \V {g}}.
Then we simply have
\Disp {
C_{\mathrm {DS}}
=\mathcal {O} \RB {N_h ^3}
}

For OMP \cite {TrG07}, \m {C_{\mathrm {OMP}} =\mathcal {O} \RB {L \RB {\log N_h} ^2}}.

For Lasso, it is equivalent to a quadratically constrained quadratic program, and there is not always a closed form for its complexity.
However, Lasso and DS are equivalent in certain conditions \cite {AsR10}, and we may suppose here they have the same complexity.
Alternatively, an argument similar to the above one for DS is valid for Lasso.
Therefore we take \m {C_{\mathrm {Lasso}} =\mathcal {O} \RB {N_h ^3}}.

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

\section{Conclusion}

The treatise aims to answer the problem of effective estimating a MIMO mm-wave channel by exploiting its sparsity.
To do so, we apply the Dantzig Selector (DS), by exploiting the sparsity in the spatial frequency domain, and justified the restricted isometry of the effective beamforming matrix.
We then prove quantitatively that the expected error norm is bounded for overwhelming probability.
We also suggest several ways of reducing the complexity without losing much performance.
Simulation is done, and we see that DS indeed outperforms other methods in most datasets.

Since we have RIP, a whole series of compressive sensing techniques become possible.
But moreover, we corroborate the prediction that DS gives better regularization, and it may extract more information than other methods do when the sampling rate is low.
In particular, when the sample is less abundant and the noise level is higher, sometimes only DS can recover successfully.
Therefore, one may use DS for sake of higher precision, or with limited RF chains and fewer stages of estimation, for example, in the ultra reliable or low latency scenario.

\section*{Acknowledgment}

The authors would like to thank the heaven.

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

\begin{thebibliography}{30}
\bibitem{RSM13}
T. S. Rappaport, S. Sun, R. Mayzus, H. Zhao, Y. Azar, K. Wang, G. N. Wong, J. K. Schulz, M. Samimi, and F. Gutierrez, “Millimeter wave mobile communications for 5g cellular: It will work!” \textit {IEEE access}, vol. 1, pp. 335–349, 2013.
\bibitem{RDD18}
M. Rani, S. B. Dhok, and R. Deshmukh, “A systematic review of compressive sensing: Concepts, implementations and applications,” \textit {IEEE Access}, vol. 6, pp. 4875–4894, 2018.
\bibitem{CaT05}
E. J. Candès and T. Tao, “Decoding by linear programming,” \textit {IEEE Transactions on Information Theory}, vol. 51, no. 12, p. 4203, 2005.
\bibitem{CaT07}
E. Candès and T. Tao, “The dantzig selector: Statistical estimation when p is much larger than n,” \textit {The annals of Statistics}, vol. 35, no. 6, pp. 2313–2351, 2007.
\bibitem{BDD08}
[6] R. Baraniuk, M. Davenport, R. DeVore, and M. Wakin, “A simple proof of the restricted isometry property for random matrices,” \textit {Constructive Approximation}, vol. 28, no. 3, pp. 253–263, 2008.
\bibitem{BHS10}
W. U. Bajwa, J. Haupt, A. M. Sayeed, and R. Nowak, “Compressed channel sensing: A new approach to estimating sparse multipath channels,” \textit {Proceedings of the IEEE}, vol. 98, no. 6, pp. 1058–1076, 2010.
\bibitem{BHR08}
W. U. Bajwa, J. Haupt, G. Raz, and R. Nowak, “Compressed channel sensing,” 2008 \textit {42nd Annual Conference on Information Sciences and Systems}, pp. 5–10, 2008.
\bibitem{AsR10}
M. S. Asif and J. Romberg, “On the lasso and dantzig selector equivalence,” 2010 \textit {44th Annual Conference on Information Sciences and Systems} (CISS), pp. 1–6, 2010.
\bibitem{LLL17}
L. Lian, A. Liu, and V. K. Lau, “Optimal-tuned weighted lasso for massive mimo channel estimation with limited rf chains,” \textit {IEEE Global Communications Conference}, pp. 1–6, 2017.
\bibitem{DJN15}
G. Destino, M. Juntti, and S. Nagaraj, “Leveraging sparsity into massive mimo channel estimation with the adaptive-lasso,” \textit {IEEE Global Conference on Signal and Information Processing} (GlobalSIP), pp. 166–170, 2015.
\bibitem{VAT19}
E. Vlachos, G. C. Alexandropoulos, and J. Thompson, “Wideband mimo channel estimation for hybrid beamforming millimeter wave systems via random spatial sampling,” \textit {IEEE Journal of Selected Topics in Signal Processing}, vol. 13, no. 5, pp. 1136–1150, 2019.
\bibitem{TrG07}
J. A. Tropp and A. C. Gilbert, “Signal recovery from random measurements via orthogonal matching pursuit,” \textit {IEEE Transactions on information theory}, vol. 53, no. 12, pp. 4655–4666, 2007.
\bibitem{ALH15}
A. Alkhateeb, G. Leus, and R. W. Heath, “Compressed sensing based multi-user millimeter wave systems: How many measurements are needed?” 2015 \textit {IEEE International Conference on Acoustics, Speech and Signal Processing} (ICASSP), pp. 2909–2913, 2015.
\bibitem{HWH13}
D. Hu, X. Wang, and L. He, “A new sparse channel estimation and tracking method for time-varying ofdm systems,” \textit {IEEE Transactions on Vehicular Technology}, vol. 62, no. 9, pp. 4648–4653, 2013.
\bibitem{LGL16}
J. Lee, G.-T. Gil, and Y. H. Lee, “Channel estimation via orthogonal matching pursuit for hybrid mimo systems in millimeter wave communications,” \textit {IEEE Transactions on Communications}, vol. 64, no. 6, pp. 2370–2386, 2016.
\bibitem{GDW15}
Z. Gao, L. Dai, Z. Wang, and S. Chen, “Spatially common sparsity based adaptive channel estimation and feedback for fdd massive mimo,” \textit {IEEE Transactions on Signal Processing}, vol. 63, no. 23, pp. 6169–6183, 2015.
\bibitem{CWX10}
T. T. Cai, L. Wang, and G. Xu, “Stable recovery of sparse signals and an oracle inequality,” \textit {IEEE Transactions on Information Theory}, vol. 56, no. 7, pp. 3516–3522, 2010.
\bibitem{CaW11}
T. T. Cai and L. Wang, “Orthogonal matching pursuit for sparse signal recovery with noise,” \textit {IEEE Transactions on Information Theory}, 2011.
\bibitem{BEE10}
Z. Ben-Haim, Y. C. Eldar, and M. Elad, “Coherence-based performance guarantees for estimating a sparse vector under random noise,” \textit {IEEE Transactions on Signal Processing}, vol. 58, no. 10, pp. 5030–5043, 2010.
\bibitem{ALS14}
M. R. Akdeniz, Y. Liu, M. K. Samimi, S. Sun, S. Rangan, T. S. Rappaport, and E. Erkip, “Millimeter wave channel modeling and cellular capacity evaluation,” \textit {IEEE journal on selected areas in communications}, vol. 32, no. 6, pp. 1164–1179, 2014.
\bibitem{LaM00}
B. Laurent and P. Massart, “Adaptive estimation of a quadratic functional by model selection,” \textit {Annals of Statistics}, pp. 1302–1338, 2000.
\bibitem{KlM17}
B. Klartag and E. Milman, \textit {Geometric Aspects of Functional Analysis}. Springer, 2017.
\bibitem{BoV04}
S. Boyd and L. Vandenberghe, \textit {Convex optimization}. Cambridge U. press, 2004.
\bibitem{FrS07}
M. P. Friedlander and M. A. Saunders, “Discussion: The dantzig selector: Statistical estimation when p is much larger than n,” \textit {The Annals of Statistics}, vol. 35, no. 6, pp. 2385–2391, 2007.

\end{thebibliography}

\end{document}


\documentclass{article}
\usepackage{graphicx}
\usepackage{tipa}
\date{February 24, 2018}

\begin{document}
\title{Finding Lane Lines, Part 1}
\author{Alexander Mont}
\maketitle
\section{Pipeline Overview}

Here is a simple project for finding the lane lines on a road image. The pipeline consisted of the following steps:

\begin{enumerate}
\item First, we convert the image to grayscale. This is because the subsequent algorithms to be run on this, such as Canny edge detection, only work on grayscale images. Note that we do this by using the OpenCV function \texttt{cv2.cvtColor(img, cv2.COLOR\_RGB2GRAY}, which treats all of the three color channels (red, green, blue) equally.
\item Then, we apply Canny edge detection. Canny edge detection works by computing the \emph{gradient} (difference between adjacent pixels) of the image, and highlights only the places where this gradient is highest - i.e., where there is an edge. Note that this effectively turns a segment of a lane line (a dotted line) into a quadrilateral, and turns a solid lane line into two edges.
\item The output of Canny edge detection is just a pixel bitmap showing which pixels are part of edges. Now we need to turn these pixels into lines. To do this we use the Hough transform, and algorithm which does the following:
\begin{enumerate}
\item Considers the ``space of possible lines'' defined by $\theta$ (the angle of the line), and $\rho$ (the shortest distance of the line from the origin) - this is referred to as the ``Hough space''.
\item Each highlighted point defines a curve in the Hough space representing the possible lines that contain that point.
\item Points in Hough space where lots of the above lines intersect represent lines in the original space (the more Hough curves intersect at that point in Hough space, the longer that line is)
\end{enumerate}
\item This process is likely to generate multiple lines for each lane line, so we must now combine these lines into just two lines - one on the left side and one on the right side. We do this as follows:
\begin{enumerate}
\item Divide up the lines into two categories: one with negative slope (on the left) and one with positive slope (on the right). The negative slope is on the left because the X axis goes from left to right, but the Y axis goes from the top dow.
\item In each of these categories, compute the \emph{smallest} (absolute value of) slope, where slope here is defined as $\frac{x}{y}$ - note that this is different from how slope is usually defined. We do it this way so that a nearly vertical line will not cause numerical issues due to the extremely high slope (and we expect nearly vertical lines to be more frequent than nearly horizontal lines(
\item On each side, we consider only Hough lines with a slope of no more than 0.2 away from this ``smallest slope''. The purpose of this is to filter out any lane lines other than the lines that bound the lane the car is in (a lane line multiple lanes over will have a higher slope)
\item We compute the average of the slopes of these lines to get the overall slope of the lane line, and then compute the intercept by fitting a line of the given slope through the endpoints of all the Hough lines.
\end{enumerate}
\item Then we draw the overall lane lines.
\end{enumerate}

It is also possible to use this algorithm to annotate the lane lines in a video by applying the above algorithm to each frame in the video. When I did this I noticed that the drawn lane lines jumped around a lot from frame to frame even though the actual lane lines do not appear to move that much. Thus I changed my algorithm in this case to compute the slope of each line in a given frame as (0.95 * slope of line from previous frame) + (0.05 * observed average slope of the Hough lines as described above). Thus this significantly dampens the frame-to-frame vibrations.

\section{Discussions and Improvements}

Here are some of the shortcomings of this algorithm and ways it could be improved. I plan to implement these and other improvements in a future project.

\begin{enumerate}
\item The slopes of the Hough lines appear to change a lot from frame to frame spuriously. It is likely that this is because the edges obtained by the Canny edge detection are only one pixel wide (all the pixels in the "middle" of the lane line are thrown out) so a change in even a few of these pixels may significantly change the slope. A better approach may be to note that we don't really care about the \emph{edges} of the lane line per se (the ``lane line'' is really a thin quadrilateral) what we care about is the overall lane line. Therefore, a better approach may be to not use Canny edge detection at all. A better approach may be to do the following:
\begin{enumerate}
\item Use thresholding to identify which pixels in the image are likely part of lane lines. for instance, any white or yellow pixels are likely part of lane lines. So the thresholding could be based on just the red and green color channels, since yellow has high red and green but low blue.
\item Use a flood fill or similar algorithm to segment these ``likely pixels'' into contiguous groups.
\item Try to identify which contiguous groups are lane lines on the road (as opposed to other objects such as white or yellow cars). Note that a lane line or lane line segment is expected to be long and thin. Thus, if one took all the $(x,y)$ coordinates of pixels in a lane line and did PCA on them, one would expect to see one very large principal component and one much smaller principal component. This pattern could be easily identified.
\item Once we have a contiguous group of pixels that represents a lane line, we can fit a line through it (e.g. using a least squares fit) to get the slope and intercept.
\end{enumerate}
\item The smoothing technique used between frames in the video works well for the test videos in this project where the car is moving roughly straight, but may not work well in a scenario where the car is changing lanes so the slope of the lane lines actually is changing significantly - it might be slow to catch up. A better solution here may be a Kalman filter which stores as its state both the current slope and a rate of change in slope. Thus if the car was e.g. changing lanes, where the lane line's slope is smoothly changing, the filter would pick up on this and track it.
\item The identifying of each lane line by a slope and intercept assumes that it is a straight line. This may not be true if the road is curving or if there is a hill in front of the car This is a major flaw because both of these situations are likely to require action by a self-driving car, so the car would want to know about it. A solution here may be to, after the lane line segments on the road have been identified as described above, to use some sort of clustering algorithm to find "clusters" of these line segments in Hough space, and assume that similar clusters represent the same lane lines. This would also mean that the algorithm wouldn't need to assume that there are two primary lane lines, one on each side - it could detect other things that look like lane lines.
\end{enumerate}

\end{document}


% !TEX root = ../main.tex
\newpage
\section{\mywork Mean Field Reductions for Undirected Graphs} \label{sec:MFRSUndirected}
We will now investigate the questions that were raised after deriving the \MFR. How do we deal with the curse of dimensionality concerning the degree distribution? If the synchronisation dynamics of the network of Theta neurons in \eqref{eq:thetaneuronnetwork} can be predicted by the Ott-Antonsen reductions \eqref{eq:OttAntonsenMeanField}, then it can also be measured by the order parameter \eqref{eq:orderparameter}. These systems describe the same quantity, but how can we show that?

\subsection{Directed graphs as permutations}
%So how can we use the \MFR efficiently when the network is a directed graph with an asymmetrical adjacency matrix? Let us investigate.
So how can we use the \MFR when the network is a directed graph?
\begin{list}{$\bullet$}{}
\item Sampling $\kinb$ and $\koutb$ from a bivariate distribution requires us to find the marginal distribution of $P$ for $\kinb$, sampling $\kinbi$, and then sampling $\koutbj$ from $P$ while keeping $\kinbi$ fixed. This is a cumbersome process. And what relation would there be between $\kinb$ and $\koutb$?
\item However, if we assume that the marginal distributions for $\kinb$ an $\koutb$ are independent, there is a simplification to be found. We can even assume that the two marginal distributions are identical univariate distributions.
\item Hence, we can sample $\kinb$ from a univariate distribution and find $\koutb = \permute ( \kinb )$ so that the total number of links remains constant. This is an important trait, as we do not have to rely on the sheer size of the network to yield a constant number of links on average.
\end{list}

This hypothesis can be tested: we assume that $P(\k) = P(\kin) \cdot P(\kout)$ so that $P$ consists of two identical and independent distributions, given by the distributions presented in Chapter \ref{sec:NetworkTopologies}. Then, we sample $\kinb \sim P(\kin)$ and perform a permutation to find $\koutb$. The surface given by $P(\k)$ and the histogram of $\k_j$ have been plotted in Figure \ref{fig:2Ddistributions}. As we can see, the variates follow the distribution well.

\begin{figure}[ht]
\centering
\includegraphics[width = \textwidth]{../Figures/Distributions/2D.pdf}
\caption{Bivariate distributions for different network topologies, using 10$^4$ number of samples. The surface given by $P(\k)$ is well approximated by the histogram of variates sampled from a univariate distribution, used as the marginal distribution. $\kmean =  2 \times 10^3$ for all topologies, $p \approx 0.2$ for the random network and $\gamma = 4.3$ for the scale-free network.}
\label{fig:2Ddistributions}
\end{figure}
%Hence, we can use univariate distributions in our simulations of the Ott-Antonsen Mean Field \eqref{eq:OttAntonsenMeanField}.
However, the problem remains the same: $\K$ is too large to simulate the dynamics of the network.

What we can do, is use $P(k)$ in the Ott-Antonsen reduction for a symmetric network, and observe how much the solution of the asymmetric network differs from the reduction of the symmetric network. This is an attainable goal.

\subsection{Building the adjacency matrix} \label{sec:buildingA}
If we want to simulate the network of theta neurons we need to construct the adjacency matrix. We can find an exact solution for $A$ given the degree vectors in \eqref{eq:definekinkoutfromP}. $A_{ij}$ represents a directed graph, but $A_{ij} \neq A_{ji}$ is not a necessary condition. For the elements of $A_{ij}$ we need to find $N^2$ number of variables. We have the following constraints:
\begin{enumerate}
\item The column- and row-sums of $A_{ij}$ must be equal to $\kinb$ and $\koutb$, see (\ref{eq:definekinkoutfromA}). 2$N$ constraints.
\item Self-coupling is mandatory: $A_{ii} = \boldsymbol{1}$. $N$ constraints. \cite{OttAntonsen2017}
\item The total number of links is constant: $\sum_{i=1}^{N} \kinbi \equiv \sum_{j=1}^{N} \koutbj \equiv \sum_{i,j=1}^{N}A_{i j}$. 1 constraint.
\end{enumerate}
This means that there are $N^2 - (3N + 1)$ variables to find. Once a solution has been found, $A_{ij}$ can be switched with element $A_{ic}$ if $A_{ij} \neq A_{ic}$ and $A_{rj}$ with $A_{rc}$, which yields another feasible solution. The solutions to this problem are thus bound by permutation symmetry. The number of switches one can make is high, and therefore we can simply try a stochastic approach to obtain $A$:
\begin{enumerate}
\item Choose a random row $i \in [1,N]$. $A_{i,i} = 1$, so we need $m = \kinbi - 1$ elements that are 1.
\item Perform $\permute ( \koutbj, j \neq i)$ and therein find the indices $\boldsymbol{\ell}$ of the $m$ first largest elements.
\item Set $A_{il} = 1 \: \: \forall \: \: l \in \permuteinv (\boldsymbol{\ell})$.
\end{enumerate}
Algorithms that find the largest value in a vector start from the first or the last element. The permutation in step 2 allows us to find different maxima every time by shuffling the row, which greatly reduces the event that constraint 1 does not hold. In practice, this stochastic method finds a solution for $A$ within 5 tries.

\begin{figure}[H]
\centering
\includegraphics[width = \textwidth]{../Figures/Adjacency_matrices.pdf}
   \caption{Adjacency matrices for different types of networks with $N$ = 500 and $\kmean$ = 100. We can see how the fixed-degree network is quite homogeneous, while the random network shows some more clustering. The scale-free network has a low number of nodes with a very high degree, which is why we see vertical and horizontal stripes in the adjacency matrix.}
   \label{fig:adjacencymatrices}
\end{figure}

\subsection{Initial conditions: analytical versus numerical approaches} \label{sec:initialconditions}
As our goal is to compare theory and simulations, we need to be able to start both at the exact same condition. This notion requires us to transform between the three number sets that our dynamics are described in: $\theta \in \T^N$, $z \in \C^{M_{\k}}$ and $Z, \bar{Z} \in \C$. It is really only necessary to find a transformation that holds accurately for $t=0$, as the distribution of $\theta$ and $z$ over their number set is unknown, but we assume they converge to that distribution when the systems are computed.

%As the systems in \cref{eq:orderparameter,eq:OttAntonsenMeanField,eq:MeanField} describe the same dynamics for fully connected networks, it is important to be able to transform initial conditions between systems. If we expect their behaviour to be the same, then we need to test that by starting from the same point in time. Hence we can test whether \textsl{macroscopically} we can find the same equilibria, but we can also test \textsl{microscopically} whether the systems arrive at those points at the same time.

%The order parameter \ref{eq:orderparameter} and the mean-field order parameter \eqref{eq:OttAntonsenMeanField} describe the same dynamics for fully connected networks. Testing this hypothesis

%  If the initial conditions of all systems are exactly the same, then we should find that they describe the exact same behaviour.
% - macroscopically and microscopically - and this is the best way to test the \MFR theory.

%When transforming between $\theta_i(t) \leftrightarrow z(\k,t) \leftrightarrow Z(t)$ we go from $\T^N \leftrightarrow \C^{M_\k} \leftrightarrow \C$. If we have the same initial conditions, then all systems will predict the same behaviour. We will only map everything to $\C$.\\
As we can optimally study the behaviour of $Z$ and $\bar{Z}$ in the complex unit circle, the most important transformations are those that yield $\theta$ and $z$ from $Z$ and $\bar{Z}$ respectively. Hence, we can start our simulations anywhere in $\C$, close to the limit cycle in Figure \ref{fig:MFRCPW} for example. Our analysis will benefit from this advantage. \\

%As we can study the behaviour of $Z$ and $\bar{Z}$ in the complex unit circle, the most important relation we need to find is the transformation from $\C$ to $\T^{N}$ and from $\C$ to $\C^{M_{\k}}$, which yield the phase angles $\theta_i(0)$ and the degree dynamics $z(\k,0)$ from $Z(0)$ and $\bar{Z}(0)$ respectively. \\

% The following maps can be used to transform the initial conditions, but as they do not give any qualitative information on the dynamics or distributions of the variables, they are not valid for transforming between dynamics. \\

Let us start with the simplest transformation. Given an initial phase angle $\theta_i(0)$ or initial degree dynamics $z(\k, 0)$ we wish to find their resulting description in the complex unit circle. Mapping operations onto the order parameter is straightforward using \eqref{eq:orderparameter} and \eqref{eq:OttAntonsenMeanField}:
\begin{align}
\theta_i(0) \xrightarrow{\hspace*{8mm}} Z(0) &= \frac{1}{N} \sum_{j=1}^N e^{\ic\theta_j(0)} \label{eq:thetatoZ}\\
z(\k,0) \longrightarrow \bar{Z}(0) &= \frac{1}{N} \sum_{\k \in \K} P(\k) z(\k, 0)  \label{eq:ztoZ}
\end{align}
Here we can immediately see that information about the distribution of $\theta$ and $z$ is lost when taking the (weighed) average.

Starting from an initial synchronization $Z(0)$ and taking the inverse tranfsormation, we can make use of the fact that a set of identical values has an average equal to that value. This is simple for $\theta_i(0)$: we can take all phase angles to be the same at $t = 0$. For $z(\k,0)$ we have a weighed average which we need to invert, while making sure that the whole sums up to $N$ by multiplying with the total number of neurons $n(\k)$ of degree $\k$:
\begin{align}
Z(0) \xrightarrow{\hspace*{8mm}} \theta_i(0) &= -\ic \cdot \log \left( Z(0) \right)  \label{eq:Ztotheta} \\
Z(0) \longrightarrow z(\k,0) &= \frac{Z(0) \cdot n(\k)}{P(\k)} \label{eq:Ztoz}
\end{align}
It is necessary to include $n(\k)$, as $P$ is only accurate in the limit that $N \rightarrow \infty$. This approach only alters the magnitude of $Z(0)$, so that $z(\k,0)$ will be distributed on a line through $Z(0)$. Then, transforming between $\theta_i$ and $z(\k)$, we need to filter $\theta_i$ per degree as there exist $n(\k)$ number of nodes with $\degree ( \theta_i ) = \k$:
\begin{alignat}{2}
z(\k,0) \longrightarrow \theta_i(0) &= -\ic \cdot \log \left( \frac{z(\k)\cdot P(\k)}{n(\k)} \right) \qquad &&\forall \: \theta \in \{ \theta \: | \: \degree(\theta) = \k \}  \label{eq:ztottheta}\\
\theta_i(0) \longrightarrow z(\k,0) &= \sum_{\k} e^{\ic \vartheta_{\k}} \qquad \qquad &&\forall \: \vartheta_{\k} \in \{ \vartheta_{\k} = \sum^{n(\k)} \theta \: | \: \degree(\theta) = \k \} \label{eq:thetatoz}
\end{alignat}
%We can see how $\lim_{N \rightarrow +\infty} n(\k) = P(\k)$, which makes these maps exact for any network size.
%The reason that these transformations can only hold for the initial state is because it is currently unknown what distributions $\theta_i(t)$ and $z(\k,t)$ should have. That information is lost when taking the (weighed) average in \eqref{eq:orderparameter} and \eqref{eq:MeanField}. \\

The relations derived here raise problems when $P(\k)$ spans different orders of magnitude. \eqref{eq:Ztoz} does not bound $z$ to its set, so it might occur that the distribution of $z$ has values outside of the complex unit circle. However, transforming back to $\bar{Z}$ will always be correct. This problem does not occur for $\theta$, as $\T$ is a one-parameter group so that multiplication and division of elements in the group remain in the group. Let us look at the example in Figure \ref{fig:mappings}, where we are trying to find $z(\k, 0)$ so that $\bar{Z}(0)$ is equal to the desired initial condition $Z(0) = $ -0.2 + $\ic$0.8, using a scale-free topology. \\

%The initial values of $z$ are not bound on $\C$, so it might occur that the initial condition given through \eqref{eq:ztoZ} is exact, but that the distribution of $z(\k,t)$ leaves us with some out of the complex unit circle. Let us look at the example in Figure \ref{fig:mappings}, where we are trying to find $z(\k, 0)$ so that $\bar{Z}(0)$ is equal to our desired initial condition $Z(0) = $ -0.2 + $\ic$0.8. \\

% Especially for scale-free networks, where there is a large difference between the smallest and largest degree, this offset is large

When simply taking all $z(\k, 0) = Z(0)$, there is a slight offset between $Z(0)$ and $\bar{Z}(0)$. However, the dynamics are well-behaved and the end-state is almost a smooth curve. One can really interpret this curve as the attractive manifold of the Ott-Antonsen reduction. This method is an easy way of quickly coming up with an initial condition, without requiring any computation. In general, this yields quite a good approximation. \\

\begin{figure}[H]
\centering
\includegraphics[width = \textwidth]{../Figures/PhaseSpace/Mappings.pdf}
   \caption{Simulation of 1000 neurons in a scale-free network. Example on the importance of accurate initial conditions. A scalefree network is used to show the outcome of different strategies of initialising the network. Left: the initial condition is not correct, but it yields very smooth dynamics. Middle: the initial condition is correct, but it does not yield smooth dynamics. Right: the initial condition is correct, and it also yields smooth dynamics.}
   \label{fig:mappings}
\end{figure}

When using \eqref{eq:ztoZ}, we can see that the initial conditions lie on a straight line through the origin indeed, and that $\bar{Z}(0)$ is exactly equal to $Z(0)$. When a given $\k$ yields a small $P(\k)$, $z(\k,0)$ will be scaled away from the origin. This means that the dynamics of nodes of that degree are not well represented. However, their contribution to $\bar{Z}$ in \eqref{eq:OttAntonsenMeanField} is small, so sometimes these effects cancel out and the dynamics are in fact quite smooth. However, we can see that in our example the dynamics are not represented well, resulting in large errors after conception and a more random end-state. We do expect these effects to cancel out after longer periods and for larger $N$, as the manifold is attractive and larger networks cancel out outliers, but our aim is to be as precise as possible from $t=0$. \\

When trying to address the problems that are encountered here, we can try and find the distribution of $z(\k,0)$ numerically. We can solve for the root of $f(z) = \| Z(0) - \bar{Z}(0) \|$ (where $\bar{Z}$ is computed from $z$) under the constraint that $| z | \leq 1$, starting from an initial guess $\hat{z}$ clustered around $Z(0)$. The resulting initial distribution is also quite clustered but as it is mostly a result of the constraint, we are more interested in the end-state, which shows a lot of improvements over the second method. The initial conditions are exact (up to $10^{-6}$) and the dynamics are smooth, which makes this method the most desirable. However, convergence can be very slow for scale-free networks, and the complexity of the system to solve scales with $\sim N^2$ . It is therefore necessary to judge which of the three methods to use when performing a new simulation.

\subsection{Final conditions}
Given that the final condition of the system is such a particular smooth curve, we can try and understand what kind of distribution $z$ follows on that curve. In Figure \ref{fig:FinalConditions} we have made different networks converge to a stable node in the \PSR state until changes to the system were smaller than a tolerance. We can see that the final condition of $z$ is close to the final condition of $\bar{Z}$. If we divide the length of the curve into equal parts, we can count how many $z$ can be found in each interval. The resulting distributions difficult to interpret, but we can see some traits of their respective degree distributions, though the likeness is not very high.
\begin{figure}[H]
\centering
\includegraphics[width = \textwidth]{../Figures/Distributions/FinalConditions.pdf}
\caption{Final conditions of $z$ for the \PSR state, represented by 40 equally spaced indices and the resulting histogram. Both the random and scale-free network topologies show that the final conditions of $z$ are a smooth curve, and that points on that curve have a particular distribution over the length of the curve.}
\label{fig:FinalConditions}
\end{figure}

For other macroscopic states the distributions of $z$ across its final condition are quite similar as presented here. However, when the scale-free network has converged to the stable focus in the \PSS state, the final condition is a highly convoluted spiral, which is difficult to interpret. What is important though, is that there is a definite structure to be found in the final condition as well.

\subsection{Commutativity of complex vectors}
It is important to notice that in \eqref{eq:OttAntonsenSystemFull} and \eqref{eq:OttAntonsenMeanField} and many other equations in this work, we compute an inner vector product, which is non-commutative for complex numbers:
\begin{align}
a \cdot b = (b \cdot a)^c \qquad a, b \in \c^r
\end{align}
This is the result of the \textsl{Conjugate} or \textsl{Hermitian} symmetry of the inner product. This is especially important in the implementation, as one needs to be consistent with left- or right-hand products.

\subsection{Fixpoint iteration}
In \cite{OttAntonsen2017} a fixpoint iteration is suggested to find attractive fixpoints of the system \eqref{eq:OttAntonsenSystemFull}. If we set $\frac{\partial z(\k, t)}{\partial t} = 0$ we can solve the following system:
\begin{align}
\ic \frac{(z(\k, t)-1)^{2}}{2} &= \frac{(z(\k, t)+1)^{2}}{2} \cdot I(\k, t) \nonumber \\
\ic \left(\frac{z(\k, t)-1}{z(\k, t)+1}\right)^2 &= I(\k, t) \nonumber \\
\frac{z(\k, t)-1}{z(\k, t)+1} &\equiv b(\k,t) \nonumber \\
z(\k, t) - 1 &= b(\k,t) z(\k, t) + b(\k,t)  \nonumber \\
z(\k, t) \cdot (1 - b(\k,t)) &= b(\k,t)  + 1\nonumber
\end{align}
We can then obtain the stable equilibria from:
\begin{align}
\ic b(\k,t)^2 = I(\k, t) \hspace{10mm} z(\k, t)_{\pm} = \frac{1 \pm b(\k,t)}{1 \mp b(\k,t)} \label{eq:fixedpointiterations}
\end{align}
where the signs are chosen so that $\vert z(\k, t) \vert \leq 1$. This works well, and in general this method converges fast.

\subsection{A Newton-Raphson iteration for all fixpoints}
The fixpoint iteration \eqref{eq:fixedpointiterations} only gives us the stable equilibria of the \MFR. We can obtain all equilibria and their stability through the Jacobian from a Newton-Raphson iteration, which has been described in \ref{app:NewtonRaphson}. The Jacobian would be a $M_{\k} \times M_{\k}$ matrix, as we have $M_{\k}$ unique degrees in the network, and we need to take the derivate of one with respect to each other. However, finding the Jacobian is a challenge, as \eqref{eq:OttAntonsenSystemFull} is non-holomorphic: $H_2(\k,t)$ does not satisfy the Cauchy-Riemann equations. We can show this by separating $z$ into its real and imaginary part and expressing $H_2(\k,t)$ as two real-valued functions $u$ and $v$:
%For \eqref{eq:OttAntonsenSystemFull}, we can compute the Jacobian for the diagonal and off-diagonal elements separately. But as $z(\k,t)$ is a complex function, first we need to understand what the derivative of a complex function is.
\begin{align*}
z(\k,t) &= x(\k,t) + \ic y(\k,t) \qquad \qquad x, y \in \R^{M_{\k}}\\
f\left( z(\k,t) \right) &= u\left(x(\k, t), y(\k, t) \right) + \ic v\left(x(\k, t), y(\k, t) \right)\\
&= \frac{\kappa}{\kmean} \sum_{\kacc} P\left(\kacc\right) \: a\left(\kacc \rightarrow \k\right) \left( 1 + \frac{z(\kacc, t)^2 + (z(\kacc, t)^c )^2}{6} - \frac{4}{3} \Re(z(\kacc, t)) \right)\\
&= \frac{\kappa}{\kmean} \sum_{\kacc} P\left(\kacc\right) \: a\left(\kacc \rightarrow \k\right) \left( 1 + \frac{x(\kacc, t)^2}{3} - \frac{4}{3} x(\kacc, t) \right)
\end{align*}
This leaves us with only $u$ defined as a real-valued function, so that the Cauchy-Riemann equations do not hold as $v$ is zero. Thus we cannot express the Jacobian as a matrix of complex numbers. \\

Instead, we must think of $z$ as a vector of real and imaginary parts and express it as $z(\k,t) = [ x(\k,t), \: y(\k,t)]$. We can then interweave the two parts in the Jacobian, forming a $2 M_{\k} \times 2 M_{\k}$ matrix of real values. For fixed-degree networks this is easy, and the approach yields the well-known $2 \times 2 $ Jacobian, which has been used in Figure \ref{fig:macroscopicstatesfixeddegree} to signify the stability of the equilibrium points and the magnitude and direction of the eigenvalues. \\

However, for the typologies with more than one unique degree in the network, this approach did not yield promising results. If convergence occurs, the the equilibrium is found outside of the unit circle, which is unphysical. One issue might be that the initial condition used for the Newton-Raphson iteration is still not close enough to the true manifold. The resulting equilibria might be due to residuals from the Fourier series applied to $f(\theta, \eta | \k, t)$ in \eqref{eq:meanfieldorderparameter}. A deeper understanding of the manifold and initial conditions is necessary. \\

Otherwise either the derivation of the Jacobian or the execution of the algorithm is flawed, though a mistake could not be found. For now, we will revert to the fixed point iteration method, \eqref{eq:fixedpointiterations}, to find stable equilibria of the system.

%\textcolor{red}{QUESTION}: \textsl{explain how the Jacobian can be found as a $2 M_{\k} \times 2 M_{\k}$ matrix by using $z(\k,t) = [ x(\k,t), \: y(\k,t)]$ and interweaving the $x$ and $y$ dimension in the matrix, see \cite{Cross2018}. This has been implemented but only stable results for the \PSR state. Right now I still can only find attractive fixpoints. Should I continue on this?}

\subsection{Fixed-degree networks as a baseline}
Now we have all the necessary tools to simulate networks of theta neurons: the adjacency matrix, and an understanding of the initial conditions. First, we will use a fixed-degree network, as this is the most simple instance of the different topologies. As all nodes have the same degree, the dynamics of a symmetric and asymmetric fixed-degree network ought to be identical. The results are shown in Figure \ref{fig:InspectMeanFieldFixedDegree}.

We can easily recognise the three macroscopic states from Figure \ref{fig:macroscopicstatesfixeddegree}. It is no wonder that the solutions for the equilibria are accurate, though results for the limit cycle are quite remarkable. There are small differences between $Z$ measured by the whole network and $\bar{Z}$ predicted by the \MFR, but these are most likely due to a finite network size and a finite integration step. The mean-field systems \eqref{eq:OttAntonsenMeanField} and \eqref{eq:MeanField} yield the exact same behaviour, as expected. This test benchmarks the lowest amount of error we can observe between simulation and theory, as for fixed-degree networks (\ref{eq:OttAntonsenSystemFull}) consists of a single equation.
\begin{figure}[H]
\centering
\includegraphics[width = \textwidth, trim={0 3mm 0 3mm},clip]{../Figures/InspectMeanFieldFixedDegree.pdf}
\caption{Comparison of the simulation of a fixed-degree network of Theta neurons and the Ott-Antonsen theory by the magnitude of the order parameter. We observe that the same three macroscopic states are found by the three descriptions of the mean-field.}
\label{fig:InspectMeanFieldFixedDegree}
\end{figure}

\subsection{Results for arbitrary network topologies} \label{sec:resArbNetw}
The dynamics of random networks seem to be very similar to fixed-degree networks, when looking at the dynamics in the unit circle. Both networks have a unimodal and symmetric degree distribution, and this might be the cause for the likeness. We can see in Figure \ref{fig:MFOARCPW_random} that the limit cycle is slightly larger, but no other differences can be observed. When looking at the dynamics over time the results in Figure \ref{fig:InspectMeanFieldRandom} are also consistent, with a little more deviation between simulation and theory in the \CPW state, but this can be expected for finite networks.
\begin{figure}[H]
\centering
\begin{subfigure}[b]{0.32\linewidth}
   \centering
  \includegraphics[width=\linewidth]{../Figures/PhaseSpace/MFOARPSR_random.pdf}
   \caption{PSR state for $\eta_0 = -0.9, \sigma = 0.8$ and $\kappa= -2$. The mean field settles onto a stable node.}
   \label{fig:MFOARPSR_random}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.32\linewidth}
   \centering
  \includegraphics[width=\linewidth]{../Figures/PhaseSpace/MFOARPSS_random.pdf}
   \caption{PSS state for $\eta_0 = 0.5, \sigma = 0.7$ and $\kappa= 2$. The mean field settles onto a stable focus.}
   \label{fig:MFOARPSS_random}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.32\linewidth}
   \centering
  \includegraphics[width=\linewidth]{../Figures/PhaseSpace/MFOARCPW_random.pdf}
   \caption{CPW state for $\eta_0 = 10.75, \sigma = 0.5$ and $\kappa= -9$. The mean field settles onto a stable limit cycle.}
   \label{fig:MFOARCPW_random}
\end{subfigure}
   \caption{Three macroscopic states observed in the \MFR using a random network, inside the imaginary unit circle $|Z(t)| \leqslant 1$. Green arrows mark the phase space vector field and green trails mark solution curves. The dotted line in the \CPW state is the limit cycle of the fixed-degree networks, added for reference.}
   \label{fig:macroscopicstatesrandomnetworks}
\end{figure}

\begin{figure}[H]
\centering
\includegraphics[width = \textwidth, trim={0 3mm 0 3mm},clip]{../Figures/InspectMeanFieldRandom.pdf}
\caption{Comparison of the simulation of a random network of Theta neurons and the Ott-Antonsen theory by the magnitude of the order parameter. }
\label{fig:InspectMeanFieldRandom}
\end{figure}

For scale-free networks, we can see that again the three macroscopic states continue to exist, Figure \ref{fig:macroscopicstatesscalefreenetworks}. However, it seems like there is a fairly large discrepancy between symmetric and asymmetric networks, in Figure \ref{fig:InspectMeanFieldScaleFree}. The stable node in the \PSR state is found at different locations, and the limit cycle in the \CPW state seems to be very different, but with a similar period. Indeed, if we look at the limit cycle to which the dynamics are attracted to in Figure \ref{fig:InspectMeanFieldScaleFreePhaseSpace} we can indeed see two distinct cycles. \\

This means that due to its topology, the scale-free network cannot be represented by a symmetric variant. The degree distribution is asymmetric, and this likely causes the asymmetry observed here. Another observation is that now the fixed-point iteration finds the centre of the limit cycle as a stable equilibrium. The limit cycle has always been observed to be attractive, so a stable equilibrium within would require another unstable limit cycle around the equilibrium. We will regard this as an error.

\begin{figure}[H]
\centering
\begin{subfigure}[b]{0.32\linewidth}
   \centering
  \includegraphics[width=\linewidth]{../Figures/PhaseSpace/MFOARPSR_scalefree.pdf}
   \caption{PSR state for $\eta_0 = -0.9, \sigma = 0.8$ and $\kappa= -2$. The mean field settles onto a stable node.}
   \label{fig:MFOARPSR_scalefree}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.32\linewidth}
   \centering
  \includegraphics[width=\linewidth]{../Figures/PhaseSpace/MFOARPSS_scalefree.pdf}
   \caption{PSS state for $\eta_0 = 0.5, \sigma = 0.7$ and $\kappa= 2$. The mean field settles onto a stable focus.}
   \label{fig:MFOARPSS_scalefree}
\end{subfigure} \hfill
\begin{subfigure}[b]{0.32\linewidth}
   \centering
  \includegraphics[width=\linewidth]{../Figures/PhaseSpace/MFOARCPW_scalefree.pdf}
   \caption{CPW state for $\eta_0 = 10.75, \sigma = 0.5$ and $\kappa= -9$. The mean field settles onto a stable limit cycle.}
   \label{fig:MFOARCPW_scalefree}
\end{subfigure}
   \caption{Three macroscopic states observed in the \MFR inside the imaginary unit circle $|Z(t)| \leqslant 1$. Green arrows mark the phase space vector field and blue trails mark solution curves. Red points indicate equilibrium points, found by the fixed-point iteration. The dotted line in the \CPW state is the limit cycle of the fixed-degree networks, added for reference}
   \label{fig:macroscopicstatesscalefreenetworks}
\end{figure}

\begin{figure}[H]
\centering
\includegraphics[width = \textwidth, trim={0 3mm 0 3mm},clip]{../Figures/InspectMeanFieldScaleFree.pdf}
\caption{Comparison of the simulation of a scale-free network of Theta neurons and the Ott-Antonsen theory by the magnitude of the order parameter.}
\label{fig:InspectMeanFieldScaleFree}
\end{figure}

The results of these experiments point us in the right direction. Symmetric and asymmetric networks of the same family share many macroscopic properties, and networks with a symmetric degree distribution might share these properties with more detail.

\begin{figure}[H]
\centering
\includegraphics[width = 0.5\textwidth]{../Figures/PhaseSpace/ScalefreeLimCycles.pdf}
\caption{Comparison of the limit cycles found by theory and simulation.}
\label{fig:InspectMeanFieldScaleFreePhaseSpace}
\end{figure}


\label{app:errors}

\subsection{Speedup Error Propagation} \label{sec:app_numba}

The speedup offered by Numba JIT compilation in comparison to just using Numpy
is calculated using,

\begin{equation}
    \text{Speedup} = \frac{t_{\text{numpy}}}{t_{\text{JIT}}}
\end{equation}

where $t_{\text{JIT}}$ and $t_{\text{numpy}}$ are the mean times taken to complete
a solve a given problem for each method respectively.

The error is then propagated using the standard formula \cite{hughes2010measurements},

\begin{equation}
    \frac{\sigma_{\text{speedup}}}{\text{Speedup}} = \sqrt{
        \left ( \frac{\sigma_{\text{JIT}}}{t_{\text{JIT}}} \right )^2 +
        \left ( \frac{\sigma_{\text{numpy}}}{t_{\text{numpy}}} \right )^2
    }
\end{equation}

where $\sigma_{\text{JIT}}$ and $\sigma_{\text{numpy}}$ are the standard deviations
from the runs for each problem size.


\documentclass{article}
\usepackage{graphicx}
\usepackage{siunitx} % Required for alignments
\begin{document}
	\title{GST 108: Quantitative Reasoning}

	\author{Ariyibi Joseph Iseoluwa}
\maketitle
\newpage
\tableofcontents
\newpage
\centering
\section{INTRODUCTION}
    A logic gate is a building block of a digital circuit which is at the heart of any computer operation.

   \includegraphics[width=1\linewidth]{logic}

	\subsection{Logic Gates}
		Logic gates perform logical operations that take binary input (0s and 1s) and produce a single binary output. They are used in most electronic device including:
	\begin{table}[h!]
		\begin{center}
			\caption{Logic Gates}
			\label{tab:table1}
			\begin{tabular}{l|c|c|}
				\hline
				Smartphones
				&
				Tablets
				&
				Memory Devices
				\\
				\hline
				\includegraphics[width=0.2\linewidth]{iphone13}
				&
				\includegraphics[width=0.25\linewidth]{ipadmini}
				&
				\includegraphics[width=0.2\linewidth]{download}
				\\
				\hline
			\end{tabular}
		\end{center}
	\end{table}
\newpage
\section{Definition Of a Gate}
A gate is a basic electronic circuit which operates on one or more signals to produce an output signal.
Logic gates are digital circuits constructed from diodes, transistors, and resistors connected in such a way that the circuit output is the result of a basic logic operation (OR, AND, NOT) performed on the inputs. \cite{okoacha2021logic}
\section{Types Of Logic Gates}
\textbf{Fundamental Gates include AND, OR, NOT gates}

\includegraphics[width=1\linewidth]{gates.jpg}
\newpage
\subsection{AND Gate}

The expression C = A X B reads as “C equals A AND B“
The multiplication sign (X) stands for the AND operation, same for ordinary multiplication of 1s and 0s.
The AND operation produces a true output (result of 1) only for the single case when all of the input variables are 1 and a false output (result of 0) where one or more inputs are 0.

\includegraphics[width=0.3\linewidth]{and.jpg}
\begin{table}[h!]
	\begin{center}
		\caption{AND TABLE}
		\begin{tabular}{c|c|c|}
			\textbf{A} & \textbf{B} &  \textbf{C= A x B} \\
			\hline
			\textbf{1} & \textbf{1} & \textbf{1} \\
			\textbf{1} & \textbf{0} & \textbf{0} \\
			\textbf{0} & \textbf{1} & \textbf{0} \\
			\textbf{0} & \textbf{0} & \textbf{0} \\
		\end{tabular}
	\end{center}
\end{table}
\subsection{OR GATE}
The expression C = A + B reads as “C equals A OR B". It is the inclusive “OR”
The Addition (+) sign stands for the OR operation.
The OR operation produces a true output (result of 1) when any of the input variable is 1 and a false output (result of 0) only when all the input variables are 0.
\includegraphics[width=0.6\linewidth]{or.jpg}
\begin{table}
	\begin{center}
		\caption{OR TABLE}
		\begin{tabular}{l|c|c|}
			\textbf{A} & \textbf{B} & \textbf{C= A + B} \\
			\hline
			\textbf{1} & \textbf{1} & \textbf{1} \\
			\textbf{1} & \textbf{0} & \textbf{1} \\
			\textbf{0} & \textbf{1} & \textbf{1} \\
			\textbf{0} & \textbf{0} & \textbf{0} \\
		\end{tabular}
	\end{center}
\end{table}
\newpage
\subsection{NOT GATE}
The NOT gate is called a logical inverter.
It has only one input. It reverses the original input (A) to give an inverted output C.
C = NOT A or C = $\overline{A}$
\includegraphics[width=0.6\linewidth]{not.jpg}

\begin{table}[h!]
	\begin{center}
		\caption{NOT TABLE}
		\begin{tabular}{c|c|}
			\textbf{A} & \textbf{C = $\overline{A}$} \\
			\hline
			\textbf{1} & \textbf{0} \\
			\textbf{0} & \textbf{1} \\
		\end{tabular}
	\end{center}
\end{table}
\subsection{NOR GATE}
The NOR (NOT OR) gate circuit is an inverter OR gate

C =  $\overline{(A + B)}$
Reads as C = NOT of A or B

The NOR Gate gives a true output (result of 1) only when both inputs are false (0)

\includegraphics[width=0.6\linewidth]{nor}
\begin{table}[h!]
	\begin{center}
		\caption{NOR TABLE}
		\begin{tabular}{l|c|c|c|}
			\textbf{A} & \textbf{B} & \textbf{A+B} & \textbf{C= (A+B)} \\
			\hline
			\textbf{1} & \textbf{1} & \textbf{1} & \textbf{0} \\
			\textbf{1} & \textbf{0} & \textbf{1} & \textbf{0} \\
			\textbf{0} & \textbf{1} & \textbf{1} & \textbf{0} \\
			\textbf{0} & \textbf{0} & \textbf{0} & \textbf{1} \\
		\end{tabular}
	\end{center}
\end{table}
\newpage
\subsection{NAND GATE}
The NAND (NOT AND) Gate is an inverted AND Gate
C = ($\overline{(A * B)}$)
Reads as C = NOT of A AND B
The NAND Gate gives a false output (result of 0) only when both inputs are true (1)

\includegraphics[width=0.7\linewidth]{nand}
\begin{table}[h!]
	\begin{center}
		\caption{NAND GATE}
		\begin{tabular}{l|c|c|c|}
			\textbf{A} & \textbf{B} & \textbf{A x B} & \textbf{C= $\overline{(A * B)}$} \\
			\hline
			\textbf{1} & \textbf{1} & \textbf{1} & \textbf{0} \\
			\textbf{1} & \textbf{0} & \textbf{0} & \textbf{1} \\
			\textbf{0} & \textbf{1} & \textbf{0} & \textbf{1} \\
			\textbf{0} & \textbf{0} & \textbf{0} & \textbf{1} \\
		\end{tabular}
	\end{center}
\end{table}

The NAND Gate is a universal gate because it can be used to form any other kind of gate
\newpage
\subsection{XOR GATE}
An XOR (exclusive OR) gate acts in the same way as the exclusive OR logical connector.
It gives a true output (result of 1) if one, and only one, of the inputs to the gate is true (1), i.e either or but not both

\includegraphics[width=0.7\linewidth]{xor}
\begin{table}[h!]
 \begin{center}
 	\caption{XOR GATE}
 	\begin{tabular}{l|c|c|c|c|c|c|}
 		\textbf{A} & \textbf{B} & \textbf{$\overline{A}$} & \textbf{$\overline{B}$} & \textbf{$\overline{A}$.B} & \textbf{$\overline{B}$.A} & \textbf{$\overline{A}$.B + $\overline{B}$.A} \\
 		\hline
 		\textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} \\
 		\textbf{1} & \textbf{0} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{1} \\
 		\textbf{0} & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{1} \\
 		\textbf{0} & \textbf{0} & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & \textbf{0}
 	\end{tabular}
 \end{center}
\end{table}
\newpage
\subsection{XNOR GATE}
The XNOR (exclusive - NOR) gate is a combination XOR gate followed by an inverter. It is represented by the $\odot$
Its gives a  true output (1), if the inputs are the same, and a false output (0) if the inputs are different.

C = $\overline{(A \odot B)}$ =$\overline{\overline{A} .B + \overline{B} .A}$
\includegraphics[width=0.7\linewidth]{xnor}
\begin{table}[h!]
	\begin{center}
		\caption{XNOR GATE}
		\begin{tabular}{l|c|c|c|c|c|c|c|}
			\textbf{A} & \textbf{B} & \textbf{$\overline{A}$} & $\overline{B}$ & \textbf{$\overline{A}$ .B} & \textbf{$\overline{B}$ .A} & \textbf{$\overline{A}$ .B + $\overline{B}$ .A} & \textbf{$\overline{\overline{A} .B + \overline{B} .A}$} \\
			\hline
			\textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{1} \\
			\textbf{1} & \textbf{0} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{1} & \textbf{0} \\
			\textbf{0} & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{0} & \textbf{1} & \textbf{0} \\
			\textbf{0} & \textbf{0} & \textbf{1} & \textbf{1} & \textbf{0} & \textbf{0} & \textbf{0} & \textbf{1} \\
		\end{tabular}
	\end{center}
\end{table}
\newpage
\section{Summary}
\subsection{LOGIC GATES AND THEIR TRUTH TABLE}
\includegraphics[width=0.8\linewidth]{truth table}
\subsection{Summary contd.}
Using different combination of logic gates, complex operations can be performed.
With the Universal logic gates - NAND and NOR, any other gate can be built.

There is no limit to the number of gates that can be arranged together in a single device.
However, in practice, there is a limit to the number of gates that can be packed into a given physical space.
Arrays of logic gates are found in digital integrated circuits.
The logic gates are abstract representations of real electronic circuits. \cite{okoacha2021sum}

In computers, Logic gates are built using transistors combined with other electrical components like resistors and diodes.
These electrical components are wired together in order to transform a particular input to give a desired output.
\newpage
\section{QUIZ}
\begin{enumerate}
\item	What is the output of an AND gate if the inputs are 1 and 0?

\item	Explain the difference between the AND gate and the OR gate.

\item	What is the output of a NOT gate if the inputs is 0?

\item	Which logic gate is this?
\begin{center}
	\includegraphics[width=0.6\linewidth]{xor2}
\end{center}

\item	Which gate is also known a logical converter?

\end{enumerate}
\newpage
\bibliography{gst}
\bibliographystyle{ieeetr}
\end{document}

ARIYIBI iSEOLUWA COMMIT/student exercise 2.tex


\documentclass{memoir}
\usepackage{notestemplate}

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

\begin{document}

% \maketitle

% Notes taken on 02/26/21

\section{G-homomorphisms}
\label{sec:g_homomorphisms}

Let \(K\) be a field and \(G\) be a group. We are going to look at a structure of interest: we define \(K\)-linear representations of \(G\) as a \(K\)-vector space \(V\) equipped with a group homomorphism
\begin{align*}
	\rho:G\to GL(V)\\
	g\mapsto [\rho g:V\to V]
\end{align*}

\begin{defn}[\(G\)-homomorphism]
	Let \((V',\rho')\) and \((V'',\rho'')\) be representations of \(G\) over \(K\). A \textbf{\(G\)-homomorphism from \((V',\rho')\) to \(V'',\rho'')\)} is a \(K\) linear map \(\varphi:V'\to V''\) which intertwines with the action of \(G\) :
	\begin{align*}
		\varphi(\rho'g(v')) = \rho''g(\varphi(v')) \quad \forall g \in G, v' \in V'
	\end{align*}
	We denote the collection of \(G\)-homomorphisms from \((V', \rho')\) to \((V'', \rho'')\) by \( \textrm{Hom}_G(V',V'')\), and \(\textrm{End}_G(V') := \textrm{Hom}_G(V',V')\). Finally, a \textbf{\(G\)-isomorphism} is an invertible \(G\)-homomorphism.
\end{defn}

This is really just a change in basis.

\begin{prop}
	If \(\varphi \in \textrm{Hom}_G(V,W)\), then \(\varphi^{-1} \in \textrm{Hom}_G(W,V)\).
\end{prop}
\begin{prop} %Exercise 1 on HW 5
	Take \(\varphi \in \textrm{Hom}_G(V,W)\). Then
	\begin{enumerate}[(a).]
		\item \(\textrm{Ker}\varphi \) is a subrepresentation of \(V\), and
		\item \(\textrm{Im}\varphi\) is a subrepresentation of \(W\).
	\end{enumerate}
\end{prop}
For the rest of the section, we take \(K = \C\).

\begin{lemma}[Schur's Lemma]
	Let \((V,\rho)\) be an irreducible representation of \(G\). If \(\varphi \in \textrm{End}_G(V)\), then \(\varphi\) is a scalar multiple of \(\textrm{Id}V\) :
	\begin{align*}
		\exists \lambda \in \C \; s.t. \; \varphi(v) = \lambda v \quad \forall v \in V
	\end{align*}
\end{lemma}
This result has many applications.
\begin{thm}
	All nonzero complex irreducible representations of an abelian group \(G\) have degree 1.
\end{thm}
Using these tools, we now can complete a few problems.

\begin{hw}
	Given a finite abelian group \(G\), describe its irreducible representations, up to equivalence. Illustrate this for the Klein-four group \(G = C_2\times C_2\).
\end{hw}
Moreover, one can apply Schur's lemma to complete the following problem:
\begin{hw}
	Let \(V\) and \(W\) be irreducible representations of \(G\), and take \(\varphi \in \textrm{Hom}_G(V,W)\). Show that
	\begin{enumerate}[(a).]
		\item If \(V \not\cong W\), then \(\varphi\) is the zero map.
		\item If \(V \cong W\) and \(\varphi\neq 0\), then \(\varphi\) is a \(G\)-isomorphism.
	\end{enumerate}
\end{hw} % Hint: hw5 exercise 1

\end{document}

Abstract Algebra - Introductory/Algebra II/Notes/source/Lecture12 - GHomo_SchursLemma.tex


\hypertarget{haskell}{%
\section{Haskell - Interpreter}\label{haskell}}

\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black]
TODO: Ich verstehe nicht ganz, was der Interpeter mit Haskell zu tun hat bzw. für was wir das gemacht haben.
\end{tcolorbox}

\hypertarget{abstract-operator}{%
\subsection{Abstract Operator}\label{abstract-operator}}

Instead of using expressions directly, one can replace them with
abstract syntax. For instance instead of using arithmetic operators, one
can define a data type `ArithOperator'.

\begin{lstlisting}[language=Haskell]
type Ident = String

data ArithOperator
= Times
| Div
| Mod
| Plus
| Minus
deriving (Eq, Show)

data ArithExpr
= LitAExpr Int
| IdAExpr Ident
| DyaAExpr ArithOperator ArithExpr ArithExpr

evalAOpr :: ArithOperator -> (Value -> Value -> Value)
evalAOpr Times = (*)
evalAOpr Div = div
evalAOpr Mod = mod
evalAOpr Plus = (+)
evalAOpr Minus = (-)

testExp1 = DyaAExpr Plus (LitAExpr 1) (DyaAExpr Times (LitAExpr 2) (LitAExpr 3))
\end{lstlisting}

\hypertarget{concrete-versus-abstract-syntax}{%
\subsubsection{Concrete Versus Abstract
Syntax}\label{concrete-versus-abstract-syntax}}

\begin{itemize}
\tightlist
\item
  Concrete syntax is easier to read for humans
\item
  Abstract syntax is easier to process for machines
\end{itemize}

\hypertarget{semantic-values}{%
\subsection{Semantic values}\label{semantic-values}}

\begin{lstlisting}[language=Haskell]
type State = Ident -> Value
\end{lstlisting}

\begin{itemize}
\tightlist
\item
  a state is modelled as a function mapping identifiers to values
\item
  example: the function s0 mapping ``x'' to 5, ``y'' to 7, ``z'' to 9,
  and everything else to 42 (or to an error)
\end{itemize}

\clearpage
\hypertarget{updates}{%
\subsubsection{updateS}\label{updates}}

\begin{lstlisting}[language=Haskell]
readS :: State -> Ident -> Value
readS s ident = s ident

updateS :: State -> (Ident, Value) -> State
updateS s (ident, val) ident'
| ident' == ident = val
| otherwise = s ident'
\end{lstlisting}

updateS s0 (``y'', 17) yields the function s1 mapping ``x'' to 5, ``y''
to 17, ``z'' to 9, and everything else to 42 (or to an error)

\clearpage


% !TEX root=../presentation_1.tex
\section{Background}

\subsection{Basic Assumptions}

\begin{frame}
\frametitle{Basic Assumptions}
\begin{itemize}
\item Synchronous CONGEST model.
\begin{itemize}
    \item \textbf{Synchronous} message-passing model.
    \item Every message is $O(\log n)$ in length.
\end{itemize}
\item Every vertex $v$ knows its own \textbf{unique} ID.
\item MST is \textbf{unique}
\begin{itemize}
    \item We can always break the symmetry by encode the weights with fractions to be a function of node ID.
\end{itemize}
\end{itemize}
\end{frame}

\subsection{Summary of methods}
\begin{frame}
\frametitle{Summary of methods}

\begin{itemize}
    \item $n=|V|, m=|E|.$
    \item $D:$ Hop-diameter of the graph. $D=\max_{u,v \in V} dist(u, v)$.
\end{itemize}
\input{sections/table}
\end{frame}

\subsection{Pipeline-MST}
\begin{frame}
\frametitle{Pipeline-MST}
\begin{itemize}
    \item A distributed version of \textbf{Kruskal's} algorithm.
    \item Build a BFS tree first, $O(D)$ rounds with $O(m)$ messages.
    \item Each node keeps a candidate set, initializes at neighbor edges.
    \item For each round
    \begin{itemize}
        \item Add the incoming edges to the set.
        \item Remove the \textbf{heaviest} edge in any \textbf{cycle} in the set.
        \item Send the \textbf{lightest} candidate to its BFS parent.
    \end{itemize}
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Pipeline-MST}
\begin{itemize}
    \item $O(D+n)$ rounds:
    \begin{itemize}
        \item $O(D)$ rounds to reach from the leaves to the root.
        \item $O(n)$ rounds to find the edges needed for an MST.
    \end{itemize}
    \item $O(m)$ messages to build BFS tree. Each node sends $O(n)$ edges.
    \item $O(D+n)$ rounds and $O(m + n^2)$ messages.
\end{itemize}
\begin{figure}
\includegraphics[width=0.4\textwidth,trim={0cm 7cm 18cm 0},clip]{figures/pipeline1.pdf}
\end{figure}
\end{frame}

\subsection{GHS [GHS86]}
\begin{frame}
\frametitle{GHS Algorithm}
\begin{itemize}
    \item A distributed version of \textbf{Boruvka's} algorithm: merging components.
    \item Each node starts as \textbf{a tree} with height 0.
    \item At phase $i$, any component with size less than $2^i$ fuses into another.
    \item Minimum outgoing edge (MWOE) of each component for merging.
    \item Worst case $O(n)$ rounds: the component can grow to size $O(n)$.
    \item $\log n$ phases, $O(n \log n)$ rounds.
\end{itemize}

\begin{figure}
\includegraphics[width=0.4\textwidth,trim={0cm 10cm 18cm 0},clip]{figures/boruv1.pdf}
\includegraphics[width=0.4\textwidth,trim={0cm 10cm 18cm 0},clip]{figures/boruv2.pdf}
\end{figure}
\end{frame}

\begin{frame}
\frametitle{GHS Algorithm}
\begin{itemize}
    \item Each edge can only be accepted or declined once $O(m)$.
    \item Every round, each node needs to send convergecast and broadcast once, $O(n \log n)$.
    and $O(m + n \log n)$ messages.
\end{itemize}
\end{frame}

\subsection{Controlled-GHS [GKP98, KP98]}
\begin{frame}
\frametitle{Controlled-GHS Algorithm [GKP98, KP98]}
\begin{itemize}
    \item \textbf{Pipeline-MST} reduces 1 component every round: \textbf{slow}.
    \item \textbf{GHS} reduces the number of components by half, but \textbf{hard to merge giant components}.
    \item Why not combine the two algorithms?
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Controlled-GHS Algorithm [GKP98, KP98]}
\begin{itemize}
    \item Idea: \textbf{maximal matching} can bound the component size.
    \item Fact: \textbf{maximal matching} on rooted tree: $\log^*(n)$ rounds.
    \item In the first part, use \textbf{GHS} to reduce \# components to $\sqrt{n}$.
    \item In the second part, use \textbf{Pipeline-MST} for $O(D + \sqrt{n})$ rounds.
\end{itemize}
\begin{figure}
\centering
\includegraphics[width=0.4\textwidth,trim={0cm 5cm 12cm 0},clip]{figures/comptree.pdf}
\end{figure}
\end{frame}

\begin{frame}
\frametitle{Controlled-GHS Algorithm [GKP98, KP98]}
\begin{itemize}
\item $\log \sqrt{n}$ phases in the first part.
\item In each phase $i$, compute the maximal matching each component.
\item $O(2^i \log^*n)$ rounds (messages need to traverse at node level).
\item $O(2^i)$ rounds to broadcast within the component.
\item First part: $\sum_{i=0}^{\log \sqrt{n}} O(2^i \log^* n) = O(\sqrt{n}\log^*n)$ rounds.
\end{itemize}
\begin{figure}
\centering
\includegraphics[width=0.4\textwidth,trim={0cm 5cm 12cm 0},clip]{figures/comptree.pdf}
\end{figure}
\end{frame}

\begin{frame}
\frametitle{Controlled-GHS Algorithm [GKP98, KP98]}
\begin{itemize}
\item Second part: Pipeline-MST, $O(D + \sqrt{n})$ rounds.
\item $O(D + \sqrt{n}\log^* n)$ rounds in total - \textbf{time-optimal}.
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Controlled-GHS Algorithm [GKP98, KP98]}
\begin{itemize}
\item \textbf{High} message complexity.
\item First part: $\log \sqrt n$ rounds.
\item $O(m + n \log \sqrt{n}) = O(m + n\log n)$ messages.
\item Second part, $O(m)$ messages to build a BFS tree.
\item Each node sends $O(\sqrt{n})$ edges.
\item Total message complexity: $O(m+n^{\frac{3}{2}})$ - \textbf{not optimal}.
\end{itemize}
\end{frame}


% Define document class, aastex631, mnras and aa.
\documentclass[twocolumn]{aastex631}

% Filler text
\usepackage{blindtext}

% Begin!
\begin{document}

% Title
\title{An open source scientific article}

% Author list
\author[0000-0000-0000-0000]{First Author}

% Abstract with filler text
\begin{abstract}
    \blindtext
\end{abstract}

% Main body with filler text
\section{Introduction}
\[
R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R+\Lambda g_{\mu\nu} = \frac{8\pi G}{c^4}T_{\mu\nu}
\]

\begin{figure}
    \begin{centering}
        \includegraphics[width=\columnwidth]{figures/test.pdf}
        \caption{This is a test.}
        \label{fig:test}
    \end{centering}
\end{figure}

\Blindtext[4]

\[
R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R+\Lambda g_{\mu\nu} = \frac{8\pi G}{c^4}T_{\mu\nu}
\]

\end{document}