\chapter{Introduction} \label{sec:introduction}
\epigraphhead[30]{\epigraph{%
\textit{"A planet is the cradle of mind, but one cannot live in a cradle forever."}}%
{\textsc{Konstantin E. Tsiolkovsky (1857 - 1935)}}%
}

\section{The conquest of space} \label{sec:conquest}

Since in 1609 German mathematician and astronomer Johannes Kepler published his book \textit{Astronomia nova}, containing the most famous of all transcendental equations, the motion of the celestial bodies has attracted the attention of the greatest minds in human history, even sparkling entire new fields in mathematics \cite{battin1999introduction}. It is easy to imagine that if even Kepler's equation, the one that captures the essence of the two-body problem in its most restricted form, already has this mathematical intricacy, any further development will carry away similar or greater complexity.

\begin{figure}[h]
\[M = E - e \sin{E}\]
\caption{The Kepler equation.}
\end{figure}

Almost three centuries later, in 1903, Russian rocket scientist Konstantin E. Tsiolkovsky first explained in his article \textit{Exploration of Outer Space by Means of Rocket Devices} precise conditions for artificial objects to reach the orbit of the Earth, making a huge leap from the mere observation of the celestial bodies and the science fiction stories that had inspired him to the real possibility of going to space. Quoting \cite{siddiqi2000challenge}:

\begin{displayquote}
In his most revolutionary idea, he proposed that humans could hope to fly to very high altitudes and ultimately into outer space only by using liquid-propellant rockets. One of his most  important conclusions was that a rocket would be capable of carrying up a cargo of any size, and develop any speed desired,  as long as the rocket was sufficiently large and the ratio of the mass of the propellant to the mass of the entire rocket was  large enough -- a relationship that is known as the Tsiolkovsky Equation.
\end{displayquote}

% Regarding Saxon genitive and equation names
% http://english.stackexchange.com/a/301270/20057

\begin{figure}[h]
\[\Delta v = v_e \ln \frac{m_0}{m_f}\]
\caption{The Tsiolkovsky equation.}
\end{figure}

If we define the term Astrodynamics as the branch of Mechanics that studies practical problems concerning the motion of rockets and other artificial objects through space, Tsiolkovsky's contribution might well be considered its starting point, and many others ensued before they could be tested in practice during the second half of the 20th century. In 1919 Yuri V. Kondratyuk conceived the gravitational slingshot or flyby to accelerate a spacecraft through interplanetary flight and suggested a mission profile for a Lunar landing \cite{siddiqi2000challenge}, in 1925 Walter Hohmann conjectured that the minimum-fuel transfer between two coplanar circular orbits consists of two tangent impulses along the line of apses (although this result was not proved until almost forty years later in \cite{lawden1963optimal}) and in 1926 Hermann J. Oberth observed that the velocity gain of an impulsive maneuver is higher when the kinetic energy is maximum (nowadays known as the Oberth effect). The severe limitations in weight and available energy for such kind of travels were already apparent for these pioneers, who were, in some way, anticipating the need to optimize on board fuel consumption.

At the same time, important practical advances were being made in the field of rocketry. In 1920 Robert H. Goddard published in his article \textit{A Method of Reaching Extreme Altitudes} several ideas and experimental results regarding the study of rockets, in particular that the exhaust speed of their combustion gases could be greatly increased by using convergent-divergent or De Laval nozzles, and in 1926 he launched the world's first liquid-fueled rocket, which reached an altitude of 12 meters, lasted 2 seconds and averaged about 100 kilometers per hour. After this remarkable event, amateur rocket societies started to form in America and Europe and bigger and more sophisticated rockets were built and launched in the following years.

To this day, chemical propulsion (whether using liquid fuel as pioneered by Goddard and later used by the Saturn V or solid fuel as already used by the Chinese in the 13th century) continues to be the only way to escape the gravitational well of the Earth. What is not so well known is that many of the people involved in the early development of astrodynamics and astronautics in the 20th century shared a common interest in an alternative method: electric propulsion. Goddard had already reflected on the use of "electrons moving with the velocity of light" as a method of propulsion as early as 1906, and Tsiolkovski wrote in 1911 about the use of electricity "to produce a large velocity for the particles ejected from a rocket device" \cite{choueiri2004history}. Oberth even envisioned electric propulsion as a real possibility for attitude control in his 1929 book \textit{Ways to Spaceflight} and already predicted its mass saving capabilities.

Despite all this enthusiasm, however, there were far too many obstacles at the time to make it a reality: first of all, the understanding of atomic physics was still in its infancy, with the nature of the electrons still unclear and the discovery of the proton not happening until 1920, hindering rigorous studies. Besides, electric propulsion was definitely not useful to attain orbital velocity, and on the other hand it requires a much more complex mathematical analysis (we will expand on these aspects in \ref{sec:propulsion}). For the following fifteen years after the publication of Oberth's book all the focus shifted away from electrical propulsion, until the tremendous advances regarding the production of intense ion currents during the forties brought back the debate about its feasibility \cite{choueiri2004history}.

Electric spacecraft propulsion was not the only idea that appeared those years that fell dormant because it was well ahead of its time. In 1925, twenty five years after Pyotr N. Lebedev demonstrated the pressure of light, Friedrich A. Zander published a technical paper titled \textit{Problems of flight by jet propulsion: interplanetary flights} where he discussed several challenges associated with space travel, including re-entry into the Earth atmosphere, and first analyzed with great detail the use of radiation pressure as a mean of propulsion, an idea suggested years earlier by Tsiolkovski. Zander proposed the use of extremely thin aluminum mirrors and computed the required surface and admissible stresses, laying the first bricks of beam-powered propulsion. The first formal technology and design effort for a solar sail did not begin until  1976 and to this day there are no flight proven solutions.

In 1950 George F. Forbes presented the element that was missing for a complete mathematical analysis, the study of low-thrust trajectories, by showing for the first time that in some cases they were more efficient than the high-thrust counterparts in his Masters thesis \textit{The trajectory of a powered rocket in space}. This, and the contribution of Lyman S. Spitzer, who in his 1952 paper \textit{Interplanetary Travel Between Satellite Orbits} suggested that for an ion propulsion system to be technically useful, an acceleration of three centimeters per square second would be enough ("sufficient to attain a velocity of $15~\text{km/sec}$ in two months" \cite{spitzer1952interplanetary}), provided the building blocks for the electrical propulsion to have the attention it deserved.

Finally, the decade of the sixties served as the definitive \textit{tour de force} of chemical propulsion, which powered the rockets used during the space race that started in 1957 with the launch of Sputnik I by the Soviet Union and that culminated with in 1969 with the first manned landing on the Moon by the United States of America. In the meanwhile, in 1964 the first mission to demonstrate the use in orbit of an ion thruster, SERT-1, was launched, whereas a milestone comparable in importance arrived as late as 1998 with the mission Deep Space 1. With these achievements, the early ideas of the visionaries of the beginning of the century were finally proven real and humanity was in the position of using these technologies to "leave the cradle".

\section{Chemical versus electric propulsion} \label{sec:propulsion}

After the historical perspective given in \ref{sec:conquest} we dedicate the following sections to introduce some important theoretical concepts, with the objective of justifying the importance of low-thrust orbit analysis within the context of orbit optimization and the pursuit of analytical solutions in this area. We start with the distinction of chemical versus electric propulsion and the main similarities and differences between them -- this does not intend to be an in-depth description of the subsystems and technologies that are involved, but rather an overview of their most essential aspects and how do they affect their performance and use cases (for such in-depth analysis we direct the readers to well known references in the subject such as \cite{sutton2016rocket}). In \ref{sec:methodstable} a thorough list of spacecraft propulsion methods has been included for reference.

Except for very small satellites, nearly all space missions require on-board propulsion systems, which have a major impact on spacecraft mass \cite{curran1993nasa}. Some sources estimate that the current cost of sending one kilo of payload into low Earth orbit lies around 20~000~€, and therefore any effort to decrease the launch mass of the spacecraft leads to significant savings \cite{choueiri2009new}.

We can define propulsion in a broad sense as the act of changing the motion of a body \cite{sutton2016rocket}. Spacecraft propulsion methods can be classified according to the energy source that is used to produce thrust, which can be chemical, nuclear or electric.

\textbf{Chemical propulsion} uses the chemical potential stored in the propellants, usually of reducing (fuel) and oxidizing nature, that is released in a high-pressure combustion reaction between the two. The reaction produces a flow of hot gases (between 2500 and 4100~\celsius) that can be accelerated in a convergent-divergent (or De Laval) nozzle to achieve supersonic velocities (1800 to 4300 m/s). In this case, therefore, the power source and the propellants are the same elements. Chemical propulsion systems can be themselves subdivided according to the state of the propellants: \textit{solid propellant rocket motors} use a solid material that contains all the chemical elements that are needed for complete burning, whereas \textit{liquid propellant rocket engines} use liquid propellants that are fed under pressure from separate tanks into a thrust chamber, where they react.

\textbf{Electric propulsion} comprises a family of systems that use an electric power source which is physically separate from the mechanism that produces the thrust itself. In \textit{electro-thermal propulsion} the propellant is heated by heated resistors or electric arcs and then expanded to supersonic velocity as it is done in chemical propulsion systems. On the other hand, \textit{ion and plasma drives} use electric and magnetic fields to accelerate ions or highly ionized plasmas, therefore not applying thermodynamic expansion to the propellant.

\textbf{Beam-powered propulsion} or directed energy propulsion refers to a broad family of methods, some of them experimental or speculative, that use an external power source to propel the spacecraft. Some of them concentrate beamed energy to heat a stored propellant, such as solar thermal rockets, while others use passive devices that take advantage of the radiation pressure, such as solar or laser-based sails.

Lastly, \textbf{nuclear propulsion} is a proposed spacecraft propulsion technology that delivers heat to a working fluid by means of a nuclear reaction, either by atomic fission or fusion. While they would be extremely useful for shortening interplanetary travel time and the first are at least feasible with today's technology, to date no nuclear thermal rocket has flown and they present too many technological and environmental problems, so we won't discuss more about them.

To this day, no optimal spacecraft propulsion method exists and when designing an space mission one or more of them must be chosen according to the desired requirements and the available technology. Figure \ref{fig:propulsionchart} displays a graphical summary of performance characteristics of several spacecraft propulsion methods according to their energy source. As mentioned before, the only method that has enough power to escape the gravitational field of the Earth is chemical propulsion, whether in the form of solid rockets or liquid engines: the rest of the methods provide an acceleration (or, equivalently, thrust) that is orders of magnitude below and that does not reach the required thrust-to-drag ratio to lift the spacecraft to the atmosphere.

\begin{figure}
\centering
\includegraphics[width=1.0\textwidth]{figures/propulsion-diagram.png}
\caption{Performance characteristics of spacecraft propulsion methods according to energy source.}
\label{fig:propulsionchart}
\end{figure}

However, chemical propulsion is not without limitations. If we recover the Tsiolkovski equation

\begin{equation}
\Delta v = v_e \ln \frac{m_0}{m_f}
\end{equation}

we notice that the obtained increment in velocity $\Delta v$ is directly proportional to the \textit{effective exhaust velocity} $v_e$ and that increases with the \textit{mass fraction} $m_0 / m_f$. Effective exhaust velocity can be also written as

\[
% * <dmorante@ing.uc3m.es> 2017-02-28T20:08:33.734Z:
%
% ^.
v_e = I_{sp} g_0 = \frac{T}{\dot{m}}
\]

where $I_{sp}$ is the specific impulse, $g_0$ is the standard gravity, $T$ is the exerted thrust and $\dot{m}$ is the mass flow rate. Therefore, $v_e$ is a measure of the \textit{efficiency} of the propulsion system. If our effective exhaust velocity (or, equivalently, specific impulse) is low, we will need a higher mass fraction to gain the required velocity increment. Notice that this equation is ideal and does not take into account loses due to atmospheric drag or the gravitational forces.

While the maximum thrust achievable with chemical propulsion is more than $10^6$ newton, the specific impulse using current technology is in the range of 250 to 500 seconds approximately. This is a comparatively low value for the efficiency and creates the need of carrying high amounts of propellant mass, both for expendable rockets that raise the payload into orbit and also for attitude control and orbit maintenance systems for the operation of the spacecraft \cite{curran1993nasa}.

Fortunately, the specific impulse for ion thrusters and plasma drives can be one or two orders of magnitude higher, therefore leading to much lower propellant mass requirements. However, although these systems are more efficient in terms of the consumed mass for a given trajectory, due to the limitation of electrical power on board the spacecraft the available thrust is significantly lower than chemical rockets. As a result, low-thrust systems in general and electric propulsion systems in particular must be used during long periods of time that can range between weeks and months.

This sole fact renders the mathematical treatment of low-thrust trajectories much more complicated: on the one hand they cannot be treated as ballistic arcs anymore since there will be a permanent force acting on the spacecraft in addition of the gravitational field, and on the other hand there will be an infinite number of possible trajectories between two points and fixed times \cite{woodcock2002benefits}. In the following sections we analyze the consequences of these two facts.

\section{The perturbed two-body problem}

The equation of the perturbed relative motion of two bodies is \cite{battin1999introduction}

\begin{equation}
\deriv[2]{\vec{r}}{t} + \frac{\mu}{r^3} \vec{r} = \vec{a}_d
\label{eq:twobody}
\end{equation}

% {Battin 84, 94, 10.3}

where $\vec{r}$ is the position vector of one body with respect to another, in our case the spacecraft with respect to its attractor, and $\vec{a}_d$ is the non-Keplerian or perturbation acceleration. This equation arises when analyzing the n-body problem, in which case the perturbation acceleration is due to the gravitational attraction of the other $n - 2$ bodies, but $\vec{a}_d$ can be more general and include the action of a low-thrust device. This action can be controlled in the case of electric propulsion systems or be subject to external factors in the case of beam-powered propulsion systems such as the radiation pressure from the Sun.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:31:33.757Z:
%
% >  perturbation acceleration
% perturbing acceleration
%
% ^ <dmorante@ing.uc3m.es> 2017-02-28T20:35:54.631Z.
% * <dmorante@ing.uc3m.es> 2017-02-28T19:48:59.231Z:
%
% > vector position
% position vector
%
% ^ <juanlu001@gmail.com> 2017-02-28T21:54:11.552Z.

The most straightforward method for determining the position $\vec{r}(t)$ and velocity $\vec{v}(t)$ in the case of a nonzero perturbing acceleration is a direct numerical integration of \ref{eq:twobody} in rectangular coordinates, known as Cowell's method \cite{battin1999introduction}. However, this equation becomes singular when the distance between the two bodies approaches zero, is nonlinear and its solution is unstable, so a number of regularizations and transformations have been proposed in the literature \cite{bau2013new}.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:10:48.158Z:
%
% > the two bodies
% Al principio empiezas hablando de 'target mass' y de 'attractor'  luego pasas directamente  a hablar de 'bodies'. Trata de conectarlo alguna manera o modificarlo
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:15:04.583Z:
%
% reescrita la primera frase
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:15:07.391Z.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:09:20.531Z:
%
% > However, this equation is nonlinear, becomes singular when the distance between the two bodies becomes zero and its solution is unstable, so a number of regularizations and transformations have been proposed in the literature
% However, this equation is singular when... (o reformular de alguna otra manera)
%
% ^ <juanlu001@gmail.com> 2017-02-28T21:55:31.446Z.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:03:59.461Z:
%
% >  if
% is
%
% ^ <juanlu001@gmail.com> 2017-02-28T21:55:57.066Z.
% * <dmorante@ing.uc3m.es> 2017-02-28T19:58:59.921Z:
%
% >  $\vec{r}(t)$
% $\vec{v}(t)$
%
% ^ <juanlu001@gmail.com> 2017-02-28T21:56:55.255Z.

Another approach to integrate the equations of motion is to use a set of orbital elements as dependent variables and then apply variational techniques. This technique, called \textit{variation of parameters}, assumes that we can use the solution of the unperturbed system to represent the complete solution \cite{vallado2001fundamentals}. The advantage is that most orbital elements stay constant for the case of pure Keplerian motion, and depending on the nature of the perturbing forces, the effects on the orbit can be circumscribed to a small subset of orbital elements. Furthermore, we can easily separate the short period, long period and secular effects on each of those elements. Two forms of variational equations exist: the Lagrangian form assumes the perturbation function can be derived from a potential, and the Gaussian form removes this constraint \cite{battin1999introduction}. The former is useful when analyzing conservative perturbations, like the effects of the non-spherical shape of the Earth, whereas the latter is more general and works for arbitrary perturbation accelerations.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:14:05.058Z:
%
% > exist
% aquí añadiría referencia
%
% ^ <juanlu001@gmail.com> 2017-02-28T21:58:33.088Z.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:13:37.464Z:
%
% Aquí añadiría referencia
%
% ^ <dmorante@ing.uc3m.es> 2017-02-28T20:14:01.833Z.

There are many forms of the Gauss planetary equations, depending on the element set in use and the reference frame chosen for projecting the perturbation acceleration components. We reproduce here the form derived by \cite{battin1999introduction}, which uses classical orbital elements $(a, e, i, \Omega, \omega, M)$ and polar coordinates $(f_r, f_{\ta}, f_h)$:
% * <dmorante@ing.uc3m.es> 2017-02-28T20:22:40.780Z:
%
% > $(f_r, f_{\ta}, f_h)$
% Convendría aclarar cuál es el sistema de coordenadas polares que se utiliza (porque podría ser cualquiera)
%
% ^ <dmorante@ing.uc3m.es> 2017-02-28T20:26:13.404Z.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:19:26.012Z:
%
% >  perturbation acceleration
% perturbing acceleration
%
% ^ <dmorante@ing.uc3m.es> 2017-02-28T20:35:46.253Z.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:14:42.716Z:
%
% > element set
% set of elements
%
% ^ <juanlu001@gmail.com> 2017-02-28T21:59:58.184Z:
%
% Lo he visto así escrito en muchos sitios
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:00:01.877Z.

\begin{align}
\deriv{a}{t} & = \frac{2 a^2}{h} \left( e \sin{\ta} f_r + \frac{p}{r} f_{\ta} \right) \\
\deriv{e}{t} & = \frac{1}{h} \left( p \sin{\ta} f_r + \left( \left( p + r \right) \cos{\ta} + r e \right) f_{\theta} \right) \\
\deriv{i}{t} & = \frac{r \cos{\arglat}}{h} f_h \\
\deriv{\Omega}{t} & = \frac{r \sin{\arglat}}{h \sin{i}} f_h \\
\deriv{\omega}{t} & = \frac{1}{he} \left( -p \cos{\ta} f_r + \left( p + r \right) \sin{\ta} f_{\theta} \right) - \frac{r \sin{\arglat} \cos{i}}{h \sin{i}} f_h \\
\deriv{M}{t} & = n + \frac{b}{ahe} \left( \left( p \cos{\ta} - 2 re \right) f_r - \left( p + r \right) \sin{\ta} f_{\ta} \right) \\
\end{align}

Where $a$ is the semimajor axis, $e$ the eccentricity, $i$ the inclination, $\Omega$ the right ascension of the ascending node, $\omega$ the argument of periapsis, $\ta$ the true anomaly, $M$ the mean anomaly, $\arglat = \omega + \ta$ the argument of latitude, $r$ the distance to the center of mass of the attractor (or equivalently, the modulus of the position vector $r = |\vec{r}|$, $p = a (1 - e^2)$ the \textit{semilatus rectum} and $h$ the specific angular momentum. The three components of the disturbing force are mutually orthogonal: $f_r$ points outwards along the position vector, $f_h$ is perpendicular to the plane of the orbit and $f_{\ta}$ completes the trihedron.
% * <dmorante@ing.uc3m.es> 2017-02-28T21:58:31.483Z:
%
% Te faltan por definir elementos, como r (distancia al centra body), h,p...etc
%
% ^ <juanlu001@gmail.com> 2017-03-01T03:09:59.378Z:
%
% hecho
%
% ^ <juanlu001@gmail.com> 2017-03-01T03:10:01.196Z.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:25:42.495Z:
%
% > disturbing force
% force or acceleration?
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:00:52.621Z:
%
% En realidad da igual, tienen la misma dirección
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:00:55.638Z.
Notice that for small values of the eccentricity or the inclination the variation of some parameters over one orbit can be very large, and for circular ($e = 0$) or equatorial ($i = 0$) orbits the equations become singular \cite{vallado2001fundamentals}. In these cases, a different set of orbital elements would have to be chosen. A recent development in this regard can be found in \cite{bau2013new}.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:29:25.310Z:
%
% > circular or equatorial orbits
% circular(e=0) or equatorial orbits (i=0)
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:01:20.315Z.

With these equations, a known perturbation acceleration or guidance law and an appropriate numerical integration scheme we would be able to integrate the equations of motion \ref{eq:twobody} and compute the variation of the dependent variables in time, apart from the numerical errors of the method and the available precision of the computer. However, if we have full control of $\vec{a}_d$ we are now in charge of selecting the appropriate control law to minimize the travel time, the fuel consumption or any other cost function of our desire, subject to the constraints of our problem. This is further explained in the following section.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:38:51.827Z:
%
% > This is
% This is further explained...
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:01:31.220Z.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:37:44.705Z:
%
% >  the equations of motion
% Referencia a la ecuación
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:02:36.598Z.

\section{Trajectory optimization}

The need to optimize the trajectory of a spacecraft comes from the stringent mass fraction constraints discussed in \ref{sec:propulsion} and predates the introduction of low-thrust systems. One example is the design of the Venus-Earth-Earth Gravity Assist (VEEGA) trajectory for the Galileo spacecraft, which took advantage of three flybys to achieve a high escape velocity while leaving enough propellant to perform the Jupiter orbit insertion and a tour around its moons \cite{damario1989galileo}. This mission had the additional constraint of visiting two asteroids, so the design of its trajectory involved checking closest approaches with several thousand objects and reoptimizing for each candidate.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:42:23.004Z:
%
% > of spacecraft
% of a spacecraft
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:02:47.823Z.

In any case, apart from this cases of parametric optimization, the use of continuous thrust devices imposes the need of modeling and determining the full time history of the thrust magnitude and direction, effectively becoming an optimal control problem \cite{conway2010spacecraft}. These optimization problems are particularly difficult for several reasons: the concurrence of short period and very long period phenomena, the indetermination of the terminal conditions or even the structure of the problem itself (which might be subject to optimization) and the presence of discontinuities as perfectly valid trajectories (namely impulsive $\Delta V$ changes) are some of them.

There are several numerical optimization methods for solving these kind of problems, generally divided into two families:
% * <dmorante@ing.uc3m.es> 2017-02-28T20:56:50.850Z:
%
% Comentaría los problemas de optimizar la trayectoria low-thrust
% --> Long transfer times
% --> amplified effect of the perturbing forces
% --> Operational constraints
% --> ....
%
% ^ <juanlu001@gmail.com> 2017-03-01T04:02:20.733Z:
%
% de manera un poco superficial, pero hecho
%
% ^.

% * <dmorante@ing.uc3m.es> 2017-02-28T20:47:39.788Z:
%
% Esta referencia también está bien --> Anil V Rao. A survey of numerical methods for optimal control. Advances in the Astronautical Sciences, 135(1):497?528, 2009.
%
% ^.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:45:42.314Z:
%
% ¡¡¡ Los nombres está cambiados!!!!
%
% ^ <juanlu001@gmail.com> 2017-03-01T03:56:24.019Z:
%
% ups, arreglado
%
% ^.
\textbf{Indirect methods} usually make use of the analytical necessary conditions from the calculus of variations to form a two-point boundary-value problem associated with the equations of motion \ref{eq:twobody}. Their advantage is that the obtained solution is smooth and accurate, but on the other hand they tend to get stuck in local optimum and it is therefore difficult to give a reasonable initial guess.
% * <dmorante@ing.uc3m.es> 2017-02-28T20:53:23.908Z:
%
% >  Difficult to give a reasonable initial guesse
% initial guess
% or (small radius of convergence)
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:03:40.306Z.

\textbf{Direct methods}, on the other hand, transform the optimal control problem into a parameter optimization problem by discretization. There are many different kinds of direct solution methods, depending on what degree of parametrization is chosen. Although some smoothness properties of the solution are lost in the discretization, they converge more easily than indirect methods and are more flexible and robust in the face of problem modifications or changes in the formulation. The great majority of optimal space trajectories are nowadays determined by direct methods \cite{conway2010spacecraft}.
% * <dmorante@ing.uc3m.es> 2017-02-28T21:04:28.610Z:
%
% > some other optimization parameters can be added
% En el método indirecto también puedes añadir 'otros parámetros'. Pero no de forma tan sencilla como con los métodos directos.  Los métodos directos son más 'flexibles' de cara a reformulaciones o modificaciones del problema
%
% ^.

There exist also \textit{hybrid methods} that combine the previous two and try to bring the advantages of both of them.

In some very restricted cases there are analytical solutions of the problem. They usually make use of very strong restrictions, such as fixing the acceleration instead of the thrust \cite{battin1999introduction} or restricting to: very low-thrust transfers between circular orbits. Even though they are of very narrow applicability and difficult to develop, analytical solutions are always less expensive in terms of computation power and provide unique physical insight on the problem under study \cite{lawden1963optimal}. It is within this context where we propose collecting several of these analytical solutions, implementing them in software and publishing them in the open, as will be explained in \ref{sec:contribution}.
% * <dmorante@ing.uc3m.es> 2017-02-28T21:09:01.282Z:
%
% >  help us being effective in using numerical techniques
% Relacionarlo con la necesidad de obtener una buena initial guess para los métodos anteriores, y a la vez una buena estimación de las performances de la misión de una formas muy rápida y sencilla (suboptimal solutions).
%
% ^.

\section{Orbital mechanics software}
% * <dmorante@ing.uc3m.es> 2017-02-28T21:09:40.069Z:
%
% > \begin{itemize}
% > \item Orekit https://www.orekit.org/static/apidocs/org/orekit/forces/maneuvers/ConstantThrustManeuver.html
% > \item GMAT
%
% Comentar que son ??
%
% ^ <juanlu001@gmail.com> 2017-03-01T03:25:53.536Z:
%
% marchando
%
% ^ <juanlu001@gmail.com> 2017-03-01T03:25:55.573Z.

There are several software packages devoted to orbital mission analysis, flight control, orbital optimization and other topics related to Astrodynamics and Space Operations. While it is not our intention to make an exhaustive list, we would like to mention two open source alternatives that are in use nowadays and that might overlap in some way with our own solution.

\begin{itemize}
\item \verb|Orekit| is a space dynamics library written in Java that aims at providing accurate and efficient low level components for the development of flight dynamics applications. It is developed by an international community led and sponsored by CS Systèmes d'Information. Although it does not have complex continuous thrust maneuvers build in, it features the necessary building blocks to program them\footnote{See \url{https://www.orekit.org/static/apidocs/org/orekit/forces/maneuvers/ConstantThrustManeuver.html}}.
%
\item \verb|GMAT| is an open-source space mission analysis tool designed to model, optimize, and estimate spacecraft trajectories in flight regimes ranging from low Earth orbit to lunar applications, interplanetary trajectories, and other deep space missions. While Orekit target audience is mostly developers, GMAT is more appropriate for the end user. It is developed in the open by NASA.
\end{itemize}

We now comment how we have used the Python programming language to develop our own solution from scratch and its advantages and drawbacks.

\subsection{Python} \label{sec:python}

The Python programming language was started by Guido van Rossum in 1989 as a successor to the ABC language, and v1.0 was released in 1994\footnote{\url{http://python-history.blogspot.com.es/2009/01/brief-timeline-of-python.html}}. It is therefore not new, and in fact it predates the Java language, first released in 1996. On the other hand, Python first uses for scientific purposes appeared as early as 1995, with the creation of a special interest group on numerical arrays \cite{millman2011python}. However, in recent times the ecosystem has greatly improved, with the application of Open Development principles, the increasing interest and involvement of private companies and the generous funds given to projects like IPython \cite{perez2007ipython} and Jupyter. Nowadays, it is one of the most used languages in fields like Astronomy \cite{momcheva2015software} as well as small-to-medium Data Science, and heavily trusted for teaching undergraduate Computer Science in top universities \cite{guo2014python}. In figure~\ref{fig:python} we can see a fragment of one of the Bate-Mueller-White algorithm to solve Lambert's problem implemented in Python.

\begin{figure}
\begin{lstinputlisting}[language=Python]{examples/algorithm.txt}
\end{lstinputlisting}
\caption{Fragment of BMW-Vallado algorithm for Lambert's problem in Python. Notice its resemblance to pseudocode.}
\label{fig:python}
\end{figure}

One of the most important differences between Python and compiled languages like Fortran or C is its dynamic typing nature. The variety of type systems across has traditionally been a major source of debate among programmers, and in fact some studies suggest that there is "a small but significant relationship between language class and defects" \cite{ray2014quality}. Languages featuring dynamic typing, as it is the case with Python, are often easier to write and read but more difficult to debug, as there are no guarantees about the types of the arguments, and have worse performance. While there is an increasing interest in developing type inference systems (see for instance the Julia and Scala languages), these are extremely difficult to set up for languages like Python \cite{cannon2005localized}.

\subsection{poliastro}

The code developed for this Master thesis is based on \verb|poliastro|, an open source, pure Python library for Astrodynamics and Orbital Mechanics focused on interplanetary applications and released under the MIT license\cite{cano2017poliastro}. To overcome the limitations mentioned in \ref{sec:python} regarding the performance of the Python programming language, \verb|poliastro| relies on \verb|numba|, an open source library which can infer types for array-oriented and math-heavy Python code and generate optimized machine instructions using the LLVM compiler infrastructure.

Numba works by inferring the types of the variables of a Python function and refining them in several stages until it generates assembly code for the desired platform. In figure~\ref{fig:numba} we see a small fragment of the code that implements the Stumpff functions in poliastro along with its so-called Numba Intermediate Representation, which is the first stage of the optimization process.
% * <dmorante@ing.uc3m.es> 2017-02-28T21:10:37.970Z:
%
% > numba
% Numba
%
% ^ <juanlu001@gmail.com> 2017-02-28T22:04:28.685Z.

\begin{figure}
\begin{lstinputlisting}[language=Python]{examples/annotations.txt}
\end{lstinputlisting}
\caption{Example of numba annotation along corresponding line of Python code.}
\label{fig:numba}
\end{figure}

In \cite{cano2016icatt} detailed benchmarks were conducted to compare the performance of core Astrodynamics algorithms written in Python as featured in \verb|poliastro| and in Fortran, measuring the number of solutions computed per unit time. The tests were performed in a virtualized CentOS machine to avoid interferences from the outside world and provide homogeneous results. The results are summarized in table~\ref{table:results}.

\begin{table*}
    \centering
    \begin{tabular}{ c|c c c c c }
          \textbf{Version} & \textbf{Minimum} & \textbf{Maximum} & \textbf{Median} & \textbf{Relative} & \textbf{IQR} \\
    \hline
        \textbf{Intel ifort}, \verb|-O2| & 594620.8 & 654121.4 & 623536.2 & \textbf{1.0} & 25861.2 \\
        \textbf{GNU gfortran}, \verb|-O2| & 358478.2 & 505127.0 & 454613.6 & \textbf{0.729} & 68265.5 \\
        \textbf{poliastro}, numba & 197610.9 & 206153.2 & 203615.8 & \textbf{0.327} & 3296.5 \\
        \textbf{poliastro}, pure Python & 3502.7 & 3703.0 & 3639.6 & \textbf{0.006} & 65.6 \\
    \end{tabular}
    \caption{Benchmarking results: solutions per unit time (higher is better).}
    \label{table:results}
\end{table*}

On the other hand, \verb|poliastro| relies on well-tested, community-backed libraries for low level astronomical tasks, such as Astropy\cite{robitaille2013astropy} and jplephem. Astropy provides several utilities for handling astronomical times and performing reference frame conversions and also allows the user to introduce quantities directly with its physical units, improving the usability of the software and reducing the probability of unit errors. jplephem, on the other hand, presents a Python layer to interact with the JPL ephemeris files to compute the position and velocities of the celestial bodies with high precision.

\section{Contribution of this Master thesis} \label{sec:contribution}

While in theory one can always resort to numerical methods to solve orbital optimization problems, in practice having analytical solutions is highly valuable: not only they are usually quicker to compute and can be used as initial guesses for iterative algorithms with small radius of convergence, but also they serve as a vehicle to understand the nature of the problem and unveil physical relations that can be lost in numerical solutions. Anyhow, analytical solutions are very difficult to find in general, and very few examples of mathematically tractable cases exist \cite{battin1999introduction}.

On the other hand, although there are some existing or ongoing projects that already implement one or more of these algorithms (see for instance \cite{dicarlo2016camelot}, which presents a MATLAB optimization package)  we have been unable to find open source implementations. Aside the philosophical implications of free software, it would be desirable to have a working implementation of these steering programs openly available, royalty-free and easy to obtain which can be then audited by a wide majority of researchers and not those in possession of a specific software license. The main object of this work is to produce such software (see appendix~\ref{sec:software} for installation instructions).

Lastly, each of the guidance laws considered for study are validated against numerical examples available in the literature, with the objective of explicitly stating the margin of error between our software and the used references, and on the other hand serve as inspiration or starting point for future research projects that want to include other guidance laws or improve the existing ones.


\documentclass[11pt, oneside]{article}   	% use "amsart" instead of "article" for AMSLaTeX format

% \usepackage{draftwatermark}
% \SetWatermarkText{Draft}
% \SetWatermarkScale{5}
% \SetWatermarkLightness {0.9}
% \SetWatermarkColor[rgb]{0.7,0,0}

\usepackage{geometry}                		% See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper}                   		% ... or a4paper or a5paper or ...
%\geometry{landscape}                		% Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    		% Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}				% Use pdf, png, jpg, or eps� with pdflatex; use eps in DVI mode
								% TeX will automatically convert eps --> pdf in pdflat
								% TeX will automatically convert eps --> pdf in pdflatex
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{hyperref}
\usepackage{url}
\usepackage{subcaption}
\usepackage{authblk}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{fixltx2e}
\usepackage{hyperref}
\usepackage{alltt}
\usepackage{color}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{float}
\usepackage{bigints}
\usepackage{braket}
\usepackage{siunitx}

\DeclareMathOperator{\E}{\mathbb{E}}
\newcommand{\argmax}{\operatornamewithlimits{argmax}}
\newcommand{\argmin}{\operatornamewithlimits{argmin}}

\title{A Few Notes on Density Operators, Expectation Values and Matrix Shapes}
\author{David Meyer \\ dmm@\{1-4-5.net,uoregon.edu\}}

\date{Last update: \today}							% Activate to display a given date or no date

\begin{document}
\maketitle

\section{Introduction}
These notes started life as an experiment in drawing matrices and their shapes (see Section \ref{sec:shapes}). However, it has evolved into a more ad-hoc collection of notes
covering a few topics in quantum mechanics. So its a WIP. We start with a review of Orthonormality, Completeness, and Projection...

\section{Orthonormality, Completeness, and Projection}
As we saw above, unitary matrices are matrices which satisfy

\begin{equation}
\mathbf{U}^{-1} = \mathbf{U}^{\dagger}
\label{eqn:inverse}
\end{equation}

\bigskip
\noindent
Unitary matrices are ubiquitous and important in quantum mechanics, in
particular because they have the following unique and useful properties: Orthonormality, Completeness, and Projection \cite{cresser2007}.
We'll briefly look at each of these below\footnote{I will use the
notation $\begin{pmatrix} x_1, \hdots, x_n \end{pmatrix}^{\text{T}}$ and $\begin{bmatrix} x_1, \hdots, x_n \end{bmatrix}^\text{T}$ interchangably in the following discussion.}.

\subsection{Orthornomality}
We can rewrite Equation \ref{eqn:inverse} as

\begin{equation}
\mathbf{U}^{\dagger} \mathbf{U} = \mathbf{I}
\label{eqn:dagger}
\end{equation}

\bigskip
\noindent
where \textbf{I} is the \emph{identity} matrix. What Equation \ref{eqn:dagger} is really telling us is that the columns of the matrix \textbf{U} form a set of orthnormal vectors.

\bigskip
\noindent
Note that we can interpret a matrix as a row vector where the entries are the columns  $\mathbf{v}_i$ of \textbf{U}. That is

\begin{equation*}
\mathbf{U} = \begin{bmatrix} \mathbf{v}_1 & \mathbf{v}_2 & \hdots & \mathbf{v}_{N} \end{bmatrix}
\end{equation*}

\bigskip
\noindent
Similarly, $\mathbf{U}^{-1}$ can be written as a column vector where the entries are the row vectors $ \mathbf{v}_{i}^\dagger$:

\begin{equation*}
\mathbf{U}^{-1} = \mathbf{U}^{\dagger} = \begin{bmatrix} \mathbf{v}_1^\dagger \\ \mathbf{v}_2^\dagger \\ \vdots  \\ \mathbf{v}_{N}^\dagger  \end{bmatrix}
\end{equation*}

\bigskip
\noindent
Now we can see that

\begin{flalign*}
\mathbf{U}^{\dagger} \mathbf{U} &= \begin{bmatrix} \mathbf{v}_1^\dagger \\ \mathbf{v}_2^\dagger \\ \vdots  \\ \mathbf{v}_{N}^\dagger  \end{bmatrix}
 \begin{bmatrix} \mathbf{v}_1 & \mathbf{v}_2 & \hdots & \mathbf{v}_{N} \end{bmatrix}  \\
 &=
 \begin{bmatrix}
 \mathbf{v}_1^\dagger  \cdot  \mathbf{v}_1 & \mathbf{v}_1^\dagger  \cdot  \mathbf{v}_2 &  \mathbf{v}_1^\dagger  \cdot  \mathbf{v}_3 & \hdots & \mathbf{v}_1^\dagger  \cdot  \mathbf{v}_N \\
 \mathbf{v}_2^\dagger  \cdot  \mathbf{v}_1 & \mathbf{v}_2^\dagger  \cdot  \mathbf{v}_2 &  \mathbf{v}_2^\dagger  \cdot  \mathbf{v}_3 & \hdots & \mathbf{v}_2^\dagger  \cdot  \mathbf{v}_N \\
 \mathbf{v}_3^\dagger  \cdot  \mathbf{v}_1 & \mathbf{v}_3^\dagger  \cdot  \mathbf{v}_2 &  \mathbf{v}_3^\dagger  \cdot  \mathbf{v}_3 & \hdots & \mathbf{v}_3^\dagger  \cdot  \mathbf{v}_N \\
 \vdots & \vdots & \vdots &\ddots & \vdots \\
 \mathbf{v}_N^\dagger  \cdot  \mathbf{v}_1 & \mathbf{v}_N^\dagger  \cdot  \mathbf{v}_2 &  \mathbf{v}_N^\dagger  \cdot  \mathbf{v}_3 & \hdots & \mathbf{v}_N^\dagger  \cdot  \mathbf{v}_N
 \end{bmatrix} \\
 &= \mathbf{I}
\end{flalign*}

\noindent
or in Dirac notation \cite{2000RPPh...63.1893G}

\begin{flalign*}
\mathbf{U}^{\dagger} \mathbf{U} &= \begin{bmatrix} \mathbf{v}_1^\dagger \\ \mathbf{v}_2^\dagger \\ \vdots  \\ \mathbf{v}_{N}^\dagger  \end{bmatrix}
 \begin{bmatrix} \mathbf{v}_1 & \mathbf{v}_2 & \hdots & \mathbf{v}_{N} \end{bmatrix} \\
 &=
 \begin{bmatrix}
 \bra{v_1} \\  \bra{v_2} \\ \vdots \\ \bra{v_N}
\end{bmatrix}
 \begin{bmatrix}
 \ket{v_1} &  \ket{v_2} & \hdots & \ket{v_N}
\end{bmatrix} \\
&=
\begin{bmatrix}
\braket{v_1 | v_1} & \braket{v_1 | v_2} & \braket{v_1 | v_3} & \hdots & \braket{v_1 | v_N} \\
\braket{v_2 | v_1} & \braket{v_2 | v_2} & \braket{v_2 | v_3} & \hdots & \braket{v_2 | v_N} \\
\braket{v_3 | v_1} & \braket{v_3 | v_2} & \braket{v_3 | v_3} & \hdots & \braket{v_3 | v_N} \\
\vdots & \vdots & \vdots & \ddots &   \vdots \\
\braket{v_N | v_1} & \braket{v_N | v_2} & \braket{v_N | v_3} & \hdots & \braket{v_N | v_N}
\end{bmatrix}  \\
&= \mathbf{I}
\end{flalign*}

\bigskip
\noindent
What we can notice\footnote{$\delta_{ij}$ is the Kronecker Delta function \cite{wiki:kronecker_delta}, $\delta_{ij} = \bigg \{
\begin{array}{ll}
1 & {\rm when  ~}  i = j \\
0 & {\rm when  ~}  i \ne j
\end{array}$}
here is that since $(\mathbf{U}^{\dagger} \mathbf{U})_{ij} = (\mathbf{U}^{-1} \mathbf{U})_{ij} = \delta_{ij}$,
the columns of \textbf{U} can be written as the inner product  $\braket{v_i | v_j} = \delta_{ij}$. Said another way,
the vectors $v_i$ form an orthonormal set. In particular, if $\mathbf{V} = \{v_j\}$ is an orthonormal set, then for  $v_i, v_j \in \mathbf{V}$,
the inner product $\braket{v_i | v_j} = \delta_{ij}$. See Section \ref{sec:shapes} for a brief discussion on matrix shapes.

\subsection{Completeness}
From $\mathbf{U}^\dagger \mathbf{U} = \mathbf{I}$ we saw that we could derive orthonormality. But we also expect that $\mathbf{U} \mathbf{U}^\dagger = \mathbf{I}$.
It turns out that we can get something interesting by observing this. In particular

\begin{flalign*}
\mathbf{U} \mathbf{U}^\dagger &= \begin{bmatrix} \ket{v_1} &  \ket{v_2} & \ket{v_3} & \hdots & \ket{v_N} \end{bmatrix}
\begin{bmatrix} \bra{v_1} \\ \bra{v_2} \\ \bra{v_3} \\ \vdots \\ \bra{v_N} \end{bmatrix}
\end{flalign*}

\bigskip
\noindent
If we multiply this out we find that

\begin{equation}
\ket{v_1}\bra{v_1} + \ket{v_2} \bra{v_2} + \cdots + \ket{v_N} \bra{v_N} = \sum\limits_{i = 1}^{N} \ket{v_i} \bra{v_i} = \mathbf{I}
\label{eqn:completeness}
\end{equation}

\bigskip
\noindent
Equation \ref{eqn:completeness} is known as the \emph{completeness} relation. Completeness turns out to be useful and is a sort of
flip-side of orthonormality. While orthonormality is kind of an "inner product" ($\mathbf{U}^{\dagger}\mathbf{U}$), completeness is
like an outer product in that $\mathbf{U}\mathbf{U}^\dagger$ is a sum over $i$ of $\ket{v_i}\bra{v_i}$ (although the shapes are reversed). Interestingly, the trace of the outer product of two
$n \times 1$ column vectors \textbf{a} and \textbf{b} is $\text{Tr}(\ket{a}\bra{b}) = \braket{a | b}$.

\subsection{Projection}
To get an idea of what projection is all about, consider the expansion of a vector into components in a basis:

\begin{equation}
\ket{w} =  \sum\limits_{i = 1}^{N} w_i \ket{v_i}
\label{eqn:ket_w}
\end{equation}

\bigskip
\noindent
Now, if the set of vectors basis vectors  $\{v_i\}$ are orthonormal, then we know that

\begin{equation*}
w_i  =  \braket{v_i  | w}
\end{equation*}

\bigskip
\noindent
and substituting back into Equation \ref{eqn:ket_w} we get

\begin{equation*}
\ket{w} =  \sum\limits_{i = 1}^{N}  \braket{v_i  | w} \ket{v_i}
\end{equation*}

\bigskip
\noindent
Interestingly, there is another way to derive this result:  use the completeness relation, which is simply a fancy but useful way to write \textbf{I}:

\begin{equation*}
\ket{w} =  \mathbf{I} \cdot \ket{w} =  \Bigg (\sum\limits_{i = 1}^{N}  \ket{v_i} \bra{v_i} \Bigg ) \ket{w} = \sum\limits_{i = 1}^{N}  \ket{v_i} \braket{v_i | w}
\end{equation*}

\bigskip
\noindent
In words, we were able to use the completeness relation to project a vector onto its components in a particular basis.

\bigskip
\noindent
For example, we know that for vectors $\ket{\alpha}$ and $\ket{\beta}$, we can take the inner product between them by using their components in a basis $\{v_i\}$:

\bigskip
\begin{equation*}
\braket{\alpha  | \beta} = \sum\limits_{i = 1}^{N} a_i^* b_i
\end{equation*}

\bigskip
\noindent
where $a_i = \braket{v_i | \alpha}$ and $b_i = \braket{v_i | \beta}$. Interestingly, we can again derive this using the completeness relation:

%
% Thanks to Alan Barrett, Job Sniders, Pierre Francois and  Nikolai Matni for their suggestions to make
% my "comment" code better (essentially wrap in in an array)
%
%  Sat Dec 15 10:41:23 PST 2018
%

\begin{equation*}
\begin{array}{rcll}
\braket{\alpha | \beta}
&=& \bra{\alpha}  \mathbf{I} \ket{\beta}                                                                           & \quad \mathrel{\#} \braket{\alpha | \beta} = \bra{\alpha} \ket{\beta} = \bra{\alpha}  \mathbf{I} \ket{\beta} \\
&=& \bra{\alpha} \Bigg (\sum\limits_{i = 1}^{N}  \ket{v_i} \bra{v_i} \Bigg )  \ket{\beta}    & \quad \mathrel{\#} \sum\limits_{i = 1}^{N}  \ket{v_i} \bra{v_i}   = \mathbf{I}  \;\; (\text{Equation } \ref{eqn:completeness}) \\
&=& \sum\limits_{i = 1}^{N} \braket{\alpha | v_i} \braket{v_i | \beta}                               & \quad \mathrel{\#}  \text{rearrange} \\
&=& \sum\limits_{i = 1}^{N} \braket{v_i | \alpha}^* \braket{v_i | \beta}                            & \quad  \mathrel{\#} \braket{a | b} = \braket{ b | a}^* \text{so} \braket{\alpha | v_i}  = \braket{v_i | \alpha}^* \\
&=& \sum\limits_{i = 1}^{N} a_i^*b_i                                                                               & \quad \mathrel{\#} a_i^* =  \braket{v_i | \alpha}^*  \text{ and } b_i = \braket{v_i | \beta}
\end{array}
\end{equation*}

\bigskip
\section{Expectation Values}
\label{sec:shapes}
Consider an observable \textbf{A}  in the pure state $\ket{\psi}$.  The expectation value $\braket{A}_{\psi}$ is given by

\begin{flalign}
\braket{A}_{\psi} &= \bra{\psi} A \ket{\psi}
\label{eqn:exp}
\end{flalign}

\bigskip
\noindent
where $\dim (\bra{\psi}) = 1 \times n$, $\dim (A) = n \times n$, and $\dim (\ket{\psi}) = n \times 1$.

\bigskip
\noindent
So why is $\braket{A}_{\psi}$ an expectation?
Well, first, if $A$ is an observable for a system with a discrete set of values $\{a_1, a_2, \hdots, a_N\}$,
then this observable is represented by a Hermitean operator $\hat{A}$ that has these discrete values as its eigenvalues, and associated eigenstates
$\{\ket{a_n\}}$, for $n = 1,2,3,\hdots$ satisfying the eigenvalue equation $\hat{A}\ket{a_n} = a_n \ket{a_n}$. I drop the "hat" in most of the below.

\bigskip
\noindent
First, observe that $ \bra{a_n} A = a_n \bra{a_n}$. Why?

\begin{equation}
\begin{array}{rcllll}
A \ket{a_n}
&=& a_n \ket{a_n}                                                                                && \quad \mathrel{\#} \text{eigenvector equation:  $AX = \lambda X$} \\
&\implies& (A \ket{a_n})^{\dagger}               &= (a_n \ket{a_n})^{\dagger}                       & \quad \mathrel{\#} \text{conjugate transpose both sides} \\
&\implies& \ket{a_n}^{\dagger} A^{\dagger} &= \ket{a_n}^{\dagger} a_n^{\dagger}        & \quad \mathrel{\#} (AB)^\dagger = B^\dagger A^\dagger \\
&\implies& \ket{a_n}^{\dagger} A^{\dagger} &= a_n^{\dagger} \ket{a_n}^{\dagger}        & \quad \mathrel{\#} \text{rearrange ($a_n^\dagger$ is a scalar)} \\
&\implies& \ket{a_n}^{\dagger} A                 &= a_n^{\dagger} \ket{a_n}^{\dagger}         & \quad \mathrel{\#} \text{$A$ is Hermitian so $A = A^\dagger$} \\
&\implies& \ket{a_n}^{\dagger} A                 & = a_n^{*} \ket{a_n}^{\dagger}                   & \quad \mathrel{\#} a_n^{\dagger} = a_n^* \; \text{($a_n$ is a scalar)} \\
&\implies& \bra{a_n} A                                 &= a_n^{*} \bra{a_n}                                    & \quad \mathrel{\#} \ket{a_n}^{\dagger} = \bra{a_n} \\
&\implies& \bra{a_n} A                                 &= a_n  \bra{a_n}                                         & \quad \mathrel{\#} a_n* = a_n
\label{eqn:aketan}
\end{array}
\end{equation}

\bigskip
\noindent
Why is $a_n^* = a_n$? Well, consider

\begin{equation}
\begin{array}{lclll}
A X
&=& \lambda X                                                                                && \quad \mathrel{\#} \text{eigenvector equation} \\
&\implies& (A X)^{\dagger} &= (\lambda X)^{\dagger}                                      & \quad \mathrel{\#} \text{take conjugate transpose of both sides} \\
&\implies& X^{\dagger} A^\dagger&= X^{\dagger} \lambda^{\dagger}             & \quad \mathrel{\#} (AB)^\dagger = B^\dagger  A^\dagger \\
&\implies& X^{\dagger} A^\dagger &= \lambda^{\dagger} X^{\dagger}             & \quad \mathrel{\#} \text{rearrange ($\lambda^\dagger$ is a scalar)} \\
&\implies& X^{\dagger} A^\dagger &= \lambda^{*} X^{\dagger}                        & \quad \mathrel{\#} \lambda^\dagger = \lambda^* \; \text{($\lambda$ is a scalar)} \\
&\implies& X^{\dagger} A &= \lambda^{*} X^{\dagger}                                     & \quad \mathrel{\#} A^\dagger = A  \text{ since $A$ is Hermitian} \\
&\implies& X^{\dagger} A &= X^{\dagger}   \lambda^{*}                                   & \quad \mathrel{\#} \text{rearrange} \\
&\implies& X^\dagger  A X &= X^{\dagger}  \lambda^{*} X                               & \quad \mathrel{\#}  \text{multiply both sides by $X$}
\end{array}
\label{eqn:ax}
\end{equation}

\bigskip
\noindent
Now notice that if we multiply both sides of the original eignenvector equation $A X = \lambda X$ by $X^{\dagger}$ we get
$X^{\dagger} AX = X^{\dagger} \lambda X$.  We know from (\ref{eqn:ax}) that $X^\dagger  A X = X^{\dagger}  \lambda^{*} X$
and therefore that $X^{\dagger}  \lambda^{*} X = X^{\dagger}  \lambda X $.
This implies that $\lambda^{*} = \lambda$, so $\lambda \in \mathbb{R}$.
Similarly $a_n^* = a_n$ so $a_n \in \mathbb{R}$.

\bigskip
\noindent
Another way to look at this is to assume the computational basis\footnote{(\ref{eqn:aketan}) doesn't seem to require this assumption.}
and then

\begin{equation*}
\begin{array}{rcll}
 \bra{a_n} A
&=& a_n \bra{n} A
    & \quad \mathrel{\#} \bra{a_n}   =  a_n \begin{bmatrix} 0 & \hdots & 1 & \hdots 0 \end{bmatrix} = a_n \bra{n}    \\
&=& a_n \bra{n} A^{\dagger}
    & \quad \mathrel{\#} \text{$A$ is Hermitian so $A = A^{\dagger}$}    \\
&=& a_n \bra{n} \begin{bmatrix} \bra{a_1}  \\  \vdots \\ \bra{a_n} \\ \vdots \\  \bra{a_N}  \end{bmatrix}
    & \quad \mathrel{\#}  A^{\dagger} =  \begin{bmatrix} \bra{a_1}  \\  \vdots \\ \bra{a_n} \\ \vdots \\  \bra{a_N}  \end{bmatrix}  \\
&=& a_n \begin{bmatrix} 0 & \cdots & 1 & \cdots 0 \end{bmatrix}  \begin{bmatrix} \bra{a_1}  \\  \vdots \\ \bra{a_n} \\ \vdots \\  \bra{a_N}  \end{bmatrix}
    & \quad \mathrel{\#}  \bra{n}  = \begin{bmatrix} 0 & \hdots & 1 & \hdots 0 \end{bmatrix}  \\
&=& a_n \bra{a_n}
    & \quad \mathrel{\#}  \bra{n} \text{ selects the $n^{th}$ element of $A^{\dagger}, \bra{a_n}$}
\end{array}
\end{equation*}

\bigskip
\noindent
In any event, now we have $\bra{a_n} A = a_n \bra{a_n}$. So we can observe that

\begin{equation*}
\begin{array}{rcll}
\braket{A}_{\psi}
&=& \braket{\psi |A | \psi}
    & \qquad\qquad \mathrel{\#} \text{definition of $\braket{A}_{\psi}$ for \emph{pure} state $\ket{\psi}$} \\
&=& \braket{\psi  | IA | \psi}
    & \qquad\qquad \mathrel{\#} I \cdot A = A \\
&=& \braket{\psi | \bigg (\sum\limits_{n = 1}^{N} \ket{a_n} \bra{a_n} \bigg ) A | \psi}
    & \qquad\qquad \mathrel{\#} \sum\limits_{n = 1}^{N} \ket{a_n} \bra{a_n} = \mathbf{I} \;\;  \text{\big (Equation \ref{eqn:completeness}} \big ) \\
&=& \sum\limits_{n = 1}^{N} \braket{\psi | a_n} \braket{a_n | A | \psi}
     & \qquad\qquad \mathrel{\#} \text{rearrange} \\
&=& \sum\limits_{n = 1}^{N} \braket{\psi | a_n} a_n   \braket{a_n | \psi}
    & \qquad\qquad \mathrel{\#}  \bra{a_n} A = a_n \bra{a_n} \text{ (see above)} \\
&=& \sum\limits_{n = 1}^{N} \braket{\psi | a_n}  \braket{a_n | \psi} a_n
    & \qquad\qquad \mathrel{\#}  \text{rearrange} \\
&=& \sum\limits_{n = 1}^{N} | \braket{\psi | a_n}|^2  a_n
    & \qquad\qquad \mathrel{\#} |\braket{\psi | a_n}|^2  = \braket{\psi | a_n}  \braket{\psi | a_n}^*  = \braket{\psi | a_n}  \braket{a_n | \psi}  \\
&=& \sum\limits_{n = 1}^{N} p(a_n)  a_n
    & \qquad\qquad \mathrel{\#}  |\braket{\psi | a_n}|^2 = p(a_n),  \text{the probability of observing $a_n$} \\
&=& \E [A]
    & \qquad\qquad \mathrel{\#}  \E [X] = \sum\limits_{n = 1}^{N} p(X_n) X_n
\end{array}
\end{equation*}

\bigskip
\noindent
So the expectation value for the result of a measurement represented by a self-adjoint operator $A$, $\braket{A}_{\psi}$,
 is the weighted average of all possible outcomes under $A$, that is, $\E [A]$.

\section{Shapes}
\label{sec:shapes}
One way to visualize $\braket{A}_{\psi}$ is

\bigskip
\begin{flalign*}
\braket{A}_{\psi} & \rightarrow
\underbrace{\begin{bmatrix} \hdots \hdots  \hdots \end{bmatrix}}_{1 \times n}
\underbrace{
\begin{bmatrix}
\hdots & \hdots  & \hdots \\
\vdots & \ddots  &  \vdots \\
 \hdots & \hdots  & \hdots
\end{bmatrix}}_{n \times n}
\underbrace{\begin{bmatrix} \hdots \\ \vdots \\  \hdots  \end{bmatrix}}_{n \times 1} \\
& \rightarrow c
\end{flalign*}

\noindent
where $c \in \mathbb{C}$.

\bigskip
\noindent
The \emph{density operator} $\rho$ for pure state $\ket{\psi}$ is given by $\rho = \ket{\psi} \bra{\psi}$. The shape of $\rho$ is

\bigskip
\begin{flalign*}
\rho \rightarrow
\underbrace{\begin{bmatrix} \hdots \\ \vdots \\  \hdots  \end{bmatrix}}_{n \times 1}
\underbrace{\begin{bmatrix} \hdots \hdots  \hdots \end{bmatrix}}_{1 \times n} \rightarrow
\underbrace{
\begin{bmatrix}
\hdots & \hdots  & \hdots \\
\vdots & \ddots  &  \vdots \\
 \hdots & \hdots  & \hdots
\end{bmatrix}}_{n \times n}
\end{flalign*}

\bigskip
\noindent
The shape of the inner product of two $n \times 1$ column vectors  $\braket{\mathbf{u}, \mathbf{v}} = \braket{u | v} =  \mathbf{u}^{\text{T}}\mathbf{v}$ is

\bigskip
\begin{flalign*}
\mathbf{u}^{\text{T}}\mathbf{v}  & \rightarrow
\underbrace{\begin{bmatrix} \hdots \hdots  \hdots \end{bmatrix}}_{1 \times n}  \underbrace{\begin{bmatrix} \hdots \\ \vdots \\  \hdots  \end{bmatrix}}_{n \times 1}  \rightarrow c
\end{flalign*}

\bigskip
\noindent
where $c \in \mathbb{C}$. The shape of the outer product $\mathbf{u} \otimes \mathbf{v} = \ket{u} \bra{v} = \mathbf{u} \mathbf{v}^{\text{T}}$ is

\bigskip
\begin{flalign*}
\mathbf{u} \mathbf{v}^{\text{T}}  \rightarrow
\underbrace{\begin{bmatrix} \hdots \\ \vdots \\  \hdots  \end{bmatrix}}_{n \times 1}
\underbrace{\begin{bmatrix} \hdots \hdots  \hdots \end{bmatrix}}_{1 \times n} \rightarrow
\underbrace{
\begin{bmatrix}
\hdots & \hdots  & \hdots \\
\vdots & \ddots  &  \vdots \\
 \hdots & \hdots  & \hdots
\end{bmatrix}}_{n \times n}
\end{flalign*}

\bigskip
\section{The Density $\rho$ and the Trace of an Operator $D$}
So $\rho$ is an $n \times n$ \emph{linear operator} with $\text{Tr}(\rho)  = \text{Tr}(\ket{\psi} \bra{\psi}) = \braket{\psi | \psi}$.
In addition, $\text{Tr}(\ket{\psi_i} \bra{\psi_i}) = \braket{\psi_i | \psi_i}  = \delta_{ii} = 1$, and if $\{\ket{\psi_i}\}$ is an
orthonormal basis then $\text{Tr}(\ket{\psi_i} \bra{\psi_j}) = \braket{\psi_i | \psi_j}  = \delta_{ij}$.

\bigskip
\noindent
The density matrix \cite{porter04052011} $\rho$ has the following important properties:

\begin{equation*}
\begin{array}{lll}
& \text{Projection:}            & \quad \rho^2 = \rho           \\
& \text{Hermiticity:}           & \quad \rho^\dagger = \rho \\
& \text{Normalization:}      & \quad \text{Tr}(\rho) = 1    \\
& \text{Positivity:}              & \quad \rho \geq 1
\end{array}
\end{equation*}

\noindent
The \emph{trace} of an operator $D$,  $\text{Tr}(D)$, is defined to be $\text{Tr}(D) = \sum\limits_{i = 1}^{n} \bra{n} D \ket{n}$.
Now, suppose $D = \ket{\psi} \bra{\phi}$. Then we can see that $\text{Tr}(D) = \text{Tr}(\ket{\psi} \bra{\phi}) = \braket{\phi | \psi}$ as follows:

\begin{equation*}
\begin{array}{rcll}
\text{Tr}(D)
&=& \sum\limits_{n = 1}^{N} \bra{n} D \ket{n}                                                          & \quad  \mathrel{\#} \text{definition of $\text{Tr}(D)$}  \\
&=& \sum\limits_{n = 1}^{N} \bra{n} (\ket{\psi} \bra{\phi})  \ket{n}                            & \quad  \mathrel{\#} D = \ket{\psi} \bra{\phi} \\
&=& \sum\limits_{n = 1}^{N} \bra{n} \ket{\psi} \bra{\phi}\ket{n}                                & \quad  \mathrel{\#} \text{drop parens} \\
&=& \sum\limits_{n = 1}^{N} \braket{n | \psi} \braket{\phi | n}                                  & \quad  \mathrel{\#} \braket{a | b} = \bra{a} \ket{b} \\
&=& \sum\limits_{n = 1}^{N} \braket{\phi | n} \braket{n | \psi}                                  & \quad  \mathrel{\#} \text{rearrange} \\
&=& \bra{\phi}  \Bigg (  \sum\limits_{n = 1}^{N}  \ket{n} \bra{n} \Bigg )  \ket{\psi}    & \quad  \mathrel{\#} \text{neither $\phi$ nor $\psi$ depend on $n$}\\
&=& \braket{\phi | I | \psi}                                                                                & \quad  \mathrel{\#} \sum\limits_{n = 1}^{N} \ket{n} \bra{n} = \mathbf{I}  \;\;  \text{\big (Equation \ref{eqn:completeness}} \big ) \\
&=& \bra{\phi } \ket{\psi}                                                                                & \quad  \mathrel{\#} \bra{\phi } I = \bra{\phi} \text{ and } I \ket{\psi}  = \ket{\psi}  \\
&=& \braket{\phi | \psi}                                                                                & \quad  \mathrel{\#} \braket{\phi | \psi} = \bra{\phi} \ket{\psi}
\end{array}
\end{equation*}

\bigskip
\noindent
So the trace of the outer product  $\ket{\psi} \bra{\phi}$,  $\text{Tr}(\ket{\psi} \bra{\phi})$, is the inner product  $\braket{\phi | \psi}$.

\bigskip
\noindent
A simple theorem relates the expectation value of an observable $A$ in a state represented by a density matrix $\rho$ to the trace of $A$:

\begin{equation}
\braket{A}_\rho = \text{Tr}(\rho A)
\label{eqn:braket_A}
\end{equation}

\bigskip
\noindent
The proof of Equation \ref{eqn:braket_A} is also pretty simple:

\begin{equation*}
\begin{array}{rcll}
\text{Tr}(\rho A)
&=& \text{Tr}(\ket{\psi} \bra{\psi}  A)                                                                      & \quad \mathrel{\#} \rho = \ket{\psi} \bra{\psi} \\
&=& \sum\limits_{n = 1}^{N} \bra{n} \ket{\psi} \bra{\psi} A \ket{n}                          & \quad \mathrel{\#} \text{definition of Tr($\cdot$)} \\
&=& \sum\limits_{n = 1}^{N} \braket{n | \psi} \bra{\psi} A \ket{n}                           & \quad \mathrel{\#}  \braket{n | \psi}  =  \bra{n} \ket{\psi}  \\
&=& \sum\limits_{n = 1}^{N} \bra{\psi} A \ket{n} \braket{n | \psi}                           & \quad \mathrel{\#} \text{rearrange} \\
&=& \bra{\psi}  A \Bigg (\sum\limits_{n = 1}^{N} \ket{n} \bra{n} \Bigg ) \ket{\psi}   & \quad \mathrel{\#} \text{neither $A$ nor $\psi$ depend on $n$} \\
&=& \bra{\psi} A  \cdot I  \ket{\psi}                                                                         & \quad \mathrel{\#} \sum\limits_{n = 1}^{N} \ket{n} \bra{n} = \mathbf{I} \;\; \text{\big (Equation \ref{eqn:completeness}} \big )  \\
&=& \bra{\psi} A \ket{\psi}                                                                                & \quad  \mathrel{\#} \mathbf{A} \cdot \mathbf{I} = \mathbf{A} \\
&=& \braket{A}                                                                                & \quad \mathrel{\#} \braket{A}_{\psi} = \bra{\psi} A \ket{\psi}   \big (\text{Equation } \ref{eqn:exp} \big )
\end{array}
\end{equation*}

\bigskip
\section{A More General View of the Density Operator}
Consider an ensemble of identical quantum systems. The system has probability $w_i$ to be in quantum state $\ket{\psi_i}$.  Here $\braket{\psi_i | \psi_i} = 1$,  but
the states $\ket{\psi_i}$ aren't necessarily orthogonal to one another.   That means that out of all the examples in the ensemble, a fraction $w_i$  are in state $\ket{\psi_i}$, with
$w_i  >  0$ and $\sum\limits_{i} w_i = 1$.
\bigskip
\noindent
The expectation value for the result of a measurement represented by a self-adjoint operator $A$ is

\begin{equation}
\braket{A}_{\psi} = \sum\limits_{i} w_i \braket{\psi_i | A | \psi_i}
\label{eqn:braketA}
\end{equation}

\bigskip
\noindent
We can write the expectation value in a different way using a basis $\ket{K}$ as

\begin{equation*}
\begin{array}{rcll}
\braket{A}_{\psi}
&=& \sum\limits_{i} w_i \braket{\psi_i | A | \psi_i}
     & \quad \mathrel{\#} \text{defintion of } \braket{A}_{\psi} , \text{Equation } \ref{eqn:braketA} \\
&=& \sum\limits_{i} w_i \braket{\psi_i | I A I | \psi_i}
     & \quad \mathrel{\#} \mathbf{A} = \mathbf{I} \cdot \mathbf{A} \cdot \mathbf{I} \\
&=& \sum\limits_{i} w_i \braket{\psi_i | \Big (  \sum\limits_{J} \ket{J} \bra{J} \Big ) |A | \Big ( \sum\limits_{K} \ket{K} \bra{K} \Big ) | \psi_i}
     & \quad \mathrel{\#} \sum\limits_{J} \ket{J}\bra{J} = \mathbf{I}, \sum\limits_{K} \ket{K}\bra{K} = \mathbf{I} \\
&=& \sum\limits_{i} w_i \sum\limits_{J,K} \braket{\psi_i | J} \braket{J |A | K} \braket{K | \psi_i}
     & \quad \mathrel{\#} \text{rearrange} \\
&=& \sum\limits_{i} w_i \sum\limits_{J,K}  \braket{K | \psi_i}   \braket{\psi_i | J} \braket{J |A | K}
     & \quad \mathrel{\#} \text{rearrange} \\
&=&  \sum\limits_{J,K} \sum\limits_{i} w_i \braket{K | \psi_i}   \braket{\psi_i | J} \braket{J |A | K}
     & \quad \mathrel{\#} \text{none of $A$, $J$, or $K$ depend on $i$} \\
&=&  \sum\limits_{J,K}  \braket{K | \Big ( \sum\limits_{i} w_i  \ket{\psi_i}\bra{\psi_i}  \Big) | J} \braket{J |A | K}
     & \quad \mathrel{\#} \text{rearrange} \\
&=& \sum\limits_{J,K} \braket{K | \rho | J} \braket{J | A | K}
     & \quad \mathrel{\#} \rho = \sum\limits_{i} w_i \ket{\psi_i} \bra{\psi_i} \\\
&=& \sum\limits_{K} \braket{K | \rho  I A | K}
     & \quad \mathrel{\#} \sum\limits_{J} \ket{J} \bra{J} = \mathbf{I} \\
&=& \sum\limits_{K} \braket{K | \rho A | K}
     & \quad \mathrel{\#}  \mathbf{I} \cdot \mathbf{A} = \mathbf{A} \\
&=&  \text{Tr}(\rho A)
     & \quad \mathrel{\#} \text{Tr}(D) = \sum\limits_{n} \braket{n | D | n}
\end{array}
\end{equation*}

\subsection{Properties of the Density Operator}
As mentioned above, there are several important properties of the density operator $\rho$.  The first of these is that $\text{Tr}(\rho) = 1$.
This follows from $w_i$ has $w_i  >  0$ and $\sum\limits_{i} w_i = 1$.

\bigskip
\noindent
Next, $\rho$ is self-adjoint: $\rho^{\dagger} = \rho$. Because it is self-adjoint,
$\rho$ has eigenvectors $\ket{J}$ with eigenvalues $\lambda_{J}$ and the eigenvectors form a basis for vector space. Thus $\rho$ has a standard spectral
representation

\begin{equation*}
\rho = \sum\limits_{J} \lambda_{J} \ket{J} \bra{J}
\end{equation*}

\bigskip
\noindent
We can express $\lambda_{J}$ as $\lambda_{J}  = \braket{J | \rho | J}$. Then

\bigskip
\begin{equation*}
\begin{array}{rcll}
\lambda_{J}
&=& \braket{J | \rho | J}                                                                                & \quad \mathrel{\#}  \\
&=& \braket{J | \Big ( \sum\limits_{i} w_i \ket{\psi_i} \bra{\psi_i} \Big ) | J}      & \quad \mathrel{\#}  \rho = \sum\limits_{i} w_i \ket{w_i} \bra{w_i}  \\
&=& \sum\limits_{i} w_i  \braket{J | \psi_i} \braket{\psi_i | J}                           & \quad \mathrel{\#}  \text{rearrange} \\
&=& \sum\limits_{i} w_i \braket{J | \psi_i} \braket{J | \psi_i}^*                         & \quad \mathrel{\#} \braket{J | \psi_i}^* = \braket{\psi_i | J} \\
&=& \sum\limits_{i} w_i |\braket{J | \psi_i}|^2                                                  & \quad \mathrel{\#} \braket{J | \psi_i} \braket{J | \psi_i}^* =  |\braket{J | \psi_i}|^2
\end{array}
\end{equation*}

\bigskip
\noindent
Since $w_i > 0$ and $ |\braket{J | \psi_i}|^2 > 0$, each eigenvalue must be non-negative, that is, $\lambda_{J} \geq 0$. In addition, the trace of $\rho$ is the sum of its
eigenvalues, so $\sum\limits_{J} \lambda_{J} = 1$. Since each eigenvalue is non-negative, $\lambda_{J} \leq 1$.

\bigskip
\noindent
Another way to see why $|\braket{a_n | \psi}|^2 = p(\psi)$:

\begin{equation*}
\begin{array}{rcll}
\ket{\psi}
&=& I \ket{\psi}                                                                                & \quad \mathrel{\#}  \mathbf{I} \cdot \mathbf{X} = \mathbf{X} \\
&=& \sum\limits_{n} \ket{a_n} \bra{a_n} \ket{\psi}                                              & \quad \mathrel{\#} \sum\limits_{n} \ket{a_n} \bra{a_n} = I \\
&=& \sum\limits_{n} \ket{a_n} \braket{a_n | \psi}                                               & \quad \mathrel{\#} \bra{a_n} \ket{\psi} = \braket{a_n | \psi}
\end{array}
\end{equation*}

\bigskip
\noindent
So $\braket{a_n | \psi}$ is the amplitude of $\ket{a_n}$, making $| \braket{a_n | \psi} |^2 = p(a_n)$.

\bigskip
\section{Acknowledgements}

\newpage
\bibliographystyle{plain}
\bibliography{/Users/dmm/papers/bib/qc}
\end{document}


%****************************************
% Lab 07: Timer
%****************************************
\chapter{Timer}

\section{Purpose}

A timer is used to time events. This lab creates a timer where the minimum and maximum counts can be set and counts both up and down. The timer assumes an input clock pulse at 1 Hz (or 60 pulses per minute) but for testing, the clock can be set to any value.

\section{Procedure}

The lab starter circuit includes several versions of the timer as an illustration of the thought process used to develop the final product.

\begin{itemize}
	\item \textbf{Timer\_V1}. This is little more than a test of the Counter (\textit{Memory} library) component. The various inputs were wired so both the \textit{Load} and \textit{Up} input pins could be tested. Instead of a clock pulse, a Button (\textit{Input/Output} library) was used for better control over the device. A Bin2BCD (\textit{BFH mega functions} library) device was used for easier interpretation of the output.
	\item \textbf{Timer\_V2}. The first circuit was expanded such that both the minimum and maximum counts could be specified. Note that the multiplexer (\textit{Plexers} library) selects whether the minimum or maximum number is loaded depending on whether the count is Up or Down.
	\item \textbf{Timer\_V3}. This is the version of the timer that will be completed for this lab.
\end{itemize}

\subsection{Timer\_V3}

Complete the circuit to match Figure \ref{fig:07-01}.

\begin{figure}[H]
	\centering
	\includegraphics[width=\maxwidth{.95\linewidth}]{gfx/07-01}
	\caption{Completed Timer}
	\label{fig:07-01}
\end{figure}

In the timer circuit, the key is the comparator in the lower left corner. That device compares the binary output of the counter to either the minimum or maximum requested value and if they are equal the comparator sends a reset signal to start the count over.

There are two multiplexers with a subtle, but important, difference. The Maximum input value is wired to the top input of the top multiplexer but the bottom input of the bottom multiplexer. The result is the when the count is ``Up'' the Minimum input is loaded into the counter but the Maximum input is used in the compare, so the counter starts at the minimum and counts up to the maximum. The opposite is true for a ``Down'' count.

Finally, the BCD output is combined by a splitter (\textit{Wiring} library) into a 12-bit bus for transmission.

\subsection{Testing the Circuit}

The \lstinline[columns=fixed]|Timer_V3| subcircuit should be added to the \lstinline[columns=fixed]|main| circuit and wired as in Figure \ref{fig:07-02}.

\begin{figure}[H]
	\centering
	\includegraphics[width=\maxwidth{.95\linewidth}]{gfx/07-02}
	\caption{Timer Main Circuit}
	\label{fig:07-02}
\end{figure}

To test the circuit:

\begin{enumerate}
	\item Enter binary four for a minimum value and eight for a maximum value. (Actually, any values can be entered but four and eight are enough to test the circuit.)
	\item Poke \textit{Up\_Down} to change its value to one so the circuit counts up.
	\item Poke the Reset button and observe that the BCD out changes to 004.
	\item Activate the clock \textsc{Simulate -> Ticks Enabled} and observe that it counts up from four to eight and then resets to four. If the speed of the timer is not reasonable then the \textsc{Simulate -> Tick Frequency} can be adjusted.
	\item Poke \textit{Up\_Down} to change the count to down and observe that the timer now counts from eight to four and resets.
\end{enumerate}

\section{Challenge}

As designed, the output of this circuit is an integer count. If it were set for counting seconds then the count of seconds would increase from 59 to 60 then 61 rather than going 0:59, 1:00, 1:01 as expected. Rewrite the \lstinline[columns=fixed]|Timer_V3| subcircuit so the output is two BCD numbers: minutes and seconds. As a hint, the Divider (\textit{Arithmetic} library) device products an integer (``modulus'') division along with a remainder. It should help to divide the count by 60, use the whole number as ``minutes'' and the remainder as the ``seconds.''

\section{Deliverable}

To receive a grade for this lab, complete the Challenge. Be sure the standard identifying information is at the top left of the \lstinline{main} circuit, similar to:

\bigskip
% The minipage environment keeps the three lines together - no page break.
\begin{minipage}{\linewidth}
	\begin{verbatim}
	George Self
	Lab 07: Timer
	March 1, 2018
	\end{verbatim}
\end{minipage}
\bigskip

Save the file with this name: \emph{\texttt{Lab07\_Timer}} and submit that file for grading.


\documentclass{article}
\usepackage{outline}
\usepackage[margin=1.0in]{geometry}

\usepackage{amsmath, amsthm, amssymb}
\usepackage{fancyhdr}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage[table]{xcolor}% http://ctan.org/pkg/xcolor
\usepackage{multirow}
\usepackage{tikz}
\usepackage{semantic}
\usetikzlibrary{arrows}
\usepackage{adjustbox}
\usepackage{indentfirst}
\usepackage{bm}
\usepackage{caption}
\usepackage{hyperref}

% fancy header %
\pagestyle{fancy}
\lhead{FPEAnalysis System: Developer's Manual}
\rhead{Revision 1}

\definecolor{ashgrey}{rgb}{0.7, 0.75, 0.71}

\begin{document}

\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height

\title{
\normalfont \normalsize
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge FPEAnalysis System: Developer's Manual\\
\vspace{0.5cm}
\normalfont \normalsize An Independent Reading and Research Project (Fall 2015)\\under Professor David Bindel (bindel@cs.cornell.edu)\\Cornell University % The assignment title
\horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule
}
\author{Humam A Alwassel (haa54@cornell.edu)} % Your name
\date{\normalsize Revision 1, updated \today} % Today's date or a custom date

\maketitle

This document is the developer's manual for FPEAnanlysis system. It explains the main ideas and techniques that the system uses. This document is technical in nature and is aimed towards developers with a sufficient computer science background, specifically in numerical analysis. Please read the ``User's Manual'' first before reading this document.

\section{Source Code Files}
The system source code files are:
\begin{itemize}
	\item $\bf{analysis.ml}$: a library for computing error estimates to analyzing stability of expressions
	\item $\bf{ast.ml}$: type definitions for the abstract syntax tree and the data structures used by FPEAnalysis
	\item $\bf{augment.ml}$: a library for augmenting expression with (1+ $\delta$)'s
	\item $\bf{deriv.ml}$: a library for computing partial derivatives of expressions
	\item $\bf{eval.ml}$: a library for evaluating expressions using interval arithmetics
	\item $\bf{FPEAnalysis.ml}$: the main system program
	\item $\bf{lexer.mll}$: the lexer for the input files
	\item $\bf{parser.mly}$: the parser for the input files
	\item $\bf{pprint.ml}$: a pretty print library for data types used by the system
	\item $\bf{util.ml}$: a utility library with functions used across the system, such as functions for simplifying expressions and interval
\end{itemize}

\section{The (1+$\delta$) Model}
Suppose that $expr$ is an arbitrary arithmetic expression with an exact value $v$. Let fl($expr$) be the correctly rounded floating point representation of $expr$'s value. The (1+$\delta$) model states that fl($expr$) = $(1 + \delta)*v$, where $|\delta| < \epsilon_{mach}$. This means that the absolute and relative floating point errors are $\delta*v$ and $1+\delta$, respectively. This is a linear model for estimating the floating point error.

\section{Interval Arithmetics}
Read about the subject on \href{https://en.wikipedia.org/wiki/Interval_arithmetic}{https://en.wikipedia.org/wiki/Interval$\_$arithmetic}

\section{How FPEAnalysis Works?}
FPEAnalysis takes the following main steps to produce its final analysis report:
\begin{enumerate}
	\item Parse the input file and divide it into a $(bindings, conditions, body)$ tuple, where
	\begin{itemize}
		\item $bindings$ is the list of $(var, val)$ pairs from the first curly braces list
		\item $conditions$ is the list of $(subexpr, val)$ pairs from the second curly braces list
		\item $body$ is the program body converted to an $Ast.aexp$ type
	\end{itemize}

	\item Convert the lists $bindings$ and $conditions$ to an $Ast.BindingMap$ and an $Ast.ConditionMap$ maps, respectively (call these maps $bind\_map$ and $cond\_map$, respectively)

	\item Augment $body$ and each of its subexpressions with ($1 + \delta$)'s. Augment each subexpression with a different $\delta$ variable (use $\delta_0, \delta_1, \delta_2, ...$) with the following exceptions:
	\begin{itemize}
		\item Augment expressions that are equivalent with the same $\delta$ because equivalent expressions should have the same error. For example, the two expressions $(a + b)$ and $(b + a)$ are equivalent and should have the same $\delta$ (see the $Ast.expCompare$ compare function for the equivalence rules)
		\item Do not augment a subexpression $(a - b)$ if $a$ and $b$ are within a factor of 2 from each other (use the $bind\_map$ to decide this). There is no floating point error in such cases and the computation is exact
	\end{itemize}
	Store each subexpression and it augmented version in an $Ast.Input2AugmentedMap$ map (call it $in2aug\_map$)

	\item Take the partial derivatives of each augmented subexpression with respect to each $\delta$. Linearize each partial derivative about $\delta = 0$. Store the results in an $Ast.Augmented2DerivMap$ map (call it $aug2deriv\_map$)

	\item Compute the worst absolute and relative errors for each subexpression. Let $eval(expr)$ donates the interval value of $expr$ under the variable bindings in $bind\_map$ and after applying any applicable conditions from $cond\_map$. The worst absolute error is
	\[
	w\_abs\_err = \max \left(\sum_i eval\left(\left[\frac{\partial\ expr}{\partial\ \delta_i}\right]_{linearized}\right)\right) * \epsilon_{mach}.
	\]
	The worst relative error is
	\[
	w\_rel\_err = \frac{w\_abs\_err}{\min (eval(expr))}.
	\]

	\item Process the computed worst relative errors for each subexpression to find critical subexpressions. Consider an expression critical if it has a high relative error but its children subexpressions have low relative error. Compile the analysis report and return it to the user
\end{enumerate}

\end{document}


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

\section*{Introduction}

\marginpar{Monday\\ 2021-4-12, \\ compiled \\ \today}

The syllabus can be found \href{http://sbernuzzi.gitpages.tpi.uni-jena.de/gw/}{here}.

Interesting things on the \href{https://indico.tpi.uni-jena.de/}{Indico server} of Jena university.

In this first lecture, a basic introduction to the theory of gravitational waves: Einstein's first papers, the sticky bead argument by Bondi \& Feynman, the quadrupole formula:
%
\begin{align}
\overline{h}_{ij} (t, r) = \frac{2G}{c^{4} r} \ddot{I}_{ij} (t - r)
\,.
\end{align}

The idea behind the multipole expansion is that we are solving the Poisson equation \(\nabla^2 \phi = \rho \), so
%
\begin{align}
\phi (\vec{r}) = \int \frac{ \rho (\vec{x}) \dd[3]{x}}{\abs{\vec{r} - \vec{x}}}
\,,
\end{align}
%
so as long as we are far away from the source we will see
%
\begin{align}
\phi (\vec{r}) = - \frac{q}{r} - \frac{p_i n^i}{r^2} - \frac{Q_{ij}n^i n^j}{r^3} + \dots
\,.
\end{align}

Quiz: which of these are GW sources?
\begin{enumerate}
    \item spherical star: no, its quadrupole is vanishing;
    \item rotating star: no, its quadrupole is constant;
    \item star with a mountain: yes, its quadrupole evolves (potential source of continuous GW);
    \item supernova explosion: yes, if there is asymmetry (potential source of burst GW);
    \item binary system: yes, already detected!
\end{enumerate}

\begin{claim}

Order of magnitude expression:
%
\begin{align}
h \lesssim \frac{GM}{c^2 D} \frac{v^2}{c^2} = \frac{R}{D} \frac{GM}{c^2 R} \qty( \frac{v}{c})^2
\,,
\end{align}
%
where \(D\) is the distance to the object, \(R\) is the characteristic scale of the object (so that \(GM / c^2 R\) is the compactness), while \(v\) is the characteristic velocity. The quantity we calculate is \(h \sim \delta L / L\), the strain.
\end{claim}

\begin{proof}
To do.
\end{proof}

The Hulse-Taylor pulsar.
The two-body problem in GR is difficult.

The typical waveform in the PN region looks like:
%
\begin{align}
h_{+} (t) \approx \frac{4}{r} \qty( \frac{GM_c}{c^2})^{5/3} \qty( \frac{\pi f_{\text{gw}}(t)}{c})^{2/3} \cos( 2 \pi f _{\text{gw}} (t) t)
\,,
\end{align}
%
then we need numerical relativity to simulate the plunge and merger, and finally the ringdown is simulated using BH perturbation methods.
The mass scale is
%
\begin{align}
h(t) \sim \nu \frac{1}{r / M} (M f _{\text{gw}})^{2/3}
\,,
\end{align}
%
while
%
\begin{align}
\phi _{\text{gw}}(t) \sim 2 \phi _{\text{orb}}(t) = 2 M_c^{-5/8} t^{5/8} = 2 \nu^{-3/8} \qty( \frac{t}{M})^{5/8}
\,,
\end{align}
%
 where \(\nu = \mu / M\), and \(\mu = 1/(1/M_1 + 1/M_2 )\).

Multiple detectors are crucial for sky localization, as well as for the measurement of polarization.

At leading order, the two-body problem in GR is scale-invariant: the length of the signal can be estimated simply from the mass of the stars involved.

R-process nucleosynthesis might have something to do with BNS mergers, if the stars are torn apart by the collision.

\end{document}


% Team members:
% Linfeng Zhou (lzhou15)
% Amit Watve (awatve)

\documentclass{article}
\usepackage{algorithm, algpseudocode}
\usepackage{geometry}
\usepackage{amsmath, amssymb, amsthm, enumerate, hyperref}
\usepackage{color}
\usepackage{setspace}
\usepackage{fancyhdr,lastpage}
\usepackage{url}
\usepackage{tabularx}
\pagestyle{fancy}
\lhead{\footnotesize Opportunity Identification Project}
\chead{Team 8}
\rhead{\footnotesize CSC (791/495)-011 -- Fall 2017}
\lfoot{}
\cfoot{\small \thepage/\pageref*{LastPage}}
\rfoot{}

\newcommand{\defproblem}[4]{%
  \hfill\\\smallskip\noindent%
  \begin{tabularx}{\textwidth}{|l X|}%
    \hline%
    \multicolumn{2}{|l|}{\pname{#1}}\\%
    \textbf{Input:}&#2\\%
    \textbf{Parameter:}&#3\\%
    \textbf{Question:}&#4\smallskip\\\hline%
  \end{tabularx}%
  \smallskip%
}%

\newcommand{\pname}[1]{\textnormal{\textsc{#1}}}

\newtheorem*{theorem}{Theorem}
\newtheorem{definition}{Definition}
\newtheorem*{lemma}{Lemma}

\begin{document}

\title{Nash Equilibrium for two player games}
\date{}
\maketitle

\begin{abstract}
We try to explore some open problems in algorithmic game theory so as to find simplified versions of them particularly which could have parameterized algorithms. Particularly we focus on problems related to finding Nash equilibrium for pure and mixed strategy two player games.

\end{abstract}

\subsection*{Introduction}

\defproblem{$2$-Nash}
%
{A two-player(bimatrix) game}
%
{support sizes bounded by $k$}
%
{Can we compute the Nash equilibrium in less than $n^{O(k)}$ time? Furthermore, can we find a special case of Nash Equilibrium in bimatrix games and solve it in $FPT$ time?}
%

The central problem in algorithmic game theory is that of computing a Nash
equilibrium, a set of strategies for each player in a given game, where no player
can gain by changing his strategy when all other players strategies remain fixed \cite{hermelin2013parameterized}.

Roughly speaking, Nash's theorem states that for any finite game a mixed Nash equilibrium always exists. However, this concept is not very meaningful for predicting behaviors of rational agents such as real-world computers. Namely it doesn't live in the computation world. To overcome this gap, researchers such as Papadimitriou started investigating the problem of computing Nash equilibria as an important complexity problem \cite{papadimitriou2001algorithms}.

The first breakthrough in determining the computational complexity of Nash equilibrium was made by Daskalakis, Goldberg, and Papadimitriou \cite{daskalakis2009complexity,goldberg2006reducibility}. They introduced a reduction technique that shows a Nash equilibrium in a four player game is PPAD-complete. In subsequent works, Daskalakis and Papadimitriou \cite{daskalakis2005three}, and Chen and Deng \cite{chen20053} extended this result to 3-player games. The case of two player games (a.k.a., bimatrix games) was finally solved by Chen and Deng \cite{chen2006settling}. That is, they proved that computing Nash equilibria in two player games is PPAD-complete. More importantly, this result implies the impossibility of the existence of a polynomial-time algorithm for the core case of bimatrix games.

\subsection*{Background}
\textsc{Nash} is a very different kind of intractable problem, one for which NP-completeness is not an appropriate concept of complexity. This is due to the fact that \emph{every game} is guaranteed to have a \textsc{Nash} Equilibrium as opposed to NP-complete problems such as \textsc{satisfiability} in which a solution may or may not exist \cite{nisan2007algorithmic}. Consequently, bimatrix, the problem of finding a Nash equilibrium in a two-player game, is complete for the complexity class PPAD (Polynomial Parity Argument, Directed version) introduced by Papadimitriou in 1991 \cite{chen2009settling,daskalakis2009complexity}.

Since the result of Chen and Deng \cite{chen2006settling}, the academia started focusing on exploring the possibilities of computing Nash equilibria in bimatrix games in somewhat weaker conditions. There are two main lines of research about this problem. The first one is to find \textit{approximate} Nash equilibria \cite{bosse2007new,chen2006computing,chen2006sparse,chen2007approximation,daskalakis2007progress,daskalakis2006note,lipton2003playing}. The second line of research is to find special cases where exact equilibria can be computed in polynomial time \cite{lipton2003playing,addario2007polynomial,chen2006sparse,codenotti2006efficient,kalyanaraman2007algorithms}.
However, the best known algorithm for general bimatrix games for computing either approximating or exact equilibria essentially tries all possibilities for the support of both players (i.e., the set of strategies played with non-zero probability), which can be assumed to be at most logarithmic in the approximate case \cite{lipton2003playing}. Once the support of both players is known, one can compute a Nash equilibrium by solving a linear program. That is, a Nash equilibrium in a bimatrix game can be computed in \(n^{O(k)}\) time \cite{nisan2007algorithmic}.

\subsection*{Related Work}
Centering around this result, a natural question to ask is \textit{can we remove the dependency on the support size from the exponent?}. This brings this question into the world of parameterized complexity theory, which is a standard framework for answering such questions. Estivill-Castro and Parsa initiated the study of computing Nash equilibria using parameterized algorithmic techniques in \cite{estivill2009computing}. They showed that if bimatrix games is parameterized by the support size, it is \(W[2]\)-hard even in certain restricted settings. Combining this result and the results of Chen et al.\cite{chen2004tight}, we obtain a devastating consequence that there is no \(n^{o(k)}\) time algorithm for computing bimatrix game parameterized by support size at most \(k\), unless \(FPT=W[1]\). In other words, for large enough games that have equilibriums with reasonably small supports, the task of computing equilibria already becomes infeasible.

A new line of research is to identify natural parameters which govern the complexity of computing Nash equilibria, and which can help in devising feasible algorithms. Kalyanaraman and Umans \cite{kalyanaraman2007algorithms} provided a fixed-parameter algorithm for finding equilibrium in bimatrix games whose matrices have small rank (and some additional constraints).

In a subsequent work, several works \cite{hermelin2013parameterized,codenotti2006efficient,addario2007polynomial} considered the graph-theoretic representation of bimatrix games, a natural class of games that has a convenient interpretation in the graph-theoretic context is the class of \(\ell\)-sparse games \cite{chen2006sparse,codenotti2006efficient,daskalakis2009oblivious}, in which each column and row have at most \(\ell\) non-zero entries in both payoff matrices. A natural attempt is to try to devise a parameterized algorithm with \(\ell\) taken as a single parameter. However, Chen, Deng and Teng \cite{chen2006sparse} showed that there is no algorithm for computing an \(\epsilon\)-approximate equilibrium for a 10-sparse game in polynomial time in \(\epsilon\) and \(n\), unless \(PPAD=P\). Therefore, such an FPT algorithm cannot exist unless PPAD is in P. Hermelin et.al.\cite{hermelin2013parameterized} showed that a Nash equilibrium in a \(\ell\)-sparse bimatrix game can be computed in FPT time when we take \(\ell\) and \(k\) as parameters, where \(k\) is the size of supports. They also considered finding Nash equilibrium in a \(k\)-unbalanced bimatrix game and Nash equilibrium in a locally bounded treewidth game and they proposed FPT algorithms respectively.

Thomas et al. explore PNE-GG, the problem of deciding the existence of a Pure Nash Equilibrium in a graphical game, and the role of treewidth in this problem. PNE-GG is known to be NP -complete in general, but polynomially solvable for graphical games of bounded treewidth. They further show that PNE-GG is   W[1]-Hard when parameterized by treewidth \cite{thomas2015pure}.

\subsection*{Importance}
The emergence of the internet has given rise to numerous applications in this area such as online
auctions, online advertising, and search engine page ranking, where humans and computers interact with each other as selfish agents negotiating to maximize their own payoff utilities \cite{hermelin2013parameterized}. The amount of research spent in attempting to devise computational models and algorithms for studying these types of interactions has been overwhelming in recent years due to its direct correlation with increased economic benefits. Before game theory, economists often analyzed markets simply in terms of the supply and demand of the goods to be sold, with no way to discuss the rules of the game that make one kind of auction different from another or make auctions different from other kinds of markets (such as stock markets or shopping malls). Today, that discussion is most often carried forward by analyzing the Nash equilibria of the auction rules.
\medskip

\bibliographystyle{unsrt}
\bibliography{references}

\end{document}


\documentclass[oneside]{memoir}

\usepackage{notestemplate}

\logo{~/LibreMath/Auxiliary Resources/resources/png/logo.png}
\institute{Rice University}
%\faculty{Faculty of Whatever Sciences}
\department{Department of Mathematics}
\title{Introduction to Complex Analysis}
%\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

\tableofcontents

\setcounter{chapter}{-1}

\chapter{Preamble}
\label{cha:preamble}

\input{Introduction}

\chapter{The Complex Field}
\label{cha:the_complex_field}

\section{Arithmetic of \(\C\)}
\label{sec:arithmetic_and_geometry_of_c}

\input{2020-02-06-ComplexNumbers}

\section{Geometry in \(\C\)}
\label{sec:geometry_in_c}

\input{2020-02-07-GeometryinC}

\section{Riemannian Sphere and Its Linear Transformations}
\label{sec:riemannian_sphere_and_its_linear_transformations}

\input{RiemannSphere}

\section{Topology of \(\C\)}
\label{sec:topology_of_c}

\input{2020-02-13-ComplexTopology}

\subsection{Sequences in \(\C\)}
\label{sub:sequences_in_c}

\input{2020-02-14-ComplexSequences}

\chapter{Complex Functions}
\label{cha:complex_functions}

\input{2020-02-20-ComplexContinuity}

\section{Differentiability in \(\C\)}
\label{sec:differentiability_in_c}

\input{2020-02-21-Holomorphic}
\input{InverseOpenMapping}

\section{Power Series}
\label{sec:power_series}

\input{2020-02-28-PowerSeries}

\chapter{Complex Integration}
\label{cha:complex_integration}

\section{Integration on Curves}
\label{sec:integration_on_curves}

\input{2020-03-05-CurveIntegration}

\section{Integration on Closed Curves}
\label{sec:integration_on_closed_curves}

\input{2020-03-06-ClosedCurveInt}

\section{Cauchy's Theorem}
\label{sec:cauchy_s_theorem}

\input{CurveHomotopy}

\input{2020-04-02-CauchysThm}

\section{Cauchy's Integral Formulas}
\label{sec:cauchy_s_integral_formulas}

\input{CauchysIntFormulas}

\input{CauchysIntApplications}

\chapter{Singularities and Residues}
\label{cha:singularities_and_residues}

\input{PolesMotivation}

\section{Zeroes and Singularities}
\label{sec:zeroes_and_singularities}

\input{Singularities}

\section{Calculus of Residues}
\label{sec:calculus_of_residues}

\input{Residues}

% Section on partial fractions? Ahlfors 5.2

\chapter{Conformal Mappings}
\label{cha:conformal_mappings}

\section{Automorphisms in the Complex Plane}
\label{sec:automorphisms_in_the_complex_plane}

\input{ConformalMappings}

\section{Riemann Mapping Theorem}
\label{sec:riemann_mapping_theorem}

\input{RiemannMappingThm}

\chapter{Harmonic Functions}
\label{cha:harmonic_functions}

In real analysis, harmonic functions form a relatively rigid class of functions, sharing many properties which are similar to holomorphic functions in many ways-- such as the mean value property and maximum modulus principle. It comes as no surprise that harmonic functions have an intimate connection to holomorphic functions. In this chapter, we will explore the connection between holomorphic and harmonic functions, and how it can be applied to learn more about the other. But-- we will also see where they differ, to better understand the kinds of functions which are harmonic but not holomorphic, and vice versa.

\section{Decomposability of Holomorphic Functions}
\label{sec:decomposability_of_holomorphic_functions}

\input{HarmonicFunctions}

\chapter{Analytic Continuation} % Cool, but not necessary for exam, so putting it on hold. May want to use it for reference later?
\label{cha:analytic_continuation}
%\input{AnalyticContinuation}

Under construction

\section{Continuation via Reflection}
\label{sec:continuation_via_reflection}

\input{SchwarzReflection}

\chapter{Entire and Meromorphic Functions}
\label{cha:entire_and_meromorphic_functions}

\section{Partial Fraction Decomposition}
\label{sec:partial_fraction_decomposition}

%\input{PartialFraction}
Under construction

\section{Infinite Products}
\label{sec:infinite_products}

\input{InfiniteProducts}

\section{Entire Functions of Finite Order}
\label{sub:entire_functions_of_finite_order}

\input{FiniteOrder}

\section{Meromorphic Functions}
\label{sec:meromorphic_functions}

\input{Meromorphic}

\chapter{Special Functions}
\label{cha:special_functions}

\section{Subharmonic Functions}
\label{sec:subharmonic_functions}

Under construction

\subsection{Dirichlet's Problem}
\label{sub:dirichlet_s_problem}

Under construction

\section{Elliptic Functions}
\label{sec:elliptic_functions}

Under construction

\subsection{Fourier Transform}
\label{sub:fourier_transform}
%\input{FourierTransform}

Under construction

\section{Riemann Zeta Function}
\label{sec:riemann_zeta_function}

Under construction

\subsection{Gamma Function}
\label{sub:gamma_function}

Under construction

\end{document}