\typeout{new file: Verification_Tests_Chapter.tex}

\chapter{Verification Tests}
\label{sec:verification}

This chapter reports the results of the verification tests performed with the new fuel data, \textit{i.e.} Ethylene ($\rm C_2H_4$), Ethane ($\rm C_2H_6$), Propylene ($\rm C_3H_6$), Propane ($\rm C_3H_8$), Toluene ($\rm C_7H_8$),
  \textit{n}-Heptane ($\rm C_7H_{16}$), Methanol ($\rm CH_3OH$), Methyl Methacrylate ($\rm C_5H_8O_2$). Synthetic transmissivity spectrum were generated with RadCal and compared with all the experimental data they were extract from. The experimental data resolution was adjusted to match that of RadCal:
\begin{equation}
 \begin{cases}
   5~{\rm cm}^{-1},\, & \om \leq 1000 {\rm cm^{-1}}\\
    25~{\rm cm}^{-1},\,& 5000 > \om > 1000 {\rm cm^{-1}} \\
    50~{\rm cm}^{-1},\,& \om > 5000 {\rm cm^{-1}}
 \end{cases}
\end{equation}

The relative error between the experimental and the RadCal-generated transmissivity, denoted $\epsilon{(\tau_{\omega})}$, was also quantified. The relative error between the experimental and the RadCal calculated transmissivities can also be quantified by a weighted average relative error $\epsilon$ over the entire experimental spectrum. A useful test function to perform the weighting is given by the spectral emissivity. Assuming Kirchhoff's law applies for each wavenumber over a narrow band, the spectral emissivity of a narrow band, denoted $\bar{\varepsilon}_{\omega}$, is given by:
\begin{equation}
 \bar{\varepsilon}_{\omega} = 1 -\bar{\tau}_{\omega}.
\end{equation}
The weighted average error is then defined by the following relation:
\begin{equation}
\label{eq:WeightedError}
 \langle\epsilon{(\bar{\tau}_{\omega})}\rangle = \dfrac{\displaystyle\int\limits_{700}^{4000}\bar{\varepsilon}_{\omega}\epsilon(\bar{\tau}_{\omega}) {\rm d} \omega}{\displaystyle\int\limits_{700}^{4000}\bar{\varepsilon}_{\omega} {\rm d} \omega}.
\end{equation}

Figure~\ref{fig:Verify_All} plots the maximum relative error and the maximum integrated weighted error for all the new species. Note that the values given in these plot correspond to the maximum over the set of tested temperatures.

\begin{figure}
\begin{center}
      \includegraphics[width=\textwidth]{../Verification/Results_Test2/Test2_Results.pdf}
\end{center}
 \caption{Left: Maximum relative error, in percent, across the whole spectrum and temperature for the new molecules implemented in RadCal. Right: Maximum integrated weighted error (across tested temperatures) calculated using Eq.~\ref{eq:WeightedError}. \label{fig:Verify_All}}
\end{figure}

In the following sections below, for each species, detailed plots comparing the spectral experimental transmissivities with the synthetic ones calculated with RadCal are presented along with plots of the spectral relative error in transmissivity for each pressure-path and temperature tested. Very good agreement is overall found except in some well localized parts of the spectrum for the heaviest molecules and usually at elevated temperature. The reason behind it is that at elevated temperature, the experimental measurements were very close to the optically thin limit, \textit{i.e.} $\tau \rightarrow 1$, and thus some of the measurements were affected by the FTIR sensitivity. Nevertheless, when comparing integrated quantities, \textit{e.g.} the integrated weighted error, the match between experimental and predicted results is very good.

\clearpage

\section{Ethylene: $\rm C_2H_4$}

\begin{figure}[h]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethylene_296.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethylene of an isothermal homogeneous column of ethylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.305, 0.18, and 0.0784 atm.cm. The gas temperature is set at 296~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethylene_Verify_296K}}
\end{figure}

\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethylene_400.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethylene of an isothermal homogeneous column of ethylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.305, 0.18, and 0.0784 atm.cm. The gas temperature is set at 400~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethylene_Verify_400K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethylene_450.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethylene of an isothermal homogeneous column of ethylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.305, 0.18, and 0.0784 atm.cm. The gas temperature is set at 450~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethylene_Verify_450K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethylene_500.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethylene of an isothermal homogeneous column of ethylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.305, 0.18, and 0.0784 atm.cm. The gas temperature is set at 500~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethylene_Verify_500K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethylene_601.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethylene of an isothermal homogeneous column of ethylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.305, 0.18, and 0.0784 atm.cm. The gas temperature is set at 601~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethylene_Verify_600K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethylene_801.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethylene of an isothermal homogeneous column of ethylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.305, 0.18, and 0.0784 atm.cm. The gas temperature is set at 801~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethylene_Verify_801K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethylene_1000.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethylene of an isothermal homogeneous column of ethylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.305, 0.18, and 0.0784 atm.cm. The gas temperature is set at 1000~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethylene_Verify_1000K}}
\end{figure}

\clearpage

\section{Ethane: $\rm C_2H_6$}

\begin{figure}[h]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethane_296.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethane of an isothermal homogeneous column of ethane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.339, 0.211, and 0.0812 atm.cm. The gas temperature is set at 296~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethane_Verify_296K}}
\end{figure}

\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethane_400.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethane of an isothermal homogeneous column of ethane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.339, 0.211, and 0.0812 atm.cm. The gas temperature is set at 400~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethane_Verify_400K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethane_450.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethane of an isothermal homogeneous column of ethane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.339, 0.211, and 0.0812 atm.cm. The gas temperature is set at 450~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethane_Verify_450K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethane_500.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethane of an isothermal homogeneous column of ethane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.339, 0.211, and 0.0812 atm.cm. The gas temperature is set at 500~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethane_Verify_500K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethane_600.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethane of an isothermal homogeneous column of ethane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.339, 0.211, and 0.0812 atm.cm. The gas temperature is set at 600~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethane_Verify_600K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethane_800.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethane of an isothermal homogeneous column of ethane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.339, 0.211, and 0.0812 atm.cm. The gas temperature is set at 801~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethane_Verify_800K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Ethane_1000.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of ethane of an isothermal homogeneous column of ethane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.339, 0.211, and 0.0812 atm.cm. The gas temperature is set at 1000~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:ethane_Verify_1000K}}
\end{figure}

\clearpage

\section{Propylene: $\rm C_3H_6$}

\begin{figure}[h]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propylene_296.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propylene of an isothermal homogeneous column of propylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.476, 0.318, and 0.159 atm.cm. The gas temperature is set at 296~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propylene_Verify_296K}}
\end{figure}

\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propylene_390.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propylene of an isothermal homogeneous column of propylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.476, 0.318, and 0.159 atm.cm. The gas temperature is set at 390~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propylene_Verify_390K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propylene_444.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propylene of an isothermal homogeneous column of propylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.476, 0.318, and 0.159 atm.cm. The gas temperature is set at 444~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propylene_Verify_444K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propylene_491.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propylene of an isothermal homogeneous column of propylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.476, 0.318, and 0.159 atm.cm. The gas temperature is set at 491~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propylene_Verify_491K}}
\end{figure}
\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propylene_594.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propylene of an isothermal homogeneous column of propylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.476, 0.318, and 0.159 atm.cm. The gas temperature is set at 594~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propylene_Verify_594K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propylene_793.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propylene of an isothermal homogeneous column of propylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.476, 0.318, and 0.159 atm.cm. The gas temperature is set at 793~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propylene_Verify_793K}}
\end{figure}
\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propylene_1003.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propylene of an isothermal homogeneous column of propylene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.476, 0.318, and 0.159 atm.cm. The gas temperature is set at 1003~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propylene_Verify_1003K}}
\end{figure}

\clearpage

\section{Propane: $\rm C_3H_8$}

\begin{figure}[h]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propane_295.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propane of an isothermal homogeneous column of propane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.127, 0.0794, and 0.0318 atm.cm. The gas temperature is set at 295~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propane_Verify_295K}}
\end{figure}

\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propane_396.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propane of an isothermal homogeneous column of propane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0318, 0.0794, and 0.127 atm.cm. The gas temperature is set at 396~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propane_Verify_396K}}
\end{figure}
\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propane_435.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propane of an isothermal homogeneous column of propane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0318, 0.0794, and 0.127 atm.cm. The gas temperature is set at 435~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propane_Verify_435K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propane_513.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propane of an isothermal homogeneous column of propane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0318, 0.127, and 0.0794 atm.cm. The gas temperature is set at 513~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propane_Verify_513K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propane_578.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propane of an isothermal homogeneous column of propane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0318, 0.0794, and 0.127 atm.cm. The gas temperature is set at 578~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propane_Verify_578K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propane_790.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propane of an isothermal homogeneous column of propane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0318, 0.0794, and 0.127 atm.cm. The gas temperature is set at 790~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propane_Verify_790K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Propane_1009.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of propane of an isothermal homogeneous column of propane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0318, 0.0794, and 0.127 atm.cm. The gas temperature is set at 1009~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:propane_Verify_1009K}}
\end{figure}

\clearpage

\section{Toluene: $\rm C_7H_8$}

\begin{figure}[h]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Toluene_300.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of toluene of an isothermal homogeneous column of toluene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.101, 0.0809, and 0.136 atm.cm. The gas temperature is set at 300~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:toluene_Verify_300K}}
\end{figure}

\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Toluene_396.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of toluene of an isothermal homogeneous column of toluene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.081, 0.125, and 0.0959 atm.cm. The gas temperature is set at 396~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:toluene_Verify_396K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Toluene_440.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of toluene of an isothermal homogeneous column of toluene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.109, 0.0846, and 0.0743 atm.cm. The gas temperature is set at 440~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:toluene_Verify_440K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Toluene_477.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of toluene of an isothermal homogeneous column of toluene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0831, 0.126, and 0.0963 atm.cm. The gas temperature is set at 477~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:toluene_Verify_477K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Toluene_587.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of toluene of an isothermal homogeneous column of toluene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.118, 0.0961, and 0.0812 atm.cm. The gas temperature is set at 587~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:toluene_Verify_587K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Toluene_795.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of toluene of an isothermal homogeneous column of toluene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.128, 0.0966, and 0.0834 atm.cm. The gas temperature is set at 795~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:toluene_Verify_795K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Toluene_999.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of toluene of an isothermal homogeneous column of toluene. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.138, 0.104, and 0.0896 atm.cm. The gas temperature is set at 999~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:toluene_Verify_999K}}
\end{figure}

\clearpage

\section{\textit{n}-Heptane: $\rm C_7H_{16}$}

\begin{figure}[h]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Heptane_293.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of \textit{n}-heptane of an isothermal homogeneous column of \textit{n}-heptane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.015, 0.0313, and 0.0493 atm.cm. The gas temperature is set at 293~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:nheptane_Verify_293K}}
\end{figure}

\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Heptane_400.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of \textit{n}-heptane of an isothermal homogeneous column of \textit{n}-heptane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0476, 0.0302, and 0.0145 atm.cm. The gas temperature is set at 400~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:nheptane_Verify_400K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Heptane_450.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of \textit{n}-heptane of an isothermal homogeneous column of \textit{n}-heptane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0497, 0.0312, and 0.0152 atm.cm. The gas temperature is set at 450~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:nheptane_Verify_450K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Heptane_490.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of \textit{n}-heptane of an isothermal homogeneous column of \textit{n}-heptane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0496, 0.0306, and 0.015 atm.cm. The gas temperature is set at 490~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:nheptane_Verify_490K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Heptane_593.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of \textit{n}-heptane of an isothermal homogeneous column of \textit{n}-heptane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0504, 0.0315, and 0.0152 atm.cm. The gas temperature is set at 593~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:nheptane_Verify_593K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Heptane_794.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of \textit{n}-heptane of an isothermal homogeneous column of \textit{n}-heptane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0149, 0.0441, and 0.0302 atm.cm. The gas temperature is set at 794~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:nheptane_Verify_794K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Heptane_1000.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of \textit{n}-heptane of an isothermal homogeneous column of \textit{n}-heptane. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0308, 0.0174, and 0.0365 atm.cm. The gas temperature is set at 1000~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:nheptane_Verify_1000K}}
\end{figure}

\clearpage

\section{Methanol: $\rm CH_3OH$}

\begin{figure}[h]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Methanol_293.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of methanol of an isothermal homogeneous column of methanol. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0498, 0.0716, and 0.0925 atm.cm. The gas temperature is set at 293~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:methanol_Verify_293K}}
\end{figure}

\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Methanol_396.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of methanol of an isothermal homogeneous column of methanol. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0505, 0.0738, and 0.0932 atm.cm. The gas temperature is set at 396~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:methanol_Verify_396K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Methanol_443.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of methanol of an isothermal homogeneous column of methanol. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0459, 0.071, and 0.094 atm.cm. The gas temperature is set at 443~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:methanol_Verify_443K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Methanol_483.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of methanol of an isothermal homogeneous column of methanol. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0489, 0.0703, and 0.0907 atm.cm. The gas temperature is set at 483~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:methanol_Verify_483K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Methanol_570.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of methanol of an isothermal homogeneous column of methanol. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0922, 0.05, and 0.0726 atm.cm. The gas temperature is set at 570~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:methanol_Verify_570K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Methanol_804.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of methanol of an isothermal homogeneous column of methanol. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0537, 0.0785, and 0.101 atm.cm. The gas temperature is set at 804~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:methanol_Verify_804K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/Methanol_1000.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of methanol of an isothermal homogeneous column of methanol. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.097, 0.0731, and 0.049 atm.cm. The gas temperature is set at 1000~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:methanol_Verify_1000K}}
\end{figure}

\clearpage

\section{Methyl Methacrylate: $\rm C_5H_8O_2$}

\begin{figure}[h]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/MMA_297.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of MMA of an isothermal homogeneous column of MMA. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.1, 0.0785, and 0.0545 atm.cm. The gas temperature is set at 297~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:MMA_Verify_297K}}
\end{figure}

\newpage

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/MMA_396.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of MMA of an isothermal homogeneous column of MMA. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.102, 0.179, and 0.0782 atm.cm. The gas temperature is set at 396~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:MMA_Verify_396K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/MMA_441.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of MMA of an isothermal homogeneous column of MMA. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0946, 0.074, and 0.0508 atm.cm. The gas temperature is set at 441~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:MMA_Verify_443K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/MMA_483.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of MMA of an isothermal homogeneous column of MMA. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0956, 0.0742, and 0.0512 atm.cm. The gas temperature is set at 483~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:MMA_Verify_483K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/MMA_597.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of MMA of an isothermal homogeneous column of MMA. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.0966, 0.0746, and 0.0516 atm.cm. The gas temperature is set at 597~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:MMA_Verify_597K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/MMA_803.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of MMA of an isothermal homogeneous column of MMA. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.106, 0.081, and 0.0554 atm.cm. The gas temperature is set at 803~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:MMA_Verify_803K}}
\end{figure}

\begin{figure}[p]
\includegraphics[width=\textwidth]{../Verification/Results_Test2/MMA_1014.pdf}
\caption{Top: comparison between the experimental (solid lines) and RadCal-generated synthetic (dashed lines) spectral transmissivity profiles, denoted $\tau_{\omega}$, of MMA of an isothermal homogeneous column of MMA. Bottom: relative transmissivity error, denoted $\epsilon{(\tau_{\omega})}$, between the experiment and the synthetic profiles presented on the top figure. Three different pressure path lengths are considered: 0.114, 0.0879, and 0.0598 atm.cm. The gas temperature is set at 1014~K and the total pressure is 101 kPa. Note: the experimental data resolution has been changed to match that of the narrow band model. \label{fig:MMA_Verify_1014K}}
\end{figure}


%%%%%%%%%%%%%%%%%%
%% CONTENTS
%%%%%%%%%%%%%%%%%%
% To-do / issues
% Packages
% Commands
% Special Symbols
% Environments
% More commands: Resizable delimiters
% More commands: Derivatives
% Useful templates
% Notes
%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%
%% TO-DO / ISSUES
%%%%%%%%%%%%%%%%%%

%% packages
% TO-DO: replace certain packages
	% fix COOL's broken derivatives
	% commath -- basically rewrite it, especially by way of mathtools package's \DeclarePairedDelimiter command
		% use \DeclarePairedDelimiter command to define delimited operators like \abs, \norm, etc. Enables stuff like \abs{x} for normal size, \abs*{x} for auto size, \abs[\big]{x} for specific size
% TO-DO: custom commands using package rotating.sty
	% \newcommand{\sideways}[1]{\begin{sideways} #1 \end{sideways}} % turn things 90 degrees CCW
	% \newcommand{\turn}[2][]{\begin{turn}{#2} #1 \end{turn}} % \turn[ang]{stuff} turns things arbitrary +/- angle
% TO-DO: find package for easily drawing mapping / algebraic / commutative diagrams..??

%%%%%%%%%%%%%%%%%%
%% PACKAGES
%%%%%%%%%%%%%%%%%%

%% debugging / diagnostics
\RequirePackage[l2tabu,orthodox]{nag} % nags user about obsolete and improper syntax
%\usepackage{iftex} % check if a document is being processed with PDFTEX, or XeTEX, or LuaTEX
%\usepackage{lineno} % load later

%% fonts and encoding

% standard and structural packages
\usepackage{cmap} % provides better copy-pasteable output text.
	% see for details: http://tex.stackexchange.com/a/64198
	% can also use mmap.sty, but not compatible with fonts other than Computer Modern
	% see for details: http://tex.stackexchange.com/questions/74630/
%\input{glyphtounicode}	% these two commands improve glyph output for non-T1 encodings
%\pdfgentounicode=1		% and this

% font packages -- load fontenc, then inputenc, then lmodern.
% see http://tex.stackexchange.com/a/44699
\usepackage[T2A,T1]{fontenc} % improves output font encoding
	% T1: provides expanded Latin character encoding, with accents
	% T2A: provides Cyrillic character encoding for use in cyrillic math commands
\usepackage[utf8]{inputenc} % provides full utf8 input encoding
\usepackage{lmodern} % loads Latin Modern fonts, enhanced versions of the Computer Modern (CM) fonts.
	% They have enhanced scaling, metrics and glyph coverage.
	% See http://www.tug.dk/FontCatalogue/lmodern/
	% Also solves rasterized/aliased fonts issue on incomplete LaTeX installations without CM-super fonts
\usepackage{soul} % provides commands for:
	% hyphenatable letter spacing (\so), underlining (\ul), caps (\caps, alt. to \textsc)
	% and some derivatives such as overstriking/strikethrough (\st) and highlighting (\hl)
\newcommand\bmmax{2} % increase max number of bm font allocations. default 4?
%\newcommand\hmmax{1} % increase max number of hm font allocations. default 3?
\usepackage{bm} % provides \bm command for robustly bolding math characters
\usepackage{amssymb} % for \mathbb (upper case only), \mathfrak fonts
\usepackage{mathrsfs} % for \mathscr font (upper case only)
\usepackage{dsfont} % best option for non-alphabetical doublestruck characters
	% use command \mathds{string}
\usepackage{bbm} % alternative option for non-alphabetical doublestruck characters
	% highly rasterized (non-smooth bitmap font), unfortunately
\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it} % defines \mathpzc for Zapf Chancery font (a standard postscript font)
	% basically another calligraphic font, alternative to mathcal
\DeclareMathAlphabet{\mathsfbf}{T1}{cmss}{bx}{sl} % bold sans-serif italic (for tensors). too bold?
	% see https://www.tug.org/TUGboat/tb30-3/tb96vieth.pdf
\usepackage{microtype} % improves kerning in certain cases.
	% recommended to disable protrusion in table of contents!
\usepackage{moresize} % adds additional font sizes \HUGE and \ssmall
\usepackage{relsize} % adds incredibly useful relative font sizing functions
	% \relsize{i}				Change font size by i steps.
	% \larger[i]				Increase size by (optional) i steps (default 1).
	% \smaller[i]				Reduce font size by i steps (default 1).
	% \relscale{f}				Change font size by scale factor f.
	% \textlarger[i]{<text>}		Text size enlarged by (optional) i steps.
	% \textsmaller[i]{<text>}		Text size reduced by (optional) i steps.
	% \textscale{f}{<text>}		Text size scaled by factor f.

% commands for script characters (e.g. Griffiths' script r)
\usepackage{calligra}
\DeclareMathAlphabet{\mathcalligra}{T1}{calligra}{m}{n}
\DeclareFontShape{T1}{calligra}{m}{n}{<->s*[2.2]callig15}{}
\newcommand{\scripty}[1]{\ensuremath{\mathcalligra{#1}}}

%% document interface

\usepackage[pdfencoding=auto,psdextra]{hyperref} % adds hyperlinks and outline to PDF documents
	% options enable enhanced unicode and math support in PDF outlines [causes conflict with \C command?]
\usepackage{cleveref} % provides \cref command which inserts contextually correct word in front of ref.
	% e.g. \cref{eq:myeq} --> Equation 1.2, or so
\usepackage{bookmark} % improves package hyperref's bookmarking.
	% properties such as style and color can be set. generates bookmarks in first run.

%% Latex interface

\usepackage{verbatim} % for verbatim and comment environments
\usepackage{letltxmacro} % provides \LetLtxMacro command for correct renaming of commands
\usepackage{multido} % provides excellent loop structure \multido{variables}{repetitions}{stuff}
\newcommand{\Repeat}[2][2]{\Multido{\i=1+1}{#1}{#2}}
	% command for repeating arbitrary TeX n times
\usepackage{etoolbox} % provides many useful programming tools,
	% e.g. \ifdefempty{cs}{true}{false}

%% media interface

\usepackage{graphicx} % support the \includegraphics command and options
\usepackage[font=footnotesize,labelfont=bf,labelsep=space]{caption}
	% makes figure captions better, more configurable.
	% specific options make captions smaller and the label bold.
\usepackage{subcaption} % allows for subfigures and subcaptions
	% can add usual caption options to change format for subcaptions
\usepackage{epstopdf} % allows complier to convert eps files to pdf files for inclusion in document
%\usepackage{svg} % provides \includesvg command for svg figures.
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
	% provides access to large number of colors and related features
	% see end notes for lists of available colors
\usepackage{pgfplots} % for plotting in tikzpicture environment
	\pgfplotsset{compat=1.11} % required to select newest version

%% math interface

\usepackage{amsmath} % for nice math commands and environments
\usepackage{mathtools} % extends amsmath with bug fixes and useful commands, e.g.
	% \shortintertext for short interjections in align environment,
	% \prescript{t}{b}{X} for simple, nicely aligned math pre-(super/sub)scripts
	% \Aboxed{...} for boxing full lines in 'align' environment
\usepackage{amsthm} % for theorem and proof environments

\usepackage{array} % improves array support, esp. in tabular env.
	% see also xtab.sty
\usepackage{booktabs} % allows for improved spacing in tabular env.
	% use \toprule, \*midrule, \bottomrule instead of \hline
	% see also ctable.sty

\usepackage{xparse} % provides high-level interface for producing document-level commands
	% via \[Declare/New/Renew/Provide/etc]DocumentCommand
	% allows for more than one optional argument in commands

%\usepackage[squaren]{SIunits} % for nice units formatting e.g. \unit{50}{\kilo\gram}
\usepackage{siunitx} % eventually deprecate SIunits package. use \SI in place of \unit
\usepackage{cancel} % for crossing out terms with \cancel, \cancelto{X}, etc
\usepackage{bropd} % provides \br command which simplifies nesting of bracketed terms within one another
	% e.g. \br{\br{x-a}^2+\br{y-b}^2} produces \left[ \left( x-a \right)^2 + \left( y-b \right)^2 \right]
	% also provides rudimentary derivatives, but overwritten by custom definitions
\usepackage{commath} % for some nice standardized syntax stuff.
	% \dif, \Dif, \od, \pd, \md, \(abs | envert), \(norm | enVert), \(set | cbr), \sbr, \eval, \int(o | c)(o | c), etc
	% has some issues -- largely in need of rewrite (some work on that done here)
\usepackage{tensor} % for \indices e.g. M\indices{^a_b^{cd}_e}, and \tensor e.g. \tensor[^a_b^c_d]{M}{^a_b^c_d}
\usepackage{slashed} % provides a command \slashed[1] for Feynman slash notation
\usepackage[version=3]{mhchem} % for writing chemical formulas with \ce, e.g. \ce{AgCl2-} or \ce{^{227}_{90}Th+}
	% version option required to use newest version

\usepackage{feynmp-auto} % for Feynman diagrams.
\usepackage{cool} % neato burrito COntent-Oriented Latex.
	% has an unfortunate bug in otherwise ideal derivatives code
	% see https://tex.stackexchange.com/questions/54425
	% Warning: renamed \Beta and \Zeta to \BetaF and \ZetaF below
\Style{ % COOL command styles
	LogBaseESymb=log % fix 'ln' bullshit
}
\usepackage{esdiff} % provides separate derivative commands
	% e.g. \diff[n]{f}{x} for nth ordinary derivative, \diffp{f}{{x}{y^2}} for multivariate derivatives,
	% \diffp*{p}{V}{T}$ for thermo derivative
\usepackage{physics} % provides streamlined interface with many commands to simplify
	% writing standard physics notation (bra-kets, derivatives, etc.)
	% differentials and derivatives: \dd[n]{x}, \dv[n]{f}{x}, \dv{x}, \pdv{f}{x}{y}, \var{Q}, \fdv{F}{g}
	% bra-ket notation: \bra, \ket, \braket, \dyad, \matrixel
	% \qty(x) for delimited quantities
	% \abs, \norm, \eval, \order ,\comm, \acomm
	% vectors: \vb, \va, vu, \vdot, \cross, \grad, \div, \curl, \laplacian
	% largely replaces and adds basic math functions with auto-delimiters: trig, linear algebra, etc.
		% no inverse hyperbolic trig?
	% in particular adds \tr, \Tr, \rank, \erf, \Res, \pv / \PV, \Re, \Im
	% auto padding text: \qq{string}
	% matrix quantities: \mqty(a & b \\ c & d) or \mqty[x \\ y], Pauli \pmat{n}, diagonal matrices \mqty(\dmat{1,2&3\\4&5}), anti-diagonal \admat

%% misc packages

\usepackage{datetime} % allows easy formatting of dates, e.g. \formatdate{dd}{mm}{yyyy}
\usepackage[inline]{enumitem} % allows for custom labels on enumerated lists
	% e.g. \begin{enumerate}[label=\textbf{(\alph*)}]
	% label options are: \alph, \Alph, \arabic, \roman, and \Roman
	% inline option creates '*' versions of enumerate, itemize, description
		% which can be inlined within the text of a paragraph.
\usepackage{outlines} % provides 'outline[style]' environment, allowing for subitems in lists
	% e.g. \begin{outline} \1 item \2 subitem \3[A)] subsubitem \1 item \end{outline}
	% or with other style: \begin{outline}[enumerate], etc

\usepackage{listings} % for typesetting source code
\usepackage{algorithm} % provides 'algorithm' float environment
%\usepackage{algorithmicx} % for typesetting algorithms and pseudocode
	% does not provide an actual layout to use!
\usepackage{algpseudocode} % invokes 'algorithmicx' package to define
	% a full modern pseudo-code layout

\usepackage{rotating}
	% provides environments for rotating arbitrary objects, e.g. sideways, turn[ang], rotate[ang]
	% also provides macro \turnbox{ang}{stuff}
%\usepackage{ctable} % allows for footnotes under table and properly spaced caption above
	% must be loaded after tikz
	% incorporates (..?)
\usepackage{framed} % provides boxed 'framed' environment for easily boxing text
\usepackage{fancybox} % provides fancier boxes than regular \makebox, \fbox, etc.
	% e.g. \doublebox, \ovalbox, \shadowbox
\usepackage{empheq} % provides 'empheq' environment
	% for improved control over shape, size, color of framed boxes, e.g.
\newcommand{\boxedeq}[2]{
	\begin{empheq}[box={\fboxsep=6pt\fbox}]{align}\label{#1}#2\end{empheq}
}
\newcommand{\coloredeq}[2]{
	\begin{empheq}[box=\colorbox{lightgreen}]{align}\label{#1}#2\end{empheq}
}

%% load later packages
\usepackage{lineno} % provides line numbers in main text for reference and peer review
	% activated by calling \linenumbers in document

%%%%%%%%%%%%%%%%%%
%% COMMANDS
%%%%%%%%%%%%%%%%%%

% functions and operators
% some functions deprecated by physics.sty
\newcommand{\code}[2][]{ % for typesetting monospaced code
	%\ifthenelse{\equal{#1}{}}{ % if description is empty
	%\ifdefempty{#1}{
	\ifstrempty{#1}{
		\texttt{#2}
	}{ %else
		\colorbox{#1}{\texttt{#2}}
	}
}
\definecolor{lighter-gray}{gray}{0.85} % lighter gray for code highlighting
\newcommand{\codehl}[2][lighter-gray]{\code[#1]{#2}} % \code with light gray highlight by default
\newcommand{\codeLtxMacro}[2]{\code[#1]{\textbackslash{}#2}} % same as \code but inserts backslash in front, for Latex macros
\newcommand{\codehlLtxMacro}[2][lighter-gray]{\codeLtxMacro[#1]{#2}}
\newcommand{\mtext}[1]{{\textnormal{#1}}} % for writing text within math mode, e.g. for subscripts
\LetLtxMacro{\mtxt}{\mtext} % legacy alias for \mtext
\LetLtxMacro{\opname}{\operatorname} % custom operator names
%\newcommand{\tr}{\opname{tr}} % for trace
%\newcommand{\rank}{\opname{rank}} % for rank
\newcommand{\diag}{\opname{diag}} % i.e. \diag(\lambda_1, \dots, \lambda_n)
\LetLtxMacro{\fancyRe}{\real} % already renamed from physics.sty
\LetLtxMacro{\fancyIm}{\imaginary} % see above
%\renewcommand{\Re}{\opname{Re}}
%\renewcommand{\Im}{\opname{Im}}
\renewcommand{\Res}{\opname*{Res}} % for residue function (handles limits properly)
\newcommand{\inv}{^{-1}}
\newcommand{\sgn}{\opname{sgn}} % sign/signum function

% deprecated by COOL/physics.sty
%\newcommand{\Tr}{\opname{Tr}} % for Trace
%\newcommand{\sech}{\opname{sech}}
%\newcommand{\csch}{\opname{csch}}

% end-closing square root command. taken from http://tex.stackexchange.com/a/29837/70383
\newcommand{\sqrtc}[1][\hphantom{3}]{%
	\def\DHLindex{#1}\mathpalette\DHLhksqrt}
\def\DHLhksqrt#1#2{%
	\setbox0=\hbox{$#1\sqrt[\DHLindex]{#2\,}$}\dimen0=\ht0
	\advance\dimen0-0.2\ht0
	\setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
	{\box0\lower0.4pt\box2}}

% vector and other notational commands
% note distinction between bold math modes \boldsymbol vs \bm
% see https://tex.stackexchange.com/questions/3238/
% use \pmb (poor man's bold) for uncooperative characters / fonts
% according to IUPAP standards, vectors should be bold italic while tensors should be slanted bold sans serif
\LetLtxMacro{\vaccent}{\v} % rename builtin command \v{} to \vaccent{}
\renewcommand{\v}[1]{ % for vectors. use \pmb for uncooperative characters / fonts
	%\boldsymbol{\mathbf{#1}}
	\bm{#1}
}
\newcommand{\uv}[1]{ % for unit vectors
	%\boldsymbol{\mathbf{\widehat{#1}}}
	\bm{\widehat{#1}}
}
\newcommand{\vd}[1]{\v{\dot{#1}}} % for dotted vectors
\newcommand{\vdd}[1]{\v{\ddot{#1}}} % for ddotted vectors
\newcommand{\vddd}[1]{\v{\dddot{#1}}} % for dddotted vectors
\newcommand{\vdddd}[1]{\v{\ddddot{#1}}} % for ddddotted vectors
\newcommand{\uvd}[1]{\bm{\dot{\widehat{#1}}}} % for dotted unit vectors
\newcommand{\uvdd}[1]{\bm{\ddot{\widehat{#1}}}} % for ddotted unit vectors
\newcommand{\bbar}[1]{\bar{\bar{#1}}} % for barring things twice -- use \cbar or \zbar instead of original \bbar
\newcommand{\bbbar}[1]{\bar{\bbar{#1}}}
\newcommand{\bbbbar}[1]{\bar{\bbbar{#1}}}
\newcommand{\tens}[1]{\mathsfbf{#1}} % for tensors

% deprecated by commath package
%\newcommand{\abs}[1]{\left| #1 \right|} % for absolute value ||x||
%\newcommand{\mag}{\abs} % magnitude, just another name for \abs
%\newcommand{\norm}[1]{\left\Vert #1 \right\Vert} % for norm ||v||

% custom symbols
%deprecated by physics.sty
%\newcommand{\grad}[1]{\v{\nabla} #1} % for gradient
%\LetLtxMacro{\divsymb}{\div} % rename builtin command \div to \divsymb
%\renewcommand{\div}[1]{\v{\nabla} \cdot #1} % for divergence
%\newcommand{\curl}[1]{\v{\nabla} \times #1} % for curl
\LetLtxMacro{\baraccent}{\=} % rename builtin command \= to \baraccent
\renewcommand{\=}[1]{\stackrel{#1}{=}} % for putting numbers above =
\LetLtxMacro{\twiddle}{\sim} % more natural name for twiddle symbol
\LetLtxMacro{\gsim}{\gtrsim} % alias for \gtrsim aka "approx greater than"
\LetLtxMacro{\lsim}{\lesssim} % alias for \lesssim aka "approx less than"

% matrix shortcuts! only use for small vectors/matrices and such
%deprecated by physics.sty
%\newcommand{\pmat}[1]{\begin{pmatrix} #1 \end{pmatrix}}
%\newcommand{\bmat}[1]{\begin{bmatrix} #1 \end{bmatrix}}
%\newcommand{\Bmat}[1]{\begin{Bmatrix} #1 \end{Bmatrix}}
%\newcommand{\vmat}[1]{\begin{vmatrix} #1 \end{vmatrix}}
%\newcommand{\Vmat}[1]{\begin{Vmatrix} #1 \end{Vmatrix}}

%%%%%%%%%%%%%%%%%%
%% SPECIAL SYMBOLS
%%%%%%%%%%%%%%%%%%

% special characters and shortcuts
\newcommand{\textoverline}[1]{$\overline{\mbox{#1}}$} % allows for overline in text mode, e.g. for MS-bar renormalization scheme
\newcommand{\const}{{\textit{const}}} % shorthand for constant. works in math mode with proper kerning
\newcommand{\bigO}{\mathcal{O}} % big O notation. is there a \O?
\LetLtxMacro{\bigo}{\bigO} % deprecated version. keeping for now because need to update instances in older files
\LetLtxMacro{\oldO}{\O} % rename builtin \O (a per mille symbol?)
\renewcommand{\O}{\bigO} % alternative big O command
\newcommand{\Lag}{\mathcal{L}} % fancy Lagrangian
\newcommand{\Ham}{\mathcal{H}} % fancy Hamiltonian
\newcommand{\AmpliM}{\mathcal{M}} % fancy M for scattering amplitudes
\newcommand{\AmpliA}{\mathcal{A}} % fancy A for scattering amplitudes
\newcommand{\emf}{\mathcal{E}} % fancy E for EMF
% fields and spaces
\newcommand{\fatemptyset}{\varnothing} % alternative to the thin character \emptyset
\newcommand{\reals}{\mathbb{R}} % real numbers
\newcommand{\complexes}{\mathbb{C}} % complex numbers
\newcommand{\ints}{\mathbb{Z}} % integers
\newcommand{\nats}{\mathbb{N}} % natural numbers
\newcommand{\irrats}{\mathbb{Q}} % irrationals
\newcommand{\quats}{\mathbb{H}} % quaternions (a la Hamilton)
\newcommand{\euclids}{\mathbb{E}} % Euclidean space
%\newcommand{\E}{\euclids}
\newcommand{\R}{\reals}
\renewcommand{\C}{\complexes}
\newcommand{\Z}{\ints}
\newcommand{\Q}{\irrats}
\newcommand{\N}{\nats}
\newcommand{\RP}{\mathbb{RP}} % real projective space
\newcommand{\CP}{\mathbb{CP}} % complex projective space
% Lie groups
\newcommand{\SO}{\mathrm{SO}}
\newcommand{\SU}{\mathrm{SU}}
% etc

% missing Greek symbol commands
\newcommand{\Alpha}{A}
\LetLtxMacro{\BetaF}{\Beta}
\renewcommand{\Beta}{B}
\newcommand{\Epsilon}{E}
\LetLtxMacro{\ZetaF}{\Zeta}
\renewcommand{\Zeta}{Z}
\newcommand{\Eta}{H}
\newcommand{\Iota}{I}
\newcommand{\Kappa}{K}
\newcommand{\Mu}{M}
\newcommand{\Nu}{N}
\newcommand{\omicron}{o}
\newcommand{\Omicron}{O}
\newcommand{\Rho}{P}
\newcommand{\Tau}{T}
\newcommand{\Chi}{X}

% Cyrillic math characters, via egreg. see https://tex.stackexchange.com/questions/664/
% input should be a LICR code, i.e. \cyr or \CYR followed by the Latin transliteration in same case
% e.g. \CYRSHCH for uppercase Shcha, \cyrzh for lowercase Zhe
% for LICR codes see: http://texdoc.net/texmf-dist/doc/latex/cyrillic/cyoutenc.pdf
% for transliterations: https://en.wikipedia.org/wiki/ALA-LC_romanization_for_Russian
\makeatletter
\def\cyrsymbol#1{\mathord{\mathchoice
	{\mbox{\fontsize\tf@size\z@\usefont{T2A}{\rmdefault}{m}{n}#1}}
	{\mbox{\fontsize\tf@size\z@\usefont{T2A}{\rmdefault}{m}{n}#1}}
	{\mbox{\fontsize\sf@size\z@\usefont{T2A}{\rmdefault}{m}{n}#1}}
	{\mbox{\fontsize\ssf@size\z@\usefont{T2A}{\rmdefault}{m}{n}#1}}
}}
\makeatother

%%%%%%%%%%%%%%%%%%
%% ENVIRONMENTS
%%%%%%%%%%%%%%%%%%

%% theorem-style environments. note amsthm builtin proof environment: \begin{proof}[title]

% appending [section] resets counter and prepends section number
% use \setcounter{counter}{0} to reset counter
% typical use cases:
% plain: Theorem, Lemma, Corollary, Proposition, Conjecture, Criterion, Algorithm
% definition: Definition, Condition, Problem, Example
% remark: Remark, Note, Notation, Claim, Summary, Acknowledgment, Case, Conclusion
\theoremstyle{plain} % default
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{conjecture}[theorem]{Conjecture}
% definition style
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{example}[theorem]{Example}
% remark style
\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{note}[theorem]{Note}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{conclusion}[theorem]{Conclusion}

%% some simple short nickname commands
\LetLtxMacro{\beg}{\begin} % a few letters less for beginning environments
\newenvironment{eqn}{\equation}{\endequation} % a lot fewer letters for equation environment

%% finally some commands for writing homework problems

% Homework Problem Counter
\newcounter{HWproblemCounter}
% commend for setting current problem number
\newcommand{\HWsetCounter}[1]{
	\setcounter{HWproblemCounter}{#1-1}
}
\HWsetCounter{1} % start at problem 1 by default
%\nobreak\extramarks{Problem \arabic{homeworkProblemCounter}}{}\nobreak{}

% Problem Section command. Creates new section with correct problem number.
% Optional argument is a short title or description.
% To skip to problem N, change the counter to N-1
\newcommand{\HWproblemSec}[1][]{
	\stepcounter{HWproblemCounter}
	%\ifthenelse{\equal{#1}{}}{ % if description is empty
	\ifstrempty{#1}{ % if description is empty
		\section*{Problem \arabic{HWproblemCounter}}
	}{ % else
		\section*{Problem \arabic{HWproblemCounter}: #1} % {#1+1} ??
	}
}

% for enumerating sub-problems
\newenvironment{HWproblemEnum}{
	% begin
	\begin{enumerate}[label=\textbf{(\alph*)},listparindent=\parindent]
}{
	% end
	\end{enumerate}
}

% for problem statements
\newenvironment{HWproblemState}{
	% begin
	\begin{em}
	\relsize{-1}
}{
	% end
	%\newline
	\vspace{5mm}
	\end{em}
}

%%%%%%%%%%%%%%%%%%
% RESIZEABLE DELIMITERS
%%%%%%%%%%%%%%%%%%

% provides template 1-component generic delimiters
% parameters: left delim., right delim., size [-1,0,..,4], string
\newcommand{\genericdel}[4]{%
	\ifcase#3\relax 			% size 0
	\ifthenelse{\equal{#1}{.}}{}{#1} #4 \ifthenelse{\equal{#2}{.}}{}{#2} \or
	\bigl#1 #4 \bigr#2 \or		% size 1
	\Bigl#1 #4 \Bigr#2 \or		% size 2
	\biggl#1 #4 \biggr#2 \or		% size 3
	\Biggl#1 #4 \Biggr#2 \else 	% size 4
	\left#1 #4 \right#2 \fi		% size -1 (automatic)
}

% the value for the optional argument ranges from -1 to 4 with higher values resulting in larger delimiters
% default value for #1 is -1 which results in automatic size for the delimeters
\newcommand{\avg}[2][-1]{\genericdel{\langle}{\rangle}{#1}{#2}}
% avg - average value <x>. the optional argument describes the size of the delimiters, no argument results in automatic size

% define \inner command as alias for \avg -- just use \inner{x,y}
\LetLtxMacro{\inner}{\avg}

% the value for the optional argument ranges from -1 to 4 with higher values resulting in larger delimiters
% default value for #1 is -1 which results in automatic size for the delimeters
\renewcommand{\bra}[2][-1]{\genericdel{\langle}{|}{#1}{#2}}
% bra - Dirac bra <x|. the optional argument describes the size of the delimiters, no argument results in automatic size

% the value for the optional argument ranges from -1 to 4 with higher values resulting in larger delimiters
% default value for #1 is -1 which results in automatic size for the delimeters
\renewcommand{\ket}[2][-1]{\genericdel{|}{\rangle}{#1}{#2}}
% bra - Dirac ket |x>. the optional argument describes the size of the delimiters, no argument results in automatic size

% the value for the optional argument ranges from -1 to 4 with higher values resulting in larger delimiters
% default value for #1 is -1 which results in automatic size for the delimeters
\renewcommand{\braket}[3][-1]{
\genericdel{\langle}{|}{#1}{#2 \vphantom{#3}}
\genericdel{.}{\rangle}{#1}{#3 \vphantom{#2}}
}
% braket - Dirac bra-ket <x|y>. the optional argument describes the size of the delimiters, no argument results in automatic size

% the value for the optional argument ranges from -1 to 4 with higher values resulting in larger delimiters
% default value for #1 is -1 which results in automatic size for the delimeters
\renewcommand{\matrixel}[4][-1]{
\bra[#1]{#2 \vphantom{#3#4}} #3 \ket[#1]{#4 \vphantom{#2#3}}
}
% matrixel - matrix element <x|A|y>. the optional argument describes the size of the delimiters, no argument results in automatic size

%%%%%%%%%%%%%%%%%%
%% DERIVATIVES
%%%%%%%%%%%%%%%%%%

% Command for ordinary derivatives. The first argument denotes the function and the second argument denotes the variable with respect to which the derivative is taken. The optional argument denotes the order of differentiation. The style (text style/display style) is determined automatically
% Example: \od[2]{f}{x} denotes the second derivative of f with respect to x
\renewcommand{\od}[3][]{
\frac{\dif[#1]{#2}}{\dif{{#3}^{#1}}}
}
% Text style
\renewcommand{\tod}[3][]{
\tfrac{\dif[#1]{#2}}{\dif{{#3}^{#1}}}
}
% Display style
\renewcommand{\dod}[3][]{
\dfrac{\dif[#1]{#2}}{\dif{{#3}^{#1}}}
}

% Command for (capitalized) ordinary derivatives. The first argument denotes the function and the second argument denotes the variable with respect to which the derivative is taken. The optional argument denotes the order of differentiation. The style (text style/display style) is determined automatically
% Example: \oD[2]{f}{x} denotes the second (capitalized) derivative of f with respect to x
\newcommand{\oD}[3][]{
\frac{\Dif[#1]{#2}}{\Dif{{#3}^{#1}}}
}
% Text style
\newcommand{\toD}[3][]{
\tfrac{\Dif[#1]{#2}}{\Dif{{#3}^{#1}}}
}
% Display style
\newcommand{\doD}[3][]{
\dfrac{\Dif[#1]{#2}}{\Dif{{#3}^{#1}}}
}

% Command for partial derivatives. The first argument denotes the function and the second argument denotes the variable with respect to which the derivative is taken. The optional argument denotes the order of differentiation. The style (text style/display style) is determined automatically
% Example: \pd[2]{f}{x} denotes the second partial derivative of f with respect to x
\renewcommand{\pd}[3][]{
\frac{\pdif[#1]{#2}}{\pdif{{#3}^{#1}}}
}
% Text style
\renewcommand{\tpd}[3][]{
\tfrac{\pdif[#1]{#2}}{\pdif{{#3}^{#1}}}
}
% Display style
\renewcommand{\dpd}[3][]{
\dfrac{\pdif[#1]{#2}}{\pdif{{#3}^{#1}}}
}

% Command for functional derivatives. The first argument denotes the function and the second argument denotes the variable with respect to which the derivative is taken. The optional argument denotes the order of differentiation. The style (text style/display style) is determined automatically
% Example: \fd[2]{f}{k} denotes the second functional derivative of f with respect to k
\newcommand{\fd}[3][]{
\frac{\deldif[#1]{#2}}{\deldif{{#3}^{#1}}}
}
% Text style
\newcommand{\tfd}[3][]{
\tfrac{\deldif[#1]{#2}}{\deldif{{#3}^{#1}}}
}
% Display style
\newcommand{\dfd}[3][]{
\dfrac{\deldif[#1]{#2}}{\deldif{{#3}^{#1}}}
}

%% REMOVED -- should use a more functionally complete version from esdiff, COOL, egreg, etc.
% mixed functional derivative - analogous to the functional derivative command
% Example: \mfd{F}{5}{x}{2}{y}{3} denotes third y derivative and second x derivative of f
%\newcommand{\mfd}[6]{
%\frac{\delta{^{#2}}#1}{\delta{{#3}^{#4}}\delta{{#5}^{#6}}}
%}
%% Text style
%\newcommand{\tmfd}[6]{
%\tfrac{\delta{^{#2}}#1}{\delta{{#3}^{#4}}\delta{{#5}^{#6}}}
%}
%% Display style
%\newcommand{\dmfd}[6]{
%\dfrac{\delta{^{#2}}#1}{\delta{{#3}^{#4}}\delta{{#5}^{#6}}}
%}

% Command for thermodynamic partial derivatives. The first argument denotes the function and the second argument denotes the variable with respect to which the derivative is taken. The optional argument denotes the order of differentiation. The style (text style/display style) is determined automatically
% Example: \pd[2]{f}{k} denotes the second thermo partial derivative of f with respect to k
\newcommand{\pdc}[4][]{
\left( \frac{\pdif[#1]{#2}}{\pdif{{#3}^{#1}}} \right)_{#4}
}
% Text style
\newcommand{\tpdc}[4][]{
(\tfrac{\pdif[#1]{#2}}{\pdif{{#3}^{#1}}})_{#4}
}
% Display style
\newcommand{\dpdc}[4][]{
\left( \dfrac{\pdif[#1]{#2}}{\pdif{{#3}^{#1}}} \right)_{#4}
}

% some shorter aliases for commath
\LetLtxMacro{\underdot}{\d} % rename builtin command \d{} to \underdot{}
\LetLtxMacro{\d}{\od} % for derivatives

% fixes and improvements for commath's differentials, which look bad for powers, e.g. $\dif^3 x$
% also additional definitions for different kinds of derivative operators (partial, delta, big D, fancy D)
% still need to consider how to handle 'inline' partials, like $\partial_\mu \phi$
% alternatives provided by physics.sty: \dd for \dif, \var for \deldif
\newcommand{\genericDif}[4]{\mathop{}#1#2^{#3} #4}
\renewcommand{\dif}[2][]{\genericDif{\!}{\mathrm{d}}{#1}{#2}}
\renewcommand{\Dif}[2][]{\genericDif{\negmedspace}{\mathrm{D}}{#1}{#2}}
\newcommand{\pdif}[2][]{\genericDif{\!}{\partial}{#1}{#2}}
\newcommand{\deldif}[2][]{\genericDif{\!}{\delta}{#1}{#2}}
\newcommand{\Deldif}[2][]{\genericDif{\!}{\Delta}{#1}{#2}}
\newcommand{\fancyDif}[2][]{\genericDif{\!}{\mathcal{D}}{#1}{#2}}

% Provides regular command \dif[n]{x} that ideally would handle spacing automatically, and starred command without spacing
% Unfortunately auto-spacing doesn't work due to unexpected behavior of \mathop near binary operators.
% Switching to physics.sty for future use, and keeping old commands for legacy use
% Idea came from http://tex.stackexchange.com/a/21114
\NewDocumentCommand{\altGenericDif}{m m m m}{
	\IfBooleanTF {#1}
	{ {#2^{#3} #4} }
	{ \mathop{#2^{#3} #4} }
}
\NewDocumentCommand{\altdif}{ s O{} m }{\altGenericDif{#1}{\mathrm{d}}{#2}{#3}}

% generic for egreg's derivative command. See http://tex.stackexchange.com/a/22080/70383
% user commands defined below
\makeatletter
\newcommand{\genericDerivEG}[3]{\begingroup
  \@tempswafalse\toks@={}\count@=\z@
  \@for\next:=#2\do
    {\expandafter\check@var\next
     \advance\count@\der@exp
     \if@tempswa
       \toks@=\expandafter{\the\toks@\,}%
     \else
       \@tempswatrue
     \fi
     \toks@=\expandafter{\the\expandafter\toks@\expandafter#3\der@var}}%
  \frac{#3\ifnum\count@=\@ne\else^{\number\count@}\fi#1}{\the\toks@}%
  \endgroup}
\def\check@var{\@ifstar{\mult@var}{\one@var}}
\def\mult@var#1#2{\def\der@var{#2^{#1}}\def\der@exp{#1}}
\def\one@var#1{\def\der@var{#1}\chardef\der@exp\@ne}
\makeatother

% egreg's ordinary and partial derivative. can write regular derivatives as \derivEG{f}{x}
% write multivariate derivatives as e.g. \pderivEG{f}{*{3}{x},y,*{4}{z}}
\newcommand{\derivEG}[2]{\genericDerivEG{#1}{#2}{\mathrm{d}}}
\newcommand{\pderivEG}[2]{\genericDerivEG{#1}{#2}{\partial}}

%%%%%%%%%%%%%%%%%%
%% USEFUL TEMPLATES
%%%%%%%%%%%%%%%%%%

\begin{comment}

% make a professional looking table
%\usepackage{booktabs}\\
\begin{table}
%\centering % optional
  \begin{tabular}{llr}
    \toprule
    \multicolumn{2}{c}{Item} \\
    \cmidrule(r){1-2}
    Animal    & Description & Price (\$) \\
    \midrule
    Gnat      & per gram    & 13.65      \\
          &    each     & 0.01       \\
    Gnu       & stuffed     & 92.50      \\
    Emu       & stuffed     & 33.33      \\
    Armadillo & frozen      & 8.99       \\
    \bottomrule
  \end{tabular}
\caption{My neat table}
\end{table}

% handle figures using graphicx package
% example - place a figure
\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{myfile.png}
\caption{This is a caption}
\label{fig:myfigure}
\end{figure}

% handle subfigures using subcaption package
% example - place three subfigures with caption and subcaptions
\begin{figure}
	\centering
	\begin{subfigure}[b]{0.3\textwidth}
		\includegraphics[width=\textwidth]{gull}
		\caption{A gull}
		\label{fig:gull}
	\end{subfigure}%
	~ %add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc.
		%(or a blank line to force the subfigure onto a new line)
	\begin{subfigure}[b]{0.3\textwidth}
		\includegraphics[width=\textwidth]{tiger}
		\caption{A tiger}
		\label{fig:tiger}
	\end{subfigure}
	~ %add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc.
	%(or a blank line to force the subfigure onto a new line)
	\begin{subfigure}[b]{0.3\textwidth}
		\includegraphics[width=\textwidth]{mouse}
		\caption{A mouse}
		\label{fig:mouse}
	\end{subfigure}
	\caption{Pictures of animals}\label{fig:animals}
\end{figure}

% draw Feynman diagrams using feynmf/feynmp package
% example - draws a basic scattering diagram with labels
\unitlength = 1mm % determine unit for size of diagram
\begin{fmffile}{simple_labels}
\begin{fmfgraph*}(40,25)
\fmfleft{i1,i2}
\fmfright{o1,o2}
\fmflabel{$e^-$}{i1}
\fmflabel{$e^+$}{i2}
\fmflabel{$e^+,\mu^+$}{o1}
\fmflabel{$e^-,\mu^-$}{o2}
\fmflabel{$i\sqrt{\alpha}$}{v1}
\fmflabel{$i\sqrt{\alpha}$}{v2}
\fmf{fermion}{i1,v1,i2}
\fmf{fermion}{o1,v2,o2}
\fmf{photon,label=$\gamma,,Z^0$}{v1,v2}
\end{fmfgraph*}
\end{fmffile}

% draw plots with pgfplot package
% example - draws plot of (???)
\pgfplotsset{compat=1.3,compat/path replacement=1.5.1}
\begin{tikzpicture}
\begin{axis}[
extra x ticks={-2,2},
extra y ticks={-2,2},
extra tick style={grid=major}]
\addplot {x};
\draw (axis cs:0,0) circle[radius=2];
\end{axis}
\end{tikzpicture}

\end{comment}
%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%
%% NOTES
%%%%%%%%%%%%%%%%%%

%% Note on math environments
% 'equation' and 'align' are basic standards
	% use '&' to for alignment in 'align'
	% multi-line environments all end lines with '\\' (except for last line)
	% generally all lines are tagged except in 'split' and '*' versions of environments
	% add \label{txt} after line to give LaTeX-label, \tag{txt} to change textual label
% use 'gather' to display multiple center-aligned lines (no manual alignment)
	% tags/labels every line
% use 'multline' to left-align first line, right-aline last line, and center-align all lines in between (no manual alignment)
	% only tags/labels last line
% use 'split' within 'equation' or 'align' to give single middle-aligned tag/label to the contained lines
	% use '&' for alignment within 'split'
	% no '*' version

%% Note on spacing
% https://tex.stackexchange.com/questions/74353
% 5) \qquad
% 4) \quad
% 3) \thickspace = \;
% 2) \medspace = \:
% 1) \thinspace = \,
% -1) \negthinspace = \!
% -2) \negmedspace
% -3) \negthickspace

%% Note on matrices
% https://en.wikibooks.org/wiki/LaTeX/Mathematics#Matrices_and_arrays
% use \matrix for simple n*n matrix. prefix with p, b, B, v, V for parentheses, square brackets, curly braces, vertical lines, double vertical lines respectively.
% use \smallmatrix for inline text. pre- and postfix with delimiters if desired.

%% Note on useful aliases
% \rightarrow = \to
% \leftarrow = \gets
% \ni = \owns = backwards \in
% \cup = union, \cap = intersect
% \sqcup / \sqcap for disjoint varieties
% \gg = >>, \ll = <<
% \vert = | (pipe, e.g. absolute value delimiter),
% \Vert = || (double pipes, e.g. norm delimiter)
% \sim = ~ (tilde)
% \overline = bar over the top. \bar achieves same effect but is fixed-width.
% \emptyset is thin (a zero with a slash). use \varnothing for fat version (defined as \fatemptyset above).
% AMS dots: \dotsc for comma dots, \dotsm for multiplicative dots,
	% \dotsb for binary operator dots, \dotsi for multiple integration dots,
	% \dotso for other dots

%% Note on primitives and wrappers
% TeX functional primitives
	% \let \foo = \bar assigns value of \bar to \foo at point of definition
	% \def \foo{\bar} assigns value of \bar at point of use
	% egreg recommends always using \LetLtxMacro{old}{new} instead
		% http://tex.stackexchange.com/a/29837/70383
% LaTeX functional primitives
	% \newcommand defines a new command, and makes an error if it is already defined.
	% \renewcommand redefines a predefined command, and makes an error if it is not yet defined.
	% \providecommand defines a new command if it isn't already defined.
% \DeclareMathOperator is a wrapper for \operatorname.
	% both have '*' versions for operators with limits

%% Note on fonts
% Use the following string to test readability of editor font: Illegal1 = O0
% Default LaTeX document classes only support font sizes of 10, 11, and 12 points.
	% Third party `extsizes' classes exist that allow 8-12, 14, 17, and 20 point fonts.
	% Available classes: extarticle, extreport, extbook, extletter, and extproc
% For text within math mode, always use \textnormal -- NOT \mathrm, \text, \textrm, etc.
	% this maintains font choices and ensures normal, upright text
% Text mode font sizes (small to large)
	% \tiny
	% \ssmall % (moresize.sty)
	% \scriptsize
	% \footnotesize
	% \small
	% \normalsize
	% \large
	% \Large
	% \LARGE
	% \huge
	% \Huge
	% \HUGE % (moresize.sty)
% Math mode font sizes for delimiters (smaller to larger)
	% \big
	% \Big
	% \bigg
	% \Bigg

%% pre-defined colors
% standard: black, blue, brown, cyan, darkgray, gray, green, lightgray, lime, magenta, olive, orange, pink, purple, red, teal, violet, white, yellow
%
% dvips: Apricot, Aquamarine, Bittersweet, Black, Blue, BlueGreen, BlueViolet, BrickRed, Brown, BurntOrange, CadetBlue, CarnationPink, Cerulean, CornflowerBlue, Cyan, Dandelion, DarkOrchid, Emerald, ForestGreen, Fuchsia, Goldenrod, Gray, Green, GreenYellow, JungleGreen, Lavender, LimeGreen, Magenta, Mahogany, Maroon, Melon, MidnightBlue, Mulberry, NavyBlue, OliveGreen, Orange, OrangeRed, Orchid, Peach, Periwinkle, PineGreen, Plum, ProcessBlue, Purple, RawSienna, Red, RedOrange, RedViolet, Rhodamine, RoyalBlue, RoyalPurple, RubineRed, Salmon, SeaGreen, Sepia, SkyBlue, SpringGreen, Tan, TealBlue, Thistle, Turquoise, Violet, VioletRed, White, WildStrawberry, Yellow, YellowGreen, YellowOrange


%!TEX root = ../notes.tex
\section{March 1, 2022}
\subsection{Power Residues}
For this section, corresponds to pages 45-46 of Ireland \& Rosen \cite{ireland1990classical} are a good reference.
\begin{definition}[Power Residue]
    If $m, n\in \ZZ_+$ and $a\in \ZZ$ such that $(a, m) = 1$, then we say that \ul{$a$ is an $n^\mathrm{th}$ power residue} modulo $m$ if and only if the congruence
    \begin{equation}\label{eqn:pow-residue}x^n\equiv a\mod m\end{equation}
    has solutions.
\end{definition}
Given \cref{eqn:pow-residue}, we're interested in two questions:
\begin{enumerate}[1)]
    \item Does \cref{eqn:pow-residue} have a solution?
    \item If yes, then how many?
\end{enumerate}

\begin{proposition}\label{prop:4.2.1}
    If $m\in\ZZ_+$ is such that $U(m)$ is cyclic, and $a\in\ZZ$ is such that $(a, m)=1$, then
    \[x^n\equiv a\mod m\]
    has solutions if and only if
    \[a^{\phi(m)/d}\equiv 1\mod m\]
    where $d = (\phi(m), n)$.

    If there are solutions, then there are exactly $d$ solutions.
\end{proposition}
\begin{proof}
    Let $g$ be a primitive root mod $m$, and let
    \[a=g^b.\]
    Suppose $x = g^y$. Then
    \begin{alignat*}{3}
         &        &  & x^n    &  & \equiv a\mod m       \\
         & \iff\  &  & g^{ny} &  & \equiv g^b\mod m     \\
         & \iff   &  & ny     &  & \equiv b\mod \phi(m)
    \end{alignat*}
    This is solvable if and only if $d=(\phi(m), n)\mid b$. If there is at least one solution, then there are exactly $d$ solutions.

    Now we show that $d\mid b\Leftrightarrow a^{\phi(m)/d}\equiv 1\mod m$.

    Forward direction:
    \[a^{\phi(m)/d} = g^{b\cdot \phi(m)/d} = \left(g^{\phi(m)}\right)^{b/d} = 1\mod m\]

    Backward direction:
    \[a^{\phi(m)/d}\equiv 1\mod m \Rightarrow g^{b\cdot \phi(m)/d}\equiv 1\mod m \Rightarrow \phi(m)\mid b\cdot \phi(m)/d \Rightarrow \frac{b}{d}\in\ZZ\]
\end{proof}

We can prove this using a similar group theory theorem that we can apply directly.
\begin{theorem}\label{thm:ft-cyclic-groups}
    Let $G$ be a cyclic group of order $n$, suppose $k\in\ZZ_+$ and $a\in G$. Then $a=b^k$ ($a$ is a $k^\mathrm{th}$ power in $G$) iff $a^{n/(k,n)} = e$ iff $x^k = a$ has $(n, k)$ solutions in $G$.
\end{theorem}

The proof of this theorem uses the following lemma:
\begin{lemma}
    Let $G$ be a cyclic group of order $n$ and let $H$ be a subgroup of $G$ of order $d$. Then $x\in H$ iff $x^d = e$ iff $\ord(x)\mid d$.
\end{lemma}

\begin{proof}[Proof of \cref{thm:ft-cyclic-groups}]
    Let $H$ be a subgroup of $k^\mathrm{th}$ powers in $G$\footnote{This is indeed a subgroup. We use the fact that $G$ is Abelian.}, and let $g\in G$ be such that $G = \langle g\rangle$.

    Then $H = \{g^{jk}\mid j\in \ZZ\} = \langle g^k\rangle$. Since $\ord(g^k) = \frac{n}{(k, n)}$ (\emph{exercise}), we that $|H| - \frac{n}{(k,n)}$.

    Consider $\phi: G\to G$ that powers by $k$, $\phi: x\mapsto x^k$. Then $\im(\phi) = H$, so this implies that $\phi$ is a $(k, n)$-to-$1$ mapping (so gives us the number of solutions to each power, and how many $k$ powers there are).
\end{proof}

Knowing how to solve these modulo a group of units gives us ways using CRT/Sunzi's Theorem to solve mod composite numbers.

We write $m = 2^ep_1^{e_1}\cdots p_r^{e_r}$ where $p_i$ are pairwise distinct odd primes. Then
\[x^n\equiv a\mod m, \quad (a, m) = 1\]
is solvable if and only if the system
\begin{align*}
    x^n & \equiv a\mod 2^e       \\
    x^n & \equiv a\mod p_i^{e_i} \\
        & \vdots                 \\
    x^n & \equiv a\mod p_r^{e_r}
\end{align*}
is solvable.

We have that $U(p_i^{e_i}), U(2), U(4)$ are all cyclic. Hence our prior discussion can be applied to those.

\begin{ques*}
    How do we solve
    \[x^n\equiv a\mod m\]
    where $e\geq 3$ (for powers of $2$)?
\end{ques*}
\begin{proposition}[4.2.2 from Text]
    Let $a\in\ZZ$ be odd, $e\geq 3$, and consider $x^n\equiv a\mod 2^e$.

    If $n$ is odd, then $a$ solution exists and is unique. If $n$ is even, $a$ solution exists if and only if $a\equiv 1\mod 4$ and $a^{2^{e-2}/d}\equiv 1\mod 2^e$ where $d = (n, 2^{e-2})$. When a solution exists, there are exactly $2d$ solutions.
\end{proposition}
\begin{proof}
    \emph{Exercise to come.}
\end{proof}

\subsection{Quadratic Residues}
Things are a lot simpler and nicer when we consider only quadratic congruences (as opposed to arbitrary residues).
\begin{definition}[Quadratic Residue]
    Let $a\in\ZZ$, $m\in\ZZ_+$, $(a, m) = 1$. We say that $a$ is a \ul{quadratic residue mod $m$} if the congruence
    \begin{equation}\label{eqn:quadratic-residue}x^2\equiv a\mod m\end{equation}
    has a solution.
\end{definition}

Conversely, if $a$ is not a quadratic residue (that is, \cref{eqn:quadratic-residue} does not have a solution), we call it a \ul{nonresidue} or a \ul{quadratic nonresidue}.

We extract the consequences of previous propositions to get special cases of propositions 4.2.3 and 4.2.4 from text.

\begin{enumerate}[1)]
    \item
          Let $p\in\ZZ_+$ be an odd prime, and suppose $a\in\ZZ$ with $p\nmid a$. Then
          \begin{align*}
              x^2 & \equiv a\mod p
              \intertext{is solvable iff}
              x^2 & \equiv a\mod p^e
          \end{align*}
          is solvable for all $e\geq 1$.
    \item
          Let $a\in\ZZ$ be odd. Then
          \begin{align*}
              x^2 & \equiv a\mod 8
              \intertext{is solvable iff }
              x^2 & \equiv a\mod 2^e
          \end{align*}
          is solvable for all $e\geq 3$.
\end{enumerate}
\begin{proposition}[5.1.1 from Text]
    Let
    \[m = 2^ep_1^{e_1}\cdots p_r^{e_r}\]
    be the prime factorization of $m\in\ZZ_+$, and suppose $(a, m) = 1$.

    Then
    \begin{equation}\label{eqn:5.1.1}
        x^2\equiv a\mod m
    \end{equation}
    is solvable if and only if three conditions are satisfied:
    \begin{enumerate}[i.]
        \item If $e = 2$, then $a\equiv 1\mod 4$.
        \item If $e\geq 3$, then $a\equiv 1\mod 8$.
        \item For each $i$, have
              \[a^{(p_i-1)/2}\equiv 1\mod p_i\]
    \end{enumerate}
\end{proposition}
\begin{proof}
    Sunzi's theorem tells us that \cref{eqn:5.1.1} is solvable iff
    \begin{align*}
        x^2 & \equiv x\mod 2^e       \\
        x^2 & \equiv a\mod p_1^{e_1} \\
            & \vdots                 \\
        x^2 & \equiv a\mod p_r^{e_r}
    \end{align*}
    are \emph{all} solvable.

    First consider the first equation $x^2\equiv 1\mod 2^e$. $1$ is the only quadratic residue mod $4$ and the same thing is true mod $8$. On the other hand, black box 2 gives us $x^2\equiv a\mod 8$ is solvable iff $x^2\equiv a\mod 2^e$ for $e\geq 3$. This gives us conditions i and ii.

    Now consider $x^2\equiv a\mod p_i^{e_i}$. \Cref{prop:4.2.1} gives that $x^2\equiv a\mod p_i$ is solvable iff $a^{(p_i - 1)/2}\equiv 1\mod p_i$. Black box 1 then tells us that
    \begin{align*}
        x^2           & \equiv a\mod p_i\quad\text{is solvable}        \\
        \iff\quad x^2 & \equiv a\mod p_i^{e_i}\quad\text{is solvable.}
    \end{align*}
    which concludes our proof.
\end{proof}

\begin{remark*}
    Studying these quadratic congruences amounts to studying them modulo primes.
\end{remark*}

\subsection{The Legendre Symbol}
\begin{definition}[The Legendre Symbol]\label{defn:legendre-symbol}
    Let $p$ be an odd prime, and let $a\in\ZZ$.
    \[\lege{a}{p} = \begin{cases}
            1  & \text{if $a$ is a quadratic residue mod $p$} \\
            0  & \text{if $p\mid a$}                          \\
            -1 & \text{otherwise}
        \end{cases}\]
    This symbol $\lege{a}{p}$ is called the Legendre symbol.
\end{definition}

\begin{proposition}[5.1.2 of Text]\label{prop:5.1.2}
    We have the following properties of the Legendre symbol:
    \begin{enumerate}[(a)]
        \item
              \[\lege{a}{p} = a^{(p-1)/2}\mod p\]
              This is called \emph{Euler's Criterion}.
        \item
              \[\lege{ab}{p} = \lege{a}{p}\cdot\lege{b}{p}\]
              which is to say that the Legendre symbol is totally multiplicative.
        \item If $a\equiv b\mod p$, then
              \[\lege{a}{p} = \lege{b}{p}.\]
    \end{enumerate}
\end{proposition}


\documentclass[a4paper,12pt]{article}

\author{Fuad Aji Pratomo}
\title{LaTeX Intro}

\begin{document}

\maketitle

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

\section{Introductio}
This section introduce a paper or journal
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

\section{Formatting}

\subsection{Formatting Subsection}

Let $D$ be a subset of $\bf R$ and let
$f \colon D \to \mathbf{R}$ be a real-valued function on
$D$. The function $f$ is said to be \emph{continuous} on
$D$ if, for all $\epsilon > 0$ and for all $x \in D$,
there exists some $\delta > 0$ (which may depend on $x$)
such that if $y \in D$ satisfies
\[ |y - x| < \delta \]
then
\[ |f(y) - f(x)| < \epsilon. \]

One may readily verify that if $f$ and $g$ are continuous
functions on $D$ then the functions $f+g$, $f-g$ and
$f.g$ are continuous. If in addition $g$ is everywhere
non-zero then $f/g$ is continuous.

\end{document}


\documentclass{article}%
\usepackage[T1]{fontenc}%
\usepackage[utf8]{inputenc}%
\usepackage{lmodern}%
\usepackage{textcomp}%
\usepackage{lastpage}%
%
\input{common_symbols_and_format.tex}%
\usepackage{tocloft}%
\renewcommand{\cfttoctitlefont}{\Large\bfseries}%
%
\begin{document}%
\normalsize%
\logo%
\rulename{Static Combination Regression}%
\tblofcontents%

\ruledescription{Regresses the one-day price changes against the lagged level and one day change of the signal for the specified number of days, using coefficients estimated from the start of the data.}
\howtotrade{
Given default parameter values, if the asset drift is 0.01 and the error is 0.05 (5\% daily volatility), this rule will take a $0.01 / (0.05)^2  = 4.0$ or 400\% position (leveraged).}
{
\begin{figure}[H]
\begin{multicols}{2}
  \centering
    \begin{subfigure}{\linewidth}
        \includegraphics[width=\linewidth]{\graphdir{market.png}}
        \caption{Market series data}
        \label{fig:01}
    \end{subfigure}
  \par
  \vspace{5mm}
  \begin{subfigure}{\linewidth}
    \includegraphics[width=\linewidth]{\graphdir{research.png}}
    \caption{Research series data}
    \label{fig:02}
  \end{subfigure}
  \par
  \begin{subfigure}{\linewidth}
    \includegraphics[width=\linewidth]{\graphdir{pa(StaticCombinationRegression).png}}
    \caption{ Suggested volume to buy or sell}
    \label{fig:03}
  \end{subfigure}
  \par
  \vspace{5mm}
  \begin{subfigure}{\linewidth}
    \includegraphics[width=\linewidth]{\graphdir{pr(StaticCombinationRegression).png}}
    \caption{Portfolio return}
    \label{fig:04}
  \end{subfigure}
  \end{multicols}
  \caption{Graphical depiction of the Static Combination Regression algorithm. 20 Days of trading data is visualised in the graphs (\ref{fig:01}) A line chart showing changes in the market price for multiple trading days. (\ref{fig:02}) A chart displaying the research series data. (\ref{fig:03}) Positive values indicate that buying the security by x\%. The negative values mean you are shorting the security by x\% (\ref{fig:04}) Chart showing the portfolio return when using the Static Combination Regression as the trading rule.}
  \label{fig:cps_graph}
\end{figure}

}

\ruleparameters{Kelly fraction}{1.0}{Amplitude weighting. 1.0 is maximum growth if regression is exact. <1.0 scales down positions taken.}{$\kellyfraction$}{Regression length}{50}{This is the number of days used to estimate the regression coefficients.}{$\lookbacklength$}%
\stoptable%

\section{Equation}
The equations below govern how the static combination regression rule calculates a trading position.

\begin{equation}
\regressionprice_\currenttime = \amplitudecoefficientone\research_\currenttime + \amplitudecoefficienttwo(\frac{\research_\currenttime}{\research_{\currenttime - 1}} - 1) +\amplitudecoefficientthree(\frac{\price_\currenttime}{\research_\currenttime}-1)+\constantc
\label{eq1}
\end{equation}\\

In the equation (\ref{eq1}), the predictive price  $\regressionprice_\currenttime$ is calculated using the static change regression, static difference regression and static level regression combined in one trading rule. Since we are using a static approach the amplitude coefficients $\amplitudecoefficient$ remain constant. In order to calculate the resultant fractional portfolio allocation $\position_{\currenttime}$ we use the Kelly fraction to obtain the maximum results for the long run.

\begin{equation}
\position_\currenttime = \kellyfraction \frac{\regressionprice_\currenttime}{ \rmserror_{\regressionprice}^{2}}  \\
\label{eq2}
\end{equation}

\hspace{200mm}
\\

where

$\research$:is the value of the research series.

$\regressionprice_\currenttime$: is the predicted price at time $\currenttime$.

$\rmserror_\regressionprice$: is the standard error.

$\kellyfraction$ is the Kelly Fraction.

$\position$: is the resultant fractional portfolio investment.

The standard error $\rmserror_{\regressionprice}$ is calculated and included in equation (\ref{eq2}) to normalize the predicted price.

\hspace{200mm}
\hspace{200mm}

\keyterms%
\furtherlinks%
\end{document}