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

\marginpar{Wednesday\\ 2020-12-16, \\ compiled \\ \today}

We will focus on the linear-order perturbations, thus setting \(r = 1\).
We can decompose our perturbation into its scalar, vector and tensor contributions.
The scalar contributions are \(\psi (\vec{x}, \eta )\) and \(\phi (\vec{x}, \eta )\); they represent a GR extension of Newtonian gravitational potentials.
The vector contributions are related to transverse (aka divergence-free, or vertical, or solenoidal) vector fields.
We can make the decomposition \(\omega _i (\vec{x}, \eta ) = \partial_i \omega^{\parallel} + \omega _i^{\perp}\), where \(\partial^{i} \omega _i^{\perp} = 0\). This is known as the Helmholtz decomposition, and it amounts to considering modes \(\omega (\vec{k})\) which are parallel and orthogonal to \(\vec{k}\) in Fourier space.
By counting the number of constraints or by reasoning geometrically in Fourier space one can see that the term \(\omega^{\parallel}\) includes 1 degree of freedom, while the term \(\omega^{\perp}_i\) includes two.

On the other hand, the tensor component can be decomposed into
%
\begin{align} \label{eq:traceless-perturbation-decomposition}
\chi_{ij} = \underbrace{D_{ij} \chi^{\parallel}}_{\text{scalar}} + \underbrace{2 \chi^{\perp}_{(i, j)}}_{\text{vector}} + \underbrace{\chi_{ij}^{T}}_{\text{tensor}}
\,,
\end{align}
%
where \(D_{ij} = \partial_i \partial_{j} - (1/3) \delta_{ij} \nabla^2\) is a traceless derivative operator.
We assume that \(\partial^{i} \chi_{i}^{\perp} = 0\), while the tensor \(\chi_{ij}^{T}\) is both traceless and transverse: \(\chi_{i}^{i, T} = 0 = \partial^{i} \chi_{ij}^{T}\).

The last term contains gravitational waves.
We can write the stress-energy tensor as
%
\begin{align}
T_{\mu \nu } = \rho u_\mu u_\nu + p h_{\mu \nu  }
\,,
\end{align}

where \(u_\mu \) is the four-velocity of the fluid, while \(\rho \) and \(p\) are the energy density and isotropic pressure, and \(h_{\mu \nu } = g_{\mu \nu} + u_\mu u_\nu \) is a projection tensor onto the hypersurfaces orthogonal to the four-velocity.

The energy density is a function of position, which can be written as
%
\begin{align}
\rho (\vec{x}, \eta ) = \rho^{(0)}(\eta ) + \sum _{r=1}^{\infty } \frac{1}{r!} \delta^{(r)} \rho (\vec{x}, \eta )
\,,
\end{align}
%
and an analogous expression can be written for the isotropic pressure \(p(\vec{x}, \eta )\).

The perturbation of the pressure can be written as
%
\begin{align}
\delta p &= \underbrace{\pdv{p}{\rho } \delta \rho }_{\text{adiabatic}}
+ \underbrace{\pdv{p}{S} \delta S}_{\text{non-adiabatic}}  \\
&= c_s^2 \delta \rho + \delta p _{\text{non-ad}}
\,.
\end{align}

On the other hand, the four-velocity of a comoving observer is
%
\begin{align}
u^{\mu } = \frac{1}{a} \qty(\delta^{\mu }_{0} + \sum _{r=1}^{\infty } \frac{1}{r!} v^{\mu }_{(r)})
\,,
\end{align}
%
since the unperturbed four-velocity is just \(u^{\mu }_{(0)} = \delta^{\mu }_0  / \sqrt{- g_{00} } = \delta^{\mu }_{0} / a\).
As for the perturbations, it can be shown (from the normalization condition \(u^2= -1\)) that at linear order \(v^{0} = - \psi \).
Then, we can just consider the peculiar spatial velocity, and Helmholtz-decompose it:
%
\begin{align}
v^{i} = \partial^{i} v^{\parallel} + v^{i}_\perp
\,,
\end{align}
%
where, as usual, \(\partial_{i} v^{i}_\perp = 0\).
This latter term describes vorticity.

As we discussed earlier, any tensor \(T\) can be gauge-transformed at linear order as
%
\begin{align}
\widetilde{\Delta T} = \Delta T + \mathscr{L}_\xi (T_0 )
\,,
\end{align}
%
along the gauge transformation represented by the vector field \(\xi \).
We write this vector field as
%
\begin{align}
\xi^{0} &= \alpha (\vec{x}, \eta )  \\
\xi^{i} &= \partial^{i} \beta + d^{i}
\,,
\end{align}
%
where \(\partial^{i} d_i = 0\).

Denoting derivatives with respect to conformal time with a prime, the perturbations transform like
%
\begin{align}
\widetilde{\psi} &= \psi + \alpha ' + \frac{a'}{a} \alpha   \\
\widetilde{\omega}_i &= \omega _i - \alpha_{, i} + \beta'_{, i} + d _i'   \\
\widetilde{\phi} &= \phi - \frac{1}{3} \nabla^2 \beta - \frac{a'}{a} \alpha d \\
\widetilde{\chi}_{ij} &= \chi_{ij} + 2 D_{ij} \beta + 2d_{(i, j)}
\,,
\end{align}
%
which follows from the equation we derived earlier, \(\widetilde{\Delta T}  = \Delta T + \mathscr{L}_\xi T_0  \)
and we can decompose these as
%
\begin{align}
\widetilde{\omega}^{\parallel} &= \omega^{\parallel} - \alpha + \beta '  \\
\widetilde{\omega}^{\perp}_i &= \omega^{\perp}_i + d'_i  \\
\widetilde{\chi}^{\parallel } &= \chi^{\parallel} + 2 \beta   \\
\widetilde{\chi}^{\perp}_i &= \chi^{\perp}_i + d _i  \\
\widetilde{\chi}^{T}_{ij} &= \chi^{T}_{ij}
\,.
\end{align}

The traceless tensor part of the perturbation is gauge invariant.

The energy density perturbation can be shown to transform like
%
\begin{align}
\widetilde{\delta \rho } &= \delta \rho + \mathscr{L}_\xi \rho^{(0)} (\eta ) \\
&= \delta \rho + \rho^{(0), \prime} \alpha
\,,
\end{align}
%
showing that \(\delta \rho \) is \emph{not} a scalar.

The velocity transforms like
%
\begin{align}
\delta u^{\mu } = \frac{1}{a} v^{\mu }
\,,
\end{align}
%
so
%
\begin{align}
\widetilde{\delta u}^{\mu } = \delta u^{\mu } + \mathscr{L}_\xi u^{\mu , 0}
\,,
\end{align}
%
meaning that
%
\begin{align}
\widetilde{v}^{0} &= v^{0} - \frac{a'}{a} \alpha - \alpha '  \\
\widetilde{v}^{i} &= v^{i} - \beta^{, i\prime} - d^{i, \prime}
\,,
\end{align}
%
so
%
\begin{align}
\widetilde{v}_\parallel &= v_\parallel - \beta '  \\
\widetilde{v}^{i}_{\perp} &= v^{i}_\perp - d^i
\,.
\end{align}

The split of the cosmological perturbation is useful since (at linear order) the evolutions of the scalar, vector and tensor modes is decoupled.

The gauge is determined by \(\xi^{\mu }\), which amounts to choosing the scalars \(\alpha \) and \(\beta \), plus the vector \(d^{i} \): a total of four degrees of freedom, since \(d^{i} \) has one constraint.

A possible gauge choice is the \textbf{Poisson gauge}:\footnote{Also known as the longitudinal or Newtonian gauge, since it reproduces the Newtonian treatment of the gravitational potential perturbations.}
%
\begin{align}
\widetilde{\omega}^{\parallel} = \widetilde{\chi}^{\parallel} = 0 = \widetilde{\chi}^{T}_i
\,.
\end{align}

In this case, the lapse function quite closely matches the behaviour of Newtonian gravitational perturbations.

In order to impose these condition we need to set
%
\begin{align}
0 = \widetilde{\chi}^{\parallel} = \chi^{\parallel} + 2 \beta = 0 \implies \beta = - \frac{1}{2} \chi^{\parallel}
\,.
\end{align}
%
% \todo[inline]{What does the bar indicate?}

This gauge is also known as the \textbf{orthogonal zero-shear gauge}.

\section{Common gauge choices and gauge invariant quantities}

If we consider constant-\(\eta \) spatial hypersurfaces, and take a vector \(N_\mu \propto \dv*{\eta }{x^{\mu }}\) perpendicular to them (this will often correspond to the four-velocity), we can make the following decomposition:
%
\begin{align}
N_{\mu ; \nu } = \frac{1}{3} \theta h_{\mu \nu } + \omega_{\mu \nu } + \sigma_{\mu \nu } - a_\mu N_\nu
\,,
\end{align}
%
where \(\theta = N^{\mu }_{;\mu }\) represents the local compression of the fluid, in FLRW \(\theta = 3 H\).
The term \(\omega_{\mu \nu }\) is given by
%
\begin{align}
\omega_{\mu \nu } =  h^{\alpha }_{\mu } h^{\beta }_{\nu } u_{[\alpha ; \beta ]}
\,
\end{align}
%
and it is known as the \emph{vorticity tensor}.
If indeed \(N_\mu = u_\mu \), then \(\omega_{\mu \nu } = 0\).

The tensor \(\sigma_{\mu \nu }\) instead represents shear:
%
\begin{align}
\sigma_{\mu \nu } =   h^{\alpha }_{\mu } h^{\beta }_{\nu } u_{(\alpha ; \beta )} - \frac{1}{3} \theta h_{\mu \nu }
\,,
\end{align}
%
and finally \(a^{\mu } = u^{\nu } u_{\mu ; \nu }\).
If \(u_{\mu} = N_\mu\), \(\sigma_{\mu \nu } \) is the geometric shear, so \(\sigma_{\mu 0} = 0\), meaning that we can only work with
%
\begin{align} \label{eq:zero-shear-gauge}
\sigma_{ij} &= D_{ij} \sigma + \sigma^{\perp}_{(i, j)} + \sigma^{T}_{ij}  \\
\sigma &= - \omega^{\parallel} + \frac{1}{2} \chi^{\parallel}
\,.
\end{align}

This term vanishes in the Poisson gauge.

The vector \(N\) reads:
%
\begin{align}
 N^{\mu } =(1/a) \qty[1 - \psi,  - \omega^{i}]
\,.
\end{align}
%

Another possible choice is the \textbf{synchronous}, or \textbf{time-orthogonal gauge}:
%
\begin{align}
\widetilde{\psi} = \widetilde{\omega}^{\parallel} = \widetilde{\omega}^{\perp}_i = 0
\,,
\end{align}
%
meaning that \(\delta g_{0\mu } = 0 \).
This amounts to only perturbing the spatial part of the metric.
If we take observers at fixed spatial coordinates, their subjective time in this gauge will be
%
\begin{align}
\dd{\tau } = \dd{t} \qty(1 + \psi ) = \dd{t}
\,,
\end{align}
%
so they will all be synchronized.

We can write
%
\begin{align}
\widetilde{\psi} = \psi + \alpha ' + \frac{a'}{a} \alpha = \psi + \frac{(a \alpha )'}{a} = 0
\,,
\end{align}
%
so we must have
%
\begin{align}
a \alpha = -\int a \psi \dd{\eta } + X(\vec{x})
\,,
\end{align}
%
so we have not completely fixed the gauge.
Similarly to electrodynamics, we have residual gauge freedom.

Another possible choice is the \textbf{comoving gauge},
defined by
%
\begin{align}
v^{i} = 0
\,,
\end{align}
%
meaning that \(v^{\parallel} = v^{i}_\perp = 0\). This basically amounts to setting the coordinate system as comoving with the fluid.

We have an additional condition, which we can use to impose that constant \(\eta \) spatial hypersurfaces must be orthogonal to \(u^{\mu }\): this leads to the condition \(v^{\parallel} + \omega^{\parallel} = 0\), which tells us that \(\omega^{\parallel} = 0\) because of the previous condition.

This is because at leading order we can lower the index of \(N^{\mu }\) and \(u^{\mu }\), and use \(v^{0}= \psi \), to get
%
\begin{align}
N_{\mu } &= \qty[- a (1 + \psi ), 0]  \\
u_{\mu } &= a\qty[ - (1 + \psi ), v_i + \omega _i]
\,,
\end{align}
%
therefore the equation \(N_\mu = u_\mu \) reads \(v_i + \omega _i = 0\).
This condition also leads to \(T^{0}_{i} = 0\): the momentum flux vanishes.
This is also called the comoving orthogonal gauge.

% \todo[inline]{is the condition not just \(\omega^{\parallel} = 0\)?}

Other options are the \textbf{spatially flat gauge}, also known as the uniform curvature gauge: this is found by selecting constant-\(\eta \) spatial hypersurfaces where the spatial metric is left unperturbed, at least for scalar and vector perturbations.

This means
%
\begin{align}
\widetilde{\phi} = \widetilde{\chi}^{\parallel} = \widetilde{\chi}^{\perp}_i = 0
\,,
\end{align}
%
and the reason for the name is that the intrinsic spatial curvature (Ricci scalar) of the constant-\(\eta \) hypersurfaces is
%
\begin{align}
^{(3)}R = \frac{6k}{a^2} + \frac{rk}{a^2} \hat{\phi} + \frac{4}{a^2} \nabla^2 \hat{\phi}
\,,
\end{align}
%
where \(\hat{\phi} = \phi + (1/6) \nabla^2 \chi^{\parallel}\).
This is why \(\hat{\phi}\) is sometimes called the \emph{curvature perturbation} itself, as \(R \propto \hat{\phi}\) in Fourier space.

The \textbf{uniform energy density gauge} is defined by \(\delta \widetilde{\rho} = 0\).

There are two approaches we can take with regard to gauge freedom: we can choose a gauge and work within it in a self-consistent way.
This is fine, but residual gauge freedom can create issues.

The alternative is to only use gauge-invariant perturbations.
A paper by Bardeen \cite[]{bardeenGaugeinvariantCosmologicalPerturbations1980a} showed how to do so.
Starting with scalars, we would have 4 of them: \(\psi, \phi , \omega^{\parallel}, \chi^{\parallel}\), however only 2 degrees of freedom can remain.
We define
%
\begin{align}
2 \Psi  _A &= 2 \psi + 2 \omega^{\parallel, \prime} + 2 \frac{a'}{a} \omega^{\parallel} - \qty(\chi^{\parallel, \prime \prime} + \frac{a'}{a} \chi^{\parallel, \prime})  \\
2 \Phi_H &= -2 \phi - \frac{1}{3} \nabla^2 \chi^{\parallel} + 2 \frac{a'}{a} \omega^{\parallel} - \frac{a'}{a} \chi^{\parallel, \prime}
\,,
\end{align}
%
and it can be shown (exercise) that these are indeed gauge invariant.
These quantities have a physical meaning: if we go to the zero-shear gauge \eqref{eq:zero-shear-gauge}, then \(\Phi _H =- \hat{\phi} \), while \(\Psi _A = \psi \).
These are known as the Bardeen gauge-invariant potentials, since they mimic Newtonian potentials.

\end{document}


\documentclass[a4paper,10pt]{article}
%\documentclass[a4paper,10pt]{scrartcl}

\usepackage[utf8x]{inputenc}
\usepackage{amsmath}

\newcommand{\VersionNum}{Version 1.0}

\title{SVM Matlab Implementation \VersionNum}
\author{James Lyons}
\date{13th Jan 2014}

\pdfinfo{%
  /Title    (SVM Matlab Implementation \VersionNum)
  /Author   (James Lyons)
  /Creator  (James Lyons)
}

\begin{document}
\maketitle

This document will refer to Alok's handwritten derivation. There may still be inaccuracies, I'll hopefully fix these in time. This is \VersionNum. Higher version numbers should mean more things are fixed.

The basic problem we have for SVM is to find a value of $\alpha$ that maximises the following function:

\begin{equation}\label{eq1} L(H,\alpha) = -\dfrac{1}{2}\alpha^T H \alpha + \alpha^T u \end{equation}

where $u$ is a vector of ones the same length as $\alpha$, and $H$ is a square symmetric matrix defined as follows:
\[ H_{ij} = y_i y_j x_i \cdotp x_j \]
where $x_i$ is an input feature vector and $y_i \in \left\{0,1\right\}$ is the class label corresponding to $x_i$.

MATLAB provides a function \texttt{quadprog} that \textit{minimises} the following function:
\begin{equation}\label{eq2} L(H,g,\alpha) = \dfrac{1}{2}\alpha^T H \alpha + \alpha^T g \end{equation}

According to the constraints $A\alpha \leq b$, $K\alpha = d$ and $e_i \leq \alpha_i \leq f_i$.

The inputs to the function are \texttt{H}, \texttt{g}, the matrices \texttt{A} and \texttt{K} and the vectors \texttt{b}, \texttt{d}, \texttt{e} and \texttt{f}.

To use it we just create all the right variables and plug them in. The first thing to notice is that \texttt{quadprog} \textit{minimises} eq \ref{eq2}, while we want to
\textit{maximise} eq \ref{eq1}, so we have to negate eq \ref{eq1}. There is also a negative sign out the front of eq \ref{eq1}, so we should absorb that into $H$.

Our constraints are that $y^t\alpha = 0$ and $\alpha_i \geq 0$. To get these we set \texttt{A} to be the negative identity matrix, and \texttt{b} to zero so we have
$-I\alpha \leq 0$, which ensures all alphas are greater than 0. For the equality constraint we set $K = y$ and $d=0$. Note that \texttt{K} does not have to be a full matrix, we only
specify the top row.

At this point we have satisfied all the constraints we need and should be able to run the program, unfortunately it usually just returns with $\alpha = [\infty,\ldots,\infty]$. By adding
some extra constraints (Using vectors \texttt{e} and \texttt{f} above) we can get it to converge all the time on a useful result and at the same time make it possible to handle the non-separable case.

It turns out that to make SVM work in non-separable cases we just need to bound $\alpha$ i.e. $0 \leq \alpha_i \leq C$ where $C$ is the cost parameter. The final call to \texttt{quadprog} looks like this:
\begin{verbatim}
quadprog(H, g,          A,       b,          K, d, e,          f)
quadprog(H, -ones(N,1), -eye(N), zeros(N,1), y, 0, zeros(N,1), C*ones(N,1))
\end{verbatim}

\section{Other things}
Once alpha is computed it is trivial to compute the weights and bias and do classification. I think it should be possible to append a 1 to the input feature vectors and set the bias to 0.
This will mean the bias is implicitly computed during the optimisation procedure.

Also, matlab's quadprog is very slow, with 2000 2-dimensional points it can take 15 minutes to compute alpha, while with 100 points it takes less than a second. So it does not scale
nicely.

It should be fairly easy to change this implementation, as long as we can get the objective function to look something like eq \ref{2}.

\end{document}


\begin{algorithm}[H]
    \caption{Build Solutions}\label{algo:build-solutions}
    \begin{algorithmic}[1]
        \REQUIRE $inst: \text{MIP instance}, config: \text{Configuration}$
        \STATE {$ur = 0.01;$} \refcomment{sec:usage-ratio}
        \STATE {$solutions = empty\_list();$} \label{build-solutions:line:empty-list}
        \STATE {$time\_out = config.min\_time; $}
        \FOR {$  i\ \textbf{in}\  count(config.count)$}
            \STATE {$ submodel = generate\_random\_submodel(inst,\ ur)^{\ref{algo:submodel-build}};$}
            \STATE {$ solution, status = solve\_submodel^{\ref{algo:solve-submodel}}(submodel, time\_out);  $}
            \IF {$ status\ \textbf{is}\ INFEASIBLE $}
                \STATE $ur = \sqrt[5]{ur^4};$ \refcomment{eq:ur-infease-grow}
            \ELSIF {$status\ \textbf{is}\ LIN\_FEASIBLE$}
                \STATE $ur = 1.1 \times ur;$ \refcomment{eq:ur-lin-fease-grow}
                \STATE $insert\_solution(solutions, solution, status);$
            \ELSIF {$status\ \textbf{is}\ INT\_FEASIBLE$}
                \STATE $ur = 0.9 \times ur;$ \refcomment{eq:ur-fease-grow}
                \STATE $insert\_solution(solutions, solution, status);$
            \ELSIF {$status\ \textbf{is}\ TIMEOUT$}
                \IF {$ time\_out < config.max\_time $}
                    \STATE {$ time\_out = time\_out + 1;$}
                \ENDIF
            \ENDIF
        \ENDFOR
        \RETURN $solutions$
    \end{algorithmic}
\end{algorithm}

\paragraph{Description} \Cref{algo:build-solutions} is a core component of Feature Kernel. It solve any submodel to understand its feasibility status and then controls
the two main inner parameter of the method: $Usage\ Ratio$, see \Cref{eq:usage-ratio}, and timeout, see \Cref{sec:timeout}.

\Cref{algo:build-solutions} requires as input some kind of MIP instance and a configuration. The configuration is just a collection of named values
(i.e. a \href{https://en.wikipedia.org/wiki/Struct_(C_programming_language)}{C Struct} or a
\href{https://docs.python.org/3/library/collections.html#namedtuple-factory-function-for-tuples-with-named-fields}{Python namedtuple})
so it is possible to pass any parameter with just one name. Config contains any useful configuration parameter, like time limits, submodel count and the split
criterion.

On line \ref{build-solutions:line:empty-list} the function $empty\_list$ create a new empty dynamic vector
(i.e. a \href{https://en.wikipedia.org/wiki/List_(abstract_data_type)}{list}) of the appropriate type to store solutions. This list can be used as the first argument of
the $insert\_solution$ that under the hood creates a new record and append it as the end of the list.

Then \Cref{algo:build-solutions} generate and solve the given number of sub models, end for each submodel it check the output status and act accordingly:
\begin{itemize}
    \item If the model is feasible it is stored and $ur$ is update as described in \Cref{eq:ur-fease-grow} and \Cref{eq:ur-lin-fease-grow}
    \item If the model is infeasible the solution is empty, so it is ignored, and $ur$ is update as described in \Cref{eq:ur-infease-grow}
    \item If the model ends with a timeout the solution is empty, so it is ignored, and $timeout$ is updated as described in \Cref{sec:timeout}
\end{itemize}

Once all the submodel have been created and tested \Cref{algo:build-solutions} returns the list of valid solutions.


\documentclass[12pt]{book}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathtools}
% Use pdflscape for pdf viewers
\usepackage{pdflscape}
% Use lscape for printing as a book
%\usepackage{lscape}
\usepackage{etoolbox}
\usepackage{csquotes}
\usepackage[normalem]{ulem}
\usepackage[toc,page]{appendix}
\usepackage{hyperref}
\usepackage{xcolor}

\title{%
  Tensor Algebra Notes
}
\author{Ernest Kirstein}
\date{\today}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[chapter]

\theoremstyle{definition}
\newtheorem{definition}{Definition}[chapter]
\newtheorem{exercise}{Exercise}[chapter]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{example}{Example}[chapter]
\newtheorem{drule}{Rule}

\newtheoremstyle{ppart}{}{}{}{}{}{:}{ }{}
\theoremstyle{ppart}
\newtheorem{ppart}{Part}

\newtheoremstyle{case}{}{}{}{}{}{:}{ }{}
\theoremstyle{case}
\newtheorem{case}{Case}

\newcounter{solutionctr}
\newtheoremstyle{solution}{}{}{}{}{}{:}{\newline}{
  Exercise \refstepcounter{solutionctr}\thesolutionctr~Solution}
\theoremstyle{solution}
\newtheorem{solution}{Solution}
\newcommand{\solutionsection}[1]{
  \section{Chapter~#1 Solutions}\setcounter{solutionctr}{0}}

\newenvironment{argument}{\noindent\textit{Argument.}}{\hfill$\square$}

\AtBeginEnvironment{proof}{\setcounter{ppart}{0}}
\AtBeginEnvironment{proof}{\setcounter{case}{0}}
\AtBeginEnvironment{align}{\setcounter{equation}{0}}
\AtBeginEnvironment{alignat}{\setcounter{equation}{0}}

%\DeclareMathOperator{\Dim}{Dim}
%\newcommand{\mmult}[1]{\text{\raisebox{1ex}{$\underset{#1}{\times}$}}}

\begin{document}

\maketitle

\tableofcontents

\chapter{What is a Tensor}

The following 3 definitions come from this \cite{youtube:tensor0} video.

\begin{definition}[Tensor as Multidimensional Array]
First, a tensor is a multidimensional array of numbers.
A zero rank tensor is a scalar. A rank one tensor is a vector. A rank two tensor is a matrix. A rank three tensor is a 3d matrix.
\end{definition}

\begin{definition}[Tensor as Invariant]
Second, a tensor is an object that is invariant under a change of coordiantes and has components that change in a special, predictable
way under a change of coordinates.
Vectors (as abstract physical objects) are invariant. Vector coordinates are not invariant.
\end{definition}

\begin{definition}[Tensor Abstractly]
Lastly, a tensor is a collection of vectors and covectors combined together using the tensor product.
\end{definition}

\chapter{Forward and Backward Transformations}

This chapter covers this \cite{youtube:tensor1} video.
These are the rules that let us move back and forth between coordiante systems.

We have two bases, the old basis, $\{\vec{e}_1, \vec{e}_2\}$, and the new basis, $\{\widetilde{\vec{e}_1}, \widetilde{\vec{e}_2}\}$.
The forward transfomation will move us from the old basis to the new basis.

\[ \widetilde{\vec{e}_1} = 2 \vec{e}_1 + 1 \vec{e}_2 \]
\[ \widetilde{\vec{e}_2} = -\frac{1}{2} \vec{e}_1 + \frac{1}{4} \vec{e}_2 \]
\[
  F =
  \begin{bmatrix}
  2 & -\frac{1}{2} \\
  1 & \frac{1}{4}
  \end{bmatrix}
\]

\[ \vec{e}_1 = \frac{1}{4} \widetilde{\vec{e}_1} - 1 \widetilde{\vec{e}_2} \]
\[ \vec{e}_2 = \frac{1}{2} \widetilde{\vec{e}_1} + 2 \widetilde{\vec{e}_2} \]
\[
  B =
  \begin{bmatrix}
  \frac{1}{4} & \frac{1}{2} \\
  -1 & 2
  \end{bmatrix}
\]

Note that $FB = I$, i.e. $B = F^{-1}$

I've noticed (this wasn't in the video) that if you want to convert a vector into the new coordiante system you actually
need to multiply by the construction matrix for the new coordiante system, which the video labeld $B$.
\[ B \vec{v} = \widetilde{\vec{v}} \]
\[
  \begin{bmatrix}
  0.25 & 0.5 \\
  -1 & 2
  \end{bmatrix}
  \begin{bmatrix}
  1 \\
  1
  \end{bmatrix}
  =
  \begin{bmatrix}
  0.75 \\
  1
  \end{bmatrix}
\]
Then since $B = F^{-1}$ so $B^{-1} = F$ and,
\[ \vec{v} = F \widetilde{\vec{v}} \]

In general,

\label{vector_basis_transform}
\[ \widetilde{\vec{e}_i} = \sum_{j=1}^{n} F_{ji} \vec{e}_j \]
\[ \vec{e}_i = \sum_{j=1}^{n} B_{ji} \widetilde{\vec{e}_j} \]

To prove that $B = F^{-1}$,

\begin{align*}
  \vec{e}_i &= \sum_{j=1}^{n} B_{ji} \widetilde{\vec{e}_j} \\
  &= \sum_{j=1}^{n} B_{ji} \sum_{k=1}^{n} F_{kj} \vec{e}_k \\
  &= \sum_{j=1}^{n} \sum_{k=1}^{n} B_{ji} F_{kj} \vec{e}_k \\
  &= \sum_{k=1}^{n} \sum_{j=1}^{n} F_{kj} B_{ji} \vec{e}_k \\
  &= \sum_{k=1}^{n} \delta_{ik} \vec{e}_k \\
\end{align*}
So,
\begin{align*}
F_{kj} B_{ji} &= \delta_{ik} \\
FB &= I \\
B &= F^{-1}
\end{align*}

\chapter{Vector Tensors}

Starting from this \cite{youtube:tensor2} video...

We've learned in linear algebra that vectors are lists of numbers with addition and scalar multiplication.
But those are really just vector components.
Saying that vectors are just lists of numbers loses the geometrical meaning behind vectors.

Geometrically, a vector is just an arrow pointing in space.
To add physical vectors you just do tip to tail addition (put the tail of the second vector on the tip of the first and
the sum is the vector from the tail of the first to the tip of the second.)
Similarly, we can scale physical vectors in space by a scalar.

The problem is, not all vectors can be visualized as arrows. Only euclidian vectors can (consider the abstract
algebra definition). A vector is just a member of a vector space, $(V,S,+,\cdot)$, a set of vector objects, $V$,
a set of scalars, $S$, an addition operation, $+$, and a scalar multiplication operation, $\cdot$.

Suppose we have some vector $\vec{v}$ in the context of the same coordinate systems of the last chapter,

\[
  F =
  \begin{bmatrix}
  2 & -\frac{1}{2} \\
  1 & \frac{1}{4}
  \end{bmatrix}
\]

\[
  B =
  \begin{bmatrix}
  \frac{1}{4} & \frac{1}{2} \\
  -1 & 2
  \end{bmatrix}
\]

Where,
\[ \vec{v} = 1 \vec{e}_1 + 1.5 \vec{e}_2 \]
\[ \vec{v} = 1 \widetilde{\vec{e}_1} + 2 \widetilde{\vec{e}_2} \]

\[ \vec{v} =
  \begin{bmatrix}
  1 \\
  1.5
  \end{bmatrix}_{\vec{e}}
\]

\[ \vec{v} =
  \begin{bmatrix}
  1 \\
  2
  \end{bmatrix}_{\widetilde{\vec{e}}}
\]

My observation from the last chapter was correct,
\label{change_vector_basis}
\[ B \vec{v}_{e} = \vec{v}_{\widetilde{e}} \]
\[ F \vec{v}_{\widetilde{e}} = \vec{v}_{e} \]
But we must be very careful to note that $\vec{v}_{e}$ and $\vec{v}_{\widetilde{e}}$ are the vector {\em{components}}, not the vector itself, in the new basis.

This is because \cite{youtube:tensor3} a transformation to the basis will effectively do the oposite to the vector from the perspective of the basis.
Like if you walk forward, a stationary object will look like it's moving in the oposite direction from your perspective.
Which lets us introduce a new term: vector components are contravariant.

This contravariance shows up in the notion in the following way,
\[ \vec{v} = \sum_{i=1}^n v^i \vec{e}_i = \sum_{i=1}^n \widetilde{v^i} \widetilde{\vec{e}_i} \]
Note that the contravariant components have indicies at the top and the covariant basis components have their indices at the bottom.

\chapter{Covectors}

Covectors are, in one sense, ``row vectors" \cite{youtube:tensor4}. Which are fundamentally different than ``column vectors".
The reason you might think they're the same is that you've been dealing with them in an ``orthonormal basis." Which is a basis
where all the unit vectors are one unit long and orthoganal to eachother.

A row vecotr can be thought of a function on a (column) vector.

\[
  \begin{bmatrix}
  2 & 1
  \end{bmatrix}
  \begin{bmatrix}
  3 \\ -4
  \end{bmatrix}
  = 2
\]

In general,
\[ \alpha(\vec{v}) = \sum_{i=1}^n \alpha_i v^i \]
\[ \alpha : V \to \mathbb{R} \]

This is obviously linear,
\[ \alpha(s \vec{u} + t \vec{v}) = s \alpha(\vec{u}) + t \alpha(\vec{v}) \]

Covectors can be thought of as planes one dimension higher that pass through the origin. Such as the range of the function:

\[
  \begin{bmatrix}
  2 & 1
  \end{bmatrix}
  \begin{bmatrix}
  x \\ y
  \end{bmatrix}
  = 2x+y
\]

And a covector acting on a vector returns the number of units increased in height on the plane
(output) from the tail of the vector to the tip of the vector.

You can scale covectors by tilting the plane (steaper for an increse > 1, less steap for a decrese 0 to 1, flipped for a negative scaling)
like this:

\[ (s \alpha)(\vec{v}) = s \alpha(\vec{v}) \]

You can add covectors by adding the planes, so
\[ (\alpha+\beta)(\vec{v}) = \alpha(\vec{v})+\beta(\vec{v}) \]

Since covectors themselves can be added and scaled, they form a vector space. This is called the Dual Space of the vectors in $V$ denoted $V^*$
The dual space necessarily have different adding and scaling rules from the vector space, since those operators are operating on different
types of objects.

\section{Covector Components}

In this section \cite{youtube:tensor5} we'll introduce two special covectors based on a basis, $\{\vec{e}_1, \vec{e}_2\}$, in $V$.
Those covectors are $\epsilon^1$ and $\epsilon^2$, such that,
\[ \epsilon^1(\vec{e}_1) = 1 \]
\[ \epsilon^1(\vec{e}_2) = 0 \]
\[ \epsilon^2(\vec{e}_1) = 0 \]
\[ \epsilon^2(\vec{e}_2) = 1 \]
In general,
\[ \epsilon^i(\vec{e}_j) = \delta_{ij} \]
Notice,
\begin{align*}
  \epsilon^1(\vec{v})
  &= \epsilon^1(v^1 \vec{e}_1 + v^2 \vec{e}_2) \\
  &= v^1 \epsilon^1(\vec{e}_1) + v^2 \epsilon^1(\vec{e}_1) \\
  &= v^1 (1) + v^2 (0) \\
  &= v^1
\end{align*}
And in general,
\[ \epsilon^i(\vec{v}) = v^i \]

These covectors form a basis for covectors in the dual space, $V^*$.
So we can rewrite any general covector $\alpha$ as a linear combination of $\epsilon^i$.
For example,
\[ \alpha = \alpha_1\epsilon^1 + \alpha_2 \epsilon^2 \]

We call this basis the `dual basis'.

Any general covector can be written in an entirely different dual basis as well,

\[ \alpha = \widetilde{\alpha_1} \widetilde{\epsilon^1} +  \widetilde{\alpha_2} \widetilde{\epsilon^2} \]

In general,
\label{change_covector_basis}
\[ \alpha_{\epsilon} F = \alpha_{\widetilde{\epsilon}} \]
\[ \alpha_{\widetilde{\epsilon}} B = \alpha_{\epsilon} \]

Remember from the last chapter that,

\[ B \vec{v}_{e} = \vec{v}_{\widetilde{e}} \]
\[ F \vec{v}_{\widetilde{e}} = \vec{v}_{e} \]

And see how these differ. That's because these covectors are covariant, not contravariant like vectors.

\section{Covector Transformations}

The next video in the series was pretty convoluted and didnt' provide the kind of insight I was hoping for.
So I've worked this out for myself.

Remember for our change in basis for vectors we saw that,
\[ \widetilde{\vec{e}_i} = \sum_{j=1}^{n} F_{ji} \vec{e}_j \]
\[ \vec{e}_i = \sum_{j=1}^{n} B_{ji} \widetilde{\vec{e}_j} \]

In other words,
\[ F \vec{e} = \widetilde{\vec{e}} \]
\[ B \widetilde{\vec{e}} = \vec{e} \]

Now note that the matrix composed of stacking the cobasis multiplied by the matrix composed of conjoining the basis vectors
is equal to the identiy matrix:

\begin{align*}
  E \vec{E} &=
  \begin{bmatrix}
  - & \epsilon^1 & - \\
  - & \vdots & - \\
  - & \epsilon^n & -
  \end{bmatrix}
  \begin{bmatrix}
  | & | & | \\
  \vec{e}_1 & \dots  & \vec{e}_n \\
  | & | & |
  \end{bmatrix} \\
  &=
  \begin{bmatrix}
  \epsilon^1(\vec{e}_1) & \dots & \epsilon^1(\vec{e}_n) \\
  \vdots & \ddots & \vdots \\
  \epsilon^n(\vec{e}_1) & \dots & \epsilon^n(\vec{e}_n)
  \end{bmatrix} \\
  &=
  \begin{bmatrix}
  \delta{1,1} & \dots & \delta{1,n} \\
  \vdots & \ddots & \vdots \\
  \delta{n,1} & \dots & \delta{n,n}
  \end{bmatrix} \\
  &=
  \begin{bmatrix}
  1 & \dots & 0 \\
  \vdots & \ddots & \vdots \\
  0 & \dots & 1
  \end{bmatrix} \\
  &= I_n
\end{align*}

And our other conversions can similarly be written in matrix form. From,

\[ F \vec{e} = \widetilde{\vec{e}} \]
\[ B \widetilde{\vec{e}} = \vec{e} \]

We get,

\[ F \vec{E} = \widetilde{\vec{E}} \]
\[ B \widetilde{\vec{E}} = \vec{E} \]

We want to find the change of basis vector, $X$, such that,

\[ E X = \widetilde{E} \]

Now since, $E \vec{E} = I$, $\vec{E} = E^{-1}$. Similarly,
$\widetilde{\vec{E}} = \widetilde{E}^{-1}$, and so,

\begin{align*}
  E X &= \widetilde{E} \\
  \vec{E} E X &= \vec{E} \widetilde{E} \\
  I X &= \vec{E} \widetilde{E} \\
  X &= B \widetilde{\vec{E}} \widetilde{E} \\
  X &= B I \\
  X &= B
\end{align*}

So,

\[ E B = \widetilde{E} \]

Therefore (since $B$ and $F$ are inverses),

\[ \widetilde{E} F = E\]

In other words,

\label{covector_transforms}
\[ \epsilon^i B = \widetilde{\epsilon^i} \]
\[ \widetilde{\epsilon^i} F = \epsilon^i \]

Which is the oposite for change of basis for the regular vector basis.

\[ F \vec{e} = \widetilde{\vec{e}} \]
\[ B \widetilde{\vec{e}} = \vec{e} \]

\chapter{Linear Maps}

The video \cite{youtube:tensor6} defines linear maps in 3 ways,

\begin{definition}[Linear Maps as Matrices]
Linear maps are matrices, a 2d array of numbers. They transform column vectors through
multiplication, $L(v) = M \vec{v} = \vec{v}'$ for some characteristic matrix $M$.
This multiplication does not change the basis of a vector.

For example,

\[
  M =
  \begin{bmatrix}
  5 & -1 \\
  3 & 4
  \end{bmatrix}_{\vec{e}}
\]
\[
  L(\vec{e}_1) =
  M
  \begin{bmatrix}
  1 \\
  0
  \end{bmatrix}_{\vec{e}}
  =
  \begin{bmatrix}
  5 \\
  3
  \end{bmatrix}_{\vec{e}}
\]
\[
  L(\vec{e}_2) =
  M
  \begin{bmatrix}
  0 \\
  1
  \end{bmatrix}_{\vec{e}}
  =
  \begin{bmatrix}
  -1 \\
  4
  \end{bmatrix}_{\vec{e}}
\]
\end{definition}

\begin{definition}[Linear Maps Geometrically]
Linear maps are spacial transformations that
\begin{enumerate}
  \item Keep grid lines parallel
  \item Keep grid lines evenly spaced
  \item Keep the origin stationary
\end{enumerate}
\end{definition}

\begin{definition}[Linear Maps Abstractly]
Linear maps are ones that map map vectors from one vector space to another,
\[ L : V \to W \]

Often times, the input and output spaces are the same, but in general they can
be differnt.

These maps are also linear, hence the name. That is, it satisfies these two conditions:

\[ L(\vec{v} + \vec{w}) = L(\vec{v}) + L(\vec{w}) \]
\[ L(s \vec{v}) = s L(\vec{v}) \]
\end{definition}

It's interesting to see that the linearity property over a vector set necessarly means that $L$ can be expressed as a matrix.
So, assuming $L$ is from $V$ to $V$, then in the basis $e$, if,

\[ \vec{w} = L(\vec{v}) \]

Then,

\begin{align*}
  \vec{w} &= L(\vec{v}) \\
  &= L(v^1 \vec{e}_1 + v^2 \vec{e}_2) \\
  &= v^1 L(\vec{e}_1) + v^2 L(\vec{e}_2)
\end{align*}

Then if we express the output of $L$ for the two basis vectors in terms of that basis (which we know we can do),
\[ L(\vec{e}_1) = L^1_1 \vec{e}_1 + L^2_1 \vec{e}_2 \]
\[ L(\vec{e}_2) = L^1_2 \vec{e}_1 + L^2_2 \vec{e}_2 \]

Then,
\begin{align*}
  \vec{w}
  &= v^1 L(\vec{e}_1) + v^2 L(\vec{e}_2) \\
  &= v^1 (L^1_1 \vec{e}_1 + L^2_1 \vec{e}_2) + v^2 (L^1_2 \vec{e}_1 + L^2_2 \vec{e}_2) \\
  &= (v^1 L^1_1 + v^2 L^1_2) \vec{e}_1 + (v^1 L^2_1 + v^2 L^2_2) \vec{e}_2
\end{align*}

We can rewrite $\vec{w}$ in terms of it's basis components,
\[ w^1 = v^1 L^1_1 + v^2 L^1_2 \]
\[ w^2 = v^1 L^2_1 + v^2 L^2_2 \]

So,
\[
  \begin{bmatrix}
  w^1 \\
  w^2
  \end{bmatrix}
  =
  \begin{bmatrix}
  L^1_1 & L^1_2 \\
  L^2_1 & L^2_2
  \end{bmatrix}
  \begin{bmatrix}
  v^1 \\
  v^2
  \end{bmatrix}
\]

In general,
\[ w^i = \sum_{j=1}^n L^i_j v^j \]

\section{Linear Map Transformation Rules}

This section covers this \cite{youtube:tensor7} video.

So you have a linear map transformation, $L(\vec{v})$ which
has some matrix representation in the basis $e$, $L$. The question is,
how do we find that linear transformation's matrix represetation in a new basis, $\widetilde{e}$, which
we'll call $\widetilde{L}$.

That is, we know that for any $\vec{v}$, if we let $\vec{w}$ be the output of the transform on $\vec{v}$ then,

\[L \vec{v}_e = \vec{w}_e \]

And we just need to solve,
\[\widetilde{L} \vec{v}_{\widetilde{e}} = \vec{w}_{\widetilde{e}} \]
In terms of $L$ and the forward and backward matrices.

\begin{align*}
  \widetilde{L} \vec{v}_{\widetilde{e}} &= \vec{w}_{\widetilde{e}} \\
  \widetilde{L} B \vec{v}_e &= B \vec{w}_e \\
  \widetilde{L} B \vec{v}_e &= B L \vec{v}_e \\
  (\widetilde{L} B) \vec{v}_e &= (B L) \vec{v}_e \\
\end{align*}

So, since this is true for all $\vec{v}_e$ we know that,

\[ \widetilde{L} B = B L \]

So,

\begin{align*}
  \widetilde{L} B &= B L \\
  \widetilde{L} B F &= B L F \\
  \widetilde{L} I &= B L F \\
  \widetilde{L} &= B L F
\end{align*}

And we can work out the inverse transform to get $L$ from $\widetilde{L}$ quite easily,

\begin{align*}
  \widetilde{L} &= B L F \\
  F \widetilde{L} B &= F B L F B\\
  F \widetilde{L} B &= I L I\\
  F \widetilde{L} B &= L \\
\end{align*}

So we have are two nice neat equations,
\label{linear_map_transforms}
\[ \widetilde{L} = B L F \]
\[ L = F \widetilde{L} B \]

\section{Einstein Notation}

Let us consider the sum,
\[ \widetilde{L}^l_i =  \sum_{k=1}^n \sum_{j=1}^n B^l_k L^k_j F^j_i \]
Which is the expansion of
\[ \widetilde{L} = B L F \]

Einstein notation will have us writing that,
\[ \widetilde{L}^l_i =  B^l_k L^k_j F^j_i \]
Where we can assume there are sums for indexes repeated on the top and the bottom.
That let's us rearrange things if we want,
\[ \widetilde{L}^l_i =  F^j_i L^k_j B^l_k \]
Is how it was written in the video, for example.

This is also demonstrated with matrix identity multiplication,

\[ (M I)^i_k = M^i_j I^j_k = M^i_j \delta^j_k = M^i_k \]

Notice how we can just drop that kronecker delta and keep replace $j$ with $k$ on $M$.

All of our important results written in Einstein Notation are as follows:

\label{einstein_notation}
For Contravariant (1,0)-Tensors:
\[ \widetilde{\epsilon}^i = B^i_j \epsilon^j \]
\[ \epsilon^i = F^i_j \widetilde{\epsilon^j} \]
\[ \widetilde{v}^i = B^i_j v^j \]
\[ v^i = F^i_j \widetilde{v^j} \]

For Covariant (0,1)-Tensors:
\[ \widetilde{\vec{e}_i} = F^j_i \vec{e}_j \]
\[ \vec{e}_i = B^j_i \widetilde{\vec{e}_j} \]
\[ \widetilde{\alpha_i} = F^j_i \alpha_j \]
\[ \alpha_i = B^j_i \widetilde{\alpha_j} \]

And for (1,1)-Tensors:
\[ \widetilde{L^i_j} = B^i_k L^k_l F^l_j \]
\[ L^i_j = F^i_k \widetilde{L^k_l} B^l_j \]

\chapter{The Metric Tensor}

Trying to measure the length of a vector is not as straight forward
as using Pythagoras' Theorem \cite{youtube:tensor8}, at least not in a non-orthonormal coordinate system.

The real length can be gotten by the dot product.

\[ \vec{v} \cdot \vec{v} = ||\vec{v}||^2 \]

This works in all coordinate systems, so long as you know the size, in the correct units, of
the dot products of the basis vectors in that coordinate system.

Now, this can also be calculated like this for a orthonormal basis, $e$,

\[ ||\vec{v}||^2 = \vec{v}^T_e I \vec{v}_e \]
\[ ||\vec{v}||^2 = v_i \delta^i_j v^j \]

And in general,

\label{length}
\[ ||\vec{v}||^2 = \vec{v}^T_{\widetilde{e}} g_{\widetilde{e}} \vec{v}_{\widetilde{e}} \]
\[ ||\vec{v}||^2 = \widetilde{v^i} \widetilde{v^j} \widetilde{g_{ij}} \]

Where $g_{\widetilde{e}}$, or $\widetilde{g^i_j}$, is the `metric tensor' for the basis $\widetilde{e}$.

In general,
\label{metric_tensor}
\[ g_{ij} = \vec{e}_i \cdot \vec{e}_j \]

The metric tensor can also be used to measure angles.
Remember that,
\[ \vec{v} \cdot \vec{w} = ||\vec{v}|| ||\vec{w}||\cos(\theta) \]

And since,

\label{dot}
\[ \vec{v} \cdot \vec{w} =  v^i w^j g_{ij} \]

\label{angle}
\begin{align*}
  v^i w^j g_{ij} &= ||\vec{v}|| ||\vec{w}||\cos(\theta) \\
  v^i w^j g_{ij} &= \sqrt{v^a v^b g_{ab}} \sqrt{w^c w^d g_{cd}} \cos(\theta) \\
  \frac{v^i w^j g_{ij}}{\sqrt{v^a v^b g_{ab}} \sqrt{w^c w^d g_{cd}}} &=  \cos(\theta)
\end{align*}

\section{Transforming the Metric Tensor}

To get one metric tensor from another, note that,

\begin{align*}
  \widetilde{g_{ij}}
  &= \widetilde{\vec{e}_i} \cdot \widetilde{\vec{e}_j} \\
  &= (F^k_i\vec{e}_k) \cdot (F^l_j\vec{e}_l) \\
  &= F^k_i F^l_j (\vec{e}_k \cdot \vec{e}_l) \\
  &= F^k_i F^l_j g_{kl}
\end{align*}

\label{metric_tensor_transform}
So,
\[ \widetilde{g_{ij}} = F^k_i F^l_j g_{kl} \]

Likewise,

\[ g_{ij} = B^k_i B^l_j \widetilde{g_{kl}} \]

The metric tensor is then said to be a (0,2)-Tensor because it transforms using
two covariant rules.

\section{Tensors In General}

Tensors in general follow this pattern,
\label{general_tensor}

\[
  \widetilde{T^{abc\dots}_{xyz\dots}}
  =
  (B^a_i B^b_j B^c_k \dots)
  T^{ijk\dots}_{rst\dots}
  (F^r_x F^s_y F^t_z \dots)
\]

Where the top indices are the contravariant indices
and the bottom indices are the covariant indices.

When the tensor has $m$ contravariant indices and $n$ covariant indices
it is an $(m,n)$-tensor.

And by the way, the reverse transform is,
\[
  T^{ijk\dots}_{rst\dots}
  =
  (F^i_a F^j_b F^k_c \dots)
  \widetilde{T^{abc\dots}_{xyz\dots}}
  (B^x_r B^y_s B^z_t \dots)
\]

\chapter{Bilinear Forms}

The Metric Tensor is a very specific example of a more general thing called a bilinear form \cite{youtube:tensor9}.

Notice that the metric tensor can be thought of as a function from two vectors to produce a scalar,
\[ g: V \times V \to \mathbb{R} \]

Specifically,

\[ g(\vec{v}, \vec{w}) = v^i w^j g_{ij} \]

Now note that,

\[ g(\vec{v}, \vec{w}) = g(\vec{w}, \vec{v}) \]
\[ s g(\vec{v}, \vec{w}) = g(s \vec{v}, \vec{w}) =  g(\vec{v}, s \vec{w}) \]
\[ g(\vec{v}+\vec{u}, \vec{w}) = g(\vec{v}, \vec{w}) + g(\vec{u}, \vec{w})\]
\[ g(\vec{v}, \vec{w}+\vec{u}) = g(\vec{v}, \vec{w}) + g(\vec{v}, \vec{u}) \]

\begin{definition}[Bilinear Form]
A bilinear form is any function, $\mathcal{B}$, from $V \times V$ to $\mathbb{R}$ that follows
the following properties,
\[ s \mathcal{B}(\vec{v}, \vec{w}) = \mathcal{B}(s \vec{v}, \vec{w}) =  \mathcal{B}(\vec{v}, s \vec{w}) \]
\[ \mathcal{B}(\vec{v}+\vec{u}, \vec{w}) = \mathcal{B}(\vec{v}, \vec{w}) + \mathcal{B}(\vec{u}, \vec{w})\]
\[ \mathcal{B}(\vec{v}, \vec{w}+\vec{u}) = \mathcal{B}(\vec{v}, \vec{w}) + \mathcal{B}(\vec{v}, \vec{u}) \]

Notice that it doesn't necessarily have to follow,
\[ \mathcal{B}(\vec{v}, \vec{w}) = \mathcal{B}(\vec{w}, \vec{v}) \]
Though that makes the bilinear form `symmetric' \cite{wiki:bilinear}.
\end{definition}

The metric tensor also has the additional property,
\[ g(\vec{v}, \vec{v}) \ge 0 \]

Bilinear forms are represented by general matrices, like so,
\[ \mathcal{B}(\vec{v}, \vec{w}) = \mathcal{B}_{ij} v^i w^j \]

A bilinear form is necessarily a $(0,2)$-tensor. So,
\[ \widetilde{\mathcal{B}_{ij}} = \mathcal{B}_{kl} F^k_i F^l_j \]
\[ \mathcal{B}_{ij} = \widetilde{\mathcal{B}_{kl}} B^k_i B^l_j \]

Covectors are sometimes called 1-forms because they operate on one vector and produce a scalar. Similarly,
bilinear forms are called 2-forms because they act on two vectors and produce a scalar.

\chapter{Tensor Product}

This chapter will build towards a definition of the tensor product.

\section{Linear Maps and Vector-Covetor Pairs}

Remember that our last definition of a tensor was ``a collection of vectors and covectors combined together
using a tensor product.'' \cite{youtube:tensor10}

That tells us that we should be able to build linear maps and metric tensors out of vectors and covectors
somehow.

If you have a vector and a covector, remember that these are column and row vectors respectively,
and that in one ordering their product is a scalar, while in the other it forms an $n \times n$ matrix.
But not all matrices can be decomposed this way.

Notice that the set of products from the basis, $\{\vec{e}_i\}$, and cobasis $\{\epsilon^j\}$ forms a basis for a vector space of $n \times n$ matrices.

\[ \{ \vec{e}_i \epsilon^j \} \text{ is a basis for } L \]

Where $L$ is a general linear map.

\begin{align*}
  \vec{w} = L(\vec{v})
  &= L^i_j \vec{e}_i \epsilon^j (v^k \vec{e}_k) \\
  &= L^i_j v^k \vec{e}_i \epsilon^j (\vec{e}_k) \\
  &= L^i_j v^k \vec{e}_i \delta^j_k \\
  &= L^i_j v^j \vec{e}_i \\
  w^i &= L^i_j v^j
\end{align*}

Notice that there's nothing special about this particular basis. Any product of basis and cobasis will form a basis for $L$.

\section{Bilinear Forms and Covector-Covector Pairs}

Now that we've redefined linear maps as vector-covector pairs, we can also redefine bilinear forms simlarly through
products of the cobasis with itself,

\[ \mathcal{B} = \mathcal{B}_{ij} \epsilon^i \epsilon^j \]

Notice that bilinear forms take 2 vector inputs. The covectors of the cobasis take one vector each.

\begin{align*}
  s &= \mathcal{B}(\vec{v}, \vec{w}) \\
  &= \mathcal{B}_{ij} \epsilon^i \epsilon^j (v^k \vec{e}_k, w^l \vec{e}_l) \\
  &= \mathcal{B}_{ij} \epsilon^i (v^k \vec{e}_k) \epsilon^j (w^l \vec{e}_l) \\
  &= \mathcal{B}_{ij} v^k w^l \epsilon^i (\vec{e}_k) \epsilon^j (\vec{e}_l) \\
  &= \mathcal{B}_{ij} v^k w^l \delta^i_k \delta^j_l \\
  &= \mathcal{B}_{ij} v^i w^j
\end{align*}

So $\{\epsilon^i \epsilon^j\}$ is a basis for $\mathcal{B}$.

\section{Tensor Product vs. Kronecker Product}

This section coverse this \cite{youtube:tensor11} video.

Technically, I should have been writing,

\[ \epsilon^i \epsilon^j \]
as
\[ \epsilon^i \otimes \epsilon^j \]

And similar for other tensor products. But this video series uses non-standard notation by
excluding the $\otimes$.

The $\otimes$ actually represents two different operations. The tesor product, and the kronecker product.
The tensor product operates on tensors while the kronecker product operates on arrays.

Let the basis for $V$ be $\vec{e}_i \in V$ and the cobasis be $\epsilon^i \in V*$ where
\[ \epsilon^i(\vec{e}_j) = \delta^i_j \]

Now $\vec{e}_i \otimes \epsilon^j$ is a new tensor, a linear map, as we've learned.
Thus, the tensor product.

The kronecker product works on arrays,

\[
  \begin{bmatrix}
  v^1 \\
  v^2
  \end{bmatrix}
  \otimes
  \begin{bmatrix}
  a_1 & a_2
  \end{bmatrix}
  =
  \begin{bmatrix}
    \begin{bmatrix}
    v^1 \\
    v^2
    \end{bmatrix}
    a_1
  &
    \begin{bmatrix}
    v^1 \\
    v^2
    \end{bmatrix}
    a_2
  \end{bmatrix}
  =
  \begin{bmatrix}
    \begin{bmatrix}
    v^1 a_1 \\
    v^2 a_1
    \end{bmatrix}
  &
    \begin{bmatrix}
    v^1 a_2 \\
    v^2 a_2
    \end{bmatrix}
  \end{bmatrix}
\]

You just distribute the array on the left into the array on the right.

\section{Generalizing Tensors}

This section covers this \cite{youtube:tensor12} video.

Let's define some new tensors,

\[ D = D^{ab} \vec{e}_a \vec{e}_b \]
\[ Q = Q^i_{jk} \vec{e}_i \epsilon^j \epsilon^k \]

Where $D$ is a (2,0) tensor and $Q$ is a (1,2) tensor.
So what are the forward and backwards transformation rules for these tensors?
That's easy enough to work out if you remember that,

\[ \widetilde{\vec{e}_j} = F^i_j \vec{e}_i \]
\[ \vec{e}_j = B^i_j \widetilde{\vec{e}_i} \]
\[ \widetilde{\epsilon^j} = \epsilon^i B^j_i \]
\[ \epsilon^j = \widetilde{\epsilon^i} F^j_i \]

So,

\begin{align*}
  D &= D^{ab} (B^i_a \widetilde{\vec{e}_i}) (B^i_b \widetilde{\vec{e}_i}) \\
  &= B^i_a B^i_b D^{ab} \widetilde{\vec{e}_i} \widetilde{\vec{e}_i} \\
  &=  \widetilde{D^{ij}} \widetilde{\vec{e}_i} \widetilde{\vec{e}_i} \\
  \widetilde{D^{ij}} &= B^i_a B^i_b D^{ab}
\end{align*}

\begin{align*}
  Q &= Q^i_{jk} (B^a_i \widetilde{\vec{e}_a}) (\widetilde{\epsilon^b} F^j_b) (\widetilde{\epsilon^c} F^k_c) \\
  &= B^a_i Q^i_{jk} F^j_b F^k_c \widetilde{\vec{e}_a} \widetilde{\epsilon^b} \widetilde{\epsilon^c} \\
  &= \widetilde{Q^a_{bc}} \widetilde{\vec{e}_a} \widetilde{\epsilon^b} \widetilde{\epsilon^c} \\
  \widetilde{Q^a_{bc}} &= B^a_i Q^i_{jk} F^j_b F^k_c
\end{align*}

Now, notice that there are many ways to combine $Q$ and $D$. Some examples are,

\[ Q^i_{jk} D^{jk} \]
\[ Q^i_{jk} D^{kj} \]
\[ Q^i_{jk} D^{kb} \]
\[ Q^i_{jk} D^{aj} \]

Which all result in different tensor results. So $Q(D)$ would be ambiguious.

Note that $Q^i_{jk} D^{jk}$ differs from $Q^i_{jk} D^{kj}$  in that,
\[ Q^i_{jk} D^{jk} = Q^i_{jk} D^{ab} \delta^j_a \delta^k_b \]
But,
\[ Q^i_{jk} D^{kj} = Q^i_{jk} D^{ab} \delta^j_b \delta^k_a \]

\section{Tensor Product Spaces}

Let ${\color{blue}T} \otimes {\color{red}S}$ be more compactly written ${\color{blue}T}{\color{red}S}$.

Tensor products are distributive over addition,

\[ AB + AC = A(B+C) \]
\[ AC + BC = (A+B)C \]

And in scalar multiplication is associative and commutative with respect to tensor products,

\[ s(AB) = (sA)B = A(sB) \]

Now if,

\[ \vec{v}, \vec{w}, \vec{e_1}, \vec{e_2} \in V \]
\[ \alpha, \beta, \epsilon^1, \epsilon^2 \in V^* \]

Then,

\[ \vec{v} \alpha, \vec{v} \beta, \vec{w} \alpha, \vec{w} \beta, \vec{e_1} \epsilon^2, L^i_{~j} \vec{e_i} \epsilon^j \in V \otimes V^* \]

A general element of $V \otimes V^*$ might be written,

\[ L^i_{~j} \vec{e_i} \epsilon^j \]

And depending on how it is combined with another tensor, may act as a linear map for vectors, or as a linear map for covectors,
or to reduce an element of $V \otimes V^*$ to the reals, or to reduce an element of $V^* \otimes V$ to the reals:

\[ L^i_{~j} v^j = w^i \]
\[ L^i_{~j} \alpha_i = \beta_j \]
\[ L^i_{~j} v^j \alpha_i = s \]
\[ L^i_{~j} \alpha_i v^j = s \]

General notation (dropping basis and cobasis vectors) will have tensors written like this,

\[ v^i \in V \]
\[ \alpha_j \in V^* \]
\[ \mathcal{A}^{ij} \in V \otimes V \]
\[ L^{i}_{~j} \in V \otimes V^* \]
\[ L^{~j}_{i} \in V^* \otimes V \]
\[ \mathcal{B}_{ij} \in V^* \otimes V^* \]
\[ T^{~j}_{i~~k} \in V^* \otimes V \otimes V^* \]

Et cetera.

Now, functions of a general tensor acting on any other tensors form what's known as a multilinear map. Which is essential just the
teneral term for an arbitrary parameter bilinear map. All input parameters are linear,

\[ T(\vec{v}, \vec{w}, \vec{x}, \dots) = T^{ijk\dots}_{abc\dots} v^{a\dots}_{i\dots} w^{b\dots}_{j\dots} x^{c\dots}_{k\dots} \]
\[ T(s\vec{v}, \vec{w}, \vec{x}, \dots) = T(\vec{v}, s\vec{w}, \vec{x}, \dots) = T(\vec{v}, \vec{w}, s\vec{x}, \dots) = s T(\vec{v}, \vec{w}, \vec{x}, \dots) \]
\[ T(\vec{v}+\vec{z}, \vec{w}, \vec{x}, \dots) = T(\vec{v}, \vec{w}, \vec{x}, \dots) + T(\vec{z}, \vec{w}, \vec{x}, \dots)\]
\[ T(\vec{v}, \vec{w}+\vec{z}, \vec{x}, \dots) = T(\vec{v}, \vec{w}, \vec{x}, \dots) + T(\vec{v}, \vec{z}, \vec{x}, \dots)\]
\[ T(\vec{v}, \vec{w}, \vec{x}+\vec{z}, \dots) = T(\vec{v}, \vec{w}, \vec{x}, \dots) + T(\vec{v}, \vec{w}, \vec{z}, \dots)\]

\chapter{Rasing and Lowing Indexes}

Let $\vec{v} \in V$. Then the function $f(\vec{w}) = \vec{v} \cdot \vec{w}$ is in $V^*$.

Now, we can express $f$ with the metric tensor $g$,

\begin{align*}
  f(\vec{w}) &= g_{ij} \epsilon^i \epsilon^j (v^k \vec{e}_k w^l \vec{e}_l) \\
  &= g_{ij} \epsilon^i (v^k \vec{e}_k) \epsilon^j (w^l \vec{e}_l) \\
  &= g_{ij} v^k w^l \epsilon^i (\vec{e}_k) \epsilon^j (\vec{e}_l) \\
  &= g_{ij} v^k w^l \delta^i_k \delta^j_l \\
  &= g_{ij} v^i w^j \\
\end{align*}

So we can express $f$ as a tensor by simply leaving out it's input parameter and simplifying:

\begin{align*}
  f &= g_{ij} \epsilon^i \epsilon^j (v^k \vec{e}_k) \\
  &= g_{ij} \epsilon^i (v^k \vec{e}_k) \epsilon^j \\
  &= g_{ij} v^k \epsilon^i (\vec{e}_k) \epsilon^j \\
  &= g_{ij} v^k \delta^i_k \delta^j_l \epsilon^j \\
  &= g_{ij} v^i \epsilon^j \\
\end{align*}

From dimensional analysis, we can see that $f$ is a (0,1)-tensor, i.e. a covector. So we can denote it as
some linear combination of $\epsilon_j$. And, as we see from above, those coefficients are $g_{ij}v^j$. Therefore,
we denote,
\[ g_{ij}v^j = v_i \]

So a vector can be written,
\[ \vec{v} = v^j \vec{e}_j \]

And it's pairdd covector can be written,
\[ \vec{v} \cdot \_ = v_i \epsilon^i \]

Note that $v^i \ne v_i$ unless we're in an orthonormal coordinate system.

The 'inverse metric tensor' is defined like this,

\[ \mathfrak{g}^{ki} g_{ij} = \delta^k_j \]

So, it's components are literally the inverse matrix of the metric tensor's.

So our index raising and lowering rules are as follows,

\[ v_j = g_{ji} v^i \]
\[ v^i = \mathfrak{g}^{ij} v_j \]

This raising and lowering property applies to tensors of all shapes.

Suppose you have a tensor $Q \in V \otimes V^* \otimes V^*$ then for any,

\[ Q = Q^i_{~jk} \vec{e}_i \epsilon^j \epsilon^k \]

We can show that,

\[ Q^i_{~jk} \mathfrak{g}^{jx} = Q^{ix}_{~~k} \]
\[ Q' = Q^{ix}_{~~k} \vec{e}_i \vec{e}_x \epsilon^k \]

Where $Q' \in V \otimes V \otimes V^*$

This pairing between vector and covector pairs can also be denoted using the $\flat$ and $\sharp$ symbols.

\[ \vec{v} \in V \iff \flat \vec{v} \in V^* \]
\[ \sharp \alpha \in V \iff \alpha \in V^* \]

\begin{appendices}

\chapter{Important Results}

This section is basically just a cheat sheet of important formula.

From section \ref{vector_basis_transform}:
\[ \widetilde{\vec{e}_i} = \sum_{j=1}^{n} F_{ji} \vec{e}_j \]
\[ \vec{e}_i = \sum_{j=1}^{n} B_{ji} \widetilde{\vec{e}_j} \]

From section \ref{change_vector_basis}:
\[ B \vec{v}_{e} = \vec{v}_{\widetilde{e}} \]
\[ F \vec{v}_{\widetilde{e}} = \vec{v}_{e} \]

From section \ref{change_covector_basis}:
\[ \alpha_{\epsilon} F = \alpha_{\widetilde{\epsilon}} \]
\[ \alpha_{\widetilde{\epsilon}} B = \alpha_{\epsilon} \]

From section \ref{covector_transforms}:
\[ \epsilon^i B = \widetilde{\epsilon^i} \]
\[ \widetilde{\epsilon^i} F = \epsilon^i \]

From section \ref{linear_map_transforms}:
\[ \widetilde{L} = B L F \]
\[ L = F \widetilde{L} B \]

From section \ref{einstein_notation}:

For Contravariant (1,0)-Tensors:
\[ \widetilde{\epsilon}^i = B^i_j \epsilon^j \]
\[ \epsilon^i = F^i_j \widetilde{\epsilon^j} \]
\[ \widetilde{v}^i = B^i_j v^j \]
\[ v^i = F^i_j \widetilde{v^j} \]

For Covariant (0,1)-Tensors:
\[ \widetilde{\vec{e}_i} = F^j_i \vec{e}_j \]
\[ \vec{e}_i = B^j_i \widetilde{\vec{e}_j} \]
\[ \widetilde{\alpha_i} = F^j_i \alpha_j \]
\[ \alpha_i = B^j_i \widetilde{\alpha_j} \]

And for (1,1)-Tensors:
\[ \widetilde{L^i_j} = B^i_k L^k_l F^l_j \]
\[ L^i_j = F^i_k \widetilde{L^k_l} B^l_j \]

From section \ref{metric_tensor}:
\[ g_{ij} = \vec{e}_i \cdot \vec{e}_j \]

From section \ref{length}
\[ ||\vec{v}||^2 = v^i v^j g_{ij} \]

From section \ref{dot}
\[ \vec{v} \cdot \vec{w} =  v^i w^j g_{ij} \]

From section \ref{angle}
\[ \frac{v^i w^j g_{ij}}{\sqrt{v^a v^b g_{ab}} \sqrt{w^c w^d g_{cd}}} =  \cos(\theta) \]

From section \ref{metric_tensor_transform}:
The metric tensor is then said to be a (0,2)-Tensor because it transforms using
two covariant rules.
\[ \widetilde{g_{ij}} = F^k_i F^l_j g_{kl} \]
\[ g_{ij} = B^k_i B^l_j \widetilde{g_{kl}} \]

From the section \ref{general_tensor}
\[
  \widetilde{T^{abc\dots}_{xyz\dots}}
  =
  (B^a_i B^b_j B^c_k \dots)
  T^{ijk\dots}_{rst\dots}
  (F^r_x F^s_y F^t_z \dots)
\]
\[
  T^{ijk\dots}_{rst\dots}
  =
  (F^i_a F^j_b F^k_c \dots)
  \widetilde{T^{abc\dots}_{xyz\dots}}
  (B^x_r B^y_s B^z_t \dots)
\]

\end{appendices}

\bibliography{book}
\bibliographystyle{ieeetr}

\end{document}


\subsection{Intrinsic and extrinsic parameters}

On physical grounds, we group waveform parameters $\vec{\mu}=(\vec{\lambda},\vec{\theta})$ into two classes: the
intrinsic parameters ($\vec{\lambda}$) and extrinsic parameters ($\vec{\theta}$).
The intrinsic parameters are fundamental to the description of the binary: if we change any intrinsic
parameters we must recompute the orbital dynamics of the binary (typically through the relatively expensive process
of numerically integrating ordinary differential equations). Extrinsic parameters simply describe how the
binary is oriented in space and time relative to the detector; changing extrinsic parameters involves a
relatively inexpensive rotation, translation or rescaling transformation. As we will show in the next subsection,
for the non-spinning case considered here the intrinsic parameters are
\begin{equation} \label{eq:intrinsic}
\itrprm=\{\mc,\eta\}\ ,
\end{equation}
where $\mc = (m_1m_2)^{3/5}/(m_1+m_2)^{1/5}$) is the chirp mass and
$\eta = m_1m_2/(m_1+m_2)^2$ is the symmetric mass ratio.
The extrinsic parameters are
\begin{equation} \label{eq:extrinsic}
\etrprm=\{t_{\rm geo},\alpha,\delta,\iota,D,\psi,\phi_c\}\ ,
\end{equation}
where $t_{\rm geo}$ is the time at which the waveform coalescence arrives at the Earth geocenter,
$\alpha$ and $\delta$ are the right ascension and declination,
$\iota$ is the inclination angle of the binary's angular momentum vector and the line of sight to Earth,
$D$ is the luminosity distance to the binary\footnote{For the sources considered in this paper,
	the redshift correction is assumed to be negligible},
$\psi$ is the polarization angle, and $\phi_c$ is the orbital phase of the binary at coalescence.

Note that throughout the rest of the paper we will denote intrinsic parameters with $\itrprm$
and extrinsic parameters with $\etrprm$.

\subsection{Waveform decomposition}

The gravitational wave strain measured by the $k^{\rm th}$ interferometric detector in a network is given by
\begin{equation} \label{eq:measured_strain}
h_k(t) = F_{+,k}(\delta, \alpha, \psi) h_{+,k}(t)
+ F_{\times,k}(\delta, \alpha, \psi) h_{\times,k}(t)\ ,
\end{equation}
where $F_{+,k}$, $F_{\times,k}$ are the antenna patterns of the detector and $h_{+,k}$, $h_{\times,k}$
are the two components of the gravitational wave strain, evaluated at the $k^{\rm th}$ detector. The antenna patterns depend only on the extrinsic sky location and polarization
angle, while the polarizations depend on both intrinsic and extrinsic parameters.   In turn, the polarizations can be
evaluated via the real and imaginary parts of a complex-valued plane wave $h(t|\mc,\eta,\iota,\phi_c)$:
\begin{align}
h_{+,k}(t)-i h_{\times, k}(t) &= h(t-t_k|\mc,\eta,\iota,\phi_c)
\end{align}

In this expression, $t_k$  denotes the time of arrival of the coalescence  at the $k^{th}$ detector,

\begin{equation} \label{eq:t_k}
t_k = t_{\rm geo} - \frac{\vec{x}_k \cdot \hat{N}(\alpha,\delta)}{c}\ .
\end{equation}

If $\vec{x}_k$ is a vector pointing from the geocenter to the $k^{th}$ detector and $\hat{N}(\alpha,\delta)$ is the direction of GW propagation, so each member of the network will have an offset relative to the geocenter time depending on sky location.

At this stage, we make no assumptions about the functional form of $h(t|\mc,\eta,\iota,\phi_c)$
%
We can use a $-2$ spin-weighted spherical harmonic mode decomposition to further separate intrinsic and extrinsic
parameters appearing in the polarizations.
In particular, we relate the polarizations to a set of $-2$ spin-weighted
spherical harmonics modes with the equation
\begin{equation} \label{eq:h:Expansion}
h_{+,k}(t) - i\,h_{\times,k}(t) = \frac{D_{\rm ref}}{D} \sum_{lm} \hat{h}_{lm}(\mc,\eta,t_k;t)  \Y{-2}_{lm}(\iota,-\phi_c) \ ,
\end{equation}
For the purposes of this work, investigating radiation from inspiralling binaries, we will use $\hat{h}_{lm}$ as the -2
spin-weighted spherical harmonics modes provided by post-Newtonian calculations for adiabatic quasicircular inpiral \cite{gw-astro-mergers-approximations-SpinningPNHigherHarmonics},
evaluated at some fixed distance $D_{\rm ref}$ (in this work we choose $D_{\rm ref} = 100$ Mpc).
%
As a concrete example, at leading order for inspiral-only waveforms the polarizations are
\begin{widetext}
\begin{eqnarray} \label{eq:polarizations}
h_{+,k}(t) &=& - \frac{2 M \eta}{D}\,v^2(\mc,\eta,t_k;t)\,\left[ \left( 1 + \cos^2 \iota \right)\, \label{eq:h+}
	\cos 2 \left( \Phi(\mc,\eta,t_k;t) - \phi_c \right) + {\cal O}(v^3)\right]\ ,\\
h_{\times,k}(t) &=& - \frac{2 M \eta}{D}\,v^2(\mc,\eta,t_k;t)\,\left[ \left( 2 \cos \iota\right)\, \label{eq:hx}
	\sin 2 \left( \Phi(\mc,\eta,t_k;t) - \phi_c \right) + {\cal O}(v^3)\right]\ .
\end{eqnarray}
\end{widetext}
$\Phi(t)$ and $v(t)$ are the key orbital dynamical quantities, typically obtained via the energy balance equation,
which are expensive to compute.
%
If we define a complex-valued antenna pattern for each detector as
\begin{equation} \label{eq:complexF}
F_k = F_{+,k} + i \, F_{\times,k} \ ,
\end{equation}
then we can re-express the measured strain in the $k^{th}$ detector as
\begin{widetext}
\begin{equation} \label{eq:decomposed_strain}
h_k(\itrprm,\etrprm;t) = {\rm Re}\ \frac{D_{\rm ref}}{D}\, F_k(\alpha,\delta,\psi) \, \sum_{lm}
\hat{h}_{lm}(\mc,\eta,t_k;t)  \Y{-2}_{lm}(\iota,-\phi_c)\ .
\end{equation}
\end{widetext}
Aside from $t_k$, we have now completely separated the intrinsic parameters (which enter only the $\hat{h}_{lm}$)
from the extrinsic parameters (which enter only the $F_k$ and $\Y{-2}_{lm}$).

Given a time-domain representation of the gravitational wave strain, we can define a
frequency-domain version of this strain via a Fourier transform
\begin{equation} \label{eq:Fourier}
\tilde{h}(f) = \int_{-\infty}^\infty h(t) e^{- 2 \pi i f t} dt\ .
\end{equation}
Time translation of frequency-domain waveforms is trivial.
If $\tilde{h}(t_k;f)$ is the Fourier-domain representation of a strain for some arrival time $t_k$, then
the same strain arriving at another time $t_k'$ can be simply related by
\begin{equation} \label{eq:time_shift}
\tilde{h}(t_k';f) = \tilde{h}(t_k;f) \, e^{- 2 \pi i f (t_k' - t_k)}\ .
\end{equation}
Thus, if we work with frequency-domain waveforms, the arrival time $t_k$
can be factored out as $\exp( - 2 \pi i f t_k)$
and we can complete the separation of intrinsic and extrinsic parameters.

For the explicit decomposition above, we have focused on non-spinning waveforms
and found that they can be separated into two intrinsic parameters and seven
extrinsic parameters. In the general case, which could include precession,
tidal effects and any other physics, this intrinsic and extrinsic separation is still
possible. In fact, there will always be seven extrinsic parameters which enter only
through inexpensive geometric factors, while any additional parameters will always
be encoded in the expensive $h_{lm}$ modes.

To see that this is true, first note that Eq.~(\ref{eq:time_shift}) holds for an arbitrary strain
and so can always be used to factor out the dependence on time of arrival. Similarly,
a gravitational wave far from its source will always fall off as $1/D$. Furthermore,
the antenna patterns $F_+$ and $F_\times$ depend on the detector geometry,
not the source, and so are unchanged. This gives a total of five extrinsic parameters
that in general can be factored out exactly as in our non-spinning waveform. Lastly,
we have two angles which enter into the $\Y{-2}_{lm}$. The physical interpretation
of these angles depends on how the frame in which the harmonic mode decomposition is
performed is defined. One should choose a frame which is convenient for expressing
and computing the $h_{lm}$. For the non-spinning case, this means aligning the frame
with the orbital angular momentum, $\hat{L}$, in which case one can show that the
zenith angle is $\iota$ and the azimuth is $- \phi_c$. In the precessing case, one would
most likely use a frame aligned with the total angular momentum, $\hat{J}$, e.g. using the
parameterization described in~\cite{Farr:2014qka}. In the notation of that paper, the extrinsic
spherical harmonic dependence is $\Y{-2}_{lm}(\theta_{JN},-\phi_{JL})$,
where $\theta_{JN}$ is the inclination of the \emph{total} angular momentum to line of sight,
and $\phi_{JL}$ marks the azimuthal position of $\hat{L}$ on its precession cone about $\hat{J}$.
Note that if we use such a frame $\iota$ and $\phi_c$ must be encoded in the $h_{lm}$,
as must any other parameters such as spin vectors or tidal deformabilities.


%% LyX 2.3.6.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[oneside,english]{amsart}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose}
\usepackage{mathrsfs}
\usepackage{amsbsy}
\usepackage{amstext}
\usepackage{amsthm}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section}
\numberwithin{figure}{section}

\makeatother

\usepackage{babel}
\begin{document}

\section{Single-patch Ebola model:}

\begin{align*}
S' & =\mu N-\beta_{I}SI-\beta_{W}SW-\mu S\\
I' & =\beta_{I}SI+\beta_{W}SW-\left(\gamma+\mu+\delta\right)I\\
R' & =\gamma I-\mu R\\
W' & =\xi_{\text{in}}I-\xi_{\text{out}}W
\end{align*}
where $N=S+I+R$.

Check that compartments remain positive, i.e. $\frac{dx_{i}}{dt}\ge0$
for any feasible set of initial conditions... (TBC)

Define $x=\left(I,W,S,R\right)^{t}$. There is a unique disease free
equilibrium given by $x_{0}=\left(N_{0},0,0,0\right)^{t}$, where
$N_{0}=N\left(0\right)$.

There are two infectious compartments: infected humans ($I$) and
the water reservoir ($W$), but new infections only occur in the infected
humans compartment.

Let $\mathscr{F}\left(x\right)$ the rate of new infections and $\mathscr{V}\left(x\right)$
the net rate of transfer for all other transitions.

\begin{align*}
\mathscr{F}\left(x\right) & =\begin{pmatrix}\beta_{I}SI+\beta_{W}SW\\
0\\
0\\
0
\end{pmatrix}\\
\mathscr{V}\left(x\right) & =\begin{pmatrix}\left(\gamma+\mu+\delta\right)I\\
\xi_{\text{out}}W-\xi_{\text{in}}I\\
\beta_{I}SI+\beta_{W}SW+\mu S-\mu N\\
\mu R-\gamma I
\end{pmatrix}
\end{align*}
The Jacobians of these
\begin{align*}
D\mathscr{F}\left(x\right) & =\begin{bmatrix}\beta_{I}S & \beta_{W}S & \beta_{I}I+\beta_{W}W & 0\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0
\end{bmatrix}\\
D\mathscr{V}\left(x\right) & =\begin{bmatrix}\gamma+\mu+\delta & 0 & 0 & 0\\
-\xi_{\text{in}} & \xi_{\text{out}} & 0 & 0\\
\beta_{I}S-\mu & \beta_{W}S & \beta_{I}I+\beta_{W}W & -\mu\\
-\gamma & 0 & 0 & \mu
\end{bmatrix}
\end{align*}
Taking the upper 2 by 2 quadrant of each matrix, to isolate the infected
compartments, and evaluating at the disease-free equilibrium, $x_{0}$,
gives us
\begin{align*}
F & =\begin{bmatrix}\beta_{I}N_{0} & \beta_{W}N_{0}\\
0 & 0
\end{bmatrix}\\
V & =\begin{bmatrix}\gamma+\mu+\delta & 0\\
-\xi_{\text{in}} & \xi_{\text{out}}
\end{bmatrix}
\end{align*}
The next generation, $K=FV^{-1}$, is given byHence
\begin{align*}
K=FV^{-1} & =\begin{bmatrix}\beta_{I}N_{0}\frac{1}{\gamma+\mu+\delta}+\beta_{W}N_{0}\frac{\xi_{\text{in}}}{\xi_{\text{out}}\left(\gamma+\mu+\delta\right)} & \frac{\beta_{W}N_{0}}{\xi}\\
0 & 0
\end{bmatrix}
\end{align*}

\subsection{Basic reproduction number}

The basic reproduction number, $\mathcal{R}_{0}$, defined as $\rho\left(K\right)$,
is therefore
\[
\mathcal{R}_{0}=\beta_{I}N_{0}\left(\frac{1}{\gamma+\mu+\delta}\right)+\beta_{W}N_{0}\left(\xi_{\text{in}}\frac{1}{\gamma+\mu+\delta}\right)\left(\frac{1}{\xi_{\text{out}}}\right)
\]
This can be decomposed as $\mathcal{R}_{0}=\mathcal{R}_{I}+\mathcal{R}_{W}$
where $\mathcal{R}_{I}$ represents the average number of new infections
induced by direct contact with an infectious individual (while alive)
and $\mathcal{R}_{W}$ represents the average number of new infections
induced by viral shedding of an infected individual into the water
source.

The type reproduction numbers, $\mathcal{R}_{I}$ and $\mathcal{R}_{W}$
can be interpreted as follows:
\begin{align*}
\mathcal{R}_{I} & =\beta_{I}N_{0}\left(\frac{1}{\gamma+\mu+\delta}\right)\\
 & =\frac{\text{\# infectious contacts}}{\text{person}\times\text{time}}\times\text{\# susceptibles}\times\text{infectious period}\\
\mathcal{R}_{W} & =\beta_{W}N_{0}\left(\xi_{\text{in}}\frac{1}{\gamma+\mu+\delta}\right)\left(\frac{1}{\xi_{\text{out}}}\right)\\
 & =\frac{\text{\# infectious contacts}}{\text{infectious units}\times\text{time}}\times\text{\# susceptibles}\times\left(\frac{\text{infectious viral units}}{\text{time}}\times\text{infectious period}\right)\times\text{virus persistence time}
\end{align*}

Note that here we have made$\xi_{\text{in}}$ and $\xi_{\text{out}}$
distinct to aid in the biological interpretation of the reproduction
number (otherwise the term $\frac{\xi_{\text{in}}}{\xi_{\text{out}}}=1$
would cancel out of the expression).

\section{Two-patch Ebola model with migration and water movement}

\begin{align*}
S_{1}' & =\mu_{1}N_{1}-\beta_{I1}S_{1}I_{1}-\beta_{W1}S_{1}W_{1}-\mu_{1}S_{1}-m_{1}S_{1}+m_{2}S_{2}\\
I_{1}' & =\beta_{I1}S_{1}I_{1}+\beta_{W1}S_{1}W_{1}-(\gamma_{1}+\mu_{1}+\delta_{1})I_{1}-n_{1}I_{1}+n_{2}I_{2}\\
R_{1}' & =\gamma_{1}I_{1}-\mu_{1}R_{1}-m_{1}R_{1}+m_{2}R_{2}\\
W_{1}' & =\xi_{1,\text{in}}I_{1}-\xi_{1,\text{out}}W_{1}-\rho_{1}W_{1}+\rho_{2}W_{2}\\
S_{2}' & =\mu_{2}N_{2}-\beta_{I2}S_{2}I_{2}-\beta_{W2}S_{2}W_{2}-\mu_{2}S_{2}+m_{1}S_{1}-m_{2}S_{2}\\
I_{2}' & =\beta_{I2}S_{2}I_{2}+\beta_{W2}S_{2}W_{2}-(\gamma_{2}+\mu_{2}+\delta_{2})I_{2}+n_{1}I_{1}-n_{2}I_{2}\\
R_{2}' & =\gamma_{2}I_{2}-\mu_{2}R_{2}+m_{1}R_{1}-m_{2}R_{2}\\
W_{2}' & =\xi_{2,\text{in}}I_{2}-\xi_{2,\text{out}}W_{2}+\rho_{1}W_{1}-\rho_{2}W_{2}
\end{align*}
where $N_{i}=S_{i}+I_{i}+R_{i}$, $i=1,2$.

Check that compartments remain positive, i.e. $\frac{dx_{i}}{dt}\ge0$
for any feasible set of initial conditions... (TBC). Define $x=\left(I_{1},I_{2},W_{1},W_{2},S_{1},S_{2},R_{1},R_{2}\right)^{t}$.
There is a unique disease free equilibrium given by $x_{0}=\left(0,0,0,0,N_{1,0},N_{2,0},0,0\right)^{t}$,
where $N_{i,0}=N_{i}\left(0\right)$. There are two infectious compartments
in each patch: infected humans ($I_{1},I_{2}$) and the water reservoir
($W_{1},W_{2}$), but new infections only occur in the infected humans
compartments. Let $\mathscr{F}\left(x\right)$ the rate of new infections
and $\mathscr{V}\left(x\right)$ the net rate of transfer out of a
compartment (for all transitions except new infections).

\begin{align*}
\mathscr{F}\left(x\right) & =\begin{pmatrix}\beta_{I1}S_{1}I_{1}+\beta_{W1}S_{1}W_{1}\\
\beta_{I2}S_{2}I_{2}+\beta_{W2}S_{2}W_{2}\\
0\\
0\\
0\\
0\\
0\\
0
\end{pmatrix}\\
\mathscr{V}\left(x\right) & =\begin{pmatrix}(\gamma_{1}+\mu_{1}+\delta_{1})I_{1}+n_{1}I_{1}-n_{2}I_{2}\\
-n_{1}I_{1}+(\gamma_{2}+\mu_{2}+\delta_{2})I_{2}+n_{2}I_{2}\\
-\xi_{1,\text{in}}I_{1}+\xi_{1,\text{out}}W_{1}+\rho_{1}W_{1}-\rho_{2}W_{2}\\
-\rho_{1}W_{1}-\xi_{2,\text{in}}I_{2}+\xi_{2,\text{out}}W_{2}+\rho_{2}W_{2}\\
\beta_{I1}S_{1}I_{1}+\beta_{W1}S_{1}W_{1}-\mu_{1}N_{1}+\mu_{1}S_{1}+m_{1}S_{1}-m_{2}S_{2}\\
-\gamma_{1}I_{1}+\mu_{1}R_{1}+m_{1}R_{1}-m_{2}R_{2}\\
\beta_{I2}S_{2}I_{2}+\beta_{W2}S_{2}W_{2}-\mu_{2}N_{2}+\mu_{2}S_{2}-m_{1}S_{1}+m_{2}S_{2}\\
-m_{1}R_{1}-\gamma_{2}I_{2}+\mu_{2}R_{2}+m_{2}R_{2}
\end{pmatrix}
\end{align*}
The Jacobians of these operators, restricted to the rows and columns
representing infected compartments, and evaluated at the DFE, $x_{0}$,
are given by the matrices
\begin{align*}
F & =\begin{bmatrix}\beta_{I1}N_{1,0} & 0 & \beta_{W1}N_{1,0} & 0\\
0 & \beta_{I2}N_{2,0} & 0 & \beta_{W2}N_{2,0}\\
0 & 0 & 0 & 0\\
0 & 0 & 0 & 0
\end{bmatrix}\\
V & =\begin{bmatrix}\gamma_{1}+\mu_{1}+\delta_{1}+n_{1} & -n_{2} & 0 & 0\\
-n_{1} & \gamma_{2}+\mu_{2}+\delta_{2}+n_{2} & 0 & 0\\
-\xi_{1,\text{in}} & 0 & \xi_{1,\text{out}}+\rho_{1} & -\rho_{2}\\
0 & -\xi_{2,\text{in}} & -\rho_{1} & \xi_{2,\text{out}}+\rho_{2}
\end{bmatrix}
\end{align*}
To simplify our calculations, we can re-write these in block form:
\begin{align*}
F & =\begin{bmatrix}\boldsymbol{F_{I}} & \boldsymbol{F_{W}}\\
\boldsymbol{0_{2}} & \boldsymbol{0_{2}}
\end{bmatrix},V=\begin{bmatrix}\boldsymbol{V_{I}} & \boldsymbol{0_{2}}\\
\boldsymbol{D} & \boldsymbol{V_{W}}
\end{bmatrix}
\end{align*}
 where
\begin{align*}
\boldsymbol{F_{I}} & =\begin{bmatrix}\beta_{I1}N_{1,0} & 0\\
0 & \beta_{I2}N_{2,0}
\end{bmatrix},\\
\boldsymbol{F_{W}} & =\begin{bmatrix}\beta_{W1}N_{1,0} & 0\\
0 & \beta_{W2}N_{2,0}
\end{bmatrix},\\
\boldsymbol{V_{I}} & =\begin{bmatrix}\gamma_{1}+\mu_{1}+\delta_{1}+n_{1} & -n_{2}\\
-n_{1} & \gamma_{2}+\mu_{2}+\delta_{2}+n_{2}
\end{bmatrix},\\
\boldsymbol{V_{W}} & =\begin{bmatrix}\xi_{1,\text{out}}+\rho_{1} & -\rho_{2}\\
-\rho_{1} & \xi_{2,\text{out}}+\rho_{2}
\end{bmatrix},\\
\boldsymbol{D} & =\begin{bmatrix}-\xi_{1,\text{in}} & 0\\
0 & -\xi_{2,\text{in}}
\end{bmatrix}.
\end{align*}
Note that each of $\boldsymbol{V_{I}}$, $\boldsymbol{V_{W}}$, and
$\boldsymbol{D}$ are invertible with biologically feasible parameters
(i.e. not all are zero). The inverse of $V$ can also be written in
block form as:
\[
V^{-1}=\begin{bmatrix}\boldsymbol{V_{I}}^{-1} & \boldsymbol{0_{2}}\\
-\boldsymbol{V_{W}}^{-1}\boldsymbol{D}\boldsymbol{V_{I}}^{-1} & \boldsymbol{V_{W}}^{-1}
\end{bmatrix}
\]
and the next generation matrix, $K=FV^{-1}$, can be determined in
block-matrix form:
\begin{align*}
K=FV^{-1} & =\begin{bmatrix}\boldsymbol{F_{I}} & \boldsymbol{F_{W}}\\
\boldsymbol{0_{2}} & \boldsymbol{0_{2}}
\end{bmatrix}\begin{bmatrix}\boldsymbol{V_{I}}^{-1} & \boldsymbol{0_{2}}\\
-\boldsymbol{V_{W}}^{-1}\boldsymbol{D}\boldsymbol{V_{I}}^{-1} & \boldsymbol{V_{W}}^{-1}
\end{bmatrix}\\
 & =\begin{bmatrix}\boldsymbol{F_{I}}\boldsymbol{V_{I}}^{-1}-\boldsymbol{F_{W}}\boldsymbol{V_{W}}^{-1}\boldsymbol{D}\boldsymbol{V_{I}}^{-1} & \boldsymbol{F_{W}}\boldsymbol{V_{W}}^{-1}\\
\boldsymbol{0_{2}} & \boldsymbol{0_{2}}
\end{bmatrix}
\end{align*}
We see immediately that $K$ will have at least two zero eigenvalues.
The remaining eigenvalues are the eigenvalues of $K_{I}=\boldsymbol{F_{I}}\boldsymbol{V_{I}}^{-1}-\boldsymbol{F_{W}}\boldsymbol{V_{W}}^{-1}\boldsymbol{D}\boldsymbol{V_{I}}^{-1}$.
We proceed in computing the eigenvalues of $K_{I}$ by first determining
$\boldsymbol{V_{I}}^{-1}$ and $\boldsymbol{V_{W}}^{-1}$.

We will work through the determination of $\boldsymbol{V_{I}}^{-1}$
below in a deliberate manner in order to facilitate the biological
interpretation of the next generation matrix and the basic reproduction
number. We start by introducing some new notation. Let $\lambda_{i}=\frac{1}{\gamma_{i}+\mu_{i}+\delta_{i}+n_{i}}$
and $\sigma_{i}=\frac{n_{i}}{\gamma_{i}+\mu_{i}+\delta_{i}+n_{i}}=n_{i}\lambda_{i}$,
$i=1,2$. The quantity $\lambda_{i}$ represents the average amount
of time an infectious individual in patch $i$ will remain in patch
$i$ before recovering, dying (due to disease or natural mortality),
or migrating. The quantity $\sigma_{i}$ represents the probability
that an infectious individual in patch $i$ will migrate to another
patch before recovering or dying. With these definitions, we can write
$\boldsymbol{V_{I}}^{-1}$ much more compactly:
\begin{align*}
\boldsymbol{V_{I}}^{-1} & =\left(\frac{1}{1-\sigma_{1}\sigma_{2}}\right)\begin{bmatrix}\lambda_{1} & 0\\
0 & \lambda_{2}
\end{bmatrix}\begin{bmatrix}1 & \sigma_{2}\\
\sigma_{1} & 1
\end{bmatrix}
\end{align*}
Note that since $\sigma_{1}$ and $\sigma_{2}$ are probabilities,
the quantity $\frac{1}{1-\sigma_{1}\sigma_{2}}$ is equivalent to
the series $\sum_{n=1}^{\infty}\left(\sigma_{1}\sigma_{2}\right)^{n}$,
which gives the average number of migrations an infectious individual
makes before either recovering or dying. Note that this quantity is
the same whether an individual starts in patch $1$ or in patch $2$,
thus we can let $\nu=\frac{1}{1-\sigma_{1}\sigma_{2}}$ and drop the
subscript.

Notice that $\boldsymbol{V_{W}}$ is structured very similarly to
$\boldsymbol{V_{I}}$. Thus we can immediately determine the inverse
of $\boldsymbol{V_{W}}$ after defining some quantities similar to
those in $\boldsymbol{V_{I}}^{-1}$. Let $\eta_{i}=\frac{1}{\xi_{i,\text{out}}+\rho_{i}}$,
$\omega_{i}=\frac{\rho_{i}}{\xi_{i,\text{out}}+\rho_{i}}$, and $\tau=\frac{1}{1-\omega_{1}\omega_{2}}$.
$\eta_{i}$, $\omega_{i}$, and $\tau$ have equivalent interpretations
to $\lambda_{i}$, $\sigma_{i}$, and $\nu$ but for the transport
of virus shed in the water, as opposed to human migration. With these
defined, we can write down the inverse of $\boldsymbol{V_{W}}$:
\[
\boldsymbol{V_{W}}^{-1}=\tau\begin{bmatrix}\eta_{1} & 0\\
0 & \eta_{2}
\end{bmatrix}\begin{bmatrix}1 & \omega_{2}\\
\omega_{1} & 1
\end{bmatrix}
\]

Now to compute $K_{I}$, note that $\boldsymbol{F_{I}}\boldsymbol{V_{I}}^{-1}-\boldsymbol{F_{W}}\boldsymbol{V_{W}}^{-1}\boldsymbol{D}\boldsymbol{V_{I}}^{-1}=\left(\boldsymbol{F_{I}}-\boldsymbol{F_{W}}\boldsymbol{V_{W}}^{-1}\boldsymbol{D}\right)\boldsymbol{V_{I}}^{-1}$.
Computing the bracketed portion first:
\begin{align*}
\boldsymbol{F_{I}}-\boldsymbol{F_{W}}\boldsymbol{V_{W}}^{-1}\boldsymbol{D} & =\begin{bmatrix}\beta_{I1}N_{1,0} & 0\\
0 & \beta_{I2}N_{2,0}
\end{bmatrix}-\begin{bmatrix}\beta_{W1}N_{1,0} & 0\\
0 & \beta_{W2}N_{2,0}
\end{bmatrix}\tau\begin{bmatrix}\eta_{1} & 0\\
0 & \eta_{2}
\end{bmatrix}\begin{bmatrix}1 & \omega_{2}\\
\omega_{1} & 1
\end{bmatrix}\begin{bmatrix}-\xi_{1,\text{in}} & 0\\
0 & -\xi_{2,\text{in}}
\end{bmatrix}\\
 & =\begin{bmatrix}\beta_{I1}N_{1,0}+\tau\beta_{W1}N_{1,0}\eta_{1}\xi_{1,\text{in}} & \tau\beta_{W1}N_{1,0}\eta_{1}\omega_{2}\xi_{2,\text{in}}\\
\tau\beta_{W2}N_{2,0}\eta_{2}\omega_{1}\xi_{1,\text{in}} & \beta_{I2}N_{2,0}+\tau\beta_{W2}N_{2,0}\eta_{2}\xi_{2,\text{in}}
\end{bmatrix}
\end{align*}
Finally,
\begin{align*}
K_{I} & =\begin{bmatrix}k_{11} & k_{12}\\
k_{21} & k_{22}
\end{bmatrix}
\end{align*}
where
\begin{align*}
k_{11} & =\beta_{I1}N_{1,0}\lambda_{1}\nu+\beta_{W1}N_{1,0}\xi_{1,\text{in}}\lambda_{1}\left(\tau\eta_{1}\right)\nu+\beta_{W1}N_{1,0}\xi_{2,\text{in}}\lambda_{2}\left(\tau\eta_{1}\omega_{2}\right)\left(\nu\sigma_{1}\right),\\
k_{12} & =\beta_{I1}N_{1,0}\lambda_{1}\nu\sigma_{2}+\beta_{W1}N_{1,0}\xi_{1,\text{in}}\lambda_{1}\left(\tau\eta_{1}\right)\left(\nu\sigma_{2}\right)+\beta_{W1}N_{1,0}\xi_{2,\text{in}}\lambda_{2}\left(\tau\eta_{1}\omega_{2}\right)\nu,\\
k_{21} & =\beta_{I2}N_{2,0}\lambda_{2}\nu\sigma_{1}+\beta_{W2}N_{2,0}\xi_{2,\text{in}}\lambda_{2}\left(\tau\eta_{2}\right)\left(\nu\sigma_{1}\right)+\beta_{W2}N_{2,0}\xi_{1,\text{in}}\lambda_{1}\left(\tau\eta_{2}\omega_{1}\right)\nu,\\
k_{22} & =\beta_{I2}N_{2,0}\lambda_{2}\nu+\beta_{W2}N_{2,0}\xi_{2,\text{in}}\lambda_{2}\left(\tau\eta_{2}\right)\nu+\beta_{W2}N_{2,0}\xi_{1,\text{in}}\lambda_{1}\left(\tau\eta_{2}\omega_{1}\right)\left(\nu\sigma_{2}\right).
\end{align*}
We will argue that $k_{ij}$ represents the average number of new
infections induced in patch $i$ by an infectious individual who started
in patch $j$. Define
\begin{align*}
\mathcal{R}_{Ii} & =\beta_{Ii}N_{i,0}\lambda_{i},\\
\mathcal{R}_{Wi} & =\beta_{Wi}N_{i,0}\xi_{i,\text{in}}\lambda_{i}\eta_{i}.
\end{align*}
These are the within-patch type reproduction numbers when there is
no human migration or water transportation. It is also helpful to
recall the interpretations of the several quantities introduced above:
\begin{align*}
\nu & =\text{average number of "there and back" migrations before recovering or dying}\\
\lambda_{i} & =\text{average infectious period of an infected individual remaining in patch \ensuremath{i}}\\
\sigma_{i} & =\text{probability of migrating out of patch \ensuremath{i} before recovering or dying }\\
\tau & =\text{average number of "there and back" transportations of shed virus in water before decaying}\\
\eta_{i} & =\text{average lifetime of shed virus in the water of patch \ensuremath{i}}\\
\omega_{i} & =\text{probability of shed virus being transported out of patch \ensuremath{i} before decaying}
\end{align*}
Then we can re-write the entries of $K$ as:
\begin{align*}
k_{11} & =\nu\mathcal{R}_{I1}+\nu\tau\mathcal{R}_{W1}+\left(\sigma_{1}\nu\right)\left(\omega_{2}\tau\right)\frac{\xi_{2,\text{in}}\lambda_{2}}{\xi_{1,\text{in}}\lambda_{1}}\mathcal{R}_{W1}\\
k_{12} & =\sigma_{2}\nu\mathcal{R}_{I1}+\left(\sigma_{2}\nu\right)\tau\mathcal{R}_{W1}+\nu\left(\omega_{2}\tau\right)\frac{\xi_{2,\text{in}}\lambda_{2}}{\xi_{1,\text{in}}\lambda_{1}}\mathcal{R}_{W1}\\
k_{22} & =\sigma_{1}\nu\mathcal{R}_{I2}+\left(\sigma_{1}\nu\right)\tau\mathcal{R}_{W2}+\nu\left(\omega_{1}\tau\right)\frac{\xi_{1,\text{in}}\lambda_{1}}{\xi_{2,\text{in}}\lambda_{2}}\mathcal{R}_{W2}\\
k_{22} & =\nu\mathcal{R}_{I2}+\nu\tau\mathcal{R}_{W2}+\left(\nu\sigma_{2}\right)\left(\tau\omega_{1}\right)\frac{\xi_{1,\text{in}}\lambda_{1}}{\xi_{2,\text{in}}\lambda_{2}}\mathcal{R}_{W2}
\end{align*}

The quantities $k_{ij}$ gives the average number of new infections
in patch $i$ induced by an infected individual initially in patch
$j$. Each $k_{ij}$ is composed of three terms which correspond to
the three ways this individual may have contributed to infections
in patch $i$: direct transmission after migrating to or starting
in patch $i$, environmental transmission after migrating to patch
$i$ and shedding virus there, and finally environmental transmission
from shedding virus in patch $j$ which is then transported by the
water to patch $i$.

So, for example, looking at $k_{12}$, the term $\sigma_{2}\nu\mathcal{R}_{I1}$
represents the average number of new infections induced in patch $1$
by an infectious individual who started in patch $2$ then migrated
to patch $1$ (with probability $\sigma_{2}$), including all ``there
and back'' migrations ($\nu$). The next term, $\left(\sigma_{2}\nu\right)\tau\mathcal{R}_{W1}$
gives the number of new infections induced in patch $1$ through the
water caused by an infected individual who started in patch $2$ and
migrated before recovery or death ($\sigma_{2}$), then while in there
in patch $1$, shed virus into the water, which leads to on average,
$\mathcal{R}_{W1}$ new infections. Finally, $\nu\left(\omega_{2}\tau\right)\frac{\xi_{2,\text{in}}\lambda_{2}}{\xi_{1,\text{in}}\lambda_{1}}\mathcal{R}_{W1}$
gives the number of infections induced by an infectious individual
in patch $2$ whose shed virus is transported to patch $1$ in the
water, with the term $\frac{\xi_{2,\text{in}}\lambda_{2}}{\xi_{1,\text{in}}\lambda_{1}}$
accounting for differences in the flow of water and infectious periods
in each patch.

Note that when migration and water transport are turned off in one
direction, then the corresponding type reproduction number is zero.
For example, if there is no movement of individuals or water say movement
from patch $1$ to patch $2$ (i.e. $\sigma_{1}=\omega_{1}=0$), then
$k_{12}=0$. Thus we rename the entries of $K_{i}$ to $\mathcal{R}_{ij}=k_{ij}$.
With this notation, we can easily write down the basic reproduction
number of the full system in terms of these patch-reproduction numbers:
\begin{align*}
\mathcal{R}_{0} & =\frac{1}{2}\left(\mathcal{R}_{11}+\mathcal{R}_{22}\right)+\frac{1}{2}\sqrt{\left(\mathcal{R}_{11}-\mathcal{R}_{22}\right)^{2}+4\mathcal{R}_{12}\mathcal{R}_{21}}
\end{align*}

\subsection{Some initial observations about the basic reproduction number}
\begin{itemize}
\item If there is no movement whatsoever of people or water ($\sigma_{i}=\omega_{i}=0$),
then $\mathcal{R}_{0}=\max\left\{ \mathcal{R}_{11},\mathcal{R}_{22}\right\} $.
\item In general, $\max\left\{ \mathcal{R}_{11},\mathcal{R}_{22}\right\} \le\mathcal{R}_{0}\le\max\left\{ \mathcal{R}_{11},\mathcal{R}_{22}\right\} +\sqrt{\mathcal{R}_{12}\mathcal{R}_{21}}$
\end{itemize}

\subsection{Water flowing in a single direction}

This scenario has water only flowing out of patch $1$, into patch
$2$, then out of patch $2$ but \textbf{not }back in to patch $1$,
we would need to rename our variables. This changes the structure
of the matrix $V$. Unfortunately we cannot check this easily (say,
by setting some parameters to zero) because the original model is
structurally different from the one represented in this scenario i.e.
we cannot set ``one'' of the $\rho_{2}$s to zero with the other
positive.

But, just as an example, suppose $\rho_{2}=0$. Then $\omega_{2}=0$
and $\tau=1$ and we get
\begin{align*}
\mathcal{R}_{11} & =\nu\mathcal{R}_{I1}+\eta_{1}\nu\mathcal{R}_{W1}\\
\mathcal{R}_{21} & =\nu\sigma_{2}\mathcal{R}_{I1}+\eta_{1}\nu\sigma_{2}\mathcal{R}_{W1}\\
\mathcal{R}_{12} & =\nu\sigma_{1}\mathcal{R}_{I2}+\eta_{2}\nu\left[\left(\sigma_{1}\right)+\frac{\xi_{1,\text{in}}\lambda_{1}}{\xi_{2,\text{in}}\lambda_{2}}\left(\omega_{1}\right)\right]\mathcal{R}_{W2}\\
\mathcal{R}_{22} & =\nu\mathcal{R}_{I2}+\eta_{2}\nu\left[1+\frac{\xi_{1,\text{in}}\lambda_{1}}{\xi_{2,\text{in}}\lambda_{2}}\left(\omega_{1}\right)\left(\sigma_{2}\right)\right]\mathcal{R}_{W2}
\end{align*}

\end{document}


\documentclass{article}
\usepackage{itaewon}
\usepackage{amsfonts}
\usepackage{lipsum}
\usepackage{amsthm}
\usepackage{amssymb}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}

\usetikzlibrary{arrows,positioning,shapes,fit,calc}
\setlength{\parindent}{0pt}

\title{Classical and Modern Geometry Lecture Notes}
\author{Benjamin Cabalona Jr.}
\date{\today}

\begin{document}

    \maketitle

    \tableofcontents

    \newpage

    \section{Origami Geometry}

        \subsection{30$^{\circ}$ - 60$^{\circ}$ - 90$^{\circ}$  Right Triangle by Paper Folding}

        First, we need a rectangular paper is needed to proceed.

        Next, follow the steps outlined below
        \begin{enumerate}
            \item Fold the paper lengthwise into 2 equal parts
            \item Fold the upper right (upper left) corner such that it intersects
            with the line that separates the paper into 2 equal parts.
        \end{enumerate}

        \begin{figure}[h!]
            \centering
            \includegraphics[width=1\textwidth]{306090.png}
            \caption{Resulting Fold}
        \end{figure}

        \begin{figure}[h!]
            \centering
            \includegraphics[width=1\textwidth]{origami.png}
            \caption{Code to Generate the Origami Animation}
        \end{figure}

        \newpage
        \begin{proof}
            Consider the diagram below. Notice that the hypotenuse of $\Delta ABC$
            is equal to the height of our paper say $x$ (in this specific case, that is equal to 4).
            It is also clear, that the shorter leg is equal to $\frac{x}{2}$ .

            Now, borrowing from plane geometry, it follows that $\Delta ABC$ is a 30-60-90 triangle.

            That fact will imply the following:

            \begin{enumerate}
                \item $\angle CAB = 30^{\circ}$
                \item $\angle DAC = 60^{\circ}$ since $\angle DAB$ is a right triangle
                \item $\angle DAE = \angle EAD = \angle DEA = \angle AEC = 30^{\circ} $ since $\overline{\rm AE}$ is a bisector of
                $\angle DAC$ and $\angle DEC$
                \item $\angle ADE = 60^{\circ}$ since $\Delta ADE$ is an isoceles triangle.
            \end{enumerate}

            \begin{figure}[h!]
                \centering
                \includegraphics[width=1\textwidth]{306090_1.png}
                \caption{Code to Generate the Origami Animation}
            \end{figure}
            \newpage
            $\therefore \Delta DAB$ is a 30$^{\circ}$ - 60$^{\circ}$ - 90$^{\circ}$ triangle since
            by contruction $\angle DAB$ is a right angle and we have shown that $\angle ADE = 60^{\circ}$
            The sum of the angles must be $180^{\circ}$ thereby forcing $\angle DBA = 30^{\circ}$.

        \end{proof}

\end{document}


\subsection{Abstract Riemann Surfaces}
As we have seen previously, when we wanted to treat stuff like $\log$ and $\sqrt[k]{\cdot}$ formally as functions, the most useful way is to obtain a bigger domain that has some topological and analytical characteristics of $\mathbb C$.
We want to do complex analysis on these ``bigger domains'' which seem to have better properties than just $\mathbb C$.
This motivated the study of Riemann surfaces.
\begin{definition}
    Let $R$ be a topological space.
    A chart on $R$ is a pair $(\phi,U)$ where $U$ is an open subset of $R$ and $\phi:U\to D$ is a homeomorphism to an open subset of $\mathbb C$.
    A set of charts $\mathcal A$ is an atlas on $R$ if:\\
    1.
    $$\bigcup_{(\phi,U)\in\mathcal A}U=R$$
    2. For $(\phi_1,U_1),(\phi_2,U_2)\in\mathcal A$ with $U_1\cap U_2\neq\varnothing$,
    $$\phi_1\circ\phi_2^{-1}=(\phi|_{U_1\cap U_2})\circ (\phi_2|_{U_1\cap U_2})^{-1}$$
    is analytic on $\phi_2(U_1\cap U_2)$.
\end{definition}
This composition $\phi_1\circ\phi_2^{-1}$ is called a transition function.
\begin{remark}
    As $(\phi_1\circ\phi_2^{-1})^{-1}=\phi_2\circ\phi_1^{-1}$, the transition function is biholomorphic.
\end{remark}
\begin{example}
    Take $R=\mathbb C$.\\
    1. $\mathcal A$ consisting of an open cover of $R$ paired with the obvious identity maps is an atlas.\\
    2. $\mathcal A'$ consisting of an open cover of $R$ paired with $z\mapsto z+1$ is also an atlas.\\
    3. $\mathcal A\cup\mathcal A'$ is also an atlas!
\end{example}
This example motivated an extended definition that ask the atlas to include as much information as possible about the analytic structure of $R$.
\begin{definition}
    A conformal structure on $R$ is an atlas $\mathcal A$ on $R$ which is maximal in the sense that if a chart $(\psi,V)$ on $R$ has the property that for any $(\phi,U)\in\mathcal A$ with $U\cap V\neq\varnothing$, the transition function $\phi\circ\psi^{-1}$ is analytic, then $(\psi,V)\in\mathcal A$.
\end{definition}
We can define Riemann surface now.
\begin{definition}
    A Riemann surface is a pair $(R,\mathcal A)$ where $R$ is a path-connected Hausdorff topological space and $\mathcal A$ is a conformal structure on $R$.
\end{definition}
By abuse of notation, we often just write $R$ to denote a Riemann surface when the conformal structure it is equipped with is understood.
\begin{lemma}
    Every atlas $\mathcal A$ is contained in a unique conformal structure $\hat{A}$.
\end{lemma}
\begin{proof}
    Make the obvious choice of $\hat{\mathcal A}$ which consists of all charts $(\psi,V)$ on $R$ such that $\psi\circ\phi^{-1}$ is analytic for every $(\phi,U)\in A$.
    This is necessarily maximal.
    To see it is an atlas, take $(\psi_1,V_1),(\psi_2,V_2)\in\hat{\mathcal A}$ and arbitrary $p\in V_1\cap V_2$.
    As $\mathcal A$ is an atlas, there is $(\phi,U)\in\mathcal A$ such that $p\in U$, so
    $$\psi_1\circ\psi_2^{-1}=(\psi_1\circ\phi^{-1})\circ(\phi\circ\psi_2^{-1})$$
    It then follows that $\psi_1\circ\psi_2^{-1}$ is analytic at $\psi_2(p)$.
    As this works for any $p\in V_1\cap V_2$, we get $\psi_1\circ\psi_2^{-1}$ is analytic at $\psi_2(V_1\cap V_2)$, so $\hat{\mathcal A}$ is an atlas, hence a conformal structure.
    Uniqueness is obvious.
\end{proof}
Therefore, we can identify a conformal structure on a Riemann surface just by an atlas defined on it.
Also for any atlas on a Riemann surface, we can extend it to a conformal structure.
\begin{example}\label{c_canon}
    The atlas $\mathcal A$ consisting of an open cover equipped with identity maps extends to a unique conformal structure $\hat{\mathcal A}$ on $\mathbb C$ that makes it a Riemann surface.
\end{example}
But this is not the only conformal structure we can define on $\mathbb C$.
\begin{example}
    The atlas $\bar{\mathcal A}$ consisting of an open cover with the conjugate map is an atlas, but is quite obviously not contained in $\hat{\mathcal A}$ as in above.
    This Riemann surface with this alternative conformal structure is denoted by $\bar{\mathbb C}$.
\end{example}
\begin{definition}
    The conformal structure in Example \ref{c_canon} is called the canonical conformal structure on $\mathbb C$.
\end{definition}
When we simply talk about $\mathbb C$ as a Riemann surface, we shall always refer to the one equipped with the canonical conformal structure.
\begin{example}
    If $R$ is a Riemann surface with conformal structure $\mathcal A$ and $S\subset R$ is open, then
    $$\{(\phi|_{S\cap U},U\cap S)|(\phi,U)\in\mathcal A\}$$
    is an atlas on $S$.
    In particular, any domain $D\subset\mathbb C$ (like $\mathbb C_\star$) can be made a Riemann surface in this way.
\end{example}
\begin{example}[Riemann Sphere]
    By stereographic projection, we have $\mathbb C_\infty=\mathbb C\cup\{\infty\}\cong S^2$.
    Let $\mathcal A=\{(\operatorname{id},\mathbb C),(\phi,U)\}$ where $U=\mathbb C_\star\cup\{\infty\}$ with $\phi(z)=1/z$.
    The transition function is $z\mapsto 1/z$ on $\mathbb C_\star$ which is analytic, so $\mathcal A$ is indeed an atlas.
\end{example}