\section{Results and analysis} \label{analysis}

\subsection{Running Time}

With above implementation and operation, we test the running time of these two
methods. Results can be found in table~\ref{tb2}. Since we do not pay attention
to the polynomials with degree more than 6, we only test the polynomials with
degree 6 in this section. These test polynomials are generated with random
coefficients from $-c$ to $c$.

\begin{center}
\label{tb2}
\begin{tabular}{ |c|c|c| }
 \hline

 $c$  & Budan's Theorem & Continued Fraction\\

 \hline
 10   & 195 $us$  & 26 $us$\\
 20   & 240 $us$  & 22 $us$\\
 50   & 243 $us$  & 32 $us$\\
 100   & 257 $us$  & 32 $us$\\
 1000   & 259 $us$  & 32 $us$\\
 \hline
\end{tabular}
\end{center}

From table~\ref{tb2}, we can see that Budan's theorem method takes longer than
the continued fraction method. This might be because in Budan’s theorem, we need
to get the upper bound of root $up\_b$ first and get $P(x+up\_b)$ to check how
many positive real roots. However in continued fraction, sign variance of $P$
can tell us the information about positive roots directly.

Furthermore, in Budan's theorem method, sometimes the search range needs to be
small enough to figure out whether there are roots or not. Take $P(x) = x^4 +1 $
as an example. In Budan's theorem method with search range $[0-\epsilon,
0+\epsilon]$, $v_{0+\epsilon}(P) - v_{0-\epsilon}(P) = 4$ is always valid, no
matter how small the $\epsilon$ is. Therefore, the bisection process will
terminate only when $2\epsilon < MINIMAL\_RANGE$. However, the continued
fraction method will check zero root first, then find no positive root since
$v_0(P(x)) = 0$ and no negative roots since $v_0(P(-x))=0$. That's the reason
why the Budan’s theorem method takes longer than the continued fraction method.

Above polynomials are generated with random coefficients, which means it cannot
guarantee that those polynomials have real roots. In order to figure out the
relationship between the running time with magnitude of roots, we designed
following experiments. Test polynomials have 6 roots and every root has $p =
0.5$ probability same as the previous one. Distinct roots are generated randomly
in range $[-max\_root, max\_root]$. Degree of test polynomials is 6. Running
times are shown in table~\ref{tb3}.

\begin{center}
\label{tb3}
\begin{tabular}{ |c|c|c| }
 \hline

 $max\_root$  & Budan's Theorem & Continued Fraction\\

 \hline
 1   & 23 $us$  & 23 $us$\\
 10   & 28 $us$  & 25 $us$\\
 50   & 34 $us$  & 36 $us$\\
 100   & 36 $us$  & 51 $us$\\
 200   & 39 $us$  & 86 $us$\\
 500   & 42 $us$  & 180 $us$\\
 1000   & 47 $us$  & 300 $us$\\
 \hline
\end{tabular}
\end{center}

First, we can observe that when roots go larger the continued fraction method
takes longer than the Budan's theorem method. It is noticeable that $p'=p(x+1)$
step in Algorithm~\ref{alg4} only shifts polynomial by $1$ each time. Therefore,
when roots are large, it takes longer for the continued fraction method to shift
the polynomial to the place around roots. This place needs to be optimized in
the future.  Shifting can be flexible according to the lower bound of roots of
polynomials.

Furthermore, we can also notice that the Budan’s theorem method runs faster than the
previous one while the continued fraction method runs slower. This mainly
because these polynomials are guaranteed to have 6 real roots. With 6 real
roots, there are no conjugate complex roots, like $x^4-1$. This condition makes
Budan’s theorem method terminate earlier. Besides that, some factors of original
polynomial might only have degree of 2 or 1. These factors can be solved very
quickly. However, for the continued fraction method, it takes longer to shift
polynomials to the place around roots.

\subsection{Error Analysis}

Although this implementation can work correctly in most cases, there are some
conditions that could lead to failure.

Since both methods need to work on polynomials with no repeat roots, square-free
decomposition becomes the most important step in the program. However, Yun's
algorithm requires exact divisions and $GCD$ success, which is hard to achieve
in floating point computation.

As mentioned before, we introduce interval arithmetic to handle the errors from
inexact computation and keep track of errors. We find that errors are related to
the magnitude of coefficients. Errors might be enlarged during the process of
$GCD$ and long division. Let's simulate the first step of $GCD(P,P')$, which is
$rem(P,P')$ where $P' = \frac{dP}{dx}$.

Given a polynomial $P=a_0+a_1*x + a_2*x^2...+a_n*x^n$, and its derivative
$P'=a_1+2*a_2*x...+n*a_n*x^{n-1}$. We assume all of coefficients of $P$ and $P'$
can be represented by computer perfectly. Which means the width of interval
$a_i$ is zero.

Then the processes to calculate $rem(P,P')$ are:

\begin{align*}
  div_1 &= 1/n \\
  rem_1 &= P - div_1 * x * P' =  a_0 + \frac{n-1}{n}a_1*x+ \frac{n-2}{n}a_2*x^2....
\frac{1}{n}*a_{n-1}x^{n-1}\\
       &= \sum_{i=0}^{n-1} \frac{n-i}{n} a_i x^i \\
  div_2 &= \frac{a_{n-1}}{a_n} * \frac{1}{n^2} \\
       &= div_1 * \frac{a_{n-1}}{na_n}\\
  rem_2 &= rem_1 - div_2 * P' = (a_0 - div_2*a_1) + (\frac{n-1}{n}*a_1 - div_2 *
  2*a_2)+ ... \\
      &= \sum_{i=0}^{n-2} (\frac{n-i}{n}*a_i -
      \frac{a_{n-1}*a_{i+1}}{n^2*a_n}(i+1)) x^i \\
      &= \sum_{i=0}^{n-2} ((1-div_1*i)*a_i -
       div_2 * a_{i+1}(i+1)) x^i
\end{align*}

Since $rem_2$ only has degree $n-2$ which is one less than $P'$, it is the
answer of $rem(P,P')$. Let's assume errors appear in computation of $div_1$.
Which means $div_1 = \frac{1}{n}\pm \epsilon$. Then we set $\xi =
\frac{a_{n-1}}{na_n}$, $div_2 = div_1 * \xi = \frac{a_{n-1}}{a_nn^2}  \pm
\epsilon \xi$. The width of value range of $div_2$ might be changed by $\xi$.
It's noticeable that start from $div_1$ the coefficients of intermediate
polynomials will be expressed as a set of possible value, instead of exact
value. Therefore, every square-free factor might be written in form as $P_i =
c_0[\pm \epsilon_0]+ c_1[\pm \epsilon_1]*x + c_2[\pm \epsilon_2]*x^2+ ... +
c_k[\pm \epsilon_k]*x^k$ after square-free decomposition.

If real roots of a polynomial are close enough, a little change of the
coefficients might change the roots a lot, not only the value, but also the
nature. For example, a square-free polynomial $P = (x-3.003)*(x-3.004)=x^2  -
6.007x + 9.021012$. If we only add $0.00000025$ to the constant term, these two
roots will become repeated $3.0035$. Besides that, if we add $1e^{-7} +
0.00000025$ to constant term, there will be no real roots for this polynomial.

As mentioned before, after square-free decomposition, error of coefficients may
not be avoidable. If roots of these polynomials are not distinctive enough,
real-root isolation might fail since it is hard to figure out the property of
these close roots. This problem seems inherent to specific problems. If we do not
have extra information about polynomials, it's hard to find out close distinct
roots.


%% SECTION HEADER /////////////////////////////////////////////////////////////////////////////////////
\section{Transformation of the Core Elements}
\label{sec:transformation}

%% SECTION CONTENT ////////////////////////////////////////////////////////////////////////////////////
All core elements are rotated relative to both skins, and thus it is necessary to transform the degrees of freedom from the local coordinate system of the core to the global coordinate system.
For this purpose, an additional sixth \ac{dof} is incorporated, i.e., rotation with respect to the \textit{z}-axis:
\begin{eqnarray}
	\widehat{\textbf{d}}^e_g = \left \{\begin{array}{cccccc}
		\widehat{\textbf{u}}^e & \widehat{\textbf{v}}^e &
		\widehat{\textbf{w}}^e & \widehat{\boldsymbol{\varphi}}_x^e &
		\widehat{\boldsymbol{\varphi}}_y^e & \widehat{\boldsymbol{\varphi}}_z^e
	\end{array}\right \}^T_g.
	\label{eq:d6}
\end{eqnarray}

First, the displacement vector is transformed from the global to local coordinate system by the direction cosines as follows:
\begin{eqnarray}
	\widehat{\textbf{d}}^e_l = \left \{\begin{array}{c}
		\widehat{\textbf{u}}^e \\ \widehat{\textbf{v}}^e \\
		\widehat{\textbf{w}}^e \\ \widehat{\boldsymbol{\varphi}}_x^e \\
		\widehat{\boldsymbol{\varphi}}_y^e
	\end{array}\right \}_l =
	\left [\begin{array}{ccccc}
		\textbf{V}^e_1, & \textbf{V}^e_2, & \textbf{V}^e_3, & \textbf{0} & \textbf{0} \\
		\textbf{0} & \textbf{0} & \textbf{0} & \textbf{V}^e_1, & \textbf{V}^e_2
	\end{array}\right ]^T
	\left \{\begin{array}{c}
		\widehat{\textbf{u}}^e \\ \widehat{\textbf{v}}^e \\
		\widehat{\textbf{w}}^e \\ \widehat{\boldsymbol{\varphi}}_x^e \\
		\widehat{\boldsymbol{\varphi}}_y^e\\
		\widehat{\boldsymbol{\varphi}}_z^e
	\end{array}\right \}_g,
	\label{eq:d_local}
\end{eqnarray}
where \(\textbf{V}^e_1\),\(\textbf{V}^e_2\) and \(\textbf{V}^e_3\) are direction cosines of the core element. Then, internal forces are calculated according to guideline from Section \ref{sec:f_internal} and transformed to a global coordinated~system:
\begin{eqnarray}
	\left\{\textbf{F}_{int}\right\}^e_g =
	\left [\begin{array}{ccccc}
		\textbf{V}^e_1, & \textbf{V}^e_2, & \textbf{V}^e_3, & \textbf{0} & \textbf{0} \\
		\textbf{0} & \textbf{0} & \textbf{0} & \textbf{V}^e_1, & \textbf{V}^e_2
	\end{array}\right ]
	\left \{\begin{array}{c}
		\textbf{F}^1_{int} \\
		\textbf{F}^2_{int} \\
		\textbf{F}^3_{int} \\
		\textbf{F}^4_{int} \\
		\textbf{F}^5_{int} \\
	\end{array}\right \}_l^e.
	\label{eq:f_global}
\end{eqnarray}

Additionally, a part of the mass matrix accounted for rotary inertia has to be transformed, and, in contrast to the internal forces vector, this has to be done only once in pre-processing as follows:

\begin{eqnarray}
	\textbf{J}_g=\left [
	\begin{array}{ccc}
		\left (\textbf{J}_{11}\right )_g & \left (\textbf{J}_{12}\right )_g & \left (\textbf{J}_{13}\right )_g\\
		& \left (\textbf{J}_{22}\right )_g & \left (\textbf{J}_{23}\right )_g\\
		Sym. &  & \left (\textbf{J}_{33}\right )_g\\
	\end{array}
	\right ]
	=\left[\begin{array}{ccc}
		\textbf{V}_1, \textbf{V}_2, \textbf{V}_3 \end{array}\right ]^T
	\,\textbf{J}_l\,
	\left[\begin{array}{ccc}
		\textbf{V}_1, \textbf{V}_2, \textbf{V}_3 \end{array}\right ].
	\label{eq:inertia}
\end{eqnarray}

As the matrix becomes non-diagonal after transformation, some approximation is necessary.
Off-diagonal terms in the matrix given in Equation~(\ref{eq:inertia}) are neglected following the analysis performed in \cite{surana1980transition}.


% s,fatrix

\subsection{The \fatrix class}

The \fatrix class
is the (now obsolete) predecessor
to the \fatrixx class.

If \x is of length 1000
and \y is of length 2000,
use the following call
to create a \fatrix object:
\begin{quote}
\ty{
A = Fatrix([2000 1000], system_arguments, ...
}
\\\hspace*{7em}
\ty{
'forw', @forward_project, 'back', @back_project);
}
\end{quote}
The resulting \fatrix object \ty{A}
acts just like
a $2000 \times 1000$ matrix
in most important respects.

Basic operations
like \ty{A(:,7)}
are also implemented,
but nonlinear operations
like \ty{A .^ 1/3}
are not
because those cannot be computed readily
using \ty{forward_project}.

For examples, see
the \ty{systems} subdirectory of \irt.

On 2007-1-30,
inspired by \ty{bbtools},
I added the following functionality:
\blist
\item
Fatrix object multiplication
(using \ty{Gcascade}): \ty{C = A * B}
\item
Scalar multiplication of Fatrix object
(using \ty{Gcascade}): \ty{B = 7 * A}
\item
Vertical concatenation (using \ty{block_fatrix}):
\ty{A = [A1; A2; A3]}
\item
Horizontal concatenation (using \ty{block_fatrix}):
\ty{A = [A1, A2, A3]}
\elist
One could use \ty{Gcascade} or \ty{block_fatrix}
directly for these operations,
but it looks nicer
and is more ``\matlab like''
to use the new syntax.

For a \fatrix,
the default behavior of the
\ty{forward_project}
and
\ty{back_project}
subroutines
is that they expect
a column vector input
and return
a column vector output.
Many of the \fatrix objects
also support an array input,
much like \fatrixx objects,
but for a \fatrix
the user must provide
both the vector and array capability
in the
\ty{forward_project}
and
\ty{back_project}
routines,
which makes them more difficult to write.
In contrast,
for \fatrixx objects,
the use provides subroutines
that only work with arrays,
and the \fatrixx object infrastructure itself
takes care of the vector case.


\subsection{Fusion Calculus}

    Bj{\"o}rn Victor and Joachim Parrow first designed the Fusion Calculus in the late 1990's as an attempt to simplify the $\pi$-calculus further still.
    They reduced the number of binding operators from two (input/output) to one (fusion).
    This new operation assigned two names to the same value or channel in one of the processes they were in, meaning the calculus has the bizarre property that all input/output actions are symmetric.
    The reduction in operators meant a reduction in bisimulation congruences, down now from three to just one, which justifies further mention here.

    \begin{definition}{Syntax\\}
        As defined by~\cite{fusion-calculus}, the Fusion Calculus is composed from \textit{free actions} ranged over by $\alpha \ldots$ and \textit{agents} ranged over by $P, Q \ldots$ as such:
        \begin{center}
            \begin{tabular}{ l l l }
                $P \quad \defeq$    & $\textbf{0}$      & (null process) \\
                                    & $\alpha . P$      & (action prefix) \\
                                    & $P \; | \; Q$     & (concurrency) \\
                                    & $P + Q$           & (choice) \\
                                    & $(x) \, P$        & (scope) \\ \\

                $\alpha \quad \defeq$   & $x y$         & (input) \\
                                        & $\bar{x} y$   & (output) \\
                                        & $\phi$        & (fusion) \\
            \end{tabular}
        \end{center}
        where $x$ is bound in $(x)P$.
    \end{definition}

    \begin{definition}{Structural Congruence\\}
        \label{fusion-calculus-structural-congruence}
        The structural congruence $\equiv$ is the least congruence relation satisfying $\alpha$-equivalence, associativity, commutativity, \textbf{0} identity and the following scope laws:
        \begin{align*}
            (x) \, \textbf{0}       & \equiv \textbf{0} \\
            (x) \, (y) \, P         & \equiv (y) \, (x) \, P \\
            (x) \, (P \; | \; Q)    & \equiv P \; | \; (x)Q \quad \text{where $z \notin fn(P)$} \\
            (x)(P \, + \, Q)        & \equiv (x)P \, + \, (x)Q
        \end{align*}
        This aims to provide the core definition of equivalent computation and a basis for reductions.
    \end{definition}

    \begin{definition}{Semantics\\}
        Similar to CCS, a reduction in the Fusion Calculus is a labelled transition $P \xrightarrow{\alpha} Q$ where:
        where each satisfies the expression:
        \begin{align*}
            \alpha . P \xrightarrow{\alpha}                             & P \\
            P \xrightarrow{ux} P', Q \xrightarrow{\bar{u}y} Q' \implies & P \; | \; Q \xrightarrow{x = y} P' \; | \; Q' \\
            P \xrightarrow{\alpha} P' \implies                          &
            \begin{cases}
                P \; | \; Q \xrightarrow{\alpha} P' \; | \; Q \\
                P + Q \xrightarrow{\alpha} P' \\
            \end{cases} \\
            P \xrightarrow{\phi} P', z \phi x, z \neq x \implies                            & (x)P \xrightarrow{\phi \backslash z} P'{x / z} \\
            P \xrightarrow{\alpha} P', x \notin names(\alpha) \implies                      & (x)P \xrightarrow{\alpha} (x)P' \\
            P \equiv P', Q \equiv Q', P \xrightarrow{\alpha} Q \implies                     & P \xrightarrow{\alpha} Q \\
            P \xrightarrow{(y) a x} P', z \in \{x, y\}, a \notin \{z, \bar{z}\} \implies    & (z)P \xrightarrow{(z y) a x} P'
        \end{align*}
    \end{definition}
    Note that all of the above can be easily generalised for action objects being k-length tuples rather than single values.

    \begin{example*}
        Within the Fusion Calculus --- like the $\pi$-calculus --- input and output actions block computation of a process until the input/output action is performed.
        We may instead define an asynchronous, delayed input that allows $P$ to continue with computation before binding an inputted value $x$ from a channel $u$.
        \begin{align*}
            u(x): P \, \defeq \, (x)(ux \; | \; P)
        \end{align*}
    \end{example*}

    \begin{remarks}
        There exists an encoding of the $\pi$-calculus within the Fusion Calculus.
        This is not so interesting at this point but is later. \\
        The Fusion Calculus shows that simplicity is definitely desirable in a process calculus as the reduction of rules and syntax eases readability and aids in proving properties of expressions.
        Despite this, \textit{I believe it still does not express suitably well the function of an expression without applying much thought or computation}.
    \end{remarks}


\documentclass[a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[english]{babel}
\usepackage{amsmath, amssymb}
\usepackage[]{amsthm} %lets us use \begin{proof}
\usepackage[]{amssymb} %gives us the character \varnothing

% figure support
\usepackage{import}
\usepackage{xifthen}
\pdfminorversion=7
\usepackage{pdfpages}
\usepackage{transparent}
\newcommand{\incfig}[1]{%
	\def\svgwidth{\columnwidth}
	\import{./figures/}{#1.pdf_tex}
}

\pdfsuppresswarningpagegroup=1

\begin{document}

\section*{Section 2.2}

\subsection*{Exercise 2.2.1}

Prove Proposition 2.2.5. (Hint: fix two of the variables and induct on the third.)

\begin{proof}

$ $\newline

We use induction on $a$. First we do the base case $a = 0$ to show $\left( 0+b \right) +c = 0+\left( b+c \right) $. By the definition of addition, we have $\left( 0+b \right) +c = b + c$ and $0+\left( b+c \right) = b+c$ . Thus the base case is done. Now suppose inductively that $\left( a+b \right) +c = a+\left( b+c \right) $, now we have to prove $\left( \left(  a \text{++} \right) +b \right) +c = \left( a \text{++} \right)  +\left( b+c \right) $. By the definition of addition, $\left( \left(  a \text{++} \right) +b \right) +c = \left( \left( a + b \right) \text{++} \right) + c = \left( \left( a + b \right)  + c \right) \text{++} $ and $\left( a \text{++} \right)  +\left( b+c \right) = \left( a + \left( b + c \right)  \right) \text{++} $. By axiom 2.4 and the hypothesis, $\left( \left( a \text{++} \right) + b \right) + c = \left( a \text{++} \right) + \left( b + c \right) $ thus we have closed the induction.

\end{proof}

\subsection*{Exercise 2.2.2}

Prove Lemma 2.2.10. (Hint: use induction.)

\begin{proof}

We use induction on $a$. Let the property  $P(a)$ to be "if $a$ is a positive number, then there exists exactly one natural number $b$ such that $b\text{++} = a$ ". First we do the base case $a = 0$. $P(0)$ is true since the hypothesis is vacuous, thus the base case is done. Now suppose inductively $P(a)$ is true, now we need to show  $P(a\text{++})$ is true. By Axiom 2.3 and Definition 2.2.7, $a\text{++}$ is a positive number and hence we need to prove the conclusion is ture. Obviously there exists at least one natural number $b\text{++} = a\text{++}$ by Axiom 2.2. For the sake of contradiction that there exists more than one natural number of which the successor is $a\text{++}$, by Axiom 2.4, a contradiction. Thus there exists exactly one natural number $b$ such that $b\text{++} = a\text{++}$, thus we have closed the induction.

\end{proof}

\subsection*{Exercise 2.2.3}

Prove Proposition 2.2.12. (Hint: you will need many of the
preceding propositions, corollaries, and lemmas.)

\begin{proof}

$ $\newline

For (a) (Order is reflexive), by Lemma 2.2.2 and $a = a + 0$, and Definition 2.2.11, $a \ge a$ is proved.

For (b) (Order is transitive), if $a \ge b$ and $b \ge c$, by Definition 2.2.11 there exists a natural number $k_0$ such that $a = b + k_0$ and $k_1$ such that $b = c + k_1$. By substitution, we have $a = \left( c + k_1 \right) + k_0$. By Proposition 2.2.5, $a = \left( c + k_1 \right) + k_0 = c + \left( k_1 + k_0 \right) $. Since $k_0 + k_1$ is a natural number (can be proved by induction), we have $a \ge c$.

For (c) (Order is anti-symmetric), For the sake of contradiction that $a \neq b$. By the trichotomy of order of natural numbers we have $a > b$ or $a < b$. If $a > b$, a contradiction to $a \le b$. If $a < b$, a contradiction to  $a \ge b$. Thus we have proved $a = b$.

For (d) (Addition preserves order), to prove $a \ge b$ iff $a + c \ge b + c$, we need to show both $a \ge b$ implies $a + c \ge b + c$ and $a + c \ge b + c$ implies $a \ge b$. For the first implication, let $x = a + c$ and $y = b + c$, we need to show $x \ge y$. By definition of ordering, $a \ge b$ iff there exists a natural number $k$ such that $a = b + k$. Then we have $x = \left( b + k \right) + c = \left( b + c \right) + k = y + k$. Thus we have proved the first implication. For the second implication, suppose $a < b$, we have $a + c < b + c$ (can be proved in the way similar to the first implication), a contradiction. Thus we have proved the second implication.

For (e), to prove $a < b$ iff $a\text{++} \le b$, we need to prove both $a < b$ implies $a\text{++} \le b$ and $a\text{++} \le b$ implies $a < b$. For the first implication, there exists a positive number $k_1$ (by (f)) such that $b = a + k_1$. By Lemma 2.2.10 there exists a natural number $k_2$ such that $b = a + k_1 = a + k_2\text{++} = \left( a + 1 \right) + k_2 = a\text{++} + k_2$, thus we have proved $a\text{++} \le b$. For the second implication, there exists a natural number $k_3$ such that $b = a\text{++} + k_3 = (a + 1) + k_3 = a + (1 + k_3)$. By Proposition 2.2.8, $1 + k_3$ is a positive number, thus $a < b$. Thus we have proved the second implication.

For (f), to prove $a < b$ iff $b = a + d$ for some positive number $d$, we need to prove $a < b$ implies $b = a + d$ and $b = a + d$ implies $a < b$, for some positive number $d$. For the first implication, we have $a = b + d$ for some natural number $d$ and $a \neq b$. For the sake of contradiction that $d = 0$, we have $a = b$, a contradiction. Thus $d$ is positive by Definition 2.2.7. For the second implication, by Definition 2.2.11 we have $a \le b$, and we need to show $a \neq b$. For the sake of contradiction that $a = b$, by Proposition 2.2.6 $a + 0 = b + d$ implies $d = 0$, a contradiction. Thus we have proved $a < b$.

\end{proof}
\subsection*{Exercise 2.2.4}

Justify the three statements marked (why?) in the proof of Proposition 2.2.13.

\begin{proof}

$ $\newline

To prove "$0 \le b$ for all natural number $b$" we use induction. First we do the base case $0 \le 0$, by Proposition 2.2.12 (a) it is true. Now suppose inductively $0 \le b$, we need to show $0 \le b\text{++}$. Since $b\text{++} = b + 1$, by Proposition 2.2.12 (f) we have $b < b\text{++}$, and then by Proposition 2.2.12 (b) we have $0 \le b\text{++}$. Thus we have closed the induction.

To prove "if $a > b$, then $a\text{++} > b$", similar to the proof of the first statement, we have $a\text{++} > a$ thus $a\text{++} \ge b$. For the sake of contradiction that $a\text{++} = b$, we have $b = a + 1$ thus $b > a$, a contradiction. Thus we have proved the statement.

To prove "if  $a = b$, then $a\text{++} > b$ ", we have $a\text{++} = a + 1 = b + 1$, thus by definition we have proved $a\text{++} > b$.

\end{proof}

\subsection*{Exercise 2.2.5}

Prove Proposition 2.2.14. (Hint: define $Q(n)$ to be the property that $P(m)$ is true for all $m_0 \le m < n$; note that $Q(n)$ is vacuously true when $n < m_0$.)

\begin{proof}

Use the definition of $Q(n)$ in the hint. We induct on the natural $n$. First we do the base case  $n = 0$. $Q(n)$ is vacuously true for all natural number  $m_0$ since $m_0 \le m < 0$ is vacuous, thus we have proved the base case. Now suppose $Q(n)$ is true, we now need to show $Q(n\text{++})$ is ture. If $Q(n)$ is true, then $P\left( m \right)$ is ture for all natural number $m_0 \le m \le n$ by the implication. By Proposition 2.2.12 (b) and $n < n\text{++}$, we have $m_0 \le m \le n\text{++}$. For the sake of contradiction that $m = n\text{++}$, $m = n + 1$ hence $m > n$, by the trichotomy of ordering, a contradiction. Thus we have proved $Q(n\text{++})$ is ture and closed the induction.

\end{proof}

\subsection*{Exercise 2.2.6}

Let n be a natural number, and let $P(m)$ be a property pertaining to the natural numbers such that whenever $P(m\text{++})$ is true, then $P(m)$ is true. Suppose that $P(n)$ is also true. Prove that $P(m)$ is true for all natural numbers $m \le n$; this is known as the principle of backwards induction. (Hint: apply induction to the variable $n$.)

\begin{proof}

We use induction on $n$. For the base case we need to show  $P(m)$ is true for all natural numbers  $m \le 0$, which is true by definition. Now suppose $P(m)$ is true for all natural numbers  $m \le n$, inductively we need to show that if $P\left( n\text{++} \right) $ is ture, then $P(m)$  is true for all natural numbers $m \le n\text{++}$. If $P(n\text{++})$ is true, then $P(n)$ is true. By the hypothesis we have  $P(m) $ is true for  $m \le n$. Thus $P(m)$ is true for  $m \le n\text{++}$, closing the induction.

\end{proof}

\end{document}


\subsection{Generalizability of the Methology and Findings}
\label{generalizability}

Whereas forecasting applications are always data-specific, the following
    aspects generalize to UDPs with ad-hoc transportation services:
\begin{itemize}
\item \textbf{Double Seasonality}:
The double seasonality causes a periodicity $k$ too large to be modeled by
    classical models, and we adapt the STL method in the \textit{fnaive} model
    such that it "flexibly" fits a seasonal pattern changing in a non-trivial
    way over time.
\item \textbf{Order Sparsity}:
The intermittent time series resulting from gridification require simple
    methods like \textit{hsma} or \textit{trivial} that are not as susceptible
    to noise as more sophisticated ones.
\item \textbf{Unified CV}:
A CV unified around a whole day allows evaluating classical statistical and ML
    methods on the same scale.
It is agnostic of both the type of the time series and retraining.
\item \textbf{Error Measure}:
Analogous to \cite{hyndman2006}, we emphasize the importance of choosing a
    consistent error measure, and argue for increased use of MASE.
\end{itemize}


\chapter{Krotov Boundary Condition for the Perfect Entangler Functional}
\chaptermark{Krotov Boundary Condition for the PE Functional}
\label{AppendixPE}

We derive the boundary condition
\begin{equation}
 \Ket{\chi^{(i)}(T)}
 = - \krotovdifquo[J_T]{\Bra{\phi_k}}{\phi_k^{(i)}(T)}\,,
\end{equation}
cf.~Eq.~\eqref{eq:chi_boundary},
for the backwards-propagation of the co-state $\Ket{\chi(t)}$ in the update
equation~\eqref{eq:krotov_first_order_update} of Krotov's method, for the
perfect-entanglers functional
\begin{equation}
  J_{\PE} = g_3 \sqrt{g_1^2 + g_2^2} - g_1\,,
  \label{eq:app_f_pe}
\end{equation}
cf.~Eq.~\eqref{eq:J_T_PE_g}.

\noindent
The forward propagation of the four Bell states
\begin{align}
 \Ket{\phi_1} &=   \frac{1}{\sqrt{2}} \left(  \ket{00}   - \ii \ket{11}\right)\,,&
 \Ket{\phi_2} &= - \frac{1}{\sqrt{2}} \left(\ii \ket{01} -     \ket{10}\right)\,,\\
 \Ket{\phi_3} &= - \frac{1}{\sqrt{2}} \left(\ii \ket{01} +     \ket{10}\right)\,,&
 \Ket{\phi_4} &=   \frac{1}{\sqrt{2}} \left(  \ket{00}   + \ii \ket{11}\right)\,.
\end{align}
\index{magic basis}%
in the two-qubit logical subspace yields a gate $U_B$, as a $4 \times 4$ matrix.
We split this matrix into real and imaginary part
\begin{equation}
  A \equiv \Re[U_B], \qquad B \equiv \Im[U_B]\,.
\end{equation}
The co-state at final time $T$ can then be written as
\begin{equation}
  \Ket{\chi(T)} = \sum_{l=1}^4 a_{lk}^* \Ket{\phi_l(T)}\,,
\end{equation}
with
\begin{equation}
  a_{kl} = - \left(
  \partdifquo[F_{PE}]{A_{kl}}
  + \ii \partdifquo[F_{PE}]{B_{kl}}
  \right)\,.
  \label{eq:app_pe_a_kl}
\end{equation}

\noindent
We can rewrite
\begin{equation}
\begin{split}
  \sqrt{g_1^{2} + g_2^{2}}
  & = \sqrt{%
        \left(\Re \frac{\Tr^2[m]}{16 \det U_B}\right)^2
       +\left(\Im \frac{\Tr^2[m]}{16 \det U_B}\right)^2
       } \\
  &= \frac{1}{16} \left(
      \Re^2\left[\Tr[m] \right] + \Im^2\left[\Tr[m] \right]
      \right)\,,
\end{split}
\label{eq:app_pe_g1_g2_rewrite}
\end{equation}
with $m \equiv U_B^T U_B$, and having used $\Abs{\tr^2[m]} = \Abs{\tr[m]}^2$.

\noindent
With Eq.\eqref{eq:app_pe_g1_g2_rewrite}, and
\begin{equation}
  g_3 = \frac{\Tr^2[m] - \Tr[m^2]}{4 \det U_B}\,,
\end{equation}
the perfect-entanglers functional can be rewritten as
{\small
\begin{equation}
\begin{split}
  F_{PE}
  &=
  \left( \frac{1}{\det U_B} \right)
  \left( \frac{1}{4} (\Tr^2[m] - \Tr[m^2] ) \right)
  \left( \frac{1}{16} \Re^2[\tr[m]] \right)
  + \\ \quad&
  + \left( \frac{2}{\det U_B} \right)
    \left( \frac{1}{4} (\Tr^2[m] - \Tr[m^2] ) \right)
    \left( \frac{1}{16} \Im^2[\tr[m]] \right)
    \left( \frac{1}{16} \Re[\tr^2[m]] \right)\,.
\end{split}
\end{equation}
}

\noindent
The derivatives in Eq.~\eqref{eq:app_pe_a_kl} can now be evaluated via the chain
rule, where the derivatives of the individual terms are
{\small
\begin{align}
  \partdifquo{A_{ab}} \left( \frac{1}{\det[U_B]} \right)
  &= - \frac{\det[U_{B}^{(ab)'}]}{\det^2[U_B]}\,,
  \\
  \partdifquo{B_{ab}} \left( \frac{1}{\det[U_B]} \right)
  &= - \ii \frac{\det[U_{B}^{(ab)'}]}{\det^2[U_B]}\,,
\end{align}
} % small
where $U_{B}^{(ab)'}$ is obtained from $U_B$ by replacing the $a$'th column by
the $b$'th unit vector, following Leibniz' formula,
cf.~Ref~\cite{ReichDipl10};
furthermore,
%
{\small
\begin{equation}
\begin{split}
  &
  \partdifquo{A_{ab}} \left( \frac{1}{4} (\Tr^2[m] - \Tr[m^2] ) \right)
  \\ &
  = \sum_{ki} \Bigg( \Big(
               A_{ab}   A_{ki}   A_{ki}
        -      A_{ab}   B_{ki}   B_{ki}
        - 2    B_{ab}   A_{ki}   B_{ki}
  \\ & \qquad\qquad
        -      A_{ki}   A_{ai}   A_{kb}
        +      A_{kb}   B_{ai}   B_{ki}
        + 2    B_{kb}   A_{ai}   B_{ki}
        \Big)
  + \\ & \qquad
  + \ii \Big(
               B_{ab}    A_{ki}   A_{ki}
        -      B_{ab}    B_{ki}    B_{ki}
        + 2    A_{ab}   A_{ki}   B_{ki}
        -      A_{ai}   A_{ki}   B_{kb}
  \\ & \qquad\qquad
        -      A_{kb}   A_{ki}   B_{ai}
        -      A_{kb}   A_{ai}   B_{ki}
        +      B_{ai}    B_{ki}    B_{kb}
  \Big)
  \Bigg)\,,
\end{split}
\end{equation}
\begin{equation}
\begin{split}
  &
  \partdifquo{B_{ab}} \left( \frac{1}{4} (\Tr^2[m] - \Tr[m^2] ) \right)
  \\ &
  = \sum_{ki} \Bigg( \Big(
               B_{ab}    B_{ki}    B_{ki}
        -      B_{ab}    A_{ki}   A_{ki}
        - 2    A_{ab}   A_{ki}   B_{ki}
  \\ & \qquad\qquad
        -      B_{ki}    B_{ai}    B_{kb}
        +      B_{kb}    A_{ai}   A_{ki}
        + 2    A_{kb}   B_{ai}    A_{ki}
        \Big)
  + \\ & \qquad
  + \ii \Big(
        -      A_{ab}   B_{ki}    B_{ki}
        +      A_{ab}   A_{ki}   A_{ki}
        - 2    B_{ab}    B_{ki}    A_{ki}
        +      B_{ai}    B_{ki}    A_{kb}
  \\ & \qquad\qquad
        +      B_{kb}    B_{ki}    A_{ai}
        +      B_{kb}    B_{ai}    A_{ki}
        -      A_{ai}   A_{ki}   A_{kb}
  \Big)
  \Bigg)\,,
\end{split}
\end{equation}

\begin{align}
  \partdifquo{A_{ab}}
  \left( \frac{1}{16} \Re^2[\tr[m]] \right)
  &= \frac{1}{4} \sum_{ki} \left(
      A_{ab}   A_{ki}   A_{ki} - A_{ab}   B_{ki}   B_{ki}
      \right)\,,
  \\
  \partdifquo{B_{ab}}
  \left( \frac{1}{16} \Re^2[\tr[m]] \right)
  &= \frac{1}{4} \sum_{ki} \left(
      B_{ab}   B_{ki}   B_{ki} - B_{ab}   A_{ki}   A_{ki}
      \right)\,,
  \\
  \partdifquo{A_{ab}}
  \left( \frac{1}{16} \Im^2[\tr[m]] \right)
  &= \frac{1}{2} \sum_{ki} \left(
        A_{ki}   B_{ab}   B_{ki}
      \right)\,,
  \\
  \partdifquo{B_{ab}}
  \left( \frac{1}{16} \Im^2[\tr[m]] \right)
  &= \frac{1}{2} \sum_{ki} \left(
       B_{ki}   A_{ab}   A_{ki}
      \right)\,,
\end{align}

\begin{equation}
\begin{split}
  &
  \partdifquo{A_{ab}} \left( \frac{1}{16} \Re[\tr^2[m]] \right)
  \\ &
  = \frac{1}{4} \sum_{ki} \Bigg( \Big(
          A_{ab}   A_{ki}   A_{ki}
        -      A_{ab}   B_{ki}    B_{ki}
        - 2        B_{ab}    A_{ki}   B_{ki}
        \Big)
  + \\ & \qquad
  + \ii \Big(
        +      B_{ab}    A_{ki}   A_{ki}
        -      B_{ab}    B_{ki}    B_{ki}
        + 2        A_{ab}   A_{ki}   B_{ki}
  \Big)
  \Bigg)\,,
\end{split}
\end{equation}
} % small

\noindent
and finally
{\small
\begin{equation}
\begin{split}
  &
  \partdifquo{B_{ab}} \left( \frac{1}{16} \Re[\tr^2[m]] \right)
  \\ &
  = \frac{1}{4} \sum_{ki} \Bigg( \Big(
           B_{ab}    B_{ki}    B_{ki}
        -  B_{ab}    A_{ki}   A_{ki}
        - 2 A_{ab}   B_{ki}    A_{ki}
        \Big)
  + \\ & \qquad
  + \ii \Big(
        -  A_{ab}   B_{ki}    B_{ki}
        +  A_{ab}   A_{ki}   A_{ki}
        - 2 B_{ab}    B_{ki}    A_{ki}
  \Big)
  \Bigg)\,.
\end{split}
\end{equation}

} % small


\documentclass{memoir}
\usepackage{notestemplate}

%\logo{./resources/pdf/logo.pdf}
%\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/08/21

\chapter{Box-counting Dimension}
\label{cha:box_counting_dimension}

The premise behind the box-counting dimension is to count the minimal number of sets of diameter \(\leq \delta\) that can cover a subset \(F\) of Euclidean space. Denoting this number by \(N_{\delta}(F)\), we observe if there exists a power law so that
\begin{align*}
	N_{\delta}(F) \cong c \delta^{-s}
\end{align*}
for some positive constants \(c,s\). If this exists, we say that \(F\) has box dimension \(s\). Note that we can rewrite this as
\begin{align*}
	s = \lim_{\delta \to 0} \frac{\log N_{\delta}(F)}{-\log \delta}.
\end{align*}

\begin{defn}
Of course, this may not be well-defined. To formalize this concept, we introduce \textbf{lower} and \textbf{upper box-counting dimensions of \(F\)} :
\begin{align*}
	\underline{ \textrm{dim}}_{B}F = \liminf_{\delta \to 0} \frac{\log N_{\delta}(F)}{-\log \delta}\\
	\overline{ \textrm{dim}}_{B}F = \limsup_{\delta \to 0} \frac{\log N_\delta(F)}{-\log \delta}
\end{align*}
If they are equal, then we say it is the \textbf{box-counting dimension} as above:
\begin{align*}
	\textrm{dim}_B F = \lim_{\delta \to 0} \frac{\log N_\delta(F)}{-\log \delta}.
\end{align*}
\end{defn}

Note that in order to make sure this is well-defined we typically only apply box dimension to non-empty bounded sets.\\

What makes this definition so interesting is that it can be modified in many ways to get the same result. Using cube, or largest number of disjoint balls still yields the same numbers. In other words, we can use the same statement but redefine \(N_\delta(F)\) to be
\begin{enumerate}
	\item the smallest number of sets of diameter at most \(\delta\) that cover \(F \)
	\item the smallest number of closed balls of radius \(\delta\) that cover \(F\)
	\item the smallest number of cubes of side \(\delta\) that cover \(F\)
	\item the number of \(\delta\)-mesh cubes that intersect \(F\)
	\item the largest number of disjoint balls of radius \(\delta\) with centers in \(F\)
\end{enumerate}
and get the same results.\\

% Probably should include some examples here

An equivalent definition of a different form is useful. Define the \(\delta\)-neighborhood to be
\begin{align*}
	F_\delta = \left\{x \in \R^{n} \mid \left| x-y \right| \leq \delta \text{ for some \(y \in F\)}\right\} .
\end{align*}
We can consider the \(n\)-dimensional Lebesgue measure of this object. In fact, if for some \(0<c<\infty\) we have
\begin{align*}
	\lim_{\delta \to 0} \left( \mathcal{L}^{n}(F_\delta) / \delta^{n-s} \right) = c
\end{align*}
for some \(s>0\), then we can regard \(F\) as \(s\)-dimensional. In this case, we call \(c\) the \(s\)-dimensional Minkowski content of \(F\).

\begin{prop}
	If \(F\) is a subset of \(\R^{n}\), then
	\begin{align*}
		\underline{ \textrm{dim}}_B F = n - \limsup_{\delta \to 0} \frac{\log \mathcal{L}^{n}(F_\delta)}{\log \delta}\\
		\overline{ \textrm{dim}}_B F = n - \liminf_{\delta\to 0} \frac{\log \mathcal{L}^{n}(F_\delta)}{\log \delta}
	\end{align*}
\end{prop}
This proposition is why the box-dimension is also commonly referred to as the Minkowski dimension.\\

One notable fact is that, if we are considering the box dimension of a compact subset of \(\R\), we can instead consider the complementary intervals in order to determine the dimension. Further detail in later chapters.

\section{Properties of Box-counting Dimension}
\label{sec:properties_of_box_counting_dimension}

\begin{enumerate}
	\item Monotonicity-- if \(E\subset F\), then \( \textrm{dim}_BE \leq \textrm{dim}_BF\), along with their supremum and infimum versions.
	\item For \(F\subset \R^{n}\) non-empty and bounded,
		\begin{align*}
			0 \leq \underline{ \textrm{dim}}_B F \leq \overline{ \textrm{dim}}_B F \leq n.
		\end{align*}
	\item Finite stability--
		\begin{align*}
			\overline{ \textrm{dim}}_B(E\cup F) = \textrm{max} \left\{ \overline{ \textrm{dim}}_B E, \overline{ \textrm{dim}}_B F \right\} .
		\end{align*}
	\item If \(F\subset \R^{n}\) is open, then \( \textrm{dim}_B F = n\).
	\item If \(F\) is non-empty and finite, then \( \textrm{dim}_B F = 0\).
	\item If \(F\) is a smooth bounded \(m\)-dimensional submanifold of \(\R^{n}\), then \( \textrm{dim}_H F = m\).
\end{enumerate}
We also have a preservation of dimension under Lipschitz transformations.

\begin{prop}
	\begin{enumerate}[(a).]
		\item If \(F\subset \R^{n}\) and \(f:F\to \R^{m}\) is a Lipschitz transformation, that is,
			\begin{align*}
				\left| f(x) - f(y) \right| \leq c \left| x-y \right| \quad \forall x,y \in F
			\end{align*}
			then
			\begin{align*}
				\underline{ \textrm{dim}}_Bf(F) \leq \underline{ \textrm{dim}}_BF\\
				\overline{ \textrm{dim}}_B f(F) \leq \overline{ \textrm{dim}}_B F
			\end{align*}
		\item If \(F\subset \R^{n}\) and \(f:F\to \R^{m}\) is a bi-Lipschitz transformation, that is,
			\begin{align*}
				c_1 \left| x-y \right| \leq \left| f(x) - f(y) \right| \leq c \left| x-y \right| \quad \forall x,y \in F
			\end{align*}
			with \(0<c_1\leq c<\infty\), then we have equality instead.
	\end{enumerate}
\end{prop}
This applies to a lot of transformations, such as affine translations. We also begin to get more information about projections-- for example, we can bound the dimension of the projection above by the original dimension.

\begin{prop}
	\begin{align*}
		\underline{ \textrm{dim}}_B \overline{F} = \underline{ \textrm{dim}}_B F\\
		\overline{ \textrm{dim}}_B \overline{F} = \overline{ \textrm{dim}}_B F.
	\end{align*}
\end{prop}
This is concerning and has some undesired consequences. FOr example, if \(F\) is a dense subset of an open region in \(\R^{n}\), its dimension must be \(n\). This implies that countable sets, which are very small compared to \(\R\), can have non-zero box dimension. Worse yet, the box dimension of individual rationals is clearly zero, yet their union has dimension \(1\). In other words, we cannot assert any sort of closure under unions.

\section{Modified Box-counting Dimension}
\label{sec:modified_box_counting_dimension}

We can resolve some of these issues, but obviously it comes at a cost (of being more difficult to apply directly).
\begin{defn}
	We define the \textbf{lower} and \textbf{upper modified} box-counting dimension by:
	\begin{align*}
		\underline{ \textrm{dim}}_{MB}F = \inf \left\{ \sup_{i} \underline{ \textrm{dim}}_B F_i \mid F\subset \bigcup_{i =1}^{\infty}F_i \right\} \\
		\overline{ \textrm{dim}}_{MB}F = \inf \left\{ \sup_{i} \overline{ \textrm{dim}}_B F_i \mid F \subset \bigcup_{i=1}^{\infty}F_i \right\} .
	\end{align*}
	This is bounded above by the original definition, but has the added benefit that countable sets have dimension zero.
\end{defn}
This carries all the properties that we had earlier with the box-counting dimension, but with some other nice properties, such as \textbf{countably stable}:
\begin{align*}
	\underline{ \textrm{dim}}_{MB} \left( \bigcup_{i =1} ^{\infty}F_i \right) = \sup_{i} \left\{ \underline{ \textrm{dim}}_{MB}F_i \right\}
\end{align*}
for any countable sequence of sets \(\left\{ F_i \right\} \) (and of course for the upper modified box dimension). We have a nice property that allows us to determine if this version is equivalent to the standard box dimension.

\begin{prop}
	Let \(F\subset \R^{n}\) be compact. Suppose that
	\begin{align*}
		\overline{ \textrm{dim}}_B (F \cap V) = \overline{ \textrm{dim}}_B F
	\end{align*}
	for all open sets  \(V\) that intersect \(F\). Then \( \overline{ \textrm{dim}}_B F = \overline{ \textrm{dim}}_{MB}F\), and likewise for lower box-counting dimensions.
\end{prop}
This can be proven by application of Baire's category theorem.\\

Recall that we say a set \(F\subset \R^{n}\) is of \textbf{second category} in \(\R^{n}\) if it cannot be expressed as a countable union of nowhere dense sets (closure has empty interior). Equivalently, if \(F\subset \bigcup_{i=1}^{\infty}F_i\), there is some \(F_i\) and non-empty open set \(V\) such that \(V \subset \overline{F\cap F_i}\).

\begin{prop}
	Let \(F\subset \R^{n}\) be of second category. Then \( \underline{ \textrm{dim}}_{MB}F = \overline{ \textrm{dim}}_{MB}F = n\).
\end{prop}

\end{document}


\documentclass[12pt]{beamer}

\usepackage{tikz}
\usepackage{graphicx}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{booktabs, braket} % For formal tables
\usepackage{cleveref}
\usepackage{graphicx}
\usepackage{blkarray}
\usetikzlibrary{graphs, graphs.standard}

\DeclareMathOperator{\E}{\textrm{E}}		     % expected value
\DeclareMathOperator{\pr}{\mathrm{P}}		     % probability
\DeclareMathOperator{\cov}{t_{cov}}	             % cover time

\DeclareMathOperator{\X}{\mathbb{X}}		     % expected value
\DeclareMathOperator{\tr}{\text{tr}}		     % trace
\DeclareMathOperator{\Ap}{$A$ ^\prime} 		     % A'
\DeclareMathOperator{\bp}{$b$ ^\prime} 		     % b'
\DeclareMathOperator{\Xb}{\mathcal{X}}		     % big X

\newcommand\coolover[2]{\mathrlap{\smash{\overbrace{\phantom{%
    \begin{matrix} #2 \end{matrix}}}^{\mbox{$#1$}}}}#2}

\newcommand\coolunder[2]{\mathrlap{\smash{\underbrace{\phantom{%
    \begin{matrix} #2 \end{matrix}}}_{\mbox{$#1$}}}}#2}

\newcommand\coolleftbrace[2]{%
#1\left\{\vphantom{\begin{matrix} #2 \end{matrix}}\right.}

\newcommand\coolrightbrace[2]{%
\left.\vphantom{\begin{matrix} #1 \end{matrix}}\right\}#2}

\title{Semidefinite Programming and Quantum Algorithms}
\author{Michael Czekanski \& R. Teal Witter}
\institute{Middlebury College}
\date{December 3, 2019}

\newcommand{\todo}[1]{{\color{red}{[{\bf TODO:} #1]}}}

\begin{document}
\graphicspath{{./../figures/}}

\frame{\titlepage}

\begin{frame}{Overview}
\setcounter{tocdepth}{1}
\tableofcontents
\end{frame}

\section{Introduction}
\begin{frame}{Motivation}
As quantum computers someday soon maybe might become a reality...
\newline
\newline
What are the problems that quantum computers
can solve more efficiently
than classical computers? \#QuantumSpeedUp

\end{frame}

\begin{frame}{Houston, we have a problem:}
Given Boolean function $f$...
\newline
\newline
What is the optimal quantum query complexity?
\newline
\newline
What is a query optimal quantum algorithm?
\end{frame}

\section{Background}
\begin{frame}{Query Complexity}
Given bitstring $x$ and function $f$,
how many bits of $x$ to determine $f(x)$ in the worst case?
\only<2-3>
{
\begin{align}
 f: x_1 \wedge (x_2 \vee \bar{x_2}) \vee x_3 \nonumber
\end{align}
}
\only<3>
{
\begin{align}
x &\rightarrow f(x) \nonumber \\
000 &\rightarrow 0 \nonumber \\
010 &\rightarrow 0 \nonumber \\
011 &\rightarrow 1 \nonumber
\end{align}
}
\only<4-5>
{
\begin{align}
 f: x_1 \vee x_2 \vee x_3 \nonumber
\end{align}
}
\only<5>
{
\begin{align}
x &\rightarrow f(x) \nonumber \\
000 &\rightarrow 0 \nonumber \\
010 &\rightarrow 1 \nonumber \\
011 &\rightarrow 1 \nonumber
\end{align}
}
\end{frame}

\begin{frame}{Span Program}
Given $x$ and $f$, is $f(x)$ true?
$$\iff$$
Given input vectors $I(x)$ and target vector $\tau$,
do the input vectors span to the target vector?
\newline
\newline
\only<2->
{
For OR, $I(x) = x$ and $\tau = 1$.
}
\newline
\newline
\only<3>
{
I(000) = {0,0,0} does not span to $\tau$
:(
}
\only<4>
{
I(010) = {0,1,0} does span to $\tau$
:)
}
\end{frame}

\section{Our Work}

\begin{frame}{Our Approach, Generally}
\centering
\includegraphics[scale=.5]{convex_optimization.pdf}
\end{frame}

\begin{frame}{Our Approach, Specifically \cite{reichardt2009span}}
\begin{align} \label{eq:reichardtObj}
    f_{\text{bound}} = \min_{\X} \left( \max_{y \in D} \sum_{j \in [n]}
    \bra{y,j}\X\ket{y,j}  \right) \nonumber
\end{align}
Subject to:
\begin{align}\label{Eq:reichardtSemi}
    \X \succcurlyeq 0 \nonumber
\end{align}
\begin{align}\label{Eq:reichardtOffDiag}
    \forall (y,z) \in F \sum_{j \in [n]: y_j \ne z_j}
    \bra{y,j} \X \ket{z, j} = 1 \nonumber
\end{align}
\end{frame}

\begin{frame}{What $\X$ Looks Like (2-bit OR)}
    \begin{align}
\X = \begin{blockarray}{ccccc}
\qquad & 00 & 01 & 10 & 11 \\
\begin{block}{c[cccc]}
  00 & X_{(00,00)} & X_{(00,01)} & X_{(00,10)} & X_{(00,11)}\\
  01 & X_{(01,00)} & X_{(01,01)} & X_{(01,10)} & X_{(01,11)}\\
  10 & X_{(10,00)} & X_{(10,01)} & X_{(10,10)} & X_{(10,11)}\\
  11 & X_{(11,00)} & X_{(11,01)} & X_{(11,10)} & X_{(11,11)}\\
\end{block}
\end{blockarray} \nonumber
\end{align}
\end{frame}

\begin{frame}{What $\X$ Looks Like (2-bit OR)}
    \begin{align}
    \X = \left[ \begin{array}{cc|cc|cc|cc}
    0.7 & 0 & 0 & 0 & 1 & 0 & 0.5 & 0\\
    0 & 0.7 & 0 & 1 & 0 & 0 & 0 & 0.5\\
    \hline
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
    0 & 1 & 0 & \sqrt{2} & 0 & 0 & 0 & 0.7\\
    \hline
    1 & 0 & 0 & 0 & \sqrt{2} & 0 & 0.7 & 0\\
    0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
    \hline
    0.5 & 0 & 0 & 0 & 0.7 & 0 & 0.6 & 0\\
    0 & 0.5 & 0 & 0.7 & 0 & 0 & 0 & 0.6\\
    \end{array}
\right] \nonumber
\end{align}
\end{frame}

\begin{frame}{What $\X$ Looks Like (2-bit OR)}
    We want to minimize the maximum (over inputs $y$) of:
    \begin{align}
         \sum_{j \in [n]}
    \bra{y,j}\X\ket{y,j}   \nonumber
    \end{align}
    \begin{align}
    \X = \left[ \begin{array}{cc|cc|cc|cc}
    \color{blue}0.7 & 0 & 0 & 0 & 1 & 0 & 0.5 & 0\\
    0 & \color{blue}0.7 & 0 & 1 & 0 & 0 & 0 & 0.5\\
    \hline
    0 & 0 & \color{orange}0 & 0 & 0 & 0 & 0 & 0\\
    0 & 1 & 0 & \color{orange}\sqrt{2} & 0 & 0 & 0 & 0.7\\
    \hline
    1 & 0 & 0 & 0 & \color{purple}\sqrt{2} & 0 & 0.7 & 0\\
    0 & 0 & 0 & 0 & 0 & \color{purple}0 & 0 & 0\\
    \hline
    0.5 & 0 & 0 & 0 & 0.7 & 0 & \color{cyan}0.6 & 0\\
    0 & 0.5 & 0 & 0.7 & 0 & 0 & 0 & \color{cyan}0.6\\
    \end{array}
\right] \nonumber
\end{align}
\end{frame}

\begin{frame}{What $\X$ Looks Like (2-bit OR)}
    For $y,z$ such that $f(y) \neq f(z)$:

    \begin{align}
         \sum_{j \in [n]: y_j \ne z_j}
    \bra{y,j} \X \ket{z, j} = 1 \nonumber
    \end{align}
    \begin{align}
    \X = \begin{array}{cc|cc|cc|cc}
    0.7 & 0 & \color{blue}0 & 0 & \color{orange}1 & 0 & \color{cyan}0.5 & 0\\
    0 & 0.7 & 0 & \color{blue}1 & 0 & \color{orange}0 & 0 & \color{cyan}0.5\\
    \hline
    \color{blue}0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
    0 & \color{blue}1 & 0 & \sqrt{2} & 0 & 0 & 0 & 0.7\\
    \hline
    \color{orange}1 & 0 & 0 & 0 & \sqrt{2} & 0 & 0.7 & 0\\
    0 & \color{orange}0 & 0 & 0 & 0 & 0 & 0 & 0\\
    \hline
    \color{cyan}0.5 & 0 & 0 & 0 & 0.7 & 0 & 0.6 & 0\\
    0 & \color{cyan}0.5 & 0 & 0.7 & 0 & 0 & 0 & 0.6\\
    \end{array} \nonumber
\end{align}
\end{frame}

\subsection{How We Get Our $\X$}
\begin{frame}{We use ADM \cite{adm}}
\centering
\includegraphics[scale=.15]{figures/adm_algorithm}
\bigskip
\begin{itemize}
    \item "Easy" to implement
    \item Exploits sparsity
\end{itemize}
\end{frame}

\begin{frame}{Numerical Results: Very Accurate :)}
\centering
\includegraphics[scale=.5]{or_all_complexity.eps}
\end{frame}

\begin{frame}{Run Time Results: Too Many Inputs :(}
\centering
\includegraphics[scale=.5]{or_all_runtime.eps}
\end{frame}

\begin{frame}{In Conclusion...}
    \begin{itemize}
        \item Our algorithm rocks
        \item Except on large inputs
    \end{itemize}
\end{frame}

\section{Future Work}
\begin{frame}{Future Work}
\begin{itemize}
    \item Expand our algorithm beyond binary outputs
    \item Utilize a more efficient solver
    \item Memory efficiency of span programs
\end{itemize}
\end{frame}

\begin{frame}{Thank you!}
\bibliographystyle{abbrv}
\bibliography{main}
\end{frame}

\end{document}


\section{Calculation of outputs}

\subsection{Incidence}
Incidence is calculated as any transitions into the early active compartment (\textit{``I"}).

\subsection{Hospital occupancy}
This is calculated as the sum of three quantities:
\begin{enumerate}
    \item All persons in the late active compartment in clinical stratum 4, representing those admitted to hospital but never critically unwell.
    \item All persons in the late active compartment in clinical stratum 5, representing those currently admitted to ICU.
    \item A proportion of the early active compartment in clinical stratum 5, representing those who will be admitted to ICU at a time in the future. This proportion is calculated as the quotient of \textit{1)} the difference between the pre-ICU period and the pre-hospital period for clinical stratum 4, divided by \textit{2)} the total pre-ICU period. That is, a proportion of the pre-ICU period is considered to represent patients in hospital who have not yet been admitted to ICU.
\end{enumerate}

\subsection{ICU occupancy}
This is calculated as all persons in the late active compartment in clinical stratum 5.

\subsection{Recovered proportion}
This is calculated as the proportion of the population in the recovered (\textit{``R"}) compartment. Although very similar numerically to the attack rate, persons who died of COVID-19 are not included in the denominator.

\subsection{COVID-19-related mortality}
This is calculated as all transitions representing death, exiting the model. This is implemented as depletion of the late active compartment.

\subsection{Notifications}
Local case notifications are calculated as transitions from the early to the late active compartment for clinical strata 3 to 5.


\chapter{Radio-Frequency Fundamentals}
% ###########################################################################
% ###########################################################################
% ###########################################################################
\section{Introduction}
In this book we will the International System (SI) of units, which differs from most of the plasma physics and waves into plasma reference books in which CGS units are used instead. In this system of units, the unit of length is the meter, the unit of time is the second and the unit of mass is the kilogram. This choice is motivated by the fact that most engineering tools such as electromagnetic solvers also use SI units by default. Moreover, these units are also the one used in practice when performing measurements.

% ###########################################################################
% ###########################################################################
% ###########################################################################
\section{The Decibel}
[1] E.A. Wolff, R. Kaul, Microwave engineering and systems applications, 1988. doi:10.1109/MAP.1989.6095665.

% ###########################################################################
% ###########################################################################
% ###########################################################################
\section{Basic Equations}
% ###########################################################################
% ###########################################################################
\subsection{Maxwell Equations}
We shall start the Maxwell equations is their most general form, before recasting them to fit our needs. The usual electromagnetic field quantities are expressed in terms of six quantities that are:
\begin{itemize}
 \item $\boldsymbol{\mathcal{E}}$: the electric field intensity (in $V/m$)
 \item $\boldsymbol{\mathcal{H}}$: the magnetic field intensity (in $A/m$)
 \item $\boldsymbol{\mathcal{D}}$: the electric flux density (in $A\cdot s/m^2=C/m^2$)
 \item $\boldsymbol{\mathcal{B}}$: the magnetic flux density (in $V\cdot s/m^2=Wb/m^2$, also known as Tesla $T$)
 \item $\boldsymbol{\mathcal{J}}$: the electric current density (in $A/m^2$)
 \item $q_v$: the electric charge density (in $C/m^3$)
\end{itemize}
where all quantities are function of space and time, e.g. $\boldsymbol{\mathcal{E}}=\boldsymbol{\mathcal{E}}(\mathbf{r},t)$.

Since James Clerk Maxwell discovered the full set of mathematical laws describing electromagnetic fields, many mathematicians, physicists and engineers have proposed different frameworks for representing fields and waves equations\parencite{Lindell2004, Warnick2014}. For day-to-day work in electromagnetic engineering, Heaviside's vector representation is commonly used. Within this frame,  Maxwell equations can be stated as a set of local differential equations:
\begin{subequations}
 \begin{align}
  \boldsymbol{\nabla} \times \boldsymbol{\mathcal{E}} &= -\frac{\partial \boldsymbol{\mathcal{B}}}{\partial t} \label{eq:Maxwell-Faraday}\\
  \boldsymbol{\nabla} \times \boldsymbol{\mathcal{H}} &= \frac{\partial \boldsymbol{\mathcal{D}}}{\partial t} + \boldsymbol{\mathcal{J}} \label{eq:Maxwell-Ampere} \\
  \boldsymbol{\nabla} \cdot \boldsymbol{\mathcal{D}} &= q_v \label{eq:Maxwell-Gauss} \\
  \boldsymbol{\nabla} \cdot \boldsymbol{\mathcal{B}} &= 0 \label{eq:Maxwell-Gauss-Magnetism}
 \end{align}
 \label{eq:MaxwellEquations}
\end{subequations}

The Maxwell-Faraday's law \ref{eq:Maxwell-Faraday} relates the magnetic flux to the electric field, by describing how a changing magnetic flux induces an electric field.
The Maxwell-Ampere's law \ref{eq:Maxwell-Ampere} relates the current to the magnetic field. It states that magnetic field can be generated by a changing electric flux density and by electric current.
The Maxwell-Gauss law \ref{eq:Maxwell-Gauss} describes the relationship between an electric flux density and the electric charges that cause it.
The Maxwell-Gauss law for magnetism states that no magnetic charge exists as for electric charges.

The corresponding equations in integral form are:
\begin{subequations}
	\begin{align}
	\oint \boldsymbol{\mathcal{E}} \cdot \diff \mathbf{l}
	=&
		- \frac{\diff }{\diff t} \iint \boldsymbol{\mathcal{B}} \cdot \diff \mathbf{S}
		\\
		\oint \boldsymbol{\mathcal{B}} \cdot \diff \mathbf{l}
		=&
		\frac{\diff }{\diff t} \iint \boldsymbol{\mathcal{D}} \cdot \diff \mathbf{S}
		+ \iint \boldsymbol{\mathcal{J}} \cdot \diff \mathbf{S}
		\\
		\oiint \boldsymbol{\mathcal{B}} \cdot \diff \mathbf{S}
		=& \; 0
		\\
		\oiint \boldsymbol{\mathcal{D}} \cdot \diff \mathbf{S}
		=&
		\iiint q_v \diff v
	\end{align}
	\label{eq:MaxwellEquationsIntegral}
\end{subequations}

On can define the following \emph{circuit} quantities associated with each field quantities\parencite{Harrington2001}:
\begin{itemize}
	\item $v$, the \emph{voltage} in $V$
	\item $i$, the \emph{current} in $A$
	\item $q$, the \emph{electric charge} in $C$
	\item $\psi$, the \emph{magnetic flux} in $Wb$
	\item $\psi_e$, the \emph{electric flux} in $C$
	\item $u$, the \emph{magnetomotive force} in $A$
\end{itemize}
defined by:
\begin{subequations}
	\begin{align}
	v =& \int \boldsymbol{\mathcal{E}} \cdot \diff \mathbf{l} \\
	i =& \iint \boldsymbol{\mathcal{J}} \cdot \diff \mathbf{S} \\
	q =& \iiint q_v \diff v \\
	\psi =& \iint \boldsymbol{\mathcal{B}} \cdot \diff \mathbf{S} \\
	\psi_e=& \iint \boldsymbol{\mathcal{D}} \cdot \diff \mathbf{S} \\
	u =& \int \boldsymbol{\mathcal{H}} \cdot \diff \mathbf{l}
	\end{align}
	\label{eq:CircuitQuantities}
\end{subequations}

In order to be able to solve the  equations(\ref{eq:MaxwellEquations}), one needs to specify the relationships existing between electric, magnetic flux densities ($\mathcal{D}$,$\mathcal{B}$) and electric current density $\mathcal{J}$ with electric and magnetic intensities ($\mathcal{E},\mathcal{H}$)\footnote{
	I've chosen here is to treat both $\mathbf{E}$ and $\mathbf{H}$ as similar kinds of fields, different from $\mathbf{D}$ and $\mathbf{B}$, as for example it is done in \parencite{Pozar1998} or \parencite{Harrington2001}. This choice has symbolic advantages when dealing with RF networks with SI units, where the electric and magnetic field intensity can be associated to voltages and currents as they are measured (tbc).

	However, many (most?) authors have chosen instead to treat $\mathbf{E}$ and $\mathbf{B}$ as the \emph{fundamental} quantities and $\mathbf{D}$ and $\mathbf{H}$ as \textit{auxiliary} (or convenience) quantities denoting the average fields over macroscopic small regions\parencite{Lindell1995, Griffiths2005, Jackson1999}. Indeed, both $\mathbf{D}$ and $\mathbf{H}$ allow to write Gauss and Ampere laws in terms of the \emph{free} charges and currents alone, such "incorporating" \emph{bounds} charge and current contributions. Thus, in these macroscopic Maxwell equations, only the external charges and currents brought into the system from outside are considered, without taking care of the average charge and current distributions in the medium, which can be a convenient mathematical tool. This choice has sense, this one cannot turn off bounds contributions as he can for free contributions \parencite[sec.6.3]{Griffiths2005}. In such as case, one would have read instead $\mathbf{H}=\boldsymbol{\mu}^{-1} $. Finally, the magnetic flux density $\mathbf{B}$ can be derived as the character of an electric field in a co-moving frame\parencite{Schwinger1998}.

	The latter choice can also take origin from the interpretation that the electric and magnetic fields as a force acting on a test charge via the Lorentz force $q(\mathbf{E}+\mathbf{v}\times\mathbf{B})$, leading naturally to $(\mathbf{E}$,$\mathbf{B})$. However, if one uses an energy picture using differential forms, interpreting the electromagnetic field as the change of energy experienced by a test charge as it moves through the field, the couples $(\mathbf{E}$,$\mathbf{H})$ and $(\mathbf{D}$,$\mathbf{B})$ are represented by different mathematical objects\parencite{Warnick2014}.
	}
. These relations depend on the medium properties in which the field exists and are called \emph{constitutive relations}. Explicit forms of these relationships have been found from experimentation or deduced from atomic considerations \parencite[sec.5]{Schwinger1998} and are discussed in a later section.

% ###########################################################################
% ###########################################################################
% ###########################################################################
\subsection{Time Harmonic Electromagnetic Fields}
% ###########################################################################
% ###########################################################################
\subsubsection{Phasors}
In most of the cases in magnetic fusion plasma heating and current drive, Radio-Frequency source time excitation varies sinusoidally in time with a single frequency (or \emph{AC} for Alternative Current). Such case of time varying electromagnetic fields is referred as \emph{time harmonic} or \emph{monochromatic} fields. In this case, the mathematical analysis is simplified by using complex quantities. A scalar quantity $a$ can be defined as\footnote{The convention $ a \stackrel{\Delta}{=} \sqrt{2} |A| \sin (\omega t + \alpha) = \sqrt{2} \Im\left[A e^{j \omega t} \right]$ could also have been used.}:
\begin{eqnarray}
a(\mathbf{r},t)
&\stackrel{\Delta}{=}&
\sqrt{2} |A(\mathbf{r})| \cos (\omega t + \alpha) = \sqrt{2} \Re\left[A(\mathbf{r}) e^{j \omega t} \right]
\label{eq:phasor}
\end{eqnarray}
where $a=a(\mathbf{r}, t)$ is called the \emph{instantaneous quantity} and $A=|A|e^{j\alpha}$ is called the \emph{complex quantity} or \emph{phasor}. Note that the complex quantity $A$ does \emph{not} depend of the time but it may be a function of position, i.e. $A=A(\mathbf{r})$. We also have the inverse mapping:
\begin{equation}
A(\r) = \frac{1}{\sqrt{2}}\left( a(\r,0) - j a(\r, \pi/2\omega) \right)
\end{equation}

This definition, taken from \parencite{Harrington2001}, leads to few remarks. In electrical engineering, it is more practical to use time-averaged power (over any integer number of cycles) than instantaneous power since the voltages and currents are time-varying functions. The $\sqrt{2}$ factor, also known as the \emph{crest factor}, comes for the choice made for the magnitude $|A|$ of the complex quantity $A$ to be the \emph{effective} (or RMS, for Root-Mean-Square) value of the sinusoidally time varying quantity $a$\footnote{Can also be proved from the average of the product of two instantaneous complex quantities $a$ and $b$ as defined by (\ref{eq:phasor}) which is
	$$
	\frac{1}{T}  \int_0^T a(t) b(t)\diff t = \Re[AB^*] = \frac{1}{2}\left(AB^* + A^* B \right)
	$$
	Then, one deduces that
	$$
	\frac{1}{T}  \int_0^T \left[a(t)\right]^2 \diff t = \Re[AA^*] = |A|^2
	$$}:
\begin{subequations}
	\begin{align}
	a_{\mathrm{rms}}
	&= \sqrt{\frac{1}{T} \int_0^T \left[a(t) \right]^2 \diff t}  \nonumber \\
	&= \sqrt{\frac{1}{T} \int_0^T  \left[\sqrt{2} |A| \cos (\omega t + \alpha) \right]^2 \diff t} \nonumber \\
	&= \sqrt{\frac{|A|^2}{T} \int_0^T  \left[ 1+\cos (2\omega t + 2\alpha) \right] \diff t} \nonumber \\
	&= |A| \nonumber
	\end{align}
\end{subequations}
Dropping the factor $\sqrt{2}$ in (\ref{eq:phasor}) would lead to express $|A|$ as the peak value of $a$ instead\footnote{Which is the case for example in ANSYS HFSS (while the Poynting vector is a time-averaged quantity)}.

When calculating the complex power, one advantage of the previous definition is to get the same proportionally factors as for their instantaneous counterparts, i.e. $p=v i$ for the instantaneous power and $P=VI^*$ for the complex power. Otherwise, a factor $1/2$ would appear in the complex power if peak values would have been used for $|V|$ and $|I|$.

This definition can be extended to vectors quantities having sinusoidal time variation:
\begin{equation}
\boldsymbol{\mathcal{E}}(\mathbf{r},t)
=
\sqrt{2} \Re \left[ \mathbf{E}(\mathbf{r}) e^{j\omega t}\right]
\label{eq:definitionTimeHarmonicField}
\end{equation}
which means that each components of $\mathbf{E}$ are related to the components of $ \boldsymbol{\mathcal{E}}$ by the relation (\ref{eq:phasor}). For example, in a cartesian frame, the components of $\boldsymbol{\mathcal{E}}$ and $\mathbf{E}$ are related by:
\begin{eqnarray*}
	\mathcal{E}_x = \sqrt{2} \Re \left[ E_x e^{j\omega t}\right] = \sqrt{2} |E_x| \cos (\omega t + \phi_x) \\
	\mathcal{E}_y = \sqrt{2} \Re \left[ E_y e^{j\omega t}\right] = \sqrt{2} |E_y| \cos (\omega t + \phi_y) \\
	\mathcal{E}_z = \sqrt{2} \Re \left[ E_z e^{j\omega t}\right] = \sqrt{2} |E_z| \cos (\omega t + \phi_z)
\end{eqnarray*}
which leads to:
\begin{subequations}
	\begin{align}
	\mathcal{E}_{\mathrm{rms}}
	=& \sqrt{\frac{1}{T} \int_0^T  \left[ \boldsymbol{\mathcal{E}}(t) \right]^2 \diff t} \nonumber \\
	=& \sqrt{\frac{1}{T} \int_0^T  \left[ \boldsymbol{\mathcal{E}}(t) \cdot \boldsymbol{\mathcal{E}}(t) \right] \diff t} \nonumber \\
	=& \sqrt{\frac{1}{T} \int_0^T  \left[ \mathcal{E}_x^2 + \mathcal{E}_y^2 + \mathcal{E}_z^2  \right] \diff t} \nonumber \\
	=& \sqrt{|E_x|^2 + |E_y|^2 + |E_z|^2} \nonumber \\
	=& \sqrt{ \mathbf{E} \cdot \mathbf{E}^* } \nonumber \\
	=& \left| \mathbf{E} \right| \nonumber
	\end{align}
\end{subequations}

Note that the phases $\phi_x, \phi_y, \phi_z$ are not necessarily equal. This leads to an important remark on the evaluation of peak values of time-harmonic vector fields. For sinusoidally time varying \emph{scalar} complex quantity, the \emph{peak} value can be obtained from:
\begin{equation}
A_{\mathrm{peak}} = \sqrt{2} |A|
\end{equation}
However, this relation does not hold in general for vector fields, unless in the particular case of linearly polarized fields\footnote{Inversely, if we have defined (\ref{eq:phasor}) without the $\sqrt{2}$ factor, the rms value would not be in general derived from $1/\sqrt{2}$ the peak value.}. In the case of circularly polarized field for example, the peak value is constant in time and such is equal to the rms value\parencite{Faria2008}.

Finally, note that in electrical engineering, the time convention in (\ref{eq:phasor}) is usually $e^{j\omega t}$ while in physics $e^{-j\omega t}$ is preferred\parencite{Bradley2007, Michelsen2017}. This choice is motivated by the fact that most of the electromagnetic solver packages use the former convention, and so to avoid any confusion. Note however that most of the physics books on plasma waves adopt instead the later convention \parencite{Swanson2003, Stix1992, Brambilla1998}.

% ###########################################################################
% ###########################################################################
\subsubsection{Time Harmonic Maxwell Equations}
For time-harmonic fields, using phasor analysis leads to obtain single frequency steady state response. Using the mathematical properties of the real part operator $\Re$, Maxwell equations can be reformulated in terms of complex phasors (See sec.1-8 of \parencite{Harrington2001} for a complete derivation). Moreover, in this process, time-derivatives are expressed by a $j\omega$ multiplier.

Thus, the Maxwell equations (\ref{eq:Maxwell-Faraday}, \ref{eq:Maxwell-Ampere}, \ref{eq:Maxwell-Gauss} \ref{eq:Maxwell-Gauss-Magnetism}) become for time harmonic fields:
\begin{subequations}
	\begin{align}
	\boldsymbol{\nabla} \times \mathbf{H} (\mathbf{r}) &= j\omega\mathbf{D}(\mathbf{r}) + \mathbf{J}(\mathbf{r})  \label{eq:Maxwell-Faraday-Harmonic} \\
	\boldsymbol{\nabla} \times \mathbf{E} (\mathbf{r}) &= -j\omega\mathbf{B}(\mathbf{r}) \label{eq:Maxwell-Ampere-Harmonic} \\
	\boldsymbol{\nabla} \cdot \mathbf{D} (\mathbf{r}) &= q_v(\mathbf{r}) \label{eq:Maxwell-Gauss-Harmonic} \\
	\boldsymbol{\nabla} \cdot \mathbf{B} (\mathbf{r}) &= 0 \label{eq:Maxwell-Gauss-Magnetism-Harmonic}
	\end{align}
	\label{eq:MaxwellEquationsTimeHarmonic}
\end{subequations}

% #######################################
\subsubsection{Finite bandwidth solutions}
Let us generalize to field solutions of finite bandwidth, which are a continuous distribution of frequencies $\omega$. Similarly to our definition  (\ref{eq:definitionTimeHarmonicField}), we express the field by a summation of time-harmonic solutions over all frequencies:
\begin{equation}
\boldsymbol{\mathcal{E}}(\mathbf{r}, t)
=
\int
\Re \left[
\boldsymbol{\mathcal{E}}(\mathbf{r}, \omega)
e^{j\omega t}
\right]
\diff \omega
\end{equation}
The real part operator can be put outside the integral:
\begin{equation}
\boldsymbol{\mathcal{E}}(\mathbf{r}, t)
=
\Re \left[
\int
\boldsymbol{\mathcal{E}}(\mathbf{r}, \omega)
e^{j\omega t}
\diff \omega
\right]
\end{equation}
which then can be seen as a time-domain Fourier transforms, defined such as as:
\begin{subequations}
	\begin{align}
		f(t) =& \int_{-\infty}^{+\infty} f(\omega) e^{j\omega t} \diff \omega \\
	f(\omega) =& \frac{1}{2\pi}\int_{-\infty}^{+\infty} f(t) e^{-j\omega t} \diff t
	\end{align}
	\label{eq:FourierTransformTime}
\end{subequations}
If $f(t)$ is a real function, then a property of the Fourier transform for $f(\omega)$ is\footnote{More of Fourier transform in \parencite[sec.1.3]{Clemmow1996} and \parencite[chap.4]{Harrington2001}.}:
\begin{equation}
f(-\omega) = f^*(\omega)
\label{eq:FourierPropertyRealFunction}
\end{equation}

If we require the property  (\ref{eq:FourierPropertyRealFunction}) to $\boldsymbol{\mathcal{E}}(\omega)$, i.e. $
\boldsymbol{\mathcal{E}}(\mathbf{r}, -\omega)
\overset{\Delta}{=}
\boldsymbol{\mathcal{E}}^*(\mathbf{r}, -\omega)
$
then we can eliminate the real part operator $\Re$:
\begin{equation}
\boldsymbol{\mathcal{E}}(\mathbf{r}, t)
=
\int
\boldsymbol{\mathcal{E}}(\mathbf{r}, \omega)
e^{j\omega t}
\diff \omega
\label{eq:FourierTimeHarmonicDef}
\end{equation}
so $\boldsymbol{\mathcal{E}}(\mathbf{r}, t)$ forms a Fourier transform pair with $\boldsymbol{\mathcal{E}}(\mathbf{r}, \omega)$,  defined by:
\begin{equation}
	\boldsymbol{\mathcal{E}}(\mathbf{r}, \omega) = \frac{1}{2\pi}\int_{-\infty}^{+\infty}
	\boldsymbol{\mathcal{E}}(\mathbf{r}, t)
	 e^{-j\omega t} \diff t
	 \label{eq:TimeFourierTransformE}
\end{equation}

After introducing the Fourier transform to Maxwell equations (\ref{eq:MaxwellEquations}), one obtains the time-spectral representation of Maxwell equations:
\begin{subequations}
	\begin{align}
	\boldsymbol{\nabla} \times \boldsymbol{\mathcal{H}} (\mathbf{r}, \omega) &= j\omega\boldsymbol{\mathcal{D}} (\mathbf{r}, \omega) + \boldsymbol{\mathcal{J}} (\mathbf{r}, \omega)   \\
	\boldsymbol{\nabla} \times \boldsymbol{\mathcal{E}} (\mathbf{r}, \omega) &= -j\omega\boldsymbol{\mathcal{B}} (\mathbf{r}, \omega)  \\
	\boldsymbol{\nabla} \cdot \boldsymbol{\mathcal{D}} (\mathbf{r}, \omega) &= q_v(\mathbf{r}, \omega)  \\
	\boldsymbol{\nabla} \cdot \boldsymbol{\mathcal{B}} (\mathbf{r}, \omega) &= 0
	\end{align}
	\label{eq:MaxwellEquationTimeSpectral}
\end{subequations}
which have the same form than (\ref{eq:MaxwellEquationsTimeHarmonic}), but with different quantities since they do not have different units\parencite[sec.1.7.5]{Smith1997}. For example, the electric field (phasor) in (\ref{eq:Maxwell-Ampere-Harmonic}) was in $V/m$, while here it is in $V/m/Hz$ that is intensity per unit frequency.

We can recover (\ref{eq:MaxwellEquationsTimeHarmonic}) in the case of time-harmonic field, i.e if $\boldsymbol{\mathcal{E}}(\mathbf{r}, t) = \mathbf{E}(\mathbf{r})\cos\omega_0 t=\Re[\mathbf{E}(\mathbf{r})e^{j\omega_0 t}]$, where (\ref{eq:TimeFourierTransformE}) becomes\footnote{We have dropped the $\sqrt{2}$ for convenience but without loss of generality.}:
\begin{eqnarray}
\boldsymbol{\mathcal{E}}(\mathbf{r},\omega)
	&=&
	\frac{1}{2\pi}\int_{-\infty}^{+\infty} \diff t \;
	\Re[\mathbf{E}(\mathbf{r})e^{j\omega_0 t}]
	e^{-j\omega t}
	\nonumber
	\\
	&=&
	\frac{1}{4\pi}\int_{-\infty}^{+\infty} \diff t \;
	\mathbf{E}(\mathbf{r}) e^{-j(\omega-\omega_0 ) t}
	+
	\mathbf{E}^*(\mathbf{r}) e^{-(\omega+\omega_0 ) t}
	\nonumber
	\\
	&=&
	\frac{1}{4\pi} \left[
	\mathbf{E}(\mathbf{r}) \delta(\omega - \omega_0)
	+
	\mathbf{E}^*(\mathbf{r}) \delta(\omega + \omega_0)
	\right]
	\nonumber
\end{eqnarray}
where we have the Dirac distribution definition:
\begin{eqnarray}
\delta(x - x_0)
= \frac{1}{2\pi}
\int
e^{j (x-x_0) u} \diff u
\label{eq:DiracDefinition}
\end{eqnarray}
Moreover, using the property (\ref{eq:FourierPropertyRealFunction}) and the fact that the Dirac distribution is even, we have finally:
\begin{eqnarray}
\boldsymbol{\mathcal{E}}(\mathbf{r},\omega)
&=&
\frac{1}{4\pi}\int_{-\infty}^{+\infty} \diff t \;
\mathbf{E}(\mathbf{r}) e^{-j(\omega-\omega_0 ) t}
+
\frac{1}{4\pi}\int_{-\infty}^{+\infty} \diff t
\mathbf{E}(-\mathbf{r}) e^{-j(\omega+\omega_0 ) t}
\nonumber
\\
&=&
\frac{1}{4\pi}\int_{-\infty}^{+\infty} \diff t \;
\mathbf{E}(\mathbf{r}) e^{-j(\omega-\omega_0 ) t}
+
\frac{1}{4\pi}\int_{-\infty}^{+\infty} \diff t
\mathbf{E}(\mathbf{r}) e^{+j(\omega+\omega_0 ) t}
\nonumber
\\
&=&
\frac{1}{2\pi}
\mathbf{E}(\mathbf{r}) \delta(\omega - \omega_0)
\end{eqnarray}
Doing the same for other fields and plugging into (\ref{eq:MaxwellEquationTimeSpectral}) leads to recover (\ref{eq:MaxwellEquationsTimeHarmonic}) if sources and materials do not depend of the frequency (no time dispersion).

% #######################################
\subsubsection{$k-\omega$ Fields Representation}\label{sec:spectralRepresentation}
Let us generalise to the case where the field solution is represented by the summation of many plane (or evanescent) waves characterized by their wavevector $\mathbf{k}=(k_x, k_y, k_z)$. We construct a solution on the form:
\begin{subequations}
	\begin{align}
	\boldsymbol{\mathcal{A}}(\mathbf{r}, t) =& \Re \left[
	\int \diff \omega \int \diff \mathbf{k} \;
	\mathbf{\boldsymbol{\mathcal{A}}}(\mathbf{k}, \omega) e^{j(\omega t - \mathbf{k}\cdot\mathbf{r})}
	\right]
	\end{align}
	\label{eq:k-spectralDefinition}
\end{subequations}
Since $\boldsymbol{\mathcal{A}}(\mathbf{r}, t)$ is a real function, one can drop the real part operator (cf previously. Still valid with causality?) which leads to the appearance of a four dimensional Fourier transform which pair is defined by:
 \begin{subequations}
 	\begin{align}
 	\boldsymbol{\mathcal{A}}(\mathbf{k}, \omega) =&
 	\frac{1}{(2\pi)^4}
 	\int \diff t \int \diff \mathbf{r} \;
 	\mathbf{\boldsymbol{\mathcal{A}}}(\mathbf{r}, t) e^{-j(\omega t - \mathbf{k}\cdot\mathbf{r})}
 	\end{align}
 \end{subequations}

Using (\ref{eq:k-spectralDefinition}), the divergence and curl operators get simpler expressions in the $k-\omega$ domain\footnote{Note that the derivation requires an additional condition on the solution, which is to be 0 at infinity. Indeed, an integration per part is used during the evaluation of the nabla operator.} :
\begin{eqnarray}
\boldsymbol{\nabla} \cdot\boldsymbol{\mathcal{A}}(\mathbf{r}, t)
&\leftrightarrow&
 -j\mathbf{k}\cdot \boldsymbol{\mathcal{A}} (\mathbf{k}, \omega)
\\
\boldsymbol{\nabla} \times \boldsymbol{\mathcal{A}} (\mathbf{r}, t)
&\leftrightarrow&
-j\mathbf{k}\times \boldsymbol{\mathcal{A}} (\mathbf{k}, \omega)
\\
\frac{\partial}{\partial t} \boldsymbol{\mathcal{A}} (\mathbf{r}, t)
&\leftrightarrow&
j \omega \boldsymbol{\mathcal{A}} (\mathbf{k}, \omega)
\end{eqnarray}
Plugging such a solution into the Maxwell equations (\ref{eq:MaxwellEquations}) leads to algebraic equations:
\begin{subequations}
	\begin{align}
	\mathbf{k} \times \boldsymbol{\mathcal{E}} (\mathbf{k}, \omega)
		=&
		\omega \boldsymbol{\mathcal{B}} (\mathbf{k}, \omega)
	\\
	\mathbf{k} \times \boldsymbol{\mathcal{H}} (\mathbf{k}, \omega)
	=&
	-\omega \boldsymbol{\mathcal{D}} (\mathbf{k}, \omega)
	+
	j\boldsymbol{\mathcal{J}} (\mathbf{k}, \omega)
	\\
	\mathbf{k}  \cdot \boldsymbol{\mathcal{D}} (\mathbf{k}, \omega)
		=& jq_v(\mathbf{k}, \omega)
	\\
	\mathbf{k}  \cdot \boldsymbol{\mathcal{B}} (\mathbf{k}, \omega)
		=& 0
	\end{align}
	\label{eq:k-omegaMaxwellEquations}
\end{subequations}
Not only the equations are simpler to solve, but we will see in the section devoted to the constitutive relations that in some case, medium properties are also simpler in this domain.

In the case of single plane-wave solution, such as:
\begin{equation}
\boldsymbol{\mathcal{E}}(\mathbf{r},t)
=
\Re\left[
\mathbf{E}_0
 e^{j(\omega_0 t - \mathbf{k}_0\cdot\mathbf{r})}
\right]
\end{equation}
then we obtain:
\begin{equation}
	\boldsymbol{\mathcal{E}}(\mathbf{k},\omega)
	=
	 	\frac{1}{(2\pi)^4}
	 	\mathbf{E}_0
	 	\delta(\omega - \omega_0) \delta(\mathbf{k} - \mathbf{k}_0)
\end{equation}
and the Maxwell equations (\ref{eq:MaxwellEquations}) become:
\begin{subequations}
	\begin{align}
	\mathbf{k} \times\mathbf{E}_0
	=&
	\omega \mathbf{B}_0
	\\
%	\mathbf{k} \times \mathbf{H}
%	=&
%	-\omega \mathbf{D}
%	+
%	j\mathbf{J}
%	\\
%	\mathbf{k}  \cdot \mathbf{D}
%	=& jq_v(\mathbf{k}, \omega)
%	\\
	\mathbf{k} \cdot \mathbf{B}
	=& 0
	\end{align}
	\label{eq:k-omegaMaxwellEquationsPhasor}
\end{subequations}
where $\mathbf{B}_0 = (\mathbf{k}\times\mathbf{E}_0)/\omega$. Without any other information on the constitutive relations, we stop here in the derivation.

% ###########################################################################
% ###########################################################################
\subsection{The Constitutive Relations}
Fluxes densities ($\mathcal{D}$,$\mathcal{B}$) differ from field intensities ($\mathcal{E},\mathcal{H}$) inside the material  with regards to relative magnitude and direction. Flux densities can be interpreted  as a response of the medium to an applied excitation\footnote{If we recall the Gauss law $	Q = \oint \boldsymbol{\mathcal{D}} \cdot \diff S$, the flux $\boldsymbol{\mathcal{D}}$ depends on the charge inside the closed surface and doesn't depend on the material itself, but the field intensity does. 	}
. Such, the constitutive relationships can be written generally as:
\begin{subequations}
	\begin{align}
		\boldsymbol{\mathcal{D}} =& \boldsymbol{\mathcal{D}}(\boldsymbol{\mathcal{E}},\boldsymbol{\mathcal{H}}) \\
		\boldsymbol{\mathcal{B}} =& \boldsymbol{\mathcal{B}}(\boldsymbol{\mathcal{E}},\boldsymbol{\mathcal{H}}) \\
		\boldsymbol{\mathcal{J}} =& \boldsymbol{\mathcal{J}}(\boldsymbol{\mathcal{E}},\boldsymbol{\mathcal{H}})
	\end{align}
\end{subequations}
All of these relations hold only if the time rate of change of the electromagnetic field is small enough. Otherwise, one needs to extend the definition of linearity using linear differential relations\parencite{Harrington2001, Jackson1998}:
\begin{subequations}
	\begin{align}
	\boldsymbol{\mathcal{D}} &= \varepsilon \boldsymbol{\mathcal{E}} + \varepsilon_1 \frac{\partial \boldsymbol{\mathcal{E}}}{\partial t} + \varepsilon_2 \frac{\partial^2 \boldsymbol{\mathcal{E}}}{\partial t^2} + \ldots \\
	\boldsymbol{\mathcal{B}} &= \varepsilon \boldsymbol{\mathcal{H}} + \varepsilon_1 \frac{\partial \boldsymbol{\mathcal{H}}}{\partial t} + \varepsilon_2 \frac{\partial^2 \boldsymbol{\mathcal{H}}}{\partial t^2} + \ldots
	\end{align}
\end{subequations}
Such situation arises typically when high intensity RF fields are used, which leads to non-linear phenomenons such \emph{ponderomotive effect}\parencite{Krapchev1979}.

%% ###########################################################################
%\subsubsection{General linear medium}
%\begin{subequations}
%	\begin{align}
%	\mathbf{D} =& \boldsymbol{\varepsilon}\mathbf{E} + \mathbf{P} \\
%	\mathbf{B} =& \boldsymbol{\mu}\left( \mathbf{H} + \mathbf{M} \right)
%	\end{align}
%\end{subequations}
%where:
%\begin{itemize}
%	\item $\mathbf{P}$ is the electric polarization of the medium, caused by displacement of bounds charges, measured in $C/m^2$.
%	\item $\mathbf{M}$ is the magnetisation of the medium (or magnetic polarization), which corresponds to the distribution of magnetic moments per unit volume, measured in $A/m$\footnote{Note that $\mathbf{M}$ is included in the parenthesis, while $\mathbf{P}$ is not, for a matter of historical definition. This of course affects the units of these quantities. }.
%\end{itemize}

% ###########################################################################
\subsubsection{Vacuum}
In vacuum or in any other medium having similar characteristics than vacuum (such as air), the constitutive relationships have their most simpler form:
\begin{subequations}
 \begin{align}
  \boldsymbol{\mathcal{D}} &= \varepsilon_0 \boldsymbol{\mathcal{E}} \\
  \boldsymbol{\mathcal{B}} &= \mu_0 \boldsymbol{\mathcal{H}} \\
  \boldsymbol{\mathcal{J}} &= 0
 \end{align}
\end{subequations}
where $\varepsilon_0$ is the vacuum \emph{permittivity} and $\mu_0$ the vacuum \emph{permeability}.

% ###########################################################################
\subsubsection{Isotropic linear mediums}
In a standard isotropic linear mediums, the constitutive relationships becomes linear relationships:
\begin{subequations}
 \begin{align}
  \boldsymbol{\mathcal{D}} &= \varepsilon \boldsymbol{\mathcal{E}} \\
  \boldsymbol{\mathcal{B}} &= \mu \boldsymbol{\mathcal{H}} \\
  \boldsymbol{\mathcal{J}} &= \sigma \boldsymbol{\mathcal{E}}
 \end{align}
\end{subequations}
where $\varepsilon$ and $\mu$ are the medium permittivity and permeability respectively. The parameter $\sigma$ is called the \emph{conductivity} of the medium. Note that these relationships generally do not hold when the field intensities are very large or in time varying medium.

Simple matter medium can be classified according its values of $\varepsilon, \mu$ and $\sigma$. Materials with high conductivity value $\sigma$ are called \emph{conductors} while those having a small value are referred as \emph{dielectrics} or \emph{insulators}. In electromagnetic models, good conductors are often approximated to \emph{perfect conductors}, characterized by the limit $\sigma\to\infty$. On the other hand, \emph{perfect dielectrics} assume $\sigma=0$.

The medium permittivity $\varepsilon$ can never be less than the vacuum permittivity $\varepsilon_0$. The \emph{relative permittivity} is defined such as $\varepsilon_r=\varepsilon/\varepsilon_0$. The permittivity of a conductor is hard to measure but appears to be unity\parencite{Harrington2001}. A similar definition holds for the \emph{relative permeability} $\mu_r=\mu/\mu_0$. For almost all materials except \emph{ferromagnetic} materials, one has $\mu=\mu_0$.

% ###########################################################################
\subsubsection{Anisotropic mediums}
If the response of the medium is different depending on the direction of the oscillating field, then the medium is called \emph{anisotropic}. In this case, his response is expressed by tensor relationships.   In anisotropic linear mediums, the constitutive relationships becomes tensor-relationships:
\begin{subequations}
 \begin{align}
  \boldsymbol{\mathcal{D}} &= \boldsymbol{\varepsilon} \cdot \boldsymbol{\mathcal{E}}
  \label{eq:disp_relation_anisotropic_stationnary_D} \\
  \boldsymbol{\mathcal{B}} &= \boldsymbol{\mu} \cdot  \boldsymbol{\mathcal{H}}
  \label{eq:disp_relation_anisotropic_stationnary_B}\\
  \boldsymbol{\mathcal{J}} &= \boldsymbol{\sigma} \cdot  \boldsymbol{\mathcal{E}}
  \label{eq:disp_relation_anisotropic_stationnary_J}
 \end{align}
\end{subequations}
where $\boldsymbol{\varepsilon}$, $\boldsymbol{\mu}$ and $\boldsymbol{\sigma}$ are the dielectric tensor, the permeability tensor and the conductivity tensor respectively, which can be interpreted as 3x3 matrices\parencite{Swanson2003}.

% ###########################################################################
\subsubsection{Nonlocal medium}
If a medium exhibits a time or space dependence to an electromagnetic excitation, it is said to be \emph{nonlocal} or \emph{dispersive}, with respect to time and space respectively. In a time and is called \emph{time dispersive} medium, explicit time dependence arises as a time delay between the imposition of the electric field and the resulting polarization of the medium. This delay is due to the inertia of charged particles to respond to the time-varying field\parencite{Mackay2010, Brambilla1998}. In a \emph{space-dispersive} medium, the response at the location $\mathbf{r}$ and time $t$ can not only depends on the field at location $\mathbf{r}$ and time $t$, but of the field in its vicinity $\mathbf{r}'$ and by all previous instant $t'$. Spatial non-locality can be significant when the wavelength is comparable to some characteristic length–scale in the medium.  In plasma, the thermal agitation of the species induces add an additional erratic motion to the particles trajectory. Thus, the particles are influenced by the field in the domain explored by their motion\parencite{Brambilla1998}. This space dispersion can be omitted in the limit at which the temperature effects can be neglected.

Thus, the constitutive relations of a general non-local anisotropic linear medium should be stated as:
\begin{subequations}
	\begin{align}
	\boldsymbol{\mathcal{D}}(\mathbf{r}, t)
	= &
	\int_{t'=-\infty}^t \diff t'
	\int \diff \mathbf{r}' \;
	\boldsymbol{\varepsilon}(\mathbf{r},\mathbf{r}', t,t') \cdot \boldsymbol{\mathcal{E}}(\mathbf{r}', t')
	\\
	\boldsymbol{\mathcal{B}}(\mathbf{r}, t)
	=&
	\int_{t'=-\infty}^t \diff t'
	\int \diff \mathbf{r}' \;
	\boldsymbol{\mu}(\mathbf{r},\mathbf{r}', t,t') \cdot \boldsymbol{\mathcal{H}}(\mathbf{r}', t')
	\\
	\boldsymbol{\mathcal{J}}(\mathbf{r}, t)
	=&
	\int_{t'=-\infty}^t \diff t'
	\int \diff \mathbf{r}' \;
	\boldsymbol{\sigma}(\mathbf{r},\mathbf{r}', t,t') \cdot \boldsymbol{\mathcal{E}}(\mathbf{r}', t')
	\end{align}
\end{subequations}
The restriction of time integration to times $t'<t$ is the expression of the causality, which impose that the quantities at $t$ can only be influenced by the quantities are previous instants.

If invariance with respect to the choice of origin in space (i.e. homogeneous) and time (i.e. stationary) can be asserted, the quantities only depend on the difference of time-space coordinates, that is verify $\mathbf{u}(\r,\r',t,t')=\mathbf{u}(\r-\r', t-t')$. This means that the quantity only depend on the the distance (time elapsed) between the excitation location (time) $(\r', t')$ and the response location (time) $(\r,t)$)\parencite{Dumont2017}. The previous relation can then be expressed in terms of convolutions in the form of\parencite[p.19]{Brambilla1998}:
\begin{subequations}
	\begin{align}
	\boldsymbol{\mathcal{D}}(\mathbf{r}, t)
	= &
	\int_{t'=-\infty}^t \diff t'
	\int \diff \mathbf{r}' \;
	\boldsymbol{\varepsilon}(\mathbf{r}-\mathbf{r}', t-t') \cdot \boldsymbol{\mathcal{E}}(\mathbf{r}', t')
	\\
	\boldsymbol{\mathcal{B}}(\mathbf{r}, t)
	=&
	\int_{t'=-\infty}^t \diff t'
	\int \diff \mathbf{r}' \;
	\boldsymbol{\mu}(\mathbf{r}-\mathbf{r}', t-t') \cdot \boldsymbol{\mathcal{H}}(\mathbf{r}', t')
	\\
	\boldsymbol{\mathcal{J}}(\mathbf{r}, t)
	=&
	\int_{t'=-\infty}^t \diff t'
	\int \diff \mathbf{r}' \;
	\boldsymbol{\sigma}(\mathbf{r}-\mathbf{r}', t-t') \cdot \boldsymbol{\mathcal{E}}(\mathbf{r}', t')
	\end{align}
	\label{eq:disp_relation_dispersive_homogeneous}
\end{subequations}

If one considers that the fields and current can be represented by a continuous spectrum of time-harmonic plane-waves such as done in section \ref{sec:spectralRepresentation}, which has the appearance of a four-dimensional Fourier transform \parencite{Clemmow1996}, i.e.:
\begin{subequations}
	\begin{align}
	\boldsymbol{\mathcal{E}}(\mathbf{r}, t) =& \Re \left[
	 \int \diff \omega \int \diff \mathbf{k} \;
	\boldsymbol{\mathcal{E}}(\mathbf{k}, \omega) e^{j(\omega t - \mathbf{k}\cdot\mathbf{r})}
	\right]
	\\
	\boldsymbol{\mathcal{H}}(\mathbf{r}, t) =& \Re \left[
	 \int \diff \omega \int \diff \mathbf{k} \;
	\boldsymbol{\mathcal{H}}(\mathbf{k}, \omega) e^{j(\omega t - \mathbf{k}\cdot\mathbf{r})}
	\right]
	\\
	\boldsymbol{\mathcal{J}}(\mathbf{r}, t) =& \Re \left[ \int \diff \omega \int \diff \mathbf{k} \;
	\boldsymbol{\mathcal{J}}(\mathbf{k}, \omega) e^{j(\omega t - \mathbf{k}\cdot\mathbf{r})} \right]
	\end{align}
\end{subequations}
In such as case, replacing the fields with the latter definition leads in the $k-\omega$ domain, to simpler algebraic time-invariant relationships thanks to the convolution theorem:
\begin{subequations}
	\begin{align}
	\boldsymbol{\mathcal{D}}(\mathbf{k}, \omega)
	=&
	\boldsymbol{\varepsilon}(\mathbf{k}, \omega) \cdot \boldsymbol{\mathcal{E}}(\mathbf{k}, \omega)
	\label{eq:disp_relation_kw_D}
	\\
	\boldsymbol{\mathcal{B}}(\mathbf{k}, \omega)
	=&
	\boldsymbol{\mu}(\mathbf{k}, \omega) \cdot \boldsymbol{\mathcal{H}}(\mathbf{k}, \omega)
	\label{eq:disp_relation_kw_B}
	\\
	\boldsymbol{\mathcal{J}}(\mathbf{k}, \omega)
	=&
	\boldsymbol{\sigma}(\mathbf{k}, \omega) \cdot \boldsymbol{\mathcal{E}}(\mathbf{k}, \omega)
	\label{eq:disp_relation_kw_J}
	\end{align}
	\label{eq:k-omegaDispersionRelation}
\end{subequations}
where the tensors have been defined by:
\begin{subequations}
	\begin{align}
	\boldsymbol{\sigma}(\mathbf{k}, \omega)
	=
	\frac{1}{(2\pi)^4}
	\int_0^\infty \diff t \int \diff \mathbf{r} \;
	\boldsymbol{\sigma}(\mathbf{r}, t) 	e^{-j(\omega t - \mathbf{k}\cdot\mathbf{r})}
	\end{align}
\end{subequations}

\subsubsection{Energy density and power flow}
\parencite[p.78]{Felsen1994}

From the source free ($\boldsymbol{\mathcal{J}}=\boldsymbol{0}$) equations \ref{eq:Maxwell-Faraday} and \ref{eq:Maxwell-Ampere}, Taking the dot product of \ref{eq:Maxwell-Faraday} and \ref{eq:Maxwell-Ampere} with $\boldsymbol{\mathcal{H}}$  and $\boldsymbol{\mathcal{E}}$ respectively, and using the following vector calculus identity:
$$
\boldsymbol{\nabla}\cdot (\mathbf{A} \times \mathbf{B})
=
(\boldsymbol{\nabla} \times \mathbf{A})\cdot\mathbf{B} - \mathbf{A}\cdot (\boldsymbol{\nabla}\times \mathbf{B})
$$
one derives the following relation:
\begin{equation}
\boldsymbol{\nabla}\cdot(\boldsymbol{\mathcal{E}}\times\boldsymbol{\mathcal{H}})
=
- \left(
\boldsymbol{\mathcal{E}}\cdot\frac{\partial \boldsymbol{\mathcal{D}}}{\partial t}
+
\boldsymbol{\mathcal{H}}\cdot\frac{\partial \boldsymbol{\mathcal{B}}}{\partial t}
\right)
\label{eq:poynting_theorem_without_source}
\end{equation}
where $\boldsymbol{\mathcal{S}}=\boldsymbol{\mathcal{E}}\times\boldsymbol{\mathcal{H}}$ is the instantaneous density of electromagnetic power flow at $(\mathbf{r},t)$, known as the Poynting vector. Per definition of a power flow, the right hand side should correspond to the time derivative of an instantaneous energy density $\mathcal{W}$. However, this is difficult to identify in the present form since as seen in the previous section, for a generic time dispersive medium, the constitute relationships are quite tedious. However, if one drops the time-dependent fields by considering the fields as time-harmonic wave:
$$
\calE(\r,t) = \sqrt{2} \Re\left[\E(\r) e^{j\omega t}\right]
\;\;\;\;\;\;
\calH(\r,t) = \sqrt{2} \Re\left[\H(\r) e^{j\omega t}\right]
$$
then:
\begin{eqnarray}
\frac{\partial \calD}{\partial t}
&=&
j\omega \sqrt{2} \Re\left[\eps \cdot \E(\r)\right]
\\
\frac{\partial \calB}{\partial t}
&=&
j\omega \sqrt{2} \Re\left[\mut \cdot \H(\r)\right]
\end{eqnarray}

Recalling that the time-average of the product of two harmonic quantities $\mathcal{A}=\sqrt{2}\Re[Ae^{j\omega t}]$ and $\mathcal{B}=\sqrt{2}\Re[Be^{j\omega t}]$, with $T=2\pi/\omega$, is:
\begin{equation}
\left< \mathcal{A} \mathcal{B}\right>
=
\frac{1}{T} \int_0^T \mathcal{A} \mathcal{B} \, \diff t
= \Re[AB^*] = \frac{1}{2}\left(AB^* + A^* B \right)
\end{equation}
then the time-average of \ref{eq:poynting_theorem_without_source} is:
\begin{eqnarray*}
\del\cdot \Re \left[ \E \times \H^*  \right]
&=&
j \omega \left[
-\E\cdot\eps^* \cdot \E^* + \E^*\cdot\eps \cdot \E
-\H\cdot\mut^* \cdot \H^* + \H^*\cdot\mut \cdot \H
\right]
\\
&=&
j \omega \left[
\E^*\cdot\left(\eps - \eps^H\right) \cdot \E +
\H^*\cdot\left(\mut - \mut^H\right) \cdot \H
\right]
\end{eqnarray*}
where $\mathbf{M}^H$ is the complex conjugate transpose of $\mathbf{M}$, also known as the \emph{Hermitian} transpose\footnote{This last relationship can be demonstrated from the following:
$$
\E\cdot\eps^*\E^* = \sum_j E_j \sum_{k} \varepsilon^{*}_{jk} E_k^* = \sum_j E_j^* \sum_{k} \varepsilon^{*}_{kj} E_k=\E^*\cdot\eps^H\E
$$ since $\sum_{k} \varepsilon^{*}_{kj} E_k=\eps^H E$ per definition of $\eps^H$.}. From the latter relation, if the permittivity and permeability tensors are Hermitian, that is if they verify $\eps=\eps^H$ and $\mut=\mut^H$, then the instantaneous density of electromagnetic power flow is zero. Thus, if the medium has Hermitian permittivity and permeability, the medium is lossless.

Although the latter property seems anecdotal, the fact that these tensors be Hermitian leads to many interesting consequences of time-invariant lossless media, since the following properties can be demonstrated:
\begin{itemize}
 \item The diagonal elements are necessarily real, because they have to be equal to their complex conjugate.
 \item Because of conjugation, for complex valued entries the off-diagonal elements cannot be symmetric (or same). \item Moreover, a matrix that has only real entries is Hermitian if and only if it is a symmetric matrix, i.e., if it is symmetric with respect to the main diagonal.
 \item Hermitian matrix can be diagonalized by a unitary matrix, and that the resulting diagonal matrix has only real entries. This implies that all eigenvalues of a Hermitian matrix A with dimension n are real, and that A has n linearly independent eigenvectors (ie. orthogonal) and its determinant is real.
\end{itemize}

\subsubsection{Can a lossless dielectric exist? The Kramers-Kronig relationships}
A dielectric is a material that can be polarized by an applied electric field. This polarization involves the partial separation of electric charges within the material, a process which requires energy. So, polarizing a dielectric means storing energy in it. In a lossy dielectric, this energy is absorbed and for example converted into heat. In a lossless dielectric, one could theoretically get back the energy put into it.

The frequency dependence of dispersive dielectrics comes from the fact that the polarization response of the material to the time-varying electric field cannot be instantaneous. Like in signal processing, such dynamic response can be described by a convolutional relationship such like \ref{eq:disp_relation_dispersive_homogeneous}:
\begin{equation}
 \label{eq:convolution_D1}
 \calD(\r,t)
  = \int_{-\infty}^t \eps(t-t')\E(\r,t') \, \diff t'
  = \varepsilon_0 \int_{-\infty}^t \eps_r(t-t')\E(\r,t') \, \diff t'
\end{equation}
Equation (\ref{eq:convolution_D1}) means that the value of $\calD(\r,t)$ at the present time $t$ only depends on the past values of $\E(\r,t')$, with $t'\leq t$. This equation can be equivalently expressed as a standard convolution by extending the integration range to all times if the dielectric response is a causal function, that is if $\eps_r(t)=0$ for $t<0$:
\begin{equation}
 \label{eq:convolution_D}
 \calD(\r,t)
  = \varepsilon_0 \int_{-\infty}^{+\infty} \eps_r(t-t')\E(\r,t') \, \diff t'
\end{equation}
The causality condition can be expressed in terms of the unit step function $u(t)$:
\begin{equation}
 \eps_r(t) = \eps_r(t) u(t)
\end{equation}
where $u(t) = 1$ if $t \geq  0$. The Fourier transform of a product of two functions being a convolution of their Fourier transforms, we have:
\begin{equation}
  \label{eq:convolution_frequency_epsr}
 \eps_r(\omega)
 =
 \frac{1}{2\pi} \int_{-\infty}^{+\infty}
  \eps_r(\omega') U(\omega - \omega') \, \diff \omega'
\end{equation}
where $U(\omega)$ is the Fourier transform of the unit step function $u(t)$:
\begin{equation}
 U(\omega) = \lim_{e\to 0^+} \frac{1}{j\omega + e} = \mathcal{P}\frac{1}{j\omega} + \pi \delta(\omega)
\end{equation}
where the symbol $\mathcal{P}$ denotes the Cauchy principal value. Inserting the latter in \ref{eq:convolution_frequency_epsr}:
\begin{eqnarray}
 \eps_r(\omega)
 &=&
 \frac{1}{2\pi} \int_{-\infty}^{+\infty}
  \eps_r(\omega')
  \left[
    \mathcal{P}\frac{1}{j(\omega-\omega')} + \pi \delta(\omega - \omega')
  \right]
  \, \diff \omega'
\\
&=&
 \frac{1}{2\pi j}
 \mathcal{P}
 \int_{-\infty}^{+\infty}
    \frac{\eps_r(\omega')}{\omega-\omega'}
  \, \diff \omega'
  + \frac{1}{2} \eps_r(\omega)
\end{eqnarray}
Rearranging the terms leads to:
\begin{eqnarray}
  \label{eq:Kramers-Kronig-complex}
 \eps_r(\omega)
 &=&
 \frac{1}{\pi j}
 \mathcal{P}
 \int_{-\infty}^{+\infty}
    \frac{\eps_r(\omega')}{\omega-\omega'}
  \, \diff \omega'
\end{eqnarray}
which is the complex-valued formulation of the Kramers-Kronig relation. Setting $\eps_r = \eps_r' + j \eps_r''$ and separating \ref{eq:Kramers-Kronig-complex} into its real and imaginary parts, we obtain the conventional Kramers-Kronig relations:
\begin{eqnarray}
 \eps_r'(\omega)
 &=&
 \frac{1}{\pi}
 \mathcal{P}
 \int_{-\infty}^{+\infty}
    \frac{\eps_r''(\omega')}{\omega-\omega'}
  \, \diff \omega'
 \\
 \eps_r''(\omega)
 &=&
 -\frac{1}{\pi}
 \mathcal{P}
 \int_{-\infty}^{+\infty}
    \frac{\eps_r'(\omega')}{\omega-\omega'}
  \, \diff \omega'
  \label{eq:Kramers-Kronig}
\end{eqnarray}

The Kramers-Kronig relations relates the real and the imaginary parts of the relative permittivity. This is a direct consequence in the frequency domain of the causality. An interesting consequence of the Kramers-Kronig relations is that there cannot exist a dispersive medium that is purely lossless, ie $\eps_r''(\omega)=0$ for all $\omega$, since this would also require that $\eps_r'(\omega)=0$. However many cases, the loss can be found small enough in a given bandwidth to be considered as negligible locally.

A second consequence is that the causality implies the analyticity condition of $\eps_r$. Indeed, in order to satisfy the Kramers-Kronig relations, $\eps_r$ must be analytic in the closed upper half-plane of $\omega$. This latter result is of interest for complex integration when dealing with lossy plasma\parencite{Brambilla1998}.

TODO: demonstration using signum function? (can be graphical)

TODO: expressing KK relation for positive $\omega$. Usefull?

% ###########################################################################
% ###########################################################################
\subsection{Boundary conditions}

% ###########################################################################
% ###########################################################################
% ###########################################################################
\section{Transmission Line Theory}
\subsection{Transmission Lines}
\subsubsection{Coaxial Line}
\paragraph{Power Handling}
https://microwaves101.com/encyclopedias/coax-power-handling
'e' in coax
peak electric field $e^1$  ==> 60 ohm
max power for $ e^0.5$  ==> 30 ohm
average power handling -> heat
\subsubsection{Rectangular Waveguides}
\paragraph{Power Handling}

\subsection{Circular Waveguides}
\paragraph{Power Handling}

% ###########################################################################
% ###########################################################################
% ###########################################################################
\section{Microwave Measurements}
[1] E.A. Wolff, R. Kaul, Microwave engineering and systems applications, 1988. doi:10.1109/MAP.1989.6095665.

VSWR (Voltage Standing Wave Ratio)
SWR (Standing Wave Ratio) are exactly the same. Since it is more practical to measure RF waves vy detecting voltage than current, most instruments measure the voltage and then convert to power ($P=V^2/R$) or the current from the line impedance ($I=V/Z$).

An antenna is a device exhibiting resistance and reactance, ie. an impedance. The resistance can be considered to be made of real resistor and imaginary resistor. The real resistance is due to RF current losses in the material, while the imaginary resistance is the radiation resistance, due to the transformation between the antenna and its facing medium impedance.

\section{Dipole antenna}
Reactance occurs when the antenna is operated away from its resonant point. At resonance, the antenna behaves like a pure resistance.

The antenna input can be modelled as capacitor, a self and a resistor in serie. At resonance, Xc and Xl are equal and opposite values so they cancel out, leaving just the resistance R. Below resonance only Xc is present and above only Xl is present. Hence the load will appear in these conditions either capacitive or inductive.

% ###########################################################################
% ###########################################################################
% ###########################################################################
\section{Microwave safety}
\parencite[sec.5.8.3]{Benford2015}