\documentclass{article}[11pt]
\usepackage{longtable}
\usepackage{graphicx}
\usepackage{fix-cm}
\usepackage[margin=1in,paperwidth=8.5in,paperheight=11in]{geometry}
\usepackage[section]{placeins}
\usepackage{flafter}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{etoolbox}
\usepackage{units}
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{pdfcomment}
\usepackage{color}
\usepackage{spverbatim}

\setcounter{topnumber}{3}
\setcounter{bottomnumber}{3}
\setcounter{totalnumber}{4}
\renewcommand{\topfraction}{0.9}
\renewcommand{\bottomfraction}{0.9}
\renewcommand{\textfraction}{0.1}
\renewcommand{\floatpagefraction}{0.7}

\newcommand{\rrangle}{\rangle\!\rangle} \newcommand{\llangle}{\langle\!\langle}
\newcommand{\ket}[1]{\ensuremath{\left|#1\right\rangle}}
\newcommand{\bra}[1]{\ensuremath{\left\langle#1\right|}}
\newcommand{\braket}[2]{\ensuremath{\left\langle#1|#2\right\rangle}}
\newcommand{\expec}[1]{\ensuremath{\left\langle#1\right\rangle}}
\newcommand{\ketbra}[2]{\ket{#1}\!\!\bra{#2}}
\newcommand{\braopket}[3]{\ensuremath{\bra{#1}#2\ket{#3}}}
\newcommand{\proj}[1]{\ketbra{#1}{#1}}
\newcommand{\sket}[1]{\ensuremath{\left|#1\right\rrangle}}
\newcommand{\sbra}[1]{\ensuremath{\left\llangle#1\right|}}
\newcommand{\sbraket}[2]{\ensuremath{\left\llangle#1|#2\right\rrangle}}
\newcommand{\sketbra}[2]{\sket{#1}\!\!\sbra{#2}}
\newcommand{\sbraopket}[3]{\ensuremath{\sbra{#1}#2\sket{#3}}}
\newcommand{\sproj}[1]{\sketbra{#1}{#1}}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\def\Id{1\!\mathrm{l}}
\newcommand{\Tr}[0]{\mathrm{Tr}}
\providecommand{\e}[1]{\ensuremath{\times 10^{#1}}}

%Command used for python automatic substitution
\newcommand{\putfield}[2]{#2}

\newtoggle{confidences}
\newtoggle{goodnessSection}
\putfield{settoggles}{}

\hypersetup{
  pdfinfo={ \putfield{pdfinfo}{}  }
}


\begin{document}

\title{\putfield{title}{Report Title Goes Here}}
\date{\vspace{-1cm}\today}
%\author{}

\begingroup
\let\center\flushleft
\let\endcenter\endflushleft
\maketitle
\endgroup

\section{Overview}
This report presents a brief gate-set tomography (GST) analysis of a dataset called ``\putfield{datasetLabel}{DATASET LABEL HERE}''.   It is intended for folks who are already familiar with GST output tables and plots.  If this isn't you, you should have GST generate a ``full report'' which give much more detail about what GST is and what the results in this ``brief report'' mean.

\section{Goodness-of-model}
\iftoggle{goodnessSection}{
Table \ref{progressTable} shows how well GST was able to fit you data through its iterations.
%, and Figure \ref{bestEstimateColorBoxPlot} shows in more detail the goodness of fit quantity for the final (best) gateset estimate.

\begin{table}[h]
\begin{center}
\putfield{progressTable}{progress table will be placed here}
\caption{\putfield{tt_progressTable}{}\textbf{Comparison between the computed and expected \putfield{gofObjective}{??} for different values of $L$}.  $N_S$ and $N_p$ are the number of gate strings and parameters, respectively.  \putfield{gofObjective}{??} is expected to lie within $[k-\sqrt{2k},k+\sqrt{2k}]$ where $k = N_s-N_p$. $P$ is the p-value derived from a $\chi^2_k$ distribution (i.e.~when $P <$ some threshold like $0.05$ there is grounds for rejecting the GST fit). The rating from 1 to 5 stars gives a very crude indication of goodness of fit as explained in the text.\label{progressTable}}
\end{center}
\end{table}


%\begin{figure}
%\begin{center}
%\XXputfield{bestEstimateColorBoxPlot}{Color box plot for best gateset}
%\caption{\XXputfield{tt_bestEstimateColorBoxPlot}{}\textbf{\XXputfield{objective}{??} values for every individual experiment in the dataset}.  Each pixel represents a single experiment (gate sequence), and its color indicates whether GST was able to fit the corresponding frequency well.  Blue is typical; dark red squares indicating $\chi^2>10$ should appear only once per 638 experiments on average.  Square blocks of pixels correspond to base sequences (arranged vertically by germ and horizontally by length); each pixel within a block corresponds to a specific choice of pre- and post-fiducial sequences.  See text for further details.\label{bestEstimateColorBoxPlot}}
%\end{center}
%\end{figure}

}{ (You need to supply the GST Results object with more data in order to compute a goodness-of-fit section.) }

\FloatBarrier

\section{Gateset Estimates}
Below is a collection of GST's primary result tables, ordered in what we think is a natural way.  These tables all pertain to the best-estimate gateset, that is, the one corresponding to the final iteration of the GST algorithm.

\subsection{Derived Quantities}

\begin{table}[h]
\begin{center}
\putfield{bestGatesetVsTargetTable}{Best gateset overview table will be placed here}
\vspace{2em}
\putfield{bestGatesetErrorGenTable}{Best gateset error generator table will be placed here}
\caption{\putfield{tt_bestGatesetVsTargetTable}{}\putfield{tt_bestGatesetErrorGenTable}{}\textbf{Comparison of GST estimated gates to target gates}.  This table presents, for each of the gates, three different measures of distance or discrepancy from the GST estimate to the ideal target operation.  See text for more detail.  The second table lists the ``Error Generator'' for each gate, which is the Lindbladian $\mathbb{L}$ that describes \emph{how} the gate is failing to match the target.  This error generator is defined by the equation \putfield{errorgenformula}{??}. \label{bestGatesetVsTargetTable}}
\end{center}
\end{table}

\begin{table}[h]
\small
\begin{center}
\putfield{bestGatesetDecompTable}{Best gateset overview table will be placed here}
\vspace{2em}
\putfield{bestGatesetRotnAxisTable}{Best gateset rotn axis table will be placed here}
\caption{\putfield{tt_bestGatesetDecompTable}{}\putfield{tt_bestGatesetRotnAxisTable}{}\textbf{Eigen-decomposition of estimated gates}.  Each estimated gate is described in terms of: (1) the eigenvalues of the superoperator; (2) the gate's fixed point (as a vector in $\mathcal{B}(\mathcal{H})$, in the Pauli basis); (3)  the axis around which it rotates, as a vector in $\mathcal{B}(\mathcal{H})$; (4) the angle of the rotation that it applies; (5) the decay rate along the axis of rotation (``diagonal decay''); (6) the decay rate perpendicular to the axis of rotation (``off-diagonal decay''); and (7) the angle between each gate's rotation axis and the rotation axes of the other gates.  ``X'' indicates that the decomposition failed or couldn't be interpreted. \label{bestGatesetDecompTable}}
\end{center}
\end{table}

\FloatBarrier

\subsection{Raw Estimates}

\begin{table}[h]
\begin{center}
\putfield{bestGatesetSpamTable}{Best gateset rho and E vectors table will be placed here}
\caption{\putfield{tt_bestGatesetSpamTable}{}\textbf{The GST estimate of the SPAM operations}.  Compare to Table \ref{targetSpamTable}.\label{bestGatesetSpamTable}}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\putfield{bestGatesetSpamParametersTable}{Best gateset spam parametesr table will be placed here}
\caption{\putfield{tt_bestGatesetSpamParametersTable}{}\textbf{GST estimate of SPAM probabilities}.  Computed by taking the dot products of vectors in Table \ref{bestGatesetSpamTable}.\label{bestGatesetSpamParametersTable}}
\end{center}
\end{table}

\begin{table}[h]
\begin{center}
\putfield{bestGatesetGatesTable}{Best gateset's gates table will be placed here}
\caption{\putfield{tt_bestGatesetGatesTable}{}\textbf{The GST estimate of the logic gate operations}.  Compare to Table \ref{targetGatesTable}.\label{bestGatesetGatesTable}}
\end{center}
\end{table}

\end{document}
