diff --git "a/data_all_eng_slimpj/shuffled/split2/finalzzfbqq" "b/data_all_eng_slimpj/shuffled/split2/finalzzfbqq" new file mode 100644--- /dev/null +++ "b/data_all_eng_slimpj/shuffled/split2/finalzzfbqq" @@ -0,0 +1,5 @@ +{"text":"\\section{Introduction}\n\nStemming from a combination of ideas from nonlinear time series analysis~\\cite{kantz2004nonlinear, bradley2015nonlinear} and information theory~\\cite{shannon1948mathematical}, permutation entropy was first introduced in 2002 by Bandt and Pompe~\\cite{bandt2002permutation} as a simple, robust, and computationally efficient complexity measure for time series. This complexity measure is defined as the Shannon entropy of a probability distribution associated with ordinal patterns evaluated from partitions of a time series -- a procedure known as the Bandt-Pompe symbolization approach. Permutation entropy and its underlying symbolization approach have become increasingly popular among researchers working with time series analysis, leading to successful applications in fields as diverse as biomedical sciences~\\cite{nicolaou2012detection}, econophysics~\\cite{zunino2009forbidden}, physical sciences~\\cite{garland2018anomaly}, and engineering~\\cite{yan2012permutation}. The uses of permutation entropy also span a large variety of goals such as monitoring the dynamical regime of a system~\\cite{yan2012permutation}, detecting anomalies in time series~\\cite{garland2018anomaly}, characterizing time series data~\\cite{nicolaou2012detection}, testing for serial independence~\\cite{garcia2008nonparametric}, and are further documented in review articles by Zanin~\\textit{et al.}~\\cite{zanin2012permutation}, Riedl~\\textit{et al.}~\\cite{riedl2013practical}, Amig{\\'o}~\\textit{et al.}~\\cite{amigo2015ordinal}, and Keller \\textit{et al.}~\\cite{keller2017permutation}.\n\nPermutation entropy's success is not limited to its practical usage as this approach has inspired numerous time series analysis tools. Some of these related methods consider different quantifiers for the ordinal probability distribution~\\cite{rosso2007distinguishing, zunino2008fractional, carpi2010missing, parlitz2012classifying, unakafov2014conditional, liang2015eeg, ruan2019ordinal, zunino2015permutation, bandt2017new, ribeiro2017characterizing, jauregui2018characterization}, generalize the Bandt-Pompe symbolization algorithm to evaluate ordinal structures on multiple temporal scales~\\cite{aziz2005multiscale, zunino2010permutation, morabito2012multivariate, zunino2012distinguishing}, include signal amplitude information~\\cite{fadlallah2013weighted, xia2016permutation, azami2016amplitude, chen2018weighted}, and account for equal values in time series~\\cite{bian2012modified, cuesta2018patterns}. Other works have generalized permutation entropy and its ordinal approach to two-dimensional data such as images~\\cite{ribeiro2012complexity, zunino2016discriminating}. The ordinal patterns underlying permutation entropy have also been used for mapping time series and images into networks known as ordinal networks~\\cite{small2013complex, mccullough2015time, small2018ordinal, pessa2019characterizing, pessa2020mapping, borges2019learning, chagas2020characterization}.\n\nThe original version of permutation entropy and its various generalizations represent an essential and appealing framework for data analysis, especially when considering the increasing availability of large data sets~\\cite{economist2010deluge} and the steady demand for reliable and computationally efficient methods for extracting meaningful information from these data sets~\\cite{mattmann2013vision, blei2017science}. However, most methods emerging from Bandt and Pompe's seminal work lack freely available computational implementation, and the exceptions are limited to a single or very few approaches. Here we help to fill this gap by presenting \\texttt{ordpy}{} -- a simple and open-source Python module implementing several of the principal methods related to Bandt and Pompe's framework. This module has been designed to be easily set up and installed as its only dependency is \\texttt{numpy}{}~\\cite{harris2020array}, a fundamental Python library implementing array objects and fast math functions that operate on these objects. Beyond our preferences, the Python programming language has been chosen for its widespread use in scientific computing~\\cite{harris2020array} and extensive community support~\\cite{perkel2015pickup}.\n\nWe present \\texttt{ordpy}{}'s functions and illustrate their usage along with a review of the pertinent theoretical developments of permutation entropy and its related ordinal methods. Our work alternates between the mathematical description of the different techniques and the presentation of functions and code snippets that implement these data analysis tools. We further use \\texttt{ordpy}{} to replicate several literature results. The source-code of \\texttt{ordpy}{} is freely available on its git repository (\\url{github.com\/arthurpessa\/ordpy}) together with the documentation of all \\texttt{ordpy}{}'s functions (\\url{arthurpessa.github.io\/ordpy}). We can install \\texttt{ordpy}{} using the Python Package Index (PyPI) via:\n\\begin{minted}{shell}\n $ pip install ordpy\n\\end{minted}\nWe further provide the code and data for replicating all analyses presented in this article as a Jupyter notebook~\\cite{shen2014interactive, kluyver2016jupyter} on \\href{http:\/\/github.com\/arthurpessa\/ordpy}{\\texttt{ordpy}{}}'s website.\n\n\\section{An overview of ordinal distributions, permutation entropy, and complexity-entropy plane} \\label{sec:permutation_methods}\n\nWe start by presenting a short review of Bandt and Pompe's seminal permutation entropy~\\cite{bandt2002permutation}. As we have already mentioned, permutation entropy is the Shannon entropy of a probability distribution related to ordinal (or permutation) patterns evaluated using sliding partitions over a time series. This probability distribution is the so-called ordinal distribution or distribution of ordinal patterns, and the symbolization process used to estimate this distribution is the Bandt-Pompe approach. To describe this process, let us consider an arbitrary time series $\\{x_t\\}_{t=1,\\dots,N_x}$. First, we divide this time series into $n_x = N_x - (d_x-1)\\tau_x$ overlapping partitions comprised of $d_x>1$ observations separated by $\\tau_x\\geq1$ time units. For given values of $d_x$ and $\\tau_x$, each data partition can be represented by \n\\begin{equation}\\label{eq:1dpartition}\n w_p = (x_{p}, x_{p + \\tau_x}, x_{p + 2\\tau_x}, \\dots, x_{p + (d_x - 2)\\tau_x}, x_{p + (d_x - 1)\\tau_x})\\,,\n\\end{equation}\nwhere $p = 1, \\dots, n_x$ is the partition index. The parameters $d_x$ and $\\tau_x$ are the only two parameters of the Bandt-Pompe method: $d_x$ is the embedding dimension~\\cite{bandt2002permutation} and $\\tau_x$ is the embedding delay~\\cite{zunino2010permutation}. It is worth remarking that Bandt and Pompe's original proposal was restricted to $\\tau_x=1$ (that is, data partitions comprised of consecutive time series elements), and the embedding delay was further introduced by Cao \\textit{et al.}~\\cite{cao2004detecting} and Zunino \\textit{et al.}~\\cite{zunino2010permutation}. As we shall see, the choices of $d_x$ and $\\tau_x$ are important, and there is research exclusively devoted to determining optimal values for these parameters~\\cite{riedl2013practical, cuestafrau2019embedded, myers2020automatic}.\n\nNext, for each partition $w_p$, we evaluate the permutation $\\pi_p = (r_0, r_1, \\dots, r_{d_x-1})$ of the index numbers $(0, 1, \\dots, d_x - 1)$ that sorts the elements of $w_p$ in ascending order, that is, the permutation of the index numbers defined by the inequality $x_{p + r_0} \\leq x_{p + r_1} \\leq \\dots \\leq x_{p + r_{d_x-1}}$. In case of equal values, we maintain the occurrence order of the partition elements, that is, if $x_{p+r_{k-1}} = x_{p+r_k}$ then $r_{k-1} < r_{k}$ for $k=1,\\dots,d_x-1$~\\cite{cao2004detecting}. As an illustration, suppose we have $x_t = (5,3,2,2,7,9)$ and set $d_x = 4$ and $\\tau_x = 1$. The first partition is $w_1 = (5,3,2,2)$, and sorting its elements we find $2 \\leq 2 < 3 < 5$ or $x_{1+2} \\leq x_{1+3} < x_{1+1} >> from ordpy import ordinal_sequence\n>>> x = [5, 3, 2, 2, 7, 9]\n>>> ordinal_sequence(x, dx=4, taux=1)\narray([[2, 3, 1, 0],\n [1, 2, 0, 3],\n [0, 1, 2, 3]])\n>>> ordinal_sequence([1.55, 1.54, 1.53], dx=2)\narray([[1, 0], [1, 0]])\n>>> ordinal_sequence([1.55, 1.54, 1.53], dx=2, \n... tie_precision=1)\narray([[1, 0], [0, 1]])\n\\end{minted}\nThe last two examples illustrate the use of parameter \\texttt{tie\\_precision}{} that defines the number of decimals considered for establishing the ordinal relations. This parameter is available in most \\texttt{ordpy}{}'s functions and is particularly relevant when working with time series presenting equal values that could be mistaken by floating-point number representation. Figure~\\ref{fig:1}(a) illustrates the application of the Bandt-Pompe approach for a simple time series and different values of $d_x$ and $\\tau_x$.\n\n\\begin{figure*}[!ht]\n\\centering\n\\includegraphics[width=0.75\\linewidth]{fig1.pdf}\n\\caption{The symbolization process of Bandt and Pompe. (a) Illustration of Bandt-Pompe method applied to a time series and the resulting ordinal sequences for embedding parameters $d_x=3$ and $\\tau_x=1$ (left) and $d_x=2$ and $\\tau_x=2$ (right). (b) Application of the two-dimensional version of the Bandt-Pompe method to a data array and the resulting ordinal sequences for embedding parameters $d_x=d_y=2$ and $\\tau_x=\\tau_1=1$ (left) and $d_x=d_y=2$ and $\\tau_x=\\tau_1=2$ (right). In both panels, the colored boxes indicate the data partitioning scheme for each set of embedding parameters, and the numbers above them represent the index numbers used for determining the ordinal patterns or permutation symbols.}\n\\label{fig:1}\n\\end{figure*}\n\nThe ordinal probability distribution $P = \\{\\rho_i(\\Pi_i)\\}_{i = 1, \\dots, n_\\pi}$ is simply the relative frequency of all possible permutations within the symbolic sequence, that is, \n\\begin{equation}\\label{eq:permutation_probability}\n \\rho_i(\\Pi_i) = \\frac{\\text{number of partitions of type} \\ \\Pi_i \\ \\text{in} \\ \n \\{\\pi_p\\}}{n_x}\\,,\n\\end{equation}\nwhere $\\Pi_i$ represents each one of the $n_\\pi=d_x!$ different ordinal patterns. The following code shows how to obtain the ordinal distribution with \\texttt{ordpy}{}'s function \\texttt{ordinal\\_distribution}{}:\n\\begin{minted}{python}\n>>> from ordpy import ordinal_distribution\n>>> x = [5, 3, 2, 2, 7, 9]\n>>> pis, rho = ordinal_distribution(x, dx=3)\n>>> pis\narray([[0, 1, 2],\n [1, 2, 0],\n [2, 1, 0]])\n>>> rho\narray([0.5 , 0.25, 0.25])\n\\end{minted}\nThe two arrays returned by \\texttt{ordinal\\_distribution}{} are the ordinal patterns and their corresponding relative frequencies, respectively. By default, \\texttt{ordinal\\_distribution}{} does not return non-occurring permutations (that is, those with $\\rho_i(\\Pi_i)=0$); however, the parameter \\texttt{return\\_missing} modifies this behavior as in:\n\\begin{minted}{python}\n>>> from ordpy import ordinal_distribution\n>>> x = [5, 3, 2, 2, 7, 9]\n>>> pis, rho = ordinal_distribution(x, dx=3, \n... return_missing=True)\n>>> pis\narray([[0, 1, 2],\n [1, 2, 0],\n [2, 1, 0],\n [0, 2, 1],\n [1, 0, 2],\n [2, 0, 1]])\n>>> rho\narray([0.5 , 0.25, 0.25, 0. , 0. , 0. ])\n\\end{minted}\nMissing permutation symbols are always the latest elements of the returned array.\n\nHaving the ordinal probability distribution $P$, we can calculate its Shannon entropy~\\cite{shannon1948mathematical} and define the permutation entropy as\n\\begin{equation}\\label{eq:permutation_entropy}\n S(P) = -\\sum_{i = 1}^{n_\\pi} \\rho_i(\\Pi_{i})\\log \\rho_i(\\Pi_{i})\\,,\n\\end{equation}\nwhere $\\log(\\dots)$ stands for the base-$2$ logarithm. Permutation entropy quantifies the randomness in the ordering dynamics of a time series such that $S\\approx\\log n_\\pi$ indicates a random behavior, while $S\\approx0$ implies a more regular dynamics. Because the maximum value of $S$ is $S_{\\rm max} = \\log{n_\\pi}$, we can further define the normalized permutation entropy as\n\\begin{equation}\\label{eq:normalized_pe}\n H(P) = \\frac{S(P)}{\\log{n_\\pi}}\\,,\n\\end{equation}\nwhere the values of $H$ are restricted to the interval $[0,1]$. The \\texttt{ordpy}'s function \\texttt{permutation\\_entropy}{} calculates the values of $S$ and $H$ directly from a time series as illustrated in:\n\\begin{minted}{python}\n>>> from ordpy import permutation_entropy\n>>> x = [5, 3, 2, 2, 7, 9]\n>>> permutation_entropy(x)\n0.5802792108518123\n>>> permutation_entropy(x, normalized=False, \n... base='e')\n1.0397207708399179\n\\end{minted}\nThe \\texttt{permutation\\_entropy}{} function uses the base-2 logarithm function by default; however, the parameter \\texttt{base} can modify this behavior.\n\nThe embedding dimension $d_x$ defines the number of possible permutations $(n_\\pi = d_x!)$, and following Bandt and Pompe's recommendation~\\cite{bandt2002permutation}, it is common to choose the values of $d_x \\in \\{3, 4, 5, 6, 7\\}$ to satisfy the condition $d_x! \\ll N_x$ to obtain a reliable estimate of the ordinal probability distribution. Another less common choice is to use a value of $d_x$ such that $5 d_x! \\leq N_x$~\\cite{amigo2008combinatorial}. More recently, however, Cuesta-Frau \\textit{et al.}~\\cite{cuestafrau2019embedded} have shown that these requirements on $d_x$ can be considerably loosened in several situations related to classification tasks. The embedding delay $\\tau_x$ defines a time scale for the system under analysis and is often set as $1$; however, different values of $\\tau_x$ may inform about delayed feedback mechanisms and time-correlation structures. We present a more detailed discussion about the choices of $d_x$ and $\\tau_x$ in Appendix~\\ref{appendix:parameter}.\n\nThe permutation entropy framework was extended to two-dimensional data by Ribeiro \\textit{et al.}~\\cite{ribeiro2012complexity} and Zunino and Ribeiro~\\cite{zunino2016discriminating}. To present this generalization, let us consider an arbitrary two-dimensional data array $\\{y_t^u\\}_{t = 1,\\dots,N_x}^{u = 1,\\dots,N_y}$ whose elements may represent pixels of an image. We further define the embedding dimensions $d_x$ and $d_y$ along the horizontal and vertical directions (respectively), and the corresponding embedding delays $\\tau_x$ and $\\tau_y$. Similarly to the one-dimensional case, we slice the data array in partitions of size $d_x \\times d_y$ defined by \n\\begin{equation}\\label{eq:matrix_partition}\n w_{p}^{q} = \n\\begin{pmatrix}\n y_{p}^{q} & y_{p+\\tau_x}^{q} & \\dots & y_{p+(d_x-1)\\tau_x}^{q} \\\\[.5em]\n y_{p}^{q+\\tau_y} & y_{p+\\tau_x}^{q+\\tau_y} & \\dots & y_{p+(d_x-1)\\tau_x}^{q+\\tau_y} \\\\\n \\vdots & \\vdots & \\ddots & \\vdots\\\\\n y_{p}^{q+(d_x-1)\\tau_x} & y_{p+\\tau_x}^{q+(d_x-1)\\tau_x} & \\dots & y_{p+(d_x-1)\\tau_x}^{q+(d_y-1)\\tau_y} \\\\\n\\end{pmatrix},\n\\end{equation}\nwhere the indexes $p = 1,\\dots, n_x$ and $q = 1,\\dots, n_y$, with $n_x = N_x-(d_x-1)\\tau_x$ and $n_y = N_y-(d_y-1)\\tau_y$, cover all $n_x n_y$ data partitions. To associate a permutation symbol with each two-dimensional partition, we flatten the partitions $w_p^q$ line by line, that is,\n\\begin{equation}\\label{eq:partition_index}\n\\begin{split}\n w_{p}^{q} = & \\left( y_{p}^{q}, y_{p+\\tau_x}^{q}, \\dots,\n y_{p+(d_x-1)\\tau_x}^{q}, \\right.\\\\\n & ~~y_{p}^{q+\\tau_y}, y_{p+\\tau_x}^{q+\\tau_y}, \\dots, \n y_{p+(d_x-1)\\tau_x}^{q+\\tau_y},\\dots,\\\\\n & \\left. ~y_{p}^{q+(d_x-1)\\tau_x}, y_{p+\\tau_x}^{q+(d_x-1)\\tau_x}, \\dots, y_{p+(d_x-1)\\tau_x}^{q+(d_y-1)\\tau_y}\\right)\\,.\n\\end{split}\n\\end{equation}\nAs this procedure does not depend on a particular partition, we can simplify the notation by representing $w_{p}^{q}$ as\n\\begin{equation}\\label{eq:partition}\n w_p^q = \\left(\\tilde{y}_0, \\tilde{y}_1, \\dots, \\tilde{y}_{d_x d_y-2}, \\tilde{y}_{d_x d_y-1}\\right)\\,,\n\\end{equation}\nwhere $\\tilde{y}_0 = y_{p}^{q},~\\tilde{y}_1 = y_{p+\\tau_x}^{q}$, and so on. Then, we evaluate the permutation symbol associated with each data partition as in the one-dimensional case to define the symbolic array $\\{\\pi_p^q\\}_{p=1,\\dots,n_x}^{q=1,\\dots,n_y}$ related to the data set (Fig.~\\ref{fig:1}{b} illustrates the Bandt-Pompe approach for two-dimensional data). From this array, we calculate the relative frequency for all $n_\\pi = (d_x d_y)!$ possible permutations $\\Pi_i$ via \n\\begin{equation}\\label{eq:permutation_probability_2d}\n \\rho_i(\\Pi_i) = \\frac{\\text{number of partitions of type $\\Pi_i$ in } \\{\\pi_p^q\\}}{n_x n_y}\\,,\n\\end{equation}\nwhere $i=1,\\dots,n_\\pi$, and so the ordinal probability distribution is $P = \\{\\rho_i(\\Pi_i)\\}_{i = 1, \\dots, n_\\pi}$. It is worth noticing that the ordering procedure defining the permutation symbols is no longer unique as in the one-dimensional case. For instance, we would find a different symbolic array by flattening the partitions $w_p^q$ column by column. However, different ordering procedures do not modify the set of elements comprising the ordinal probability distribution (only their order is changed)~\\cite{ribeiro2012complexity}.\n\nAs in the one-dimensional case, the two-dimensional permutation entropy is simply the Shannon entropy of the ordinal distribution $P = \\{\\rho_i(\\Pi_i)\\}_{i = 1, \\dots, n_\\pi}$, so we can calculate the two-dimensional permutation entropy and its normalized version using Eqs.~\\ref{eq:permutation_entropy} and \\ref{eq:normalized_pe}, respectively. Only the total number of possible ordinal patterns ($n_\\pi = (d_x d_y)!$ in the two-dimensional case) is modified.\n\nSimilarly to the one-dimensional case, the values of $d_x$ and $d_y$ are usually constrained by the condition $(d_x d_y)! \\ll N_x N_y$ in order to obtain a reliable estimate of the ordinal distribution $P$~\\cite{ribeiro2012complexity, zunino2016discriminating}. Naturally, this two-dimensional formulation recovers the one-dimensional case ($N_y=1$ for time series data) by setting $d_y = \\tau_y = 1$. In \\texttt{ordpy}{}, the functions \\texttt{ordinal\\_sequence}{}, \\texttt{ordinal\\_distribution}{} and \\texttt{permutation\\_entropy}{} automatically implement this two-dimensional generalization when the input data is a two-dimensional array as in:\n\\begin{minted}{python}\n>>> from ordpy import ordinal_sequence, \n... ordinal_distribution, permutation_entropy\n>>> y = [[5, 3, 2], [2, 7, 9]]\n>>> ordinal_sequence(y, dx=2, dy=2)\narray([[[2, 1, 0, 3],\n [1, 0, 2, 3]]])\n>>> ordinal_distribution(y, dx=2, dy=2)\n(array([[1, 0, 2, 3],\n [2, 1, 0, 3]]), array([0.5, 0.5]))\n>>> permutation_entropy(y, dx=2, dy=2)\n0.21810429198553155\n\\end{minted}\n\nIn addition to permutation entropy, the complexity-entropy plane proposed by Rosso \\textit{et al.}~\\cite{rosso2007distinguishing} is another popular time series analysis tool directly related to Bandt and Pompe's symbolization approach. This method was initially introduced for distinguishing between chaotic and stochastic time series but has been successfully used as an effective discriminating tool in several other contexts~\\cite{rosso2009detecting, zunino2010complexity, zunino2012efficiency, ribeiro2012songs, sigaki2019estimating}. The complexity-entropy plane combines the normalized permutation entropy $H$ (Eq.~\\ref{eq:normalized_pe}) with an intensive statistical complexity measure $C$ (also calculated using the ordinal distribution) to build a two-dimensional representation space with the values of $C$ versus $H$. The statistical complexity $C$ used by Rosso \\textit{et al.} is inspired by the work of Lopez-Ruiz \\textit{et al.}~\\cite{lopezruiz1995statistical} and is defined by the product of the normalized permutation and a normalized version of the Jensen-Shannon divergence~\\cite{lin1991divergence} between the ordinal distribution $P = \\{\\rho_i(\\Pi_i)\\}_{i = 1, \\dots, n_\\pi}$ and the uniform distribution $U = \\{ 1\/n_\\pi \\}_{i = 1,\\dots,n_\\pi}$ (it is worth remembering that $n_\\pi$ is the number of possible ordinal patterns). Mathematically, we can write this measure as\n\\begin{equation}~\\label{eq:statistical_complexity}\n C(P) = \\frac{D(P,U)H(P)}{D^{\\rm max}}\\,,\n\\end{equation}\nwhere \n\\begin{equation}\n D(P,U) = S[(P + U)\/2] - \\dfrac{1}{2}S(P) - \\dfrac{1}{2}S(U) \n\\end{equation}\nis the Jensen-Shannon divergence and \n\\begin{equation*} \n D^{\\rm max} = -\\dfrac{1}{2}\\left(\\frac{n_\\pi!+1}{n_\\pi!}\\log(n_\\pi!+1)-2\\log(2n_\\pi!)+\\log{n_\\pi!}\\right)\n\\end{equation*}\nis a normalization constant. This latter constant expresses the maximum possible value of $D(P,U)$ occurring for $P = \\{ \\delta_{1,i} \\}_{i = 1,\\dots,n_\\pi}$~\\cite{lamberti2004intensive, martin2006generalized}, where\n$\\delta_{ij} =\n\\begin{cases}\n1 & \\text{if } i = j\\\\\n0 & \\text{if } i \\neq j\n\\end{cases}$ \nis the Kronecker delta function.\n\nDifferently from permutation entropy, the statistical complexity $C$ is zero in both extremes of order (when only one permutation symbol occurs) and disorder (when all permutations are equally likely to happen). The value of $C$ quantifies structural complexity and provides additional information that is not carried by the\nvalue of $H$. Furthermore, $C$ is a nontrivial function of $H$ in the sense that for a given value of $H$, there exists a range of possible values for $C$~\\cite{lamberti2004intensive, martin2006generalized, rosso2007distinguishing}. This happens because $H$ and $D$ are expressed by different sums of $\\rho_i(\\Pi_i)$ and there is thus no reason for assuming a univocal relationship between $H$ and $C$. \n\nTo better illustrate this feature, let us assume (for simplicity) we replace the Jensen-Shannon divergence by the Euclidean distance between $P$ and $U$ (as in the seminal work of Lopez-Ruiz \\textit{et al.}~\\cite{lopezruiz1995statistical}), that is, $D(P,U) = \\sum_{i=1}^{n_\\pi} (\\rho_i(\\Pi_i)-1\/n_\\pi)^2$. In this case, the statistical complexity is\n\\begin{equation*}\n C(P) \\propto -\\left(\\sum_{i=1}^{n_\\pi} \\rho_i(\\Pi_i) \\log \\rho_i(\\Pi_i)\\right)\\left(\\sum_{i=1}^{n_\\pi} (\\rho_i(\\Pi_i)-1\/n_\\pi)^2\\right)\\,,\n\\end{equation*}\nand we can readily observe that different ordinal distributions $P=\\{\\rho_i(\\Pi_i)\\}_{i=1,\\ldots,n_\\pi}$ may lead to the same value of $H$ but different values of $C$ (or vice-versa). Let us further consider a particular ordinal distribution with three possible permutation symbols (this would be equivalent to having $d_x!=3$ or $(d_x d_y)!=3$, if possible), that is, $P=\\{a,b,1-(a+b)\\}$, where $a>0$ and $b>0$ are real numbers such that $(a+b)\\leq1$ (to ensure the normalization of $P$). For this case, we have $S = - a \\log a - b \\log b - [1-(a+b)]\\log[1-(a+b)]$ and $D = (a-1\/3)^2 + (b-1\/3)^2 + ([1-(a+b)]-1\/3)^2$. Thus, for instance, if $a=0.79$ and $b=0.18$ or $a=0.80$ and $b=0.16$ we find the same value of $H = S\/\\log{3}\\approx0.55$, but different values for $D$ ($0.32$ in the first case and $0.33$ in the second) and, consequently, for $C$. \n\n\\begin{figure*}[!ht]\n\\centering\n\\includegraphics[width=0.8\\linewidth]{fig2.pdf}\n\\caption{Probability distributions of ordinal patterns for stochastic and deterministic series. (a) Comparison between the empirical probability distribution of ordinal patterns obtained from a simulated Gaussian random walk with $10^6$ steps and the exact distribution $P_{\\rm walk}$ (dashed horizontal lines) for $d_x = 3$ and $\\tau_x = 1$. (b) Comparison between the empirical probability distribution of ordinal patterns obtained from $10^6$ iterations of the logistic map at fully developed chaos and the exact distribution $P_{\\rm logistic}$ (dashed horizontal lines) for $d_x = 3$ and $\\tau_x = 1$. All results in this figure can be replicated by running a Jupyter notebook available at \\href{http:\/\/github.com\/arthurpessa\/ordpy}{\\texttt{ordpy}{}}'s webpage.}\n\\label{fig:2}\n\\end{figure*}\n\nIn \\texttt{ordpy}{}, the \\texttt{complexity\\_entropy}{} function simultaneously returns the values of $H$ and $C$ from time series as illustrated in:\n\\begin{minted}{python}\n>>> from ordpy import complexity_entropy \n>>> complexity_entropy([4,7,9,10,6,11,3],\n... dx=2)\n(0.9182958340544894, 0.06112816548804511)\n\\end{minted}\nFurthermore, the complexity-entropy plane was generalized for two-dimensional data~\\cite{ribeiro2012complexity, zunino2016discriminating} (notice that the only changes are related to the process of estimating the ordinal distribution) and the \\texttt{complexity\\_entropy}{} function also accepts two-dimensional arrays as input as shown in:\n\\begin{minted}{python}\n>>> from ordpy import complexity_entropy\n>>> complexity_entropy([[1,2,1],[8,3,4],\n... [6,7,5]], dx=2, dy=2)\n(0.3271564379782973, 0.2701200547320647)\n\\end{minted}\n\n\\section{Applications of Bandt and Pompe's framework with \\texttt{ordpy}{}}\n\nThis section presents more engaging applications of \\texttt{ordpy}{}'s functions by replicating literature results. We start by determining the ordinal probability distributions of two different time series of stochastic and chaotic nature, namely, a random walk with Gaussian steps and the logistic map at fully developed chaos (see Appendix~\\ref{appendix:chaos} for definitions). We choose these two examples because their ordinal distributions are exactly known for some combinations of the embedding parameters~\\cite{amigo2006order, bandt2007order}. More specifically, for $d_x = 3$ and $\\tau_x = 1$, the probability distributions associated with the permutation symbols $\\{(0,1,2), (0,2,1), (1,0,2), (1,2,0), (2,0,1), (2,1,0)\\}$ are $P_{\\rm walk} = \\{{1}\/{4}, {1}\/{8}, {1}\/{8}, {1}\/{8}, {1}\/{8}, {1}\/{4}\\}$ and $P_{\\rm logistic} = \\{{1}\/{3}, {1}\/{15}, {2}\/{15}, {3}\/{15}, {4}\/{15}, 0\\}$ for the random walk~\\cite{bandt2007order} and the logistic map~\\cite{amigo2006order}, respectively.\n\nTo numerically estimate these two ordinal distributions, we generate a time series from a Gaussian random walk process and another time series from iterations of the fully chaotic logistic map. In both cases, we have simulated one realization of each process with $10^6$ observations and used the \\texttt{ordinal\\_distribution}{} function. Figure~\\ref{fig:2} shows that the exact ordinal distributions are in excellent agreement with simulated results obtained with \\texttt{ordpy}{}. It is intriguing to observe that the ordinal pattern $(2,1,0)$ (``descending permutation'') does not occur in the logistic series (it has probability zero). This fact is best understood as a feature directly associated with the intrinsic determinism of the logistic map dynamics~\\cite{amigo2006order, amigo2007true}. As we shall discuss in the next section, investigations about such ``missing ordinal patterns'' are also useful for characterizing time series dynamics.\n\nTo better illustrate the use of the \\texttt{permutation\\_entropy}{} function, we partially reproduce Bandt and Pompe's analysis of the logistic map (Fig.~2 of Ref.~\\onlinecite{bandt2002permutation}). We generate time series consisting of $10^6$ iterations of the logistic map for each value of parameter $r \\in \\{3.5, 3.5001, 3.5002, \\dots, 4.0\\}$ (see Appendix~\\ref{appendix:chaos} for definitions). Next, we calculate the permutation entropy $S$ for each of these 5001 time series using \\texttt{permutation\\_entropy}{} with embedding parameters $d_x = 6$ and $\\tau_x = 1$. We further divide the permutation entropy by $5$ to obtain the permutation entropy per symbol of order 6, that is, $h_6 = S\/5$ as defined in Bandt and Pompe's work~\\cite{bandt2002permutation}. Figure~\\ref{fig:3}{a} depicts the well-known bifurcation diagram for the logistic map, while Fig.~\\ref{fig:3}{b} shows the values of $h_6$ as a function of the parameter $r$. We note that the permutation entropy per symbol has an overall increasing trend with the parameter $r$, marked by abrupt drops in intervals of $r$ related to periodic behaviors. As noticed by Bandt and Pompe, the behavior of the permutation entropy is similar to the one observed for the Lyapunov exponent~\\cite{bandt2002permutation}.\n\n\\begin{figure*}[!ht]\n\\centering\n\\includegraphics[width=1\\linewidth]{fig3.pdf}\n\\caption{Permutation entropy of one- and two-dimensional data. (a) Bifurcation diagram of the logistic map for $r$ between $3.5$ and $4$ in steps of size $10^{-4}$. (b) Permutation entropy per symbol of order six $(h_6)$ calculated from logistic time series with $10^6$ observations (random initial conditions) and $r \\in \\{3.5,3.5001,3.5002,\\dots,4.0\\}$. The embedding parameters are $d_x = 6$ and $\\tau_x = 1$. (c) Time series of the transient logistic map obtained from the initial condition $x_0 = 0.65$, and by incrementing the logistic parameter $r$ at each iteration from $2.8$ to $4$ in steps of size $10^{-5}$. Despite appearing very similar to a bifurcation diagram, this result refers to a time series where each observation $x[r(t)]$ corresponds to a value $r(t)$. (d) Dependence of the normalized permutation entropy evaluated within a sliding window with 1024 observations of the original time series. Here $r(t)$ represents the logistic parameter at the end of each sliding window. The different curves show the results for $d_x = 5$ and $\\tau_x = 1$ (red), and $d_x = 5$ and $\\tau_x = 2$ (blue). The vertical line at $r = 3.56$ indicates the period-8 to period-16 bifurcation. (e) Ising surfaces obtained after $10^6$ Monte Carlo steps with reduced temperatures $T_r \\in \\{0.8, 0.9, 1.0, 1.1\\}$. In these surfaces, dark gray shades indicate high lattice sites while light gray regions indicate the opposite. (f) Normalized permutation entropy as a function of the reduced temperature $T_r \\in \\{0.5,0.6,\\dots,3.0\\}$ for Ising surfaces of size $250 \\times 250$ obtained after $10^6$ Monte Carlo steps. The different curves show the results for embedding parameters $d_x = 3$ and $d_y =2$ (red) and $d_x = 2$ and $d_y =3$ (blue), both with $\\tau_x = \\tau_y = 1$. All results in this figure can be reproduced by running a Jupyter notebook available at \\href{http:\/\/github.com\/arthurpessa\/ordpy}{\\texttt{ordpy}{}}'s webpage.}\n\\label{fig:3}\n\\end{figure*}\n\nIn another example with \\texttt{permutation\\_entropy}{}, we replicate a numerical experiment of Cao \\textit{et al.}~\\cite{cao2004detecting} (see their Fig.~1) that searches for dynamical changes in the transient logistic map time series (see Appendix~\\ref{appendix:chaos} for definitions). This problem illustrates the role of the embedding delay $\\tau_x$. As in the original article, we iterate the transient logistic map starting with the initial condition $x_0 = 0.65$ and incrementing the logistic parameter $r$ from $2.8$ to $4$ in steps of size $10^{-5}$. This process generates a time series with $120001$ observations as shown in Fig.~\\ref{fig:3}{c}. Using this time series, we calculate the normalized permutation entropy within a sliding window with 1024 observations for the embedding dimension $d_x = 5$ and two values for the embedding delay ($\\tau_x = 1$ and $\\tau_x = 2$). \n\nAs Cao \\textit{et al.}~\\cite{cao2004detecting}, we denote the permutation entropy values by $H[r(t)]$, where $r(t)$ represents the logistic parameter at the end of the sliding window. Figure~\\ref{fig:3}{d} shows the values of $H[r(t)]$, where abrupt changes are clearly associated with dynamical changes observed in the time series (Fig.~\\ref{fig:3}{c}). Despite the overall similarities, we note that the embedding delay $\\tau_x = 2$ identifies these dynamical changes better than the case with $\\tau_x = 1$; for instance, the transition from period-8 to period-16 (at $r \\approx 3.56$) is missed when $\\tau_x = 1$ but captured when $\\tau_x = 2$~\\cite{cao2004detecting}.\n\nAs we have mentioned, a generalization of permutation entropy to two-dimensional data was first proposed by Ribeiro \\textit{et al.}~\\cite{ribeiro2012complexity}. To illustrate the use of the \\texttt{permutation\\_entropy}{} function with two-dimensional data, we replicate a numerical experiment related to Ising surfaces (see Appendix~\\ref{appendix:stochastic} for definitions) present in that work (Fig.~8 of Ref.~\\onlinecite{ribeiro2012complexity}). These surfaces represent the accumulated sum of spin variables of the canonical two-dimensional Ising model in a Monte Carlo simulation. Figure~\\ref{fig:3}{e} shows four examples of these surfaces (square lattices of size $250 \\times 250$) obtained after $10^6$ Monte Carlo steps for different reduced temperatures $T_r$. We notice non-trivial patterns emerging when the reduced temperature is equal to the critical temperature $(T_r = 1)$ of phase transition for the Ising model~\\cite{landau2015guide}. Following the original article, we generate Ising surfaces (size $250 \\times 250$) for reduced temperatures $T_r \\in \\{0.5,0.6,\\dots,3.0\\}$ and calculate their normalized permutation entropy with $d_x = 3$ and $d_y = 2$, and $d_x = 2$ and $d_y = 3$, both for $\\tau_x = \\tau_ y = 1$. In agreement with Ribeiro \\textit{et al.}~\\cite{ribeiro2012complexity}, Fig.~\\ref{fig:3}{f} shows that the permutation entropy precisely identifies the phase transition of the Ising model (the sudden decrease around the critical temperature) and that these Ising surfaces are symmetric under reversal of the embedding dimensions.\n\n\\begin{figure*}[!ht]\n\\centering\n\\includegraphics[width=0.8\\linewidth]{fig4.pdf}\n\\caption{Complexity-entropy plane for one- and two-dimensional data. (a) Average values of the statistical complexity $C$ versus the normalized permutation entropy $H$ (over ten realizations) evaluated from time series of chaotic maps and stochastic processes. The embedding parameters are $d_x = 6$ and $\\tau_x = 1$. The solid lines represent the maximum and minimal possible values of complexity for a given entropy (for $d_x = 6$ and $\\tau_x = 1$). (b) Localization of three art paintings in the complexity-entropy plane with embedding parameters $d_x = d_y = 2$ and $\\tau_x = \\tau_y = 1$. All data and code necessary to reproduce this figure are available in a Jupyter notebook at \\href{http:\/\/github.com\/arthurpessa\/ordpy}{\\texttt{ordpy}{}}'s webpage.}\n\\label{fig:4}\n\\end{figure*}\n\nThe \\texttt{complexity\\_entropy}{} function simultaneously calculates the permutation entropy and the statistical complexity from time series and image data. To illustrate its usage, we partially reproduce the results of Rosso \\textit{et al.}~\\cite{rosso2007distinguishing} (Fig.~1 in that work) on distinguishing chaotic from stochastic time series. By following their article, we iterate four discrete maps to generate chaotic series. Specifically, we obtain chaotic time series from skew tent map (parameter $w = 0.1847$), H\\'enon map ($x$-component, parameters $a = 1.4$ and $b = 0.3$), logistic map $(r = 4)$, and Schuster map (parameter $z \\in \\{3\/2, 2, 5\/2\\}$) -- see Appendix~\\ref{appendix:chaos} for definitions. We further generate stochastic series from three stochastic processes: noises with $1\/f^{-k}$ power spectrum (for $k \\in \\{0.00, 0.25, \\dots, 3.00\\}$), fractional Brownian motion (Hurst exponent $h \\in \\{0.1,0.2,\\dots,0.9\\}$), and fractional Gaussian noise (also $h \\in \\{0.1,0.2,\\dots,0.9\\}$) -- see Appendix~\\ref{appendix:stochastic} for definitions. For each of these maps and stochastic processes, we generate ten time series with $2^{15}$ observations and random initial conditions. Next, we use \\texttt{complexity\\_entropy}{} with embedding parameters $d_x = 6$ and $\\tau_x = 1$ to calculate their statistical complexity and permutation entropy (average values over 10 time series realizations).\n\nAs in the original work of Rosso \\textit{et al.}~\\cite{rosso2007distinguishing}, Fig.~\\ref{fig:4}{a} shows that chaotic series usually have high complexity and low entropy values. Stochastic time series, in turn, display high entropy and intermediary complexity values. It is also interesting to note that stochastic time series approach the lower-right corner of the complexity-entropy plane ($H\\to1$ and $C\\to0$) as the serial auto-correlation decreases~\\cite{rosso2007distinguishing}. These results also illustrate that some stochastic and chaotic series have very similar entropy values but different statistical complexity (for instance, fractional Brownian motion with $h=0.9$ and Schuster map with $z=3\/2$), confirming that the statistical complexity extracts additional information from the ordinal distribution. In this figure, we have also included two solid lines delimiting the accessible region of the complexity-entropy plane~\\cite{martin2006generalized}. In \\texttt{ordpy}{}, the functions \\texttt{maximum\\_complexity\\_entropy}{} and \\texttt{minimum\\_complexity\\_entropy}{} generate these curves, as shown in the following code snippet:\n\\begin{minted}{python}\n>>> from ordpy import \n... maximum_complexity_entropy, \n... minimum_complexity_entropy\n>>> maximum_complexity_entropy(dx=4)\narray([[-0. , -0. ],\n [ 0.21810429, 0.19670592],\n [ 0.34568712, 0.28362016],\n ...\n [ 0.98660828, 0.02388382]])\n>>> minimum_complexity_entropy(dx=4)\narray([[-0.00000000e+00, -0.00000000e+00],\n [ 2.67076969e-02, 2.55212327e-02],\n ...\n [ 1.00000000e+00, -3.66606083e-16]])\n\\end{minted}\n\nThe \\texttt{complexity\\_entropy}{} function also works with two-dimensional data, and to illustrate its usage, we follow Sigaki \\textit{et al.}~\\cite{sigaki2018history} and use the complexity-entropy plane to investigate patterns in art paintings. Due to the large-scale of the data analyzed by Sigaki \\textit{et al.} and to keep our examples self-contained, we do not reproduce their original results but simply use their ideas to illustrate how complexity and entropy extract useful information from images. To do so, we handpick three paintings from \\href{https:\/\/www.wikiart.org\/}{wikiart.org} (in the original article, the authors studied 137,364 images obtained from the same webpage). These are a Color Field Painting artwork (Blue, 1953 by Ad Reinhardt, image size $768 \\times 435$~\\cite{reinhardt1953abstract}), a Brazilian Modernist artwork (Abaporu, 1928 by Tarsila do Amaral, image size $1200 \\times 1026$~\\cite{tarsila1928abaporu}), and an American Abstract Expressionist painting (Number 1, 1950 (Lavender Mist), 1950 by Jackson Pollock, image size $749 \\times 1024$~\\cite{pollock1950number}). The three images are in JPEG format with 24 bits per pixel (8 bits for red, green, and blue colors in the RGB color space). We have averaged the pixels over the three RGB layers to represent each image by a usual two-dimensional array. Having these arrays, we calculate the statistical complexity and permutation entropy for the three paintings with embedding parameters $d_x = d_y = 2$ and $\\tau_x = \\tau_y = 1$.\n\nFigure~\\ref{fig:4}{b} shows the complexity-entropy plane for these images (insets depict the artworks). In agreement with the global trend observed by Sigaki \\textit{et al.}~\\cite{sigaki2018history}, these results show that paintings portraying objects with clearly defined borders (such as the squares in Reinhardt's artwork) tend to present large values of statistical complexity and low values of entropy. On the other extreme, paintings with smudged and diffuse contours (such as Pollock's drip paintings) have high entropy and low complexity values. Between these somewhat opposite behaviors, we have a whole continuum of images, as exemplified here by the work of the Brazilian painter Tarsila do Amaral. As argued by Sigaki \\textit{et al.}~\\cite{sigaki2018history}, the complexity-entropy plane maps the local degree of order of artworks into a scale of order-disorder and simplicity-complexity that is similar to qualitative descriptions of artworks proposed by art historians such as W\\\"olfflin (the linear versus painterly dichotomy) and Riegl (the haptic versus optic dichotomy).\n\n\\section{Missing ordinal patterns}\n\nAs we have commented, the logistic map at fully developed chaos does not exhibit the ``descending permutation'' $(2,1,0)$ for $d=3$ (see Fig.~\\ref{fig:2}{b}). This feature is not a particularity of the logistic map. Indeed, these missing ordinal patterns (also called forbidden patterns) occur in different systems, and simple statistics associated with them have proven to be useful and reliable indicators of a system's dynamics~\\cite{zanin2008forbidden, zunino2009forbidden, sakellariou2016counting2, mcculough2016counting1, kulp2016using}. The works of Amig\\'o \\textit{et al.}~\\cite{amigo2006order, amigo2007true} are seminal in this regard, and by following their classification, we can divide these forbidden ordinal patterns into two categories: true or false~\\cite{amigo2007true}. True forbidden patterns (such as the $(2,1,0)$ in the logistic map) are a fingerprint of determinism in a time series dynamics and represent an intrinsic feature of the underlying dynamical process~\\cite{amigo2006order}; that is, these patterns are not an artifact related to the finite length of empirical observations. In turn, false forbidden patterns are related to the finite length of time series~\\cite{amigo2007true} and can emerge even from completely random processes.\n\nThis distinction is not straightforward when dealing with empirical data, but a typical analysis in this context consists in investigating the number of missing patterns ($\\eta$) as a function of the time series length ($N_x$). The behavior of this curve is useful for discriminating time series. In \\texttt{ordpy}{}, the \\texttt{missing\\_patterns}{} function identifies missing ordinal patterns and estimates their relative frequency as in:\n\\begin{minted}{python}\n>>> from ordpy import missing_patterns\n>>> missing_patterns([4,7,9,10,6,11,3,5,\n... 6,2,3,1], dx=3)\n(array([[0, 2, 1],\n [2, 1, 0]]),\n 0.3333333333333333)\n\\end{minted}\n\nTo better illustrate the use of this function, we investigate missing ordinal patterns in time series obtained from the logistic map at fully developed chaos ($r = 4$) and Gaussian random walks. In both cases, we use the embedding dimensions $d_x = 5$ and $d_x = 6$ (with $\\tau_x = 1$) and series lengths $N_x \\in \\{60,150,240,\\dots,6000\\}$. Figure~\\ref{fig:5}{a} shows the results. We observe that the number of missing ordinal patterns approaches zero as the time series length of random walks increases. Conversely, the number of missing permutations related to the logistic map displays an initial decay with the time series length but it rapidly saturates in considerably large numbers, indicating that these missing patterns are intrinsically associated with the underlying determinism of the process~\\cite{amigo2007true}.\n\n\\begin{figure*}[!t]\n\\centering\n\\includegraphics[width=0.8\\linewidth]{fig5.pdf}\n\\caption{Missing ordinal patterns in time series. (a) Number of missing ordinal patterns ($\\eta$) in random walk (blue) and logistic map (red) time series as a function of sequence length ($N_x$) for embedding parameters $d_x = 5$ and $d_x = 6$, both with $\\tau_x = 1$. Results represent the average number of missing permutations over ten time series replicas for each $N_x\\in \\{60,150,240,\\dots,6000\\}$. (b) Dependence of the number of missing ordinal patterns on the noise intensity ($\\xi$) for noisy logistic time series with 6000 observations. The noise added to the logistic series is uniformly distributed in the interval $[-\\xi, \\xi]$ with $\\xi \\in \\{0,0.001,0.002,\\dots,0.5\\}$. Results represent average values over ten time series replicas for each noise level. The embedding dimensions are indicated within the plot and the embedding delay is $\\tau_x = 1$. We use random initial conditions and set the parameter $r = 4$ in all experiments with the logistic map. The necessary code to reproduce these results is available in a Jupyter notebook at \\href{http:\/\/github.com\/arthurpessa\/ordpy}{\\texttt{ordpy}{}}'s webpage.}\n\\label{fig:5}\n\\end{figure*}\n\nIn another application with the \\texttt{missing\\_patterns}{} function, we replicate a result of Amig\\'o \\textit{et al.}~\\cite{amigo2007true} (Fig.~4 in their work) to further show that the number of missing patterns is a good indicator of determinism in time series~\\cite{amigo2007true, amigo2008combinatorial}. By following the original work, we generate time series from the logistic map at fully developed chaos (6000 iterations) and add to them uniformly distributed noise in the interval $[-\\xi, \\xi]$, where $\\xi$ is the noise amplitude. Next, we estimate the average number of missing patterns (over ten time series replicas) for each noise level $\\xi \\in \\{0,0.001,0.002,\\dots,0.5\\}$, and embedding dimensions $d_x=5$ and $d_x=6$ (with $\\tau_x=1$). Figure~\\ref{fig:5}{b} shows the number of missing ordinal patterns as a function of noise amplitude $\\xi$ for both embedding dimensions. We observe that the number of missing patterns related to these deterministic series contaminated with noise approaches zero as noise amplitude grows. However, significantly higher noise levels are necessary to remove all signs of determinism expressed by the lack of permutation patterns when $d_x=6$~\\cite{amigo2007true}.\n\n\\section{Tsallis and R\\'enyi entropy-based quantifiers of the ordinal distribution}\n\nIn addition to Shannon's entropy and the statistical complexity, researchers have proposed to use other quantifiers of the ordinal probability distribution~\\cite{bandt2017new, small2018ordinal, zunino2008fractional, liang2015eeg}. As we have explicitly verified for the statistical complexity, these different quantifiers are supposed to extract additional information from a time series' dynamics that is not captured by permutation entropy and statistical complexity. In this context, a productive approach is to consider parametric generalizations of Shannon's entropy, such as those proposed by Tsallis~\\cite{tsallis1988generalization} and R\\'enyi~\\cite{renyi1961measures}. The work of Zunino \\textit{et al.}~\\cite{zunino2008fractional} was the first to consider the Tsallis entropy in place of Shannon's entropy to define the Tsallis permutation entropy as\n\\begin{equation}\n S_\\beta(P) = \\frac{1}{\\beta-1}\\sum_{i = 1}^{n_\\pi} (\\rho_i(\\Pi_i) - \\rho_i(\\Pi_i)^\\beta)\\,,\n\\end{equation}\nwhere $\\beta$ is a real parameter ($\\beta \\to 1$ recovers the usual Shannon entropy and so the permutation entropy). Tsallis's entropy is also maximized by the uniform distribution, such that $S_\\beta^{\\rm max} = \\frac{1 - (n_\\pi)^{1-\\beta}}{\\beta-1}$. Thus, the normalized Tsallis permutation entropy is\n\\begin{equation}\n H_\\beta(P) = (\\beta-1)\\frac{S_\\beta(P)}{1 - (n_\\pi)^{1-\\beta}}.\n\\end{equation}\n\nSimilarly, Liang \\textit{et al.}~\\cite{liang2015eeg} have proposed the R\\'enyi permutation entropy\n\\begin{equation}\n S_\\alpha(P) = \\frac{1}{1-\\alpha}\\ln\\left(\\sum_{i = 1}^{n_\\pi} \\rho_i(\\Pi_i)^\\alpha\\right)\\,,\n\\end{equation}\nwhere $\\alpha > 0$ is a real parameter. R\\'enyi's entropy converges to Shannon's entropy when $\\alpha \\to 1$ and is maximized by the uniform distribution ($S_\\alpha^{\\rm max} = \\ln n_\\pi$, as the usual Shannon entropy). Thus, the normalized R\\'enyi permutation entropy is\n\\begin{equation}\n H_\\alpha(P) = \\frac{S_\\alpha(P)}{\\ln n_\\pi}.\n\\end{equation}\n\nIn both cases, the generalized entropic form is mono-parametric and has a term where the ordinal probabilities appear raised to the power of the entropic parameter (that is, $\\rho_i(\\Pi_i)^\\beta$ and $\\rho_i(\\Pi_i)^\\alpha$). These parameters assign different weights to the underlying ordinal probabilities, allowing us to access different dynamical scales and produce a family of quantifiers for the ordinal distribution. In \\texttt{ordpy}{}, the \\texttt{tsallis\\_entropy}{} and \\texttt{renyi\\_entropy}{} functions implement these two quantifiers as in:\n\\begin{minted}{python}\n>>> from ordpy import tsallis_entropy, \n... renyi_entropy \n>>> tsallis_entropy([4,7,9,10,6,11,3], \n... q=[1,2], dx=2) #Here q plays the\n... role of beta.\narray([0.91829583, 0.88888889])\n>>> renyi_entropy([4,7,9,10,6,11,3],\n... alpha=[1,2], dx=2)\narray([0.91829583, 0.84799691])\n\\end{minted}\n\nIn a similar direction, there are also the developments of complexity-entropy curves proposed by Ribeiro \\textit{et al.}~\\cite{ribeiro2017characterizing} and Jauregui \\textit{et al.}~\\cite{jauregui2018characterization}. These works have further extended the complexity-entropy plane concept by considering the Tsallis and R\\'enyi entropies combined with proper generalizations of statistical complexity~\\cite{martin2006generalized}. Thus, instead of having a single point in the complexity-entropy plane for a given time series, Ribeiro \\textit{et al.}~\\cite{ribeiro2017characterizing} and Jauregui \\textit{et al.}~\\cite{jauregui2018characterization} have created parametric curves by varying the entropic parameter ($\\beta$ or $\\alpha$) and simultaneously calculating the generalized entropy and the generalized statistical complexity. \n\nTo define the Tsallis complexity-entropy curves~\\cite{ribeiro2017characterizing}, we first extend the statistical complexity (Eq.~\\ref{eq:statistical_complexity}) using the Tsallis entropy, that is,\n\\begin{equation}\\label{eq:statistical_complexity_tsallis}\n C_\\beta(P) = \\frac{D_\\beta(P,U) H_\\beta(P)}{D^{\\rm max}_\\beta}\\,,\n\\end{equation}\nwhere\n\\begin{equation}\n D_\\beta(P,U) = \\frac{1}{2}K_\\beta\\left( P\\bigg|\\frac{P+U}{2}\\right) + \\frac{1}{2}K_\\beta\\left(U\\bigg|\\frac{P+U}{2}\\right)\n\\end{equation}\nis the Jensen-Tsallis divergence~\\cite{martin2006generalized} written in terms of the corresponding Kullback-Leibler divergence~\\cite{martin2006generalized, tsallis2009introduction}\n\\begin{equation}\n K_\\beta(V|R) = \\frac{1}{\\beta-1}\\sum_i^{n_\\pi} v_i^\\beta[r_i^{1-\\beta}-v_i^{1-\\beta}]\\,,\n\\end{equation}\nwhere $V=\\{v_i\\}_{i = 1, \\dots, n_\\pi}$ and $R=\\{r_i\\}_{i = 1, \\dots, n_\\pi}$ are two arbitrary distributions. In Eq.~\\ref{eq:statistical_complexity_tsallis}, \\begin{equation*}\n D^{\\rm max}_\\beta = \\frac{2^{2-\\beta}n_\\pi - (1 + n_\\pi)^{1-\\beta}-n_\\pi(1+1\/n_\\pi)^{1-\\beta}-n_\\pi+1}{2^{2-\\beta}n_\\pi(1-\\beta)}\n\\end{equation*}\nis a normalization constant representing the maximum possible value of $D_\\beta(P,U)$ that occurs for $P = \\{ \\delta_{1,i} \\}_{i = 1,\\dots,n_\\pi}$ (as in the usual Jensen-Shannon divergence). By following Ribeiro \\textit{et al.}~\\cite{ribeiro2017characterizing}, we construct a parametric representation of the ordered pairs $(H_\\beta(P), C_\\beta(P))$ for $\\beta > 0$, obtaining the Tsallis complexity-entropy curves. \n\nSimilarly, to define the R\\'enyi complexity-entropy curves~\\cite{jauregui2018characterization}, we generalize the statistical complexity in R\\'enyi's formalism as \n\\begin{equation}\n C_\\alpha(P,U) = \\frac{D_\\alpha(P,U) H_\\alpha(P)}{D_\\alpha^{\\rm max}}\\,,\n\\end{equation}\nwhere\n\\begin{equation}\n D_\\alpha(P,U) = \\frac{1}{2}K_\\alpha\\left( P\\bigg|\\frac{P+U}{2}\\right) + \\frac{1}{2}K_\\alpha\\left(U\\bigg|\\frac{P+U}{2}\\right)\n\\end{equation}\nis the Jensen-R\\'enyi divergence~\\cite{martin2006generalized} written in terms of \n\\begin{equation}\n K_\\alpha(V|R) = \\frac{1}{\\alpha-1}\\ln \\left( \\sum_{i = 1}^{d!} v_i^\\alpha r_i^{1-\\alpha}\\right)\\,, \n\\end{equation}\nthe corresponding Kullback-Leibler divergence for R\\'enyi's entropy~\\cite{martin2006generalized, vanerven2014renyi}. The normalization constant\n\\begin{equation*}\n D_\\alpha^{\\rm max} = \\frac{1}{2(\\alpha-1)}\\ln{\\left[\\frac{(n_\\pi+1)^{1-\\alpha} + n_\\pi - 1}{n_\\pi}\\left(\\frac{n_\\pi+1}{4 n_\\pi}\\right)^{1-\\alpha}\\right]}\n\\end{equation*}\ncorresponds to the maximum possible value of $D_\\alpha(P,U)$ occurring for $P = \\{ \\delta_{1,i} \\}_{i = 1,\\dots,n_\\pi}$ (as in the usual Jensen-Shannon divergence). Again, we can construct a parametric representation of the ordered pairs $(H_\\alpha(P), C_\\alpha(P))$ for $\\alpha > 0$, obtaining the R\\'enyi complexity-entropy curves proposed by Jauregui \\textit{et al.}~\\cite{jauregui2018characterization}.\n\nIn \\texttt{ordpy}{}, the functions \\texttt{tsallis\\_complexity\\_entropy}{} and \\texttt{renyi\\_complexity\\_entropy}{} implement the Tsallis and R\\'enyi complexity-entropy curves as shown in the following code snippet:\n\\begin{minted}{python}\n>>> from ordpy import \n... tsallis_complexity_entropy,\n... renyi_complexity_entropy\n>>> tsallis_complexity_entropy(\n... [4,7,9,10,6,11,3], \n... dx=2, q=[1,2]) #Here q plays the\n... role of beta.\narray([[0.91829583, 0.06112817],\n [0.88888889, 0.07619048]])\n>>> renyi_complexity_entropy(\n... [4,7,9,10,6,11,3],\n... dx=2, alpha=[1, 2])\narray([[0.91829583, 0.06112817],\n [0.84799691, 0.08303895]])\n\\end{minted}\n\nTo better illustrate the use of these \\texttt{ordpy}{}'s functions, we replicate some numerical experiments involving the logistic map and random walks presented in the original works of Ribeiro \\textit{et al.}~\\cite{ribeiro2017characterizing} (Figs.~1 and 6 in that work) and Jauregui \\textit{et al.}~\\cite{jauregui2018characterization} (Figs.~1 and 3 in that work). We start by generating time series from the logistic map at fully developed chaos ($r=4$, random initial condition) and a Gaussian random walk. For the logistic map series, we discard the first $10^4$ iterations to avoid transient effects and iterate other $10^6$ steps. The random walk series also has $10^6$ observations. By using these time series, we generate their corresponding Tsallis complexity-entropy curves for $d_x = 3$ and $\\tau_x = 1$ by sampling $10^3$ log-spaced values of the entropic parameter $\\beta$ between $0.01$ and $100$ for the logistic map, and between $0.001$ and $100$ for the random walk. \n\n\\begin{figure*}[!t]\n\\centering\n\\includegraphics[width=0.8\\linewidth]{fig6.pdf}\n\\caption{Tsallis and R\\'enyi complexity-entropy curves. Tsallis complexity-entropy curves for time series obtained from (a) the logistic map at fully developed chaos and (b) a Gaussian random walk, both with embedding parameters $d_x = 3$ and $\\tau_x = 1$. The solid lines represent the empirical results and the dashed lines indicate the exact form of these complexity-entropy curves. Panels (c) and (d) show the R\\'enyi complexity-entropy curves obtained from the same two time series with embedding parameters $d_x = 4$ and $\\tau_x = 1$. In all panels, star markers indicate the beginning of the curves ($\\beta\\approx0$ or $\\alpha\\approx0$), while circle markers indicate the end of the curves (largest values of $\\beta$ and $\\alpha$). Data and code necessary to reproduce these results are available in a Jupyter notebook at \\href{http:\/\/github.com\/arthurpessa\/ordpy}{\\texttt{ordpy}{}}'s webpage.}\n\\label{fig:6}\n\\end{figure*}\n\nFigures~\\ref{fig:6}{a} and \\ref{fig:6}{b} show the empirical complexity-entropy curves in comparison with their exact shape (dashed lines). These theoretical curves can be determined for these time series because the ordinal distributions of the logistic map ($P_{\\rm logistic} = \\{{1}\/{3}, {1}\/{15}, {2}\/{15}, {3}\/{15}, {4}\/{15}, 0\\}$) and random walks ($P_{\\rm walk} = \\{{1}\/{4}, {1}\/{8}, {1}\/{8}, {1}\/{8}, {1}\/{8}, {1}\/{4}\\}$) are exactly known for $d_x = 3$~\\cite{amigo2006order, bandt2007order}. We observe that theoretical and empirical results are in excellent agreement. As discussed by Ribeiro \\textit{et al.}~\\cite{ribeiro2017characterizing}, random series tend to form closed complexity-entropy curves (Fig.~\\ref{fig:6}{b}), while chaotic time series are usually represented by open complexity-entropy curves (Fig.~\\ref{fig:6}{a}). These features emerge as a direct consequence of the existence or not of missing ordinal patterns captured by the limiting behavior of $H_\\beta$ as $\\beta \\to 0$ and $\\beta \\to \\infty$~\\cite{ribeiro2017characterizing}.\n\nBy following a similar approach, we also estimate the R\\'enyi complexity-entropy curves for the two previous time series for $d_x = 4$ and $\\tau_x = 1$. Figures~\\ref{fig:6}{c} and \\ref{fig:6}{d} show these R\\'enyi complexity-entropy curves. Differently from the Tsallis case, R\\'enyi complexity-entropy curves are always open~\\cite{jauregui2018characterization}, and the usage of these curves for distinguishing chaotic from stochastic series relies on a more subtle characteristic. Indeed, Jauregui \\textit{et al.}~\\cite{jauregui2018characterization} have found that the initial curvature of R\\'enyi complexity-entropy curves ($dC_\\alpha\/dH_\\alpha$ for small $\\alpha$) can be used as an indicative of determinism in time series. Specifically, they found that positive curvatures are associated with time series of stochastic nature, while negative ones are related to chaotic phenomena. This pattern also occurs in the results of Figs.~\\ref{fig:6}{c} and \\ref{fig:6}{d}.\n\n\\section{Ordinal networks}\n\nAmong the more recent developments related to the Bandt-Pompe framework, we have the so-called ordinal networks. First proposed by Small~\\cite{small2013complex} for investigating nonlinear dynamical systems, and later generalized with his collaboration in a series of works~\\cite{mccullough2015time, mccullough2017multiscale, sun2014characterizing, sakellariou2019markov}, ordinal networks belong to a more general class of methods designed to map time series into networks, collectively known as time series networks~\\cite{zou2019complex}. Beyond counting ordinal patterns, this approach considers first-order transitions among ordinal symbols within a symbolic sequence. In this network representation, the different ordinal patterns occurring in a data set are mapped into nodes of a complex network. The edges between nodes indicate that the associated permutation symbols are adjacent to each other in a symbolic sequence. Furthermore, edges can be directed according to the temporal succession of ordinal symbols and weighted by the relative frequencies in which the corresponding successions occur in a symbolic sequence~\\cite{mccullough2015time}.\n\nAfter applying the Bandt-Pompe method with embedding parameters $d_x$ and $\\tau_x$ to a time series $\\{x_t\\}_{t=1,\\dots,N_x}$ and obtaining the symbolic sequence $\\{\\pi_p\\}_{p = 1, \\dots, n_x}$, we can define the elements of the weighted adjacency matrix of the corresponding ordinal network as~\\cite{mccullough2015time, pessa2019characterizing}\n\\begin{equation}\\label{eq:adj_matrix}\n \\rho_{i, j} = \\frac{\\text{total of transitions} \\ \\Pi_i \\to \\Pi_j\\ \\text{in}\\ \\{\\pi_p\\}_{p = 1, \\dots, n_x}}{n_x - 1}\\,,\n\\end{equation} \nwhere $i,j=1,2,\\dots,n_\\pi$ (with $n_\\pi=d_x!$), $\\Pi_i$ and $\\Pi_j$ represent all possible ordinal patterns, and the denominator $n_x - 1$ is the total number of ordinal transitions. In \\texttt{ordpy}{}, the \\texttt{ordinal\\_network}{} function returns the nodes, edges, and edge weights of an ordinal network mapped from a time series as in:\n\\begin{minted}{python}\n>>> from ordpy import ordinal_network\n>>> ordinal_network([4,7,9,10,6,11,8,3,7],\n... dx=2, normalized=False)\n(array(['0|1', '1|0'], dtype='>> from ordpy import ordinal_network\n>>> ordinal_network([4,7,9,10,6,11,8,3,7],\n... dx=2, normalized=False,\n... overlapping=False)\n(array(['0|1', '1|0'], dtype='>> from ordpy import ordinal_network\n>>> ordinal_network([[1,2,1],[8,3,4],[6,7,5]], \n... dx=2, dy=2, normalized=False)\n(array(['0|1|3|2', '1|0|2|3', '1|2|3|0'], \ndtype='>> from ordpy import ordinal_network\n>>> ordinal_network([[1,2,1],[8,3,4],[6,7,5]],\n... dx=2, dy=2, normalized=False, \n... connections='horizontal')\n(array(['0|1|3|2', '1|0|2|3', '1|2|3|0'], \ndtype='>> from ordpy import random_ordinal_network\n>>> random_ordinal_network(dx=2)\n(array(['0|1', '1|0'], dtype='>> from ordpy import random_ordinal_network\n>>> random_ordinal_network(dx=2,\n... overlapping=False)\n(array(['0|1', '1|0'], dtype='>> from ordpy import global_node_entropy\n>>> global_node_entropy(\n... [1,2,3,4,5,6,7,8,9], dx=2)\n0.0\n>>> global_node_entropy(\n... ordinal_network([1,2,3,4,5,6,7,8,9],\n... dx=2))\n0.0\n>>> global_node_entropy(\n... np.random.uniform(size=100000), dx=3)\n1.4988332319747597\n>>> global_node_entropy(\n... random_ordinal_network(dx=3))\n1.5\n\\end{minted}\n\n\\section{Applications of ordinal networks with \\texttt{ordpy}{}}\n\nTo better illustrate the use of \\texttt{ordpy}{} in the context of ordinal networks, we review and replicate some literature results. Before starting, we remark that \\texttt{ordpy}{} does not have functions for network analysis or graph visualization. The \\texttt{ordinal\\_network}{} function generates output data (nodes, edges and weight lists) that can feed graph libraries such as \\texttt{graph\\_tool}{}~\\cite{peixoto2014graphtool}, \\texttt{networkx}{}~\\cite{hagberg2008networkx}, and \\texttt{igraph}{}~\\cite{csardi2006igraph}. Here, we have used \\texttt{networkx}{} and \\texttt{igraph}{}. \n\n\\begin{figure*}[!ht]\n\\centering\n\\includegraphics[width=0.8\\linewidth]{fig8.pdf}\n\\caption{Global node entropy of one- and two-dimensional data. (a) The initial data points of a sawtooth-like time series defined as $x_t = \\{0,{1}\/{3},{1}\/{6},1,\\dots\\}$. (b) Normalized permutation entropy ($H$) and normalized global node entropy ($H_{\\rm GN}$) as a function of the amplitude ($\\xi$) of the uniform white noise added to the periodic sawtooth-like signals. The different curves represent average values of $H$ and $H_{\\rm GN}$ over ten realizations for $\\xi = \\{0, 0.05,0.1,\\dots,2\\}$. (c) Eight examples (out of 112) of the normalized Brodatz textures. These are grayscale images (256 gray levels) with size $640\\times640$~\\cite{safia2020multiband}. (d) Differences between the global node entropy evaluated from the horizontal and vertical ordinal networks ($S_{\\rm GN}^{\\rm Horizontal} - S_{\\rm GN}^{\\rm Vertical}$) mapped from each Brodatz texture. We highlight eight textures (the same as shown in panel c) with the largest differences. Data and code necessary to reproduce these results are available in a Jupyter notebook at \\href{http:\/\/github.com\/arthurpessa\/ordpy}{\\texttt{ordpy}{}}'s webpage.}\n\\label{fig:8}\n\\end{figure*}\n\nWe start by partially reproducing Small's~\\cite{small2013complex} pioneering work in which ``ordinal partition networks'' first appeared (see Fig.~3 in that work). By following Small~\\cite{small2013complex}, we numerically solve the differential equations of the R\\\"ossler system (with parameters $a=0.3$, $b = 2$ and $c = 4$, see Appendix~\\ref{appendix:chaos} for definitions) and sample the $x$-coordinate to obtain a time series with $10^5$ observations. Figure~\\ref{fig:7}{a} illustrates the periodic behavior of this time series. We then create the ordinal network from this data set with embedding parameters $d_x = 16$ and $\\tau_x=1$. It is worth remembering that Small's original algorithm uses non-overlapping partitions and the edges of the resulting ordinal network are undirected and unweighted. The parameter \\texttt{overlapping} in \\texttt{ordinal\\_network}{} should be equal to \\texttt{False} to properly use Small's original algorithm. Figure~\\ref{fig:7}{b} shows a visualization of this ordinal network, where the circular structure alludes to the periodicity of the original time series.\n\nIn another simple example with ordinal networks, we partially replicate Pessa and Ribeiro's~\\cite{pessa2019characterizing} results on fractional Brownian motion (see Fig.~6 in their work). To do so, we generate a time series from this stochastic process with Hurst exponent $h = 0.8$ (see Appendix~\\ref{appendix:stochastic} for definitions) and $2^{16}$ observations, as illustrated in Fig.~\\ref{fig:7}{c}. Next, we map this time series into an ordinal network with embedding parameters $d_x = 3$ and $\\tau_x = 1$ (this time using overlapping partitions as in the usual Bandt-Pompe approach). Figure~\\ref{fig:7}{d} shows a visualization of the resulting ordinal network, where the persistent behavior imposed by the Hurst exponent $h = 0.8$ is captured by the quite intense autoloops associated with the ordinal patterns $(0,1,2)$ and $(2,1,0)$ (that is, the upward and downward trends of this time series). Pessa and Ribeiro~\\cite{pessa2019characterizing} have also shown that local properties of ordinal networks (for instance, average weighted shortest path) are quite effective for estimating the Hurst exponent of time series, having performance superior to widely used approaches such as detrended fluctuation analysis (DFA)~\\cite{peng1994mosaic}.\n\nWe also consider ordinal networks mapped from two-dimensional data. We map a periodic ornament previously explored in Ref.~\\onlinecite{pessa2020mapping} (see Fig.~2 in that reference). Figure~\\ref{fig:7}{e} shows the ornament of size $250 \\times 250$ (see Appendix~\\ref{appendix:stochastic} for more details), while Fig.~\\ref{fig:7}{f} presents a visualization of the corresponding ordinal network with embedding parameters $d_x = d_y = 2$ and $\\tau_x = \\tau_y = 1$. \nWe have made edge thickness proportional to edge weight (Eq. 22) to highlight that a few edges concentrate most of the transition probability of the network. Furthermore, we observe that this network has $12$ nodes and $72$ edges, that is, only a small fraction of all possible nodes ($24$) and edges ($416$) of a ordinal networks with $d_x = d_y = 2$ and $\\tau_x = \\tau_y = 1$.\n\nIn addition to the previous more qualitative examples, we have also replicated some results related to the global node entropy of ordinal networks. For time series, we follow Pessa and Ribeiro~\\cite{pessa2019characterizing} (see Fig.~5 in their work) and generate a periodic sawtooth-like signal (Fig.~\\ref{fig:8}{a}) with $10^5$ observations and add to it uniform white noise in the interval $[-\\xi, \\xi]$, where $\\xi$ represents the noise amplitude. We generate these noisy sawtooth-like time series for each $\\xi \\in \\{0,0.05,0.1,\\dots,2\\}$ and determine the average values of the normalized permutation entropy ($H$) and the normalized global node entropy ($H_{\\rm GN}$) over ten time series replicas with $d_x = 4$ and $\\tau_x = 1$. \n\nFigure~\\ref{fig:8}{b} shows the average values of $H$ and $H_{\\rm GN}$ as a function of the noise amplitude $\\xi$. We note that both measures approach one with the increase of the noise amplitude. However, permutation entropy saturates for $\\xi\\approx1$, while global node entropy requires significantly higher values of $\\xi$. This result indicates that global node entropy is more robust to noise addition and has a higher discrimination power than permutation entropy~\\cite{pessa2019characterizing}.\n\nTo demonstrate the use of \\texttt{global\\_node\\_entropy}{} with two-dimensional data, we calculate the global node entropy for a set of 112 8-bit images of natural textures known as the normalized Brodatz textures~\\cite{safia2013new, safia2020multiband}. Figure~\\ref{fig:8}{c} shows examples of these images. By following Pessa and Ribeiro~\\cite{pessa2020mapping} (see Fig.~5 in their work), we calculate the global node entropy from the horizontal ($S_{\\rm GN}^{\\rm Horizontal}$) and vertical ($S_{\\rm GN}^{\\rm Vertical}$) ordinal networks mapped from the Brodatz textures with $d_x = d_y = 2$ and $\\tau_x = \\tau_y = 1$. \n\nFigure~\\ref{fig:8}{d} depicts the difference between these two entropy values (that is, $S_{\\rm GN}^{\\rm Horizontal} - S_{\\rm GN}^{\\rm Vertical}$) for each Brodatz texture. We have also highlighted eight textures with extreme values for this difference. Most of these images are characterized by stripes or line segments predominantly oriented in the vertical or horizontal directions which, in turn, suggests that properties of vertical and horizontal ordinal networks can detect simple image symmetries.\n\n\\begin{figure*}[!ht]\n\\centering\n\\includegraphics[width=0.8\\linewidth]{fig9.pdf}\n\\caption{True and false missing links in ordinal networks. (a) Dependence of the fraction of missing links ($f$) estimated from Gaussian white noise time series as a function of the time series length ($N_x$). (b) Dependence of the fraction of missing links ($f$) estimated from fully chaotic logistic time series ($r = 4$) as a function of the time series length ($N_x$). In both panels, the different curves represent average values over ten realizations (for each series length) and embedding dimension $d_x \\in\\{3,4,5,6\\}$ with $\\tau_x = 1$. We also use 194 values for $N_x$ logarithmically spaced in the interval $[10,10^5]$ in both panels. Data and code necessary to reproduce these results are available in a Jupyter notebook at \\href{http:\/\/github.com\/arthurpessa\/ordpy}{\\texttt{ordpy}{}}'s webpage.}\n\\label{fig:9}\n\\end{figure*}\n\nIn a final application with ordinal networks, we explore the concept of missing links or missing transitions among ordinal patterns~\\cite{pessa2019characterizing}. Similarly to the missing ordinal patterns described by Amig\\'o \\textit{et al.}~\\cite{amigo2006order, amigo2007true}, ordinal networks can display true and false forbidden transitions among ordinal patterns. In this case, true missing links are related to the intrinsic dynamics of the process under analysis, while false missing links are associated with the finite size of empirical data sets. Because we know the exact form of random ordinal networks~\\cite{pessa2019characterizing, pessa2020mapping} (here these networks represent all possible connections) we can readily find all missing links of an empirical ordinal network. In \\texttt{ordpy}{}, the \\texttt{missing\\_links}{} function evaluates all missing ordinal transitions directly from a data set or the returned arrays of \\texttt{ordinal\\_network}{} as in: \n\\begin{minted}{python}\n>>> from ordpy import missing_links\n>>> missing_links([4,7,9,10,6,11,3], dx=2, \n... return_fraction=False)\n(array([['1|0', '1|0']], dtype='>> missing_links(ordinal_network(\n... [4,7,9,10,6,11,3], dx=2),\n... dx=2, return_fraction=True)\n(array([['1|0', '1|0']], dtype='0$, denote by $\\mathcal F(\\theta; M)$ the collection of functions $f\\in L_2(P_0)$ such that for any $R>0$, there exists an $f_R\\in \\mathcal H(K)$ such that\n$$\n\\|f_R\\|_K\\le R,\\qquad {\\rm and}\\qquad \\|f-f_R\\|_{L_2(P_0)}\\le M R^{-1\/\\theta}.\n$$\nSee, \\textit{e.g.}, \\cite{cucker2007learning} for further discussion on these so-called interpolation spaces and their use in statistical learning. We shall also adopt the convention that\n$$\\mathcal F(0;M)=\\{f\\in \\mathcal H(K): \\|f\\|_K\\le M\\}.$$\nWe investigate the optimal rate of detection for testing $H_0$ against\n\\begin{equation}\n\\label{alter}\nH_1(\\Delta_n,\\theta,M): P\\in \\mathcal P(\\Delta_n,\\theta,M),\n\\end{equation}\nwhere $\\mathcal P(\\Delta_n,\\theta,M)$ is the collection of distributions $P$ on $(\\mathcal X,\\mathcal B)$ satisfying:\n$$\ndP\/dP_0-1\\in \\mathcal F(\\theta; M),\\qquad {\\rm and}\\qquad \\chi^2(P,P_0)\\ge \\Delta_n.\n$$\nWe call $r_n$ the optimal rate of detection if for any $c>0$, there exists no consistent test whenever $\\Delta_n\\le cr_n$; and on the other hand, a consistent test exists as long as $\\Delta_n\\gg r_n$.\n\nAlthough one could consider a more general setup, for concreteness, we assume that the eigenvalues of $K$ with respect to $L_2(P_0)$ decays polynomially in that $\\lambda_k\\asymp k^{-2s}$. We show that the optimal rate of detection for testing $H_0$ against $H_1(\\Delta_n,\\theta,M)$ for any $\\theta\\ge 0$ is $n^{-{4 s\\over 4 s+ \\theta+1}}$. The rate of detection, although not achievable with a $\\gamma_K(\\widehat{P}_n,P_0)$ based test, can be attained via a moderated version of the MMD based approach. A practical challenge to the approach, however, is its reliance on the knowledge of $\\theta$. Unlike $s$ which is determined by $K$ and $P_0$ and therefore known apriori, $\\theta$ depends on $u$ and is not known in advance. This naturally brings about the issue of adaptation -- is there an agnostic approach that can adaptively attain the optimal detection boundary without the knowledge of $\\theta$. We show that the answer is affirmative although a small price in the form of $\\log \\log n$ is required to achieve such adaptation.\n\nThe rest of the paper is organized as follows. We first analyze the power of MMD based tests in Section \\ref{sec:mmd}. This analysis reveals a significant gap between the detection boundary achieved by the MMD based test and the usual parametric $1\/n$ rate. In turn, this prompts us to introduce, in Section \\ref{sec:m3d}, a new class of tests based on a modified MMD. We show that the new tests are rate optimal. To address the practical challenge of choosing an appropriate tuning parameter for these tests, we investigate the issue of optimal adaptation in Section \\ref{sec:adapt}, where we establish the optimal rates of detection for adaptively testing $H_0$ agains a broader set of alternatives and propose a test based on the modified MMD that can attain these rates. Numerical experiments are presented in Section \\ref{sec:num}.\nAll proofs are relegated to Section \\ref{sec:proof}.\n\n\\section{Operating characteristics of MMD based test}\n\\label{sec:mmd}\n\n\\subsection{Background and notation}\nIn this section, we investigate the performance of the MMD based test. As shown in \\citet{gretton2012kernel}, the squared MMD between two probability distributions $P$ and $P_0$ can be expressed as\n\\begin{align}\n\\gamma_K^2(P,P_0)=\\int K(x,x'){d}(P-P_0)(x){d}(P-P_0)(x').\\label{deg}\n\\end{align}\nWrite\n\\begin{align*}\n\\bar{K}(x,x')=K(x,x')-{\\mathbb E} _{P_0}K(x,X)-{\\mathbb E} _{P_0} K(X,x')+{\\mathbb E} _{P_0}K(X,X'),\n\\end{align*}\nwhere the subscript $P_0$ signifies the fact that the expectation is taken over $X, X'\\sim P_0$ independently. By (\\ref{deg}), $\\gamma_K^2(P,P_0)=\\gamma_{\\bar{K}}^2(P,P_0)$. Therefore, without loss of generality, we shall assume in what follows that $K$ is degenerate under $P_0$, \\textit{i.e.}, \n\\begin{align}\n{\\mathbb E} _{P_0}K(X,\\cdot)=0.\\label{degenerate}\n\\end{align}\nFor brevity, we shall omit the subscript $K$ in $\\gamma$ in the rest of the paper, unless it is necessary to emphasize the dependence of MMD on the reproducing kernel.\n\nAssuming that $K$ is square integrable, by Mercer's theorem, it can be decomposed as\n\\begin{align}\nK(x,x')=\\sum\\limits_{k\\geq 1}\\lambda_k\\varphi_k(x)\\varphi_k(x'),\\label{decomp}\n\\end{align}\nwhere the limit is in the sense of $L_2(P_0)$, $\\lambda_1>\\lambda_2>\\cdots>0$ are the positive eigenvalues of the integral operator induced by $K$, and $\\{\\varphi_k: k\\ge 1\\}$ are the corresponding orthonormal eigenfunctions, \\textit{i.e.}, $\\langle \\varphi_k,\\varphi_{k'} \\rangle_{L_2(P_0)}=\\delta_{k,k'}$ and $\\langle \\varphi_k,\\varphi_{k'} \\rangle_K=\\lambda_k^{-1}\\delta_{k,k'}$, with $\\delta$ representing the Kronecker delta. For the sake of concreteness, we shall assume $K$ is universal in that $\\{\\varphi_k: k\\ge 1\\}$ forms an orthonormal basis of $L_2(P_0)$, and has infinitely many positive eigenvalues decaying polynomially, that is,\n\\begin{align}\n0<\\varliminf_{k\\rightarrow \\infty}k^{2s}\\lambda_k\\leq\\varlimsup_{k\\rightarrow \\infty}k^{2s}\\lambda_k<\\infty\\label{summable}\n\\end{align}\nfor some $s>1\/2$. Moreover, we assume the eigenfunctions are uniformly bounded, \\textit{i.e.},\n\\begin{align}\n\\sup_{k\\geq 1}\\|\\varphi_k\\|_{\\infty}<\\infty.\\label{unif}\n\\end{align}\nAssumptions (\\ref{summable}) and (\\ref{unif}) ensure that the spectral decomposition (\\ref{decomp}) holds both pointwisely and uniformly.\n\nNote that (\\ref{degenerate}) implies ${\\mathbb E} _{P_0}\\varphi_k(X)=0$, $\\forall\\ k\\ge 1$, and (\\ref{decomp}) gives\n\\begin{align*}\n\\gamma^2(P,P_0)=\\sum\\limits_{k\\geq 1}\\lambda_k[{\\mathbb E} _{P}\\varphi_k(X)]^2\n\\end{align*}\nfor any $P$. Accordingly, when $P$ is replaced by the empirical distribution $\\widehat{P}_n$, the empirical squared MMD can be expressed as\n\\begin{align*}\n\\gamma^2(\\widehat{P}_n,P_0)=\\sum\\limits_{k\\geq 1}\\lambda_k\\left[\\frac{1}{n}\\sum\\limits_{i=1}^{n}\\varphi_k(X_i)\\right]^2.\n\\end{align*}\nClassic results on the asymptotics of V-statistic \\citep{serfling2009approximation} imply that\n\\begin{align*}\nn\\gamma^2(\\widehat{P}_n,P_0)\\stackrel{d}{\\rightarrow}\\sum\\limits_{k\\geq 1}\\lambda_kZ_k^2:= W\n\\end{align*}\nunder $H_0$, where $Z_k\\stackrel{i.i.d.}{\\sim} N(0,1)$. Let $T_{\\mathrm{MMD}}$ be an MMD based test, which rejects $H_0$ if and only if $n\\gamma^2(\\widehat{P}_n,P_0)$ exceeds the upper $\\alpha$ quantile $q_{w,1-\\alpha}$ of $W$, \\textit{i.e.},\n$$T_{\\mathrm{MMD}}=\\mathds{1}_{\\{n\\gamma^2(\\widehat{P}_n,P_0)>q_{w,1-\\alpha}\\}}.$$\nThe above limiting distribution of $n\\gamma^2(\\widehat{P}_n,P_0)$ immediately suggests that $T_{\\mathrm{MMD}}$ is an asymptotic $\\alpha$-level test.\n\n\\subsection{Power analysis for MMD based tests}\nWe now investigate the power of $T_{\\mathrm{MMD}}$ in testing $H_0$ against $H_1(\\Delta_n,\\theta,M)$ given by (\\ref{alter}). Recall that the type \\uppercase\\expandafter{\\romannumeral2}\\ error of a test $T:\\mathcal{X}^{n}\\rightarrow [0,1]$ for testing $H_0$ against a composite alternative $H_1:P\\in\\mathcal{P}$ is given by\n$$\\beta(T;\\mathcal P)=\\sup\\limits_{P\\in \\mathcal{P}}{\\mathbb E}_{P}[1-T(X_1,\\ldots,X_n)],$$\nwhere ${\\mathbb E}_P$ means taking expectation over $X_1,\\ldots, X_n\\stackrel{i.i.d.}{\\sim}P$.\nFor brevity, we shall write $\\beta(T;\\Delta_n,\\theta,M)$ instead of $\\beta(T;\\mathcal{P}(\\Delta_n,\\theta,M))$ in what follows. The performance of a test $T$ can then be evaluated by its detection boundary, that is, the smallest $\\Delta_n$ under which the type \\uppercase\\expandafter{\\romannumeral2}\\ error converges to $0$ as $n\\rightarrow \\infty$. Our first result establishes the convergence rate of the detection boundary for $T_{\\mathrm{MMD}}$\\ in the case when $\\theta=0$. Hereafter, we abbreviate $M$ in $\\mathcal P(\\Delta_n,\\theta,M)$, $H_1(\\Delta_n,\\theta,M)$ and $\\beta(T;\\Delta_n,\\theta,M)$, unless it is necessary to emphasize the dependence.\n\n\n\\begin{theorem}\\label{mmdthm}\nConsider testing $H_0: P=P_0$ against $H_1(\\Delta_n,0)$ by $T_{\\mathrm{MMD}}$.\n\\renewcommand{\\labelenumi}{(\\roman{enumi})} \n\\begin{enumerate}\n\t\\item If $\\sqrt{n}\\Delta_n\\rightarrow \\infty$, then\n\t$$\\beta(T_{\\mathrm{MMD}};\\Delta_n,0)\\rightarrow 0\\qquad {\\rm as} \\quad n\\rightarrow \\infty;$$\n\t\\item conversely, there exists a constant $c_0>0$ such that\n\t$$\\varliminf\\limits_{n\\rightarrow \\infty}\\beta(T_{\\mathrm{MMD}};c_0n^{-1\/2},0)>0.$$\n\\end{enumerate}\n\\end{theorem}\n\n\nTheorem \\ref{mmdthm} shows that when the alternative $H_1(\\Delta_n,0)$ is considered, the detection boundary of $T_{\\mathrm{MMD}}$\\ is of the order $n^{-1\/2}$.\nIt is of interest to compare the detection rate achieved by $T_{\\text{MMD}}$ with that in a parametric setting where consistent tests are available if $n\\Delta_n\\rightarrow \\infty$ \\citep{lehmann2008testing}. It is natural to raise the question to what extent such a gap can be entirely attributed to the fundamental difference between parametric and nonparametric testing problems. We shall now argue that this gap actually is largely due to the sup-optimality of $T_{\\mathrm{MMD}}$, and the detection boundary of $T_{\\mathrm{MMD}}$\\ could be significantly improved through a slight modification of the MMD.\n\n\\section{Optimal tests based on moderated MMD}\n\\label{sec:m3d}\n\n\\subsection{Moderated MMD test statistic}\nThe basic idea behind MMD is to project two probability measures onto a unit ball in $\\mathcal H(K)$ and use the distance between the two projections to measure the distance between the original probability measures. If the two probability measures are far away from $\\mathcal H(K)$, the distance between the two projections may not honestly reflect the distance between them. More specifically, $\\gamma^2(P,P_0)=\\sum\\limits_{k\\geq 1}\\lambda_k[{\\mathbb E} _{P}\\varphi_k(X)]^2$, while the $\\chi^2$ distance between $P$ and $P_0$ is $\\chi^2(P,P_0)=\\sum\\limits_{k\\geq 1}[{\\mathbb E} _{P}\\varphi_k(X)]^2$. Considering that $\\lambda_k$ decreases with $k$, $\\gamma^2(P,P_0)$ can be much smaller than $\\chi^2(P,P_0)$. To overcome this problem, we consider a moderated version of the MMD which allows us to project the probability measures onto a larger ball in $\\mathcal H(K)$. The new class of integral probability metric between two distributions $P$ and $Q$ is given as\n\\begin{equation}\n\\label{def2}\n\\eta_{K,\\varrho}(P,Q;P_0)=\\sup_{f\\in \\mathcal H(K): \\|f\\|_{L_2(P_0)}^2+\\varrho^2\\|f\\|_K^2\\le 1} \\int_\\mathcal X fd(P-Q)\n\\end{equation}\nfor a given distribution $P_0$ and a constant $\\varrho>0$. It should be noted that a related test statistics was proposed previously by \\cite{harchaoui2009kernel} from a completely different viewpoint\n\nIt is worth noting that $\\eta_{K,\\varrho}(P,Q;P_0)$ can also be identified with a particular type of RKHS embedding. Specifically, $\\eta_{K,\\varrho}(P,Q;P_0)=\\gamma_{\\tilde{K}_{\\varrho}}(P,Q)$, where\n\\begin{align*}\n\\tilde{K}_{\\varrho}(x,x'):=\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho^2}\\varphi_k(x)\\varphi_k(x')\n\\end{align*}\nWe shall abbreviate the dependence of $\\eta$ on $K$ and $P_0$ unless necessary. The unit ball in (\\ref{def2}) is defined in terms of both RKHS norm and $L^2$ norm. Recall that $u=dP\/dP_0-1$ so that\n\\begin{align*}\n\\sup\\limits_{\\|f\\|_{L_2(P_0)}\\leq 1}\\int\\limits_{\\mathcal{X}}f{d}(P-P_0)=\\sup\\limits_{\\|f\\|_{L_2(P_0)}\\leq 1}\\int\\limits_{\\mathcal{X}}fu{d}P_0=\\|u\\|_{L_2(P_0)}=\\chi(P,P_0).\n\\end{align*}\nWe can therefore expect that a smaller $\\varrho$ will make $\\eta^2_{\\varrho}(P,P_0)$ closer to $\\chi^2(P,P_0)$, since the unit ball to be considered will become more similar to the unit ball in $L_2(P_0)$. This can also be verified by noticing that $\\eta^2_{\\varrho}(P,P_0)$ could be expressed as\n\\begin{align*}\n\\eta^2_{\\varrho}(P,P_0)=\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho^2}[{\\mathbb E}_P\\varphi_k(X)]^2\n\\end{align*}\nTherefore, we choose $\\varrho$ converging to $0$ when constructing our test statistic.\n\nHereafter we shall attach the subscript $n$ to $\\varrho$ to signify its dependence on $n$. We now argue that letting $\\varrho_n$ converge to $0$ at an appropriate rate indeed results in a test more powerful than $T_{\\mathrm{MMD}}$. The test statistic we propose is the empirical version of $\\eta^2_{\\varrho_n}(P,P_0)$,\n\\begin{align}\n\\eta^2_{\\varrho_n}(\\widehat{P}_n,P_0)=\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\left[\\frac{1}{n}\\sum\\limits_{i=1}^{n}\\varphi_k(X_i)\\right]^2.\\label{eq:etatest}\n\\end{align}\n\n\\subsection{Operating characteristics of $\\eta^2_{\\varrho_n}(\\widehat{P}_n,P_0)$ based tests}\nAlthough the expression for $\\eta^2_{\\varrho_n}(\\widehat{P}_n,P_0)$ given by \\eqref{eq:etatest} looks similar to that of $\\gamma^2(\\widehat{P}_n,P_0)$, their asymptotic behaviors are quite different. At a technical level, this is due to the fact that the eigenvalues of the underlying kernel\n$$\\tilde{\\lambda}_{nk}:=\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}$$ \ndepend on $n$ and may not be uniformly summable over $n$. As presented in the following theorem, a certain type of asymptotic normality, instead of a sum of chi-squares as in the case of $\\gamma^2(\\widehat{P}_n, P_0)$, holds for $\\eta^2_{\\varrho_n}(\\widehat{P}_n,P_0)$ under $P_0$, which helps determine the rejection region of the $\\eta^2_{\\varrho_n}$ based test.\n\n\\begin{theorem}\\label{asympm3d}\nAssume that $\\varrho_n\\to 0$ as $n\\to \\infty$ in such a fashion that $n\\varrho_n^{{1}\/(2s)}\\rightarrow\\infty$. Then under $H_0$ where $X_1,\\ldots, X_n\\stackrel{i.i.d.}{\\sim}P_0$, \n\\begin{align*}\nv_n^{-1\/2}[n\\eta_{\\varrho_n}^2(\\widehat{P}_n,P_0)-A_n]\\stackrel{d}{\\rightarrow}N(0,2),\n\\end{align*}\nwhere\n$$v_n=\\sum\\limits_{k\\geq 1}\\left(\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\right)^2,\\qquad {\\rm and} \\qquad\nA_n=\\frac{1}{n}\\sum\\limits_{i=1}^n\\tilde{K}_{\\varrho_n}(X_i,X_i).$$\n\\end{theorem}\n\nIn the light of Theorem \\ref{asympm3d}, a test that rejects $H_0$ if and only if\n$$2^{-1\/2}v_n^{-1\/2}[n{\\eta}_{\\varrho_n}^2(\\widehat{P}_n,P_0)-A_n]$$\nexceeds $z_{1-\\alpha}$ is an asymptotic $\\alpha$-level test, where $z_{1-\\alpha}$ stands for the $1-\\alpha$ quantile of a standard normal distribution. We refer to this test as $T_{\\mathrm{M}^3\\mathrm{d}}$. The performance of $T_{\\mathrm{M}^3\\mathrm{d}}$\\ under the alternative hypothesis is characterized by the following theorem, showing that its detection boundary is much improved when compared with that of $T_{\\mathrm{MMD}}$.\n\n\\begin{theorem}\\label{crm3d}\nConsider testing $H_0$ against $H_1(\\Delta_n,\\theta)$ by $T_{\\mathrm{M}^3\\mathrm{d}}$\\ with $\\varrho_n=cn^{-{2s(\\theta+1)\\over 4 s+\\theta+1}}$ for an arbitrary constant $c>0$. If $n^{\\frac{4s}{4s+\\theta+1}}\\Delta_n\\rightarrow\\infty$, the\n$$\n\\beta(T_{\\mathrm{M}^3\\mathrm{d}};\\Delta_n, \\theta)\\to 0, \\qquad {\\rm as\\ }n\\to \\infty.\n$$\n\\end{theorem}\n\nTheorem \\ref{crm3d} indicates that the detection boundary for $T_{\\mathrm{M}^3\\mathrm{d}}$\\ is $n^{-{4s}\/({4s+\\theta+1})}$. In particular, when testing $H_0$ against $H_1(\\Delta_n, 0)$, \\textit{i.e.}, $\\theta=0$, it becomes $n^{-4s\/(4s+1)}$. This is to be contrasted with the detection boundary for $T_{\\mathrm{MMD}}$, which, as suggested by Theorem \\ref{mmdthm}, is of the order $n^{-1\/2}$. It is also worth noting that the detection boundary for $T_{\\mathrm{M}^3\\mathrm{d}}$\\ deteriorates as $\\theta$ increases, implying that it is harder to test against a larger interpolation space.\n\n\\subsection{Minimax optimality}\n\nIt is of interest to investigate if the detection boundary of $T_{\\mathrm{M}^3\\mathrm{d}}$\\ can be further improved. We now show that the answer is negative in a certain sense. More specifically, we shall follow the minimax framework for nonparametric hypothesis testing pioneered by Ingster \\citep[see, \\textit{e.g.},][]{ingster1993asymptotically, ingster1995minimax} and show that $T_{\\mathrm{M}^3\\mathrm{d}}$\\ attains the optimal rate of detection for testing $H_0$ against $H_1(\\Delta_n,\\theta)$ in that no consistent test exists if there exists $c>0$ such that $\\Delta_n\\le cn^{-\\frac{4s}{4s+\\theta+1}}$.\n\n\\begin{theorem}\\label{cr}\nConsider testing $H_0: P=P_0$ against $H_1(\\Delta_n,\\theta)$, for some $\\theta<2s-1$. If $\\varlimsup\\limits_{n\\rightarrow \\infty}\\Delta_nn^{4s\\over 4s+\\theta+1}<\\infty$, then\n$$\n\\varliminf\\limits_{n\\rightarrow \\infty}\\inf_{{T}\\in\\mathcal{T}_n} \\left[{\\mathbb E}_{P_0} {T} +\\beta({T};\\Delta_n,\\theta)\\right]>0,\n$$\nwhere $\\mathcal{T}_n$ denotes the collection of all test functions based on $X_1,\\ldots,X_n$.\n\\end{theorem}\n\nRecall that for a test ${T}$, ${\\mathbb E}_{P_0} {T}$ is its Type I error. Theorem \\ref{cr} shows that, if $\\Delta_n=O\\left(n^{-4s\/(4s+\\theta+1)}\\right)$, then the sum of Type I and Type II errors of any test does not vanish as $n$ increases. In other words, there is no consistent test if $\\Delta_n=O\\left(n^{-4s\/(4s+\\theta+1)}\\right)$. Together with Theorem \\ref{crm3d}, this suggests that $T_{\\mathrm{M}^3\\mathrm{d}}$\\ is rate optimal in the minimax sense.\n\n\\section{Adaptation}\n\\label{sec:adapt}\nDespite the minimax optimality of $T_{\\mathrm{M}^3\\mathrm{d}}$, a practical challenge in using it is the choice of an appropriate tuning parameter $\\varrho_n$. In particular, Theorem \\ref{crm3d} suggests that $\\varrho_n$ needs to be taken at the order of $n^{-2s(\\theta+1)\/(4s+\\theta +1)}$ which depends on the value of $s$ and $\\theta$. On the one hand, since $P_0$ and $K$ are known apriori, so is $s$. On the other hand, $\\theta$ reflects the property of $dP\/dP_0$ which is typically not known in advance. This naturally brings about the issue of adaptation \\citep[see, \\textit{e.g.},][]{spokoiny1996adaptive,ingster2000adaptive}. In other words, we are interested in a single testing procedure that can achieve the detection boundary for testing $H_0$ against $H_1(\\Delta_n(\\theta), \\theta)$ simultaneously over all $\\theta\\ge 0$. We emphasize the dependence of $\\Delta_n$ on $\\theta$ since the detection boundary may depend on $\\theta$, as suggested by the results from the previous section. In fact, we should build upon the test statistic introduced before.\n\nMore specifically, write\n$$\n\\rho_\\ast=\\left(\\frac{\\sqrt{\\log \\log n}}{n}\\right)^{2s},\n$$\nand\n$$\nm_\\ast=\\left\\lceil\\log_2 \\left[\\rho_\\ast^{-1}\\left(\\frac{\\sqrt{\\log\\log n}}{n}\\right)^{\\frac{2s}{4s+1}}\\right]\\right\\rceil.\n$$\nThen our test statistics is taken to be the maximum of $T_{n,\\varrho_n}$ for $\\rho_n=\\rho_\\ast, 2\\rho_\\ast, 2^2\\rho_\\ast,\\ldots, 2^{m_\\ast}\\rho_\\ast$:\n\\begin{align*}\n\\tilde{T}_n:= \\sup\\limits_{0\\le k\\le m_\\ast}T_{n,2^k\\varrho_\\ast},\n\\end{align*}\nwhere, with slight abuse of notation,\n$$T_{n,\\varrho_n}=(2v_n)^{-1\/2}[n\\eta_{\\varrho_n}^2(\\widehat{P}_n,P_0)-A_n].$$ \nIt turns out if an appropriate rejection threshold is chosen, $\\tilde{T}_n$ can achieve a detection boundary very similar to the one we have before, but now simultaneously over all $\\theta>0$.\n\n\\begin{theorem}\\label{crtm3d}\n\t\\rm(\\romannumeral1) \\it Under $H_0$,\n\t\\begin{align*}\n\t\\lim\\limits_{n\\rightarrow \\infty}P\\left(\\tilde{T}_n\\geq \\sqrt{3\\log\\log n}\\right)=0;\n\t\\end{align*}\n\t\\rm(\\romannumeral2) \\it on the other hand, there exists a constant $c_1>0$ such that\n\t\\begin{align*}\n\t\\lim\\limits_{n\\rightarrow \\infty}\\inf\\limits_{P\\in\\cup_{\\theta\\ge 0}\\mathcal P(\\Delta_{n}(\\theta))}P\\left(\\tilde{T}_n\\geq \\sqrt{3\\log\\log n}\\right)=1,\n\t\\end{align*}\n\tprovided that $\\Delta_n(\\theta)\\geq c_1(n^{-1}{\\sqrt{\\log\\log n}})^{\\frac{4s}{4s+\\theta+1}}$.\n\\end{theorem}\n\nTheorem \\ref{crtm3d} immediately suggests that a test rejects $H_0$ if and only if $\\tilde{T}_n\\geq \\sqrt{3\\log\\log n}$ is consistent for testing it against $H_1(\\Delta_n(\\theta),\\theta)$ for all $\\theta\\ge 0$ provided that $\\Delta_n(\\theta)\\geq c_1(n^{-1}{\\sqrt{\\log\\log n}})^{\\frac{4s}{4s+\\theta+1}}$. We can further calibrate the rejection region to yield a test at a given significance level. More precisely, let $\\tilde{q}_\\alpha$ be the upper $\\alpha$ quantile of $\\tilde{T}_n$, we can proceed to reject $H_0$ whenever the observed test statistic exceeds $\\tilde{q}_\\alpha$. Denote such a test by $\\tilde{T}_{\\mathrm{M}^3\\mathrm{d}}$. By definition, $\\tilde{T}_{\\mathrm{M}^3\\mathrm{d}}$\\ is an $\\alpha$-level test. Theorem \\ref{crtm3d} implies that the type II error of $\\tilde{T}_{\\mathrm{M}^3\\mathrm{d}}$\\ vanishes as $n\\to\\infty$ uniformly over all $\\theta\\ge 0$. In practice, the quantile $\\tilde{q}_\\alpha$ can be evaluated by Monte Carlo methods as we shall discuss in further details in the next section. We note that the detection boundary given in Theorem \\ref{crtm3d} is similar, but inferior by a factor of $(\\log\\log n)^{\\frac{2s}{4s+\\theta+1}}$, to that from Theorem \\ref{cr}. This turns out be the price one needs to pay for adaptation.\n\n\n\n\n\n\n\n \n\\begin{theorem}\\label{cra}\nLet $0<\\theta_1<\\theta_2<2s-1$. Then there exists a positive constant $c_2$ such that\n\\begin{align*}\n\\varlimsup\\limits_{n\\rightarrow \\infty}\\sup\\limits_{\\theta\\in[\\theta_1,\\theta_2]}\\left\\{\\Delta_n(\\theta)\\left(\\frac{n}{\\sqrt{\\log\\log n}}\\right)^{\\frac{4s}{4s+\\theta+1}}\\right\\}\\leq c_2\n\\end{align*}\nimplies that\n\\begin{align*}\n\\lim\\limits_{n\\rightarrow \\infty}\\inf\\limits_{{T}\\in \\mathcal{T}_n}\\left[{\\mathbb E}_{P_0} {T}+\\sup_{\\theta\\in [\\theta_1,\\theta_2]}\\beta({T};\\Delta_n(\\theta), \\theta)\\right]=1.\n\\end{align*}\n\\end{theorem}\n\nSimilar to Theorem \\ref{cr}, Theorem \\ref{cra} shows that there is no consistent test for $H_0$ against $H_1(\\Delta_n,\\theta)$ simultaneously over all $\\theta\\in [\\theta_1,\\theta_2]$, if $\\Delta_n(\\theta)\\leq c_2\\left(n^{-1}\\sqrt{\\log\\log n}\\right)^{\\frac{4s}{4s+\\theta+1}}$ $\\forall\\ \\theta\\in[\\theta_1,\\theta_2]$ for a sufficiently small $c_2$. Together with Theorem \\ref{crtm3d}, this suggests that the test $\\tilde{T}_{\\mathrm{M}^3\\mathrm{d}}$\\ is indeed rate optimal.\n\n\n\n\\section{Numerical Experiments}\n\\label{sec:num}\n\nTo complement the earlier theoretical development, we also performed several sets of simulation experiments to demonstrate the merits of the proposed adaptive test based on $\\tilde{T}_n$. To do so, we need to first address a practical issue of computing the test statistic $\\tilde{T}_n$: how to compute ${\\eta}_{\\varrho_n}^2(\\widehat{P}_n, P_0)$ for a given $\\varrho_n$.\n\n\\subsection{Computing $\\tilde{T}_n$}\\label{sec:compute}\nThough the form of ${\\eta}_{\\varrho_n}^2(\\widehat{P}_n, P_0)$ looks similar to that of ${\\gamma}^2(\\widehat{P}_n, P_0)$, from the point of view of computing it numerically, there is a subtle issue. The kernel $\\tilde{K}_{\\varrho_n}(x,x')$ is defined only in its Mercer decomposed form, which is based on the Mercer decomposition of $K(x,x')$. Hence, in order to compute the kernel $\\tilde{K}_{\\varrho_n}(x,x')$, we need to first choose a kernel $K(x,x')$ and compute its Mercer decomposition numerically. Specifically, we use \\emph{chebfun} framework in Matlab (with slight modifications) to compute Mercer decompositions associated with kernels based on their integral operator representations ~\\cite{Driscoll2014, Battles2004}. Once we compute $\\lambda_k$ and the associated $\\varphi_k(\\cdot)$, we approximately compute $\\tilde{K}_{\\varrho_n}(x,x')$ based on the top $K$ eigvevalues and eigenfunctions. This provides a numerical framework for computing $\\tilde{K}_{\\varrho_n}(x,x')$ once we fix a kernel $K(x,x')$. In the cases when the eigenvalues and eigenfunction are known, for example when using polynomial kernels, from our experiments we found that using the top few numerical eigenvalues gives a good approximation to the actual value of the kernel. Given a way to compute kernel evaluations, computing ${\\eta}_{\\varrho_n}^2(\\widehat{P}_n, P_0)$ follows similarly.\n\n\n\\subsection{ Power comparison}\n\nOnce we are able to compute $\\tilde{T}_n$, we can assess its null distribution by simulating it under the null hypothesis $H_0$. In particular, we repeated for each case 200 runs and estimated the $95\\%$ quantile of $\\tilde{T}_n$ under $H_0$ by the corresponding sample quantile. We then proceeded to reject $H_0$ when an observed test statistic exceeds the estimate $95\\%$ quantile. By construction, the procedure gives a $5\\%$-level test, up to Monte Carlo error.\n\n\\paragraph{Euclidean data:} We first consider using both the test $T_{\\mathrm{MMD}}$\\ and $\\tilde{T}_{\\mathrm{M}^3\\mathrm{d}}$\\ to test the hypothesis $P_0$ is uniform on $[0,1]^d$ given a sample of observations $\\{ X_1, \\ldots, X_n\\}$. The dimensionality used are $100$ and $200$. We followed the examples for densities put forward in~\\cite{marron1992exact} in the context of nonparametric density estimation, for the alternatives. Specifically we set the alternative hypothesis to be (1) mixture of five Gaussians, (2) skewed unimodal, (3) asymmetric claw density and (4) smooth comb density. The value of $\\alpha$ is set to $0.05$. The sample size $n$ is varied from $200$ to $1000$ (in steps of 200) and for each value of sample size 100 simulations are conducted to estimate the probability of rejecting a false null hypothesis. \n\nWe use a Gaussian kernel $K$ to compute the ${\\gamma}^2(\\widehat{P}_n, P_0)$ and use the procedure outlined in section~\\ref{sec:compute} to compute ${\\eta}_{\\varrho_n}^2(\\widehat{P}_n, P_0)$. The issue of choosing the kernel is subtle when using $T_{\\mathrm{MMD}}$. For simplicity, we fixed the value of bandwidth of Gaussian kernel (which corresponds to choosing the kernel in this case) to a fixed value, that corresponds to the best performance of $T_{\\mathrm{MMD}}$. With the fixed value of the bandwidth, to fix $\\varrho$, we tried values over a grid and set it to the value that performed best. Figure~\\ref{fig:simT2} illustrates a plot of the estimated probability of accepting the null hypothesis when it is false for different values of sample size $n$ for the proposed test $\\tilde{T}_{\\mathrm{M}^3\\mathrm{d}}$\\ along with $T_{\\mathrm{MMD}}$\\ and the more classical Kolmogorov-Smirnov (K-S, for short) goodness-of-fit test. We note from Figure~\\ref{fig:simT2} that the estimated error probability converges to zero at a faster rate for the adaptive M$^3$D test compared to the MMD test and the Kolmogorov-Smirnov test on all the different simulation settings that are considered. Note that it has been previously observed that MMD test performs better than K-S test in various setting in \\cite{gretton2012kernel}, which we observe in our setting as well.\n\n\\begin{figure*}[!htbp]\n\\centering\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.94 )+- (0.0, 0.04)\n( 400, 0.40 )+- (0.0, 0.03)\n( 600, 0.31 )+- (0.0, 0.00)\n( 800, 0.15 )+- (0.0, 0.00)\n( 1000, 0.05 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.03)\n( 400, 0.45 )+- (0.0, 0.03)\n( 600, 0.38 )+- (0.0, 0.03)\n( 800, 0.22 )+- (0.0, 0.03)\n( 1000, 0.08 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.98 )+- (0.0, 0.03)\n( 400, 0.52 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.28 )+- (0.0, 0.03)\n( 1000, 0.12 )+- (0.0, 0.03)\n}; \\addlegendentry{$KS$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.94 )+- (0.0, 0.04)\n( 400, 0.40 )+- (0.0, 0.03)\n( 600, 0.30 )+- (0.0, 0.00)\n( 800, 0.20 )+- (0.0, 0.00)\n( 1000, 0.06 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.03)\n( 400, 0.44 )+- (0.0, 0.03)\n( 600, 0.35 )+- (0.0, 0.03)\n( 800, 0.23 )+- (0.0, 0.03)\n( 1000, 0.09 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.03)\n( 400, 0.53 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.30 )+- (0.0, 0.00)\n( 1000, 0.13 )+- (0.0, 0.00)\n}; \\addlegendentry{$KS$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\hfill \\vspace{-0.1in}\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.04)\n( 400, 0.30 )+- (0.0, 0.03)\n( 600, 0.14 )+- (0.0, 0.00)\n( 800, 0.105 )+- (0.0, 0.00)\n( 1000, 0.06 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.03)\n( 400, 0.46 )+- (0.0, 0.03)\n( 600, 0.35 )+- (0.0, 0.03)\n( 800, 0.19 )+- (0.0, 0.00)\n( 1000, 0.10 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.03)\n( 400, 0.59 )+- (0.0, 0.03)\n( 600, 0.48 )+- (0.0, 0.03)\n( 800, 0.23 )+- (0.0, 0.00)\n( 1000, 0.11 )+- (0.0, 0.00)\n}; \\addlegendentry{$KS$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.04)\n( 400, 0.32 )+- (0.0, 0.03)\n( 600, 0.19 )+- (0.0, 0.00)\n( 800, 0.11 )+- (0.0, 0.00)\n( 1000, 0.05 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.03)\n( 400, 0.46)+- (0.0, 0.03)\n( 600, 0.26 )+- (0.0, 0.03)\n( 800, 0.20 )+- (0.0, 0.03)\n( 1000, 0.09 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.03)\n( 400, 0.59 )+- (0.0, 0.03)\n( 600, 0.41 )+- (0.0, 0.03)\n( 800, 0.30 )+- (0.0, 0.00)\n( 1000, 0.11 )+- (0.0, 0.00)\n}; \\addlegendentry{$KS$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\vspace{-0.1in}\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.04)\n( 400, 0.35 )+- (0.0, 0.03)\n( 600, 0.20 )+- (0.0, 0.00)\n( 800, 0.15 )+- (0.0, 0.00)\n( 1000, 0.05 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.03)\n( 400, 0.52 )+- (0.0, 0.03)\n( 600, 0.41 )+- (0.0, 0.03)\n( 800, 0.25 )+- (0.0, 0.03)\n( 1000, 0.10 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.97 )+- (0.0, 0.03)\n( 400, 0.63 )+- (0.0, 0.03)\n( 600, 0.51 )+- (0.0, 0.03)\n( 800, 0.35 )+- (0.0, 0.00)\n( 1000, 0.10 )+- (0.0, 0.00)\n}; \\addlegendentry{$KS$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.04)\n( 400, 0.48 )+- (0.0, 0.03)\n( 600, 0.30 )+- (0.0, 0.00)\n( 800, 0.15 )+- (0.0, 0.00)\n( 1000, 0.06 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.97 )+- (0.0, 0.03)\n( 400, 0.66 )+- (0.0, 0.03)\n( 600, 0.45 )+- (0.0, 0.03)\n( 800, 0.26 )+- (0.0, 0.03)\n( 1000, 0.09 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.97 )+- (0.0, 0.03)\n( 400, 0.69 )+- (0.0, 0.03)\n( 600, 0.51 )+- (0.0, 0.03)\n( 800, 0.31 )+- (0.0, 0.00)\n( 1000, 0.104 )+- (0.0, 0.00)\n}; \\addlegendentry{$KS$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\vspace{-0.1in}\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.04)\n( 400, 0.41 )+- (0.0, 0.03)\n( 600, 0.25 )+- (0.0, 0.00)\n( 800, 0.16 )+- (0.0, 0.00)\n( 1000, 0.04 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.97 )+- (0.0, 0.03)\n( 400, 0.54 )+- (0.0, 0.03)\n( 600, 0.40 )+- (0.0, 0.03)\n( 800, 0.22 )+- (0.0, 0.03)\n( 1000, 0.06 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.97 )+- (0.0, 0.03)\n( 400, 0.60 )+- (0.0, 0.03)\n( 600, 0.45 )+- (0.0, 0.04)\n( 800, 0.33 )+- (0.0, 0.00)\n( 1000, 0.10 )+- (0.0, 0.00)\n}; \\addlegendentry{$KS$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.04)\n( 400, 0.41 )+- (0.0, 0.03)\n( 600, 0.25 )+- (0.0, 0.00)\n( 800, 0.16 )+- (0.0, 0.00)\n( 1000, 0.04 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.97 )+- (0.0, 0.03)\n( 400, 0.54 )+- (0.0, 0.03)\n( 600, 0.40 )+- (0.0, 0.03)\n( 800, 0.22 )+- (0.0, 0.03)\n( 1000, 0.06 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.97 )+- (0.0, 0.03)\n( 400, 0.60 )+- (0.0, 0.03)\n( 600, 0.45 )+- (0.0, 0.03)\n( 800, 0.33 )+- (0.0, 0.00)\n( 1000, 0.10 )+- (0.0, 0.00)\n}; \\addlegendentry{$KS$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\hfill\\vspace{-0.1in}\n\\caption{Error versus Sample Size: mixture of Gaussian (row 1), skewed unimodal (row 2), asymmetric claw (row 3) and smooth comb (row 4) with dimensionality 100 (left) and 200 (right).}\n\\label{fig:simT2}\n\\end{figure*}\n\n\n\\paragraph{Directional data:} One of the advantages of the proposed RKHS embedding based approach is that it could be used on domains other than the $d$-dimensional Euclidean space. For example when $\\mathcal{X} = \\mathbb{S}^{d-1}$ where $\\mathbb{S}^{d-1}$ corresponds to the $d$-dimensional unit sphere, one can perform hypothesis testing using the above framework, as long as we can compute the Mercer decomposition of a kernel $K$ defined on the domain. In several applications, like protein folding, often times data are modeled as coming from the unit-sphere and testing goodness-of-fit for such data needs specialized methods different from the standard nonparametric testing methods~\\cite{mardia2009directional,jupp2005sobolev}. \n\nIn order to highlight the advantage of the proposed approach, we assume $P_0$ is uniform distribution on the unit sphere of dimension $100$ and test it against the alternative that data are from: \n\\begin{enumerate}\n\\item[(1)] multivariate von Mises-Fisher distribution (which is the Gaussian analogue on the unit-sphere) given by $f_{vM\\mhyphen F}(x, \\mu, \\kappa) = C_{vM\\mhyphen F}(\\kappa) \\exp(\\kappa \\mu^\\top x)$ for data $x \\in \\mathbb{S}^{d-1}$, where $\\kappa \\geq 0$ is concentration parameter and $\\mu$ is the mean parameter. The term $C_{vM\\mhyphen F}$ is the normalization constant given by $\\frac{\\kappa^{d\/2-1}}{2\\pi^{d\/2}I_{d\/2-1}(\\kappa)}$ where $I$ is modified Bessel function;\n\n\\item[(2)] multivariate Watson distribution (used to model axially symmetric data on sphere) given by $f_{W}(x, \\mu, \\kappa) = C_W(\\kappa) \\exp(\\kappa (\\mu^\\top x)^2)$ for data $x \\in \\mathbb{S}^{d-1}$, where $\\kappa \\geq 0$ is concentration parameter and $\\mu$ is the mean parameter as before. The term $C_W(\\kappa)$ is the normalization constant given by $\\frac{\\Gamma(d\/2)}{2\\pi^{p\/2} M(1\/2,d\/2,\\kappa)}$ where $M$ is Kummer's confluent hypergeometric function;\n\n\\item[(3)] mixture of five von Mises-Fisher distribution which are used in modeling and clustering spherical data~\\cite{banerjee2005clustering};\n\\item[(4)] mixture of five Watson distribution which are used in modeling and clustering spherical data~\\cite{sra2013multivariate}.\n\\end{enumerate}\n\nNote that in this setup one can analytically compute the Mercer decomposition of the Gaussian kernel on the unit sphere with respect to the uniform distribution. Specifically, the eigenvalues are given by Theorem 2 in~\\cite{minh2006mercer} and the eigenfunctions are the standard spherical harmonics of order $k$ (see section 2.1 in ~\\cite{minh2006mercer} for details). Rest of the simulation setup is similar to the previous setting (of Euclidean data) and we compared $\\tilde{T}_{\\mathrm{M}^3\\mathrm{d}}$\\ against $T_{\\mathrm{MMD}}$\\ and the Sobolev test approach (denoted as ST hereafter) proposed in~\\cite{jupp2005sobolev}. Figure~\\ref{fig:simT3} illustrates a plot of estimated probability of accepting null hypothesis when it is false for different values of sample size, from which we see the adaptive M$^3$D test performs better. \n\n\\begin{figure*}[!htbp]\n\\centering\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.04)\n( 400, 0.46 )+- (0.0, 0.03)\n( 600, 0.28 )+- (0.0, 0.00)\n( 800, 0.18 )+- (0.0, 0.00)\n( 1000, 0.08 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.93 )+- (0.0, 0.03)\n( 400, 0.59 )+- (0.0, 0.03)\n( 600, 0.38 )+- (0.0, 0.03)\n( 800, 0.28 )+- (0.0, 0.03)\n( 1000, 0.10 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.98 )+- (0.0, 0.03)\n( 400, 0.52 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.28 )+- (0.0, 0.03)\n( 1000, 0.12 )+- (0.0, 0.03)\n}; \\addlegendentry{$ST$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.92 )+- (0.0, 0.04)\n( 400, 0.50 )+- (0.0, 0.03)\n( 600, 0.34 )+- (0.0, 0.00)\n( 800, 0.24 )+- (0.0, 0.00)\n( 1000, 0.07 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.03)\n( 400, 0.61 )+- (0.0, 0.03)\n( 600, 0.40 )+- (0.0, 0.03)\n( 800, 0.28 )+- (0.0, 0.03)\n( 1000, 0.07 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.03)\n( 400, 0.53 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.30 )+- (0.0, 0.00)\n( 1000, 0.13 )+- (0.0, 0.00)\n}; \\addlegendentry{$ST$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\hfill \\vspace{-0.1in}\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.04)\n( 400, 0.48 )+- (0.0, 0.03)\n( 600, 0.32 )+- (0.0, 0.00)\n( 800, 0.19 )+- (0.0, 0.00)\n( 1000, 0.08 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.97 )+- (0.0, 0.03)\n( 400, 0.60 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.32 )+- (0.0, 0.03)\n( 1000, 0.11 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.98 )+- (0.0, 0.03)\n( 400, 0.52 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.28 )+- (0.0, 0.03)\n( 1000, 0.12 )+- (0.0, 0.03)\n}; \\addlegendentry{$ST$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.94 )+- (0.0, 0.04)\n( 400, 0.45 )+- (0.0, 0.03)\n( 600, 0.30 )+- (0.0, 0.00)\n( 800, 0.18 )+- (0.0, 0.00)\n( 1000, 0.07 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.03)\n( 400, 0.54 )+- (0.0, 0.03)\n( 600, 0.41 )+- (0.0, 0.03)\n( 800, 0.28 )+- (0.0, 0.03)\n( 1000, 0.11 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.03)\n( 400, 0.53 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.30 )+- (0.0, 0.00)\n( 1000, 0.13 )+- (0.0, 0.00)\n}; \\addlegendentry{$ST$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\vspace{-0.1in}\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.94 )+- (0.0, 0.04)\n( 400, 0.40 )+- (0.0, 0.03)\n( 600, 0.20 )+- (0.0, 0.00)\n( 800, 0.11 )+- (0.0, 0.00)\n( 1000, 0.05 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.03)\n( 400, 0.56 )+- (0.0, 0.03)\n( 600, 0.34 )+- (0.0, 0.03)\n( 800, 0.23 )+- (0.0, 0.03)\n( 1000, 0.09 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.98 )+- (0.0, 0.03)\n( 400, 0.52 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.28 )+- (0.0, 0.03)\n( 1000, 0.12 )+- (0.0, 0.03)\n}; \\addlegendentry{$ST$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.94 )+- (0.0, 0.04)\n( 400, 0.43 )+- (0.0, 0.03)\n( 600, 0.29 )+- (0.0, 0.00)\n( 800, 0.12 )+- (0.0, 0.00)\n( 1000, 0.07 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.03)\n( 400, 0.63 )+- (0.0, 0.03)\n( 600, 0.38 )+- (0.0, 0.03)\n( 800, 0.25 )+- (0.0, 0.03)\n( 1000, 0.09 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.03)\n( 400, 0.53 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.30 )+- (0.0, 0.00)\n( 1000, 0.13 )+- (0.0, 0.00)\n}; \\addlegendentry{$ST$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\vspace{-0.1in}\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.04)\n( 400, 0.48 )+- (0.0, 0.03)\n( 600, 0.26 )+- (0.0, 0.00)\n( 800, 0.15 )+- (0.0, 0.00)\n( 1000, 0.06 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.93 )+- (0.0, 0.03)\n( 400, 0.59 )+- (0.0, 0.03)\n( 600, 0.42 )+- (0.0, 0.03)\n( 800, 0.31 )+- (0.0, 0.03)\n( 1000, 0.09 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.98 )+- (0.0, 0.03)\n( 400, 0.52 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.28 )+- (0.0, 0.03)\n( 1000, 0.12 )+- (0.0, 0.03)\n}; \\addlegendentry{$ST$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\begin{minipage}{0.5\\textwidth}\n\\centering\n\\begin{tikzpicture}[scale=0.70]\n \\begin{axis}[\n xlabel = $\\text{Sample size (n)}$,\nylabel=$P(~\\text{accepting}~H_0~\\text{when false}~)$,\nxmax = 1000,\nxmin = 200,\nymax = 1,\nymin = 0\n]\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.94 )+- (0.0, 0.04)\n( 400, 0.42 )+- (0.0, 0.03)\n( 600, 0.21 )+- (0.0, 0.00)\n( 800, 0.12 )+- (0.0, 0.00)\n( 1000, 0.06 )+- (0.0, 0.00)\n}; \\addlegendentry{$M^3D$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.95 )+- (0.0, 0.03)\n( 400, 0.56 )+- (0.0, 0.03)\n( 600, 0.35 )+- (0.0, 0.03)\n( 800, 0.18 )+- (0.0, 0.03)\n( 1000, 0.08 )+- (0.0, 0.00)\n}; \\addlegendentry{$MMD$} ;\n\\addplot+[error bars\/.cd,\ny dir=both,y explicit]\n coordinates {\n( 200, 0.96 )+- (0.0, 0.03)\n( 400, 0.53 )+- (0.0, 0.03)\n( 600, 0.44 )+- (0.0, 0.03)\n( 800, 0.30 )+- (0.0, 0.00)\n( 1000, 0.13 )+- (0.0, 0.00)\n}; \\addlegendentry{$ST$} ;\n\\end{axis}\n\\end{tikzpicture}\n\\end{minipage\n\\hfill\\vspace{-0.1in}\n\\caption{Error versus Sample Size: von Mises-Fisher distribution (row 1), Watson distribution (row 2), Mixture of von Mises-Fisher distribution (row 3) and mixture of Watson distribution (row 4) on sphere for 100 dimensions (left) and 150 dimensions (right).}\n\\label{fig:simT3}\n\\end{figure*}\n\n\n\n\\subsection{Real data experiments}\nIn addition to the simulation examples, we also performed experiments on several real-world data examples. Similar to before, in the case of Euclidean data, we compared $\\tilde{T}_{\\mathrm{M}^3\\mathrm{d}}$\\ against the standard MMD and Kolmogorov-Smirnov test, and in the case of spherical data, we used the Sobolev test~\\cite{jupp2005sobolev}, instead of the Kolmogorov-Smirnov test.\n\nFor the case of Euclidean data, we used the MINST digits data set from the following webpage: \\hyperref[http:\/\/yann.lecun.com\/exdb\/mnist\/]{http:\/\/yann.lecun.com\/exdb\/mnist\/}. Model-based clustering~ \\cite{fraley2002model} is a widely-used and practical successful clustering technique in the literature. Furthermore, the MNIST data set is a standard data set for testing clustering algorithms and consists of image of digits. Several works have implicitly assumed that the data come from a mixture of Gaussian distributions, because of the observed superior empirical performance under such an assumption. But the validity of such a mixture model assumption is invariably not tested statistically. In this experiment we selected three digits (which correspond to a cluster) randomly and conditioned on the selected digit (cluster), we test the hypothesis that the data come from a Gaussian distribution (that is, $P_0$ is Gaussian). For our experiments, we down sampled the images and use pixels as feature vectors with dimensionality 64 as is commonly done in the literature. Table~\\ref{tab:realdata1} reports the probability with which the null hypothesis is accepted. The observed result reiterates in a statistically significant way that it is reasonable to make a mixture of Gaussian assumption in this case.\n\nFor the spherical case, we use the Human Fibroblasts dataset from~\\cite{iyer1999transcriptional,dhillon2003diametrical}, Yeast Cell Cycle dataset from~\\cite{spellman1998comprehensive} and the Rosetta yeast gene expression dataset~\\cite{hughes2000functional}. The Fibroblast data set contains 12 expression data corresponding to 517 samples (genes) report in the response of human fibroblasts following addition of serum to the growth media. We refer to~\\cite{iyer1999transcriptional} for more details about the scientific procedure with which these data were obtained. The Yeast Cell Cycle dataset consists of 82-dimensional data corresponding to 696 subjects. The Rosetta yeast dataset contains 300-dimensional element vector for around 6000 yeast genes. Previous data analysis studies~\\cite{sra2013multivariate, dhillon2003diametrical} have used mixtures of spherical distributions for clustering the above data set. Specifically, it has been observed in~\\cite{sra2013multivariate} that clustering using a mixture of Watson distribution has superior performance. While that has proved to be useful scientifically, it was not statistically tested if such an assumption is valid. Here, we test for goodness of fit of Watson distribution (that is, $P_0$ is a Watson distribution) for the largest cluster from the above data sets. Table~\\ref{tab:realdata2} shows the estimated probability of acceptance of the null hypothesis when it is assumed to be true. The values reported are averages from 50 random trails of the same dataset. The observed results provide a statistical justification for the use of Watson distribution in modeling the above data sets. \n\nWe note that for both situations, the tests considered tend to agree that the true hypothesis is true when there are more samples as indicated by Table~\\ref{tab:realdata1} and~\\ref{tab:realdata2}. But, the probability of acceptance is higher for low sample sizes for the adaptive M$^3$D test $\\tilde{T}_{\\mathrm{M}^3\\mathrm{d}}$\\, in all cases, showing that the method works better with finite sample sizes. This highlights the advantage of the $\\tilde{T}_{\\mathrm{M}^3\\mathrm{d}}$\\ in a finite sample setting confirming the better rates of convergence obtained in theory.\n\\begin{table}[t]\n\\centerin\n\\begin{tabular}{|c|c|c|c|}\n\\hline\n Sample size = & $300$ & $400$& $500$\\\\ \\hline \\hline \nK-S & 0.86&0.91 &0.94\\\\ \\hline\n$MMD$ & 0.90 & 0.93 &0.95 \\\\ \\hline\n$M^3D$& 0.94 &0.96 & 0.98\\\\ \\hline\n\\end{tabular}\n\\begin{tabular}{|c|c|c|}\n\\hline\n $300$ & $400$& $500$\\\\ \\hline \\hline \n 0.83& 0.88 & 0.93\\\\ \\hline\n 0.89 &0.92 & 0.95\\\\ \\hline\n 0.93& 0.95 & 0.98\\\\ \\hline\n\\end{tabular}\n\\begin{tabular}{|c|c|c|}\n\\hline\n $300$ & $400$& $500$\\\\ \\hline \\hline \n 0.84& 0.88 & 0.92\\\\ \\hline\n 0.88 &0.92 & 0.94\\\\ \\hline\n 0.93& 0.95 & 0.98\\\\ \\hline\n\\end{tabular}\n\\caption{ The values reported are the estimated probability with which the corresponding hypothesis test accepts the null hypothesis when it is true. The level of the test $\\alpha=0.05$. Digit 4 on left, Digit 6 on the middle and Digit 7 on right, for various values of sample size.}\n\\label{tab:realdata1}\n\\end{table}\n\n\\begin{table}[t]\n\\centering\n\\begin{tabular}{|c|c|c|c|}\n\\hline\n Sample size = & $75$ & $150$& $200$\\\\ \\hline \\hline \nST & 0.87&0.93 &0.98\\\\ \\hline\n$MMD$ & 0.90 & 0.94 &0.98 \\\\ \\hline\n$M^3D$& 0.92 &0.96 & 0.99\\\\ \\hline\n\\end{tabular}\n\\begin{tabular}{|c|c|c|}\n\\hline\n $150$ & $200$& $250$\\\\ \\hline \\hline \n 0.82& 0.87 & 0.91\\\\ \\hline\n 0.85 &0.92 & 0.94\\\\ \\hline\n 0.88& 0.93 & 0.96\\\\ \\hline\n\\end{tabular}\n\\begin{tabular}{|c|c|c|}\n\\hline\n $400$ & $500$& $600$\\\\ \\hline \\hline \n 0.76& 0.84 & 0.91\\\\ \\hline\n 0.79 &0.87 & 0.92\\\\ \\hline\n 0.81& 0.90 & 0.95\\\\ \\hline\n\\end{tabular}\n\\caption{ The values reported are the estimated probability with which the corresponding hypothesis test accepts the null hypothesis when it is true. The level of the test $\\alpha=0.05$. Human Fibroblasts dataset on left, Yeast Cell Cycle dataset on the middle and Rosetta Yeast dataset on the right, for various values of sample size.}\n\\label{tab:realdata2}\n\\end{table}\n\n\n\\section{Proofs}\n\\label{sec:proof}\n\n\\begin{proof}[Proof of Theorem \\ref{mmdthm}]\n\n\\noindent{\\bf Part (i).} The proof of the first part consists of two key steps. First, we show that the population counterpart $n\\gamma^2(P,P_0)$ of the test statistic converges to $\\infty$ uniformly, \\textit{i.e.},\n$$n\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,0)}\\gamma^2(P,P_0)\\rightarrow \\infty.$$\nThen, we argue that the deviation from $\\gamma^2(P,P_0)$ to $\\gamma^2(\\widehat{P}_n,P_0)$ is uniformly negligible compared with $\\gamma^2(P,P_0)$ itself.\n\nIt is not hard to see that\n\t\\begin{align*}\n\t\\gamma(\\widehat{P}_n,P_0)=&\\sqrt{\\sum\\limits_{k\\geq 1}\\lambda_k\\Big[\\frac{1}{n}\\sum\\limits_{i=1}^{n}\\varphi_k(X_i)\\Big]^2}\\\\\n\t\\geq&\\sqrt{\\sum\\limits_{k\\geq 1}\\lambda_k[{\\mathbb E} _{P}\\varphi_k(X)]^2}-\\sqrt{\\sum\\limits_{k\\geq 1}\\lambda_k\\Big[\\frac{1}{n}\\sum\\limits_{i=1}^{n}\\varphi_k(X_i)-{\\mathbb E} _P\\varphi_k(X)\\Big]^2}.\n\t\\end{align*}\nThus,\n\t\\begin{align*}\n\t&P\\left\\{n\\gamma^2(\\widehat{P}_n,P_0)\\sqrt{n\\sum\\limits_{k\\geq 1}\\lambda_k[{\\mathbb E} _{P}\\varphi_k(X)]^2}-\\sqrt{q_{w,1-\\alpha}}\\right\\}.\n\t\\end{align*}\n\t\n\tSuppose that \n\t\\begin{align*}\n\tn\\sum\\limits_{k\\geq 1}\\lambda_k[{\\mathbb E} _{P}\\varphi_k(X)]^2>q_{w,1-\\alpha}.\n\t\\end{align*}\nThen\n\t\\begin{align*}\n\tP\\left\\{n\\gamma^2(\\widehat{P}_n,P_0)0$ such that $P_n$'s are well-defined probability measures for any $n\\geq N_0$.\n\t\n\tNote that \\begin{align*}\n\t\\|u_n\\|_K^2=\\frac{C_1^2}{L^2(k_n)}\\leq \\underline{L}^{-2}C_1^2\n\t\\end{align*} and \n\t\\begin{align*}\n\t\\|u_n\\|_{L^2(P_0)}^2=\\frac{C_1^2\\lambda_{k_n}}{L^2(k_n)}=\\frac{C_1^2}{L(k_n)}k_n^{-2s}\\geq \\overline{L}^{-1}{C_1^2}k_n^{-2s}\\sim \\overline{L}^{-1}{C_1^2}C_2^{-2s}n^{-1\/2},\n\t\\end{align*}\n\twhere $A_n\\sim B_n$ means that $\\lim\\limits_{n\\rightarrow \\infty}{A_n}\/{B_n}=1$.\n\tThus, by choosing $C_1$ sufficiently small and $c_0=\\frac{1}{2}\\overline{L}^{-1}{C_1^2}C_2^{-2s}$, we ensure that $P_n\\in \\mathcal{P}(c_0n^{-1\/2},0)$ for sufficiently large $n$.\n\t\n\t\n\t\n\tTo apply Lemma $\\ref{lemG}$, we note that\n\t$$\\lim\\limits_{n\\rightarrow \\infty}\\|u_n\\|_{L^2(P_0)}^2=\\lim\\limits_{n\\rightarrow \\infty}\\frac{C_1^2\\lambda_{k_n}}{L^2(k_n)}=0.$$ \n\tIn addition, for any fixed $k$,\n\t$$\\tilde{a}_{n,k}=\\sqrt{n}\\langle u_n,\\varphi_k\\rangle_{L^2(P_0)}=0$$\n\t for sufficiently large $n$, and \n\t $$\\sum\\limits_{k\\geq 1}\\lambda_k\\tilde{a}_{n,k}^2=\\frac{nC_1^2\\lambda_{k_n}^2}{L^2(k_n)}=nC_1^2k_n^{-4s}\\rightarrow C_1^2C_2^{-4s}$$ \n\t as $n\\rightarrow \\infty$. Thus, Lemma \\ref{lemG} implies that\n\t\\begin{align*}\n\tn\\gamma(\\widehat{P}_n,P_0)\\stackrel{d}{\\rightarrow}\\sum_{k\\geq 1}\\lambda_kZ_k^2+C_1^2C_2^{-4s}.\n\t\\end{align*}\n\t\n\tNow take $C_2=\\left({2C_1^2}\/{q_{w,1-\\alpha}}\\right) ^{{1}\/{4s}}$ so that $C_1^2C_2^{-4s}=\\frac{1}{2}q_{w,1-\\alpha}$. Then\n\t\\begin{align*}\n\t\\varliminf\\limits_{n\\rightarrow \\infty}\\beta(T_{\\text{MMD}};c_0n^{-1\/2},0)\\geq& \\lim_{n\\rightarrow \\infty}P_n(n\\gamma(\\widehat{P}_n,P_0)< q_{w,1-\\alpha})\\\\\n\t=&P\\Big(\\sum_{k\\geq 1}\\lambda_kZ_k^2< \\frac{1}{2}q_{w,1-\\alpha}\\Big)>0,\n\t\\end{align*}\n\twhich concludes the proof.\n\\end{proof}\n\\vskip 25pt\n\n\\begin{proof}[Proof of Theorem \\ref{asympm3d}]\n\tLet $\\tilde{K}_n(\\cdot,\\cdot):=\\tilde{K}_{\\varrho_n}(\\cdot,\\cdot)$. Note that\n\t\\begin{align*}\n\tn\\widehat{\\eta}_{\\varrho_n}^2(P,P_0)=&\\frac{1}{n}\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\Big[\\sum\\limits_{i=1}^n\\varphi_k(X_i)\\Big]^2\\\\=&\\frac{1}{n}\\sum\\limits_{i,j=1}^n\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\varphi_k(X_i)\\varphi_k(X_j)\\\\=&\\frac{1}{n}\\sum\\limits_{i,j=1}^n\\tilde{K}_n(X_i,X_j).\n\t\\end{align*}\n\tThus\n\t\\begin{align*}\n\tv_n^{-1\/2}[n\\widehat{\\eta}_{\\varrho_n}^2(P,P_0)-A_n]=2(n^2v_n)^{-1\/2}\\sum\\limits_{j=2}^n\\sum\\limits_{i=1}^{j-1}\\tilde{K}_n(X_i,X_j).\n\t\\end{align*}\n\tLet $\\zeta_{nj}=\\sum\\limits_{i=1}^{j-1}\\tilde{K}_n(X_i,X_j)$. Consider a filtration $\\{\\mathcal{F}_j: j\\geq 1\\}$ where $\\mathcal{F}_j=\\sigma\\{X_j:1\\leq i\\leq j\\}$. Due to the assumption that $K$ is degenerate, we have ${\\mathbb E} \\varphi_k(X)=0$ for any $k\\geq 1$, which implies that\n\t\\begin{align*}\n\t{\\mathbb E} (\\zeta_{nj}|\\mathcal{F}_{j-1})=\\sum\\limits_{i=1}^{j-1}{\\mathbb E} [\\tilde{K}_n(X_i,X_j)|\\mathcal{F}_{j-1}]=\\sum\\limits_{i=1}^{j-1}{\\mathbb E} [\\tilde{K}_n(X_i,X_j)|X_i]=0,\n\t\\end{align*}\n\tfor any $j\\geq 2$. \n\t\n\tWrite \n\t\\begin{align*}\n\tU_{nm}=\\begin{cases}\n\t0&m=1 \\\\ \n\t\\sum\\limits_{j=2}^m\\zeta_{nj}& m\\geq 2\n\t\\end{cases}.\n\t\\end{align*}\n\tThen for any fixed $n$, $\\{U_{nm}\\}_{m\\geq 1}$ is a martingale with respect to $\\{\\mathcal{F}_m: m\\geq 1\\}$ and \n\t\\begin{align*}\n\tv_n^{-1\/2}[n\\widehat{\\eta}_{\\varrho_n}^2(P,P_0)-A_n]=2(n^2v_n)^{-1\/2}U_{nn}.\n\t\\end{align*}\n\t\n\tWe now apply martingale central limit theorem to $U_{nn}$. Following the argument from \\citet{hall1984central}, it can be shown that\n\t\\begin{align}\n\t\\Big[\\frac{1}{2}n^2{\\mathbb E} \\tilde{K}_n^2(X,X')\\Big]^{-1\/2}U_{nn}\\stackrel{d}{\\rightarrow}N(0,1),\\label{con2}\n\t\\end{align}\n\tprovided that\n\t\\begin{align}\n\t&[{\\mathbb E} G_n^2(X,X')+n^{-1}{\\mathbb E} \\tilde{K}_n^2(X,X')\\tilde{K}_n^2(X,X^{''})+n^{-2}{\\mathbb E} \\tilde{K}_n^4(X,X')]\/[{\\mathbb E} {\\tilde{K}_n^2(X,X')}]^2\\rightarrow 0,\\label{con3}\n\t\\end{align}\n\tas $n\\rightarrow \\infty$, where $G_n(x,x')={\\mathbb E} \\tilde{K}_n(X,x)\\tilde{K}_n(X,x')$.\n\tSince\n\t$${\\mathbb E} \\tilde{K}_n^2(X,X')=\\sum\\limits_{k\\geq 1}\\Big(\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\Big)^2=v_n,$$\n\t(\\ref{con2}) implies that\n\t\\begin{align*}\n\tv_n^{-1\/2}[n\\widehat{\\eta}_{\\varrho_n}^2(P,P_0)-A_n]=\\sqrt{2}\\cdot\\Big(\\frac{1}{2}n^2{\\mathbb E} \\tilde{K}_n^2(X,X')\\Big)^{-1\/2}U_{nn}\\stackrel{d}{\\rightarrow}N(0,2).\n\t\\end{align*}\n\tIt therefore suffices to verify (\\ref{con3}).\n\t\t\n\tNote that\n\t\\begin{align*}\n\t{\\mathbb E} \\tilde{K}_n^2(X,X')=\\sum\\limits_{k\\geq 1}\\Big(\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\Big)^2\n\t\\geq &\\sum\\limits_{\\lambda_k\\geq \\varrho_n^2}\\frac{1}{4}+\\frac{1}{4\\varrho_n^4}\\sum\\limits_{\\lambda_k<\\varrho_n^2}\\lambda_k^2\\\\\n\t=&\\frac{1}{4}|\\{k:\\lambda_k\\geq \\varrho_n^2\\}|+\\frac{1}{4\\varrho_n^4}\\sum\\limits_{\\lambda_k<\\varrho_n^2}\\lambda_k^2\\asymp \\varrho_n^{-1\/s},\n\t\\end{align*}\n\twhere the last step holds by considering that $\\lambda_k\\asymp k^{-2s}$. \tHereafter, we shall write $a_n\\asymp b_n$ if $0<\\varliminf\\limits_{n\\rightarrow \\infty}a_n\/b_n\\leq \\varlimsup\\limits_{n\\rightarrow \\infty}a_n\/b_n <\\infty$, for two positive sequences $\\{a_n\\}$ and $\\{b_n\\}$.\nSimilarly, \n\t\\begin{align*}\n\t{\\mathbb E} G_n^2(X,X')=\\sum\\limits_{k\\geq 1}\\Big(\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\Big)^4\\leq |\\{k:\\lambda_k\\geq\\varrho_n^2\\}|+\\varrho_n^{-8}\\sum\\limits_{\\lambda_k<\\varrho_n^2}\\lambda_k^4\\asymp\\varrho_n^{-1\/s},\n\t\\end{align*}\n\tand\n\t\\begin{align*}\n\t{\\mathbb E} \\tilde{K}_n^2(X,X')\\tilde{K}_n^2(X,X'')=&{\\mathbb E} \\Big\\{\\sum\\limits_{k\\geq 1}\\Big(\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\Big)^2\\varphi_k^2(X)\\Big\\}^2\\\\\\leq &\\left(\\sup_{k\\geq 1}\\|\\varphi_k\\|_{\\infty}\\right)^4\\Big\\{\\sum\\limits_{k\\geq 1}\\Big(\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\Big)^2\\Big\\}^2\\asymp \\varrho_n^{-2\/s}.\n\t\\end{align*}\n\tThus there exists a positive constant $C_3$ such that\n\t\\begin{align}\n\t{\\mathbb E} G_n^2(X,X')\/[{\\mathbb E} \\tilde{K}_n^2(X,X')]^2\\leq C_3\\varrho_n^{1\/s}\\rightarrow 0,\\label{conv1}\n\t\\end{align}\n\tand\n\t\\begin{align}\n\tn^{-1}{\\mathbb E} \\tilde{K}_n^2(X,X')\\tilde{K}_n^2(X,X'')\/[{\\mathbb E} {\\tilde{K}_n^2(X,X')}]^2\\leq C_3n^{-1}\\rightarrow \\infty,\\label{conv2}\n\t\\end{align}\n\tas $n\\rightarrow \\infty$. On the other hand,\n\t\\begin{align*}\n\t{\\mathbb E} \\tilde{K}_n^4(X,X')\\leq \\|\\tilde{K}_n\\|^2_{\\infty}{\\mathbb E} \\tilde{K}_n^2(X,X'),\n\t\\end{align*}\n\twhere\n\t\\begin{align*}\n\t\\|\\tilde{K}_n\\|_{\\infty}=\\sup\\limits_{x}\\Bigg\\{\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\varphi_k^2(x)\\Bigg\\}\\leq\\Big(\\sup\\limits_{k\\geq 1}\\|\\varphi_k\\|_{\\infty}\\Big)^2\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\asymp \\varrho_n^{-1\/s}.\n\t\\end{align*}\n\tThis implies that for some positive constant $C_4$,\n\t\\begin{align}\n\tn^{-2}{\\mathbb E} \\tilde{K}_n^4(X,X')\\}\/[{\\mathbb E} {\\tilde{K}_n^2(X,X')}]^2\\leq n^{-2}\\|\\tilde{K}_n\\|^2_{\\infty}\/{\\mathbb E} {\\tilde{K}_n^2(X,X')}\\leq C_4(n^2\\varrho_n^{1\/s})^{-1}\\rightarrow 0.\\label{conv3}\n\t\\end{align}\n\tas $n\\rightarrow \\infty$. Together, (\\ref{conv1}), (\\ref{conv2}) and (\\ref{conv3}) ensure that condition (\\ref{con3}) holds.\n\\end{proof}\n\\vskip 25pt\n\n\\begin{proof}[Proof of Theorem \\ref{crm3d}]\n\tNote that\n\t\\begin{align*}\n\t&n\\eta_{\\varrho_n}^2(\\widehat{P}_n,P_0)-\\frac{1}{n}\\sum_{i=1}^n\\tilde{K}_n(X_i,X_j)\\\\=&\\frac{1}{n}\\sum_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\sum_{\\substack{1\\leq i,j\\leq n\\\\ i\\neq j}}\\varphi_k(X_i)\\varphi_k(X_j)\\\\\n\t=&\\frac{1}{n}\\sum_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\sum_{\\substack{1\\leq i,j\\leq n\\\\ i\\neq j}}[\\varphi_k(X_i)-{\\mathbb E} _P\\varphi_k(X)][\\varphi_k(X_j)-{\\mathbb E} _P\\varphi_k(X)]\\\\\n\t&+\\frac{2(n-1)}{n}\\sum_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)]\\sum_{1\\leq i\\leq n}[\\varphi_k(X_i)-{\\mathbb E} _P\\varphi_k(X)]\\\\\n\t&+\\frac{n(n-1)}{n}\\sum_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)]^2\\\\\n\t:=& V_1+V_2+V_3.\n\t\\end{align*}\nObviously, ${\\mathbb E} _PV_1V_2=0$. We first argue that the following three statements together implies the desired result:\n\\begin{eqnarray}\n\\label{as2}\\lim\\limits_{n\\rightarrow \\infty}\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}v_n^{-1\/2}V_3&=&\\infty,\\\\\n\\label{as1a}\\sup\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}({\\mathbb E} _PV_1^2\/V_3^2)&=&o(1),\\\\\n\\label{as1b}\\sup\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}({\\mathbb E} _PV_2^2\/V_3^2)&=&o(1).\n\\end{eqnarray}\n\nTo see this, note that \\eqref{as2} implies that\n\t\\begin{align*}\n\t&\\lim\\limits_{n\\rightarrow \\infty}\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}P(v_n^{-1\/2}[n\\widehat{\\eta}_{\\varrho_n}^2(P,P_0)-A_n]\\geq \\sqrt{2}z_{1-\\alpha})\\\\\n\t\\geq&\\lim_{n\\rightarrow \\infty}\\inf_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}P\\Big(v_n^{-1\/2}V_3\\geq 2\\sqrt{2}z_{1-\\alpha}, V_1+V_2+V_3\\geq\\frac{1}{2}V_3\\Big)\\\\\n\t=&\\lim_{n\\rightarrow \\infty}\\inf_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}P\\Big(V_1+V_2+V_3\\geq\\frac{1}{2}V_3\\Big).\n\t\\end{align*}\nOn the other hand, \\eqref{as1a} and \\eqref{as1b} imply that\n\t\\begin{align*}\n\\lim_{n\\rightarrow \\infty}\\inf_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}P\\Big(V_1+V_2+V_3\\geq\\frac{1}{2}V_3\\Big)\n\t=&1-\\lim_{n\\rightarrow \\infty}\\sup_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}P\\Big(V_1+V_2+V_3<\\frac{1}{2}V_3\\Big)\\\\\n\t\\geq&1-\\lim_{n\\rightarrow \\infty}\\sup_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}\\frac{{\\mathbb E} _P(V_1+V_2)^2}{(V_3\/2)^2}=1.\n\t\\end{align*}\nThis immediately suggests that $T_{\\text{M}^3\\text{d}}$ is consistent. We now show that \\eqref{as2}-\\eqref{as1b} indeed hold.\n\n\\paragraph{Verifying \\eqref{as2}.}\nWe begin with \\eqref{as2}. Since $v_n\\asymp \\varrho_n^{-1\/s}$ and $V_3=(n-1)\\eta_{\\varrho_n}^2(P,P_0)$, (\\ref{as2}) is equivalent to\n\t\\begin{align*}\n\t\\lim\\limits_{n\\rightarrow \\infty}\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}n\\varrho_n^{\\frac{1}{2s}}\\eta_{\\varrho_n}^2(P,P_0)=\\infty.\n\t\\end{align*}\n\t\n\tFor any $P\\in\\mathcal{P}(\\Delta_n,\\theta)$, let $u={{d}P}\/{{d}P_0}-1$ and $a_k=\\langle u,\\varphi_k\\rangle_{L_2(P_0)}={\\mathbb E} _P\\varphi_k(X)$. Based on the assumption that $K$ is universal, $u=\\sum\\limits_{k\\geq 1}a_k\\varphi_k$. We consider the case $\\theta=0$ and $\\theta>0$ separately\n\t\n\\begin{enumerate}\t\n\\item[(1)] First consider $\\theta=0$. It is clear that\n\t\\begin{align*}\n\t\\eta_{\\varrho_n}^2(P,P_0)=&\\sum_{k\\geq 1}a_k^2-\\sum_{k\\geq 1}\\frac{\\varrho_n^2}{\\lambda_k+\\varrho_n^2}a_k^2\\\\\n\t\\geq&\\|u\\|_{L_2(P_0)}^2-\\varrho_n^2\\sum_{k\\geq 1}\\frac{1}{\\lambda_k}a_k^2\\\\\n\t\\geq&\\|u\\|_{L_2(P_0)}^2-\\varrho_n^2M^2.\n\t\\end{align*}\n\tTake $\\varrho_n\\le \\sqrt{{\\Delta_n}\/(2M^2)}$ so that $\\rho_n^2M^2\\le\\frac{1}{2}\\Delta_n$. Then we have\n\t\\begin{align*}\n\t\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,0)}\\eta_{\\varrho_n}^2(P,P_0)\\geq\\frac{1}{2}\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,0)}\\|u\\|_{L_2(P_0)}^2=\\frac{1}{2}\\Delta_n\n\t\\end{align*}\n\n\t\n\\item[(2)] Now consider the case when $\\theta>0$. For $P\\in\\mathcal{P}(\\Delta_n,\\theta)$, $\\forall$ $R>0$, $\\exists$ $f_R\\in\\mathcal{H}(K)$ such that $\\|u-f_R\\|_{L_2(P_0)}\\leq MR^{-1\/\\theta}$ and $\\|f_R\\|_{K}\\leq R$. Let $b_k=\\langle f_R,\\varphi_k\\rangle _{L_2(P_0)}$.\n\\begin{align*}\n\\eta_{\\varrho_n}^2(P,P_0)=&\\sum_{k\\geq 1}a_k^2-\\sum_{k\\geq 1}\\frac{\\varrho_n^2}{\\lambda_k+\\varrho_n^2}a_k^2\\\\\n\\geq&\\|u\\|_{L_2(P_0)}^2-2\\sum_{k\\geq 1}\\frac{\\varrho_n^2}{\\lambda_k+\\varrho_n^2}(a_k-b_k)^2-2\\sum_{k\\geq 1}\\frac{\\varrho_n^2}{\\lambda_k+\\varrho_n^2}b_k^2\\\\\n\\geq&\\|u\\|_{L_2(P_0)}^2-2\\sum_{k\\geq 1}(a_k-b_k)^2-2\\varrho_n^2\\sum_{k\\geq 1}\\frac{1}{\\lambda_k}b_k^2\\\\\n=&\\|u\\|_{L_2(P_0)}^2-2\\|u-f_R\\|_{L_2(P_0)}^2-2\\varrho_n^2\\|f_R\\|_{K}^2.\n\\end{align*}\n\tTaking $R=({2M}\/{\\|u\\|_{L_2(P_0)}})^{\\theta}$ yields that\n\t\\begin{align*}\n\t\\eta_{\\varrho_n}^2(P,P_0)\\geq \\|u\\|_{L_2(P_0)}^2-2M^2R^{-2\/\\theta}-2\\varrho_n^2R^2=\\frac{1}{2}\\|u\\|_{L_2(P_0)}^2-2\\varrho_n^2R^2.\n\t\\end{align*}\n\tNow by choosing\n\t$$\n\t\\varrho_n\t\\le\\frac{1}{2\\sqrt{2}}(2M)^{-\\theta}\\Delta_n^{\\frac{1+\\theta}{2}},\n\t$$\n\twe can ensure that\n\t$$2\\varrho_n^2R^2\\leq \\frac{1}{4}\\|u\\|_{L_2(P_0)}^2.$$ So that\n\t\\begin{align*}\n\t\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}\\eta_{\\varrho_n}^2(P,P_0)\\geq\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}\\frac{1}{4}\\|u\\|_{L_2(P_0)}^2\\geq\\frac{1}{4}\\Delta_n.\n\t\\end{align*} \n\t\n\n\\end{enumerate}\n\n\tIn both cases, with $\\varrho_n\\leq C\\Delta_n^{\\frac{\\theta+1}{2}}$ for a sufficiently small $C=C(M)>0$, $\\lim\\limits_{n\\rightarrow\\infty}\\varrho_n^{\\frac{1}{2s}}n\\Delta_n=\\infty$ suffices to ensure (\\ref{as2}) holds. Under the condition that $\\lim\\limits_{n\\rightarrow \\infty}\\Delta_nn^{\\frac{4s}{4s+\\theta+1}}=\\infty$, \n$$\n\\varrho_n=cn^{-\\frac{2s(\\theta+1)}{4s+\\theta+1}}\\leq C\\Delta_n^{\\frac{\\theta+1}{2}}\n$$\nfor sufficiently large $n$ and $\\lim\\limits_{n\\rightarrow\\infty}\\varrho_n^{\\frac{1}{2s}}n\\Delta_n=\\infty$ holds as well.\n\n\t\n\\paragraph{Verifying \\eqref{as1a}.}\nRewrite $V_1$ as\n\t\\begin{align*}\n\tV_1=&\\frac{1}{n}\\sum_{\\substack{1\\leq i,j\\leq n\\\\ i\\neq j}}\\sum_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[\\varphi_k(X_i)-{\\mathbb E} _P\\varphi_k(X)][\\varphi_k(X_j)-{\\mathbb E} _P\\varphi_k(X)]\\\\\n\t:=& \\frac{1}{n}\\sum_{\\substack{1\\leq i,j\\leq n\\\\ i\\neq j}}F_n(X_i,X_j).\n\t\\end{align*}\n\tThen\n\t\\begin{align*}\n\t{\\mathbb E} _PV_1^2=&\\frac{1}{n^2}\\sum_{\\substack{i\\neq j\\\\ i'\\neq j'}}{\\mathbb E} _PF_n(X_i,X_j)F_n(X_{i'},X_{j'})\\\\\n\t=&\\frac{2n(n-1)}{n^2}{\\mathbb E} _PF_n^2(X,X')\\\\\n\t\\leq& 2{\\mathbb E} _PF_n^2(X,X').\n\t\\end{align*}\n\t\n\tRecall that, for any two random variables $Y_1$, $Y_2$ such that ${\\mathbb E} Y_1^2<\\infty$,\n\t\\begin{align*}\n\t{\\mathbb E} [Y_1-{\\mathbb E} (Y_1|Y_2)]^2={\\mathbb E} Y_1^2-{\\mathbb E} [{\\mathbb E} (Y_1|Y_2)^2]\\leq {\\mathbb E} Y_1^2.\n\t\\end{align*}\n\tTherefore,\n\t\\begin{align*}\n\t{\\mathbb E} _PF_n^2(X,X')\\leq {\\mathbb E} _P\\{\\tilde{K}_n(X,X')-{\\mathbb E} _P[\\tilde{K}_n(X,X')|X]\\}^2\\leq {\\mathbb E} _{P}\\tilde{K}_n^2(X,X').\n\t\\end{align*}\n\tThus, to prove \\eqref{as1a}, it suffices to show that\n\t\\begin{align*}\n\t\\lim\\limits_{n\\rightarrow \\infty}\\sup\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}{\\mathbb E} _{P}\\tilde{K}_n^2(X,X')\/V_3^2=0.\n\t\\end{align*}\n\t\n\t\n\tFor any $g\\in L_2(P_0)$ and positive definite kernel $G(\\cdot,\\cdot)$ such that ${\\mathbb E} _{P_0}G^2(X,X')<\\infty$, let\n\t\\begin{align*}\n\t\\|g\\|_G:= \\sqrt{{\\mathbb E} _{P_0}[g(X)g(X')G(X,X')]}.\n\t\\end{align*}\n\tBy the positive definiteness of $G(\\cdot,\\cdot)$, triangular inequality holds for $\\|\\cdot\\|_G$, \\textit{i.e.}, for any $g_1$, $g_2\\in L_2(P_0)$, \n\t\\begin{align*}\n\t|\\|g_1\\|_G-\\|g_2\\|_G|\\leq \\|g_1-g_2\\|_G,\n\t\\end{align*}\n\twhich implies that\n\t\\begin{align}\n\t\\Bigg|\\sqrt{{\\mathbb E} _P\\tilde{K}_n^2(X,X')}-\\sqrt{{\\mathbb E} _{P_0}\\tilde{K}_n^2(X,X')}\\Bigg|\\leq \\sqrt{{\\mathbb E} _{P_0}[u(X)u(X')\\tilde{K}_n^2(X,X')]}.\\label{tri}\n\t\\end{align}\n\tWe now appeal to the following lemma to bound the right hand side of \\eqref{tri}:\n\t\\begin{lemma}\\label{schur2}\n\tLet $G$ be a Mercer kernel defined over $\\mathcal X\\times \\mathcal X$ with eigenvalue-eigenfunction pairs $\\{(\\mu_k, \\varphi_k): k\\ge 1\\}$ with respect to $L_2(P)$ such that $\\mu_1\\ge \\mu_2\\ge\\cdots$. If $G$ is a trace kernel in that ${\\mathbb E} G(X,X)<\\infty$, then for any $g\\in L_2(P)$\n\t$$\n\t{\\mathbb E} _{P}[g(X)g(X')G^2(X,X')]\\le \\mu_1\\left(\\sum_{k\\ge 1}\\mu_k\\right)\\left(\\sup_{k\\ge 1}\\|\\varphi_k\\|_\\infty\\right)^2\\|g\\|_{L_2(P)}^2.\n\t$$\n\t\\end{lemma}\n\tBy Lemma \\ref{schur2}, we get\n\t\\begin{align*}\n\t{\\mathbb E} _{P_0}[u(X)u(X')\\tilde{K}_n^2(X,X')]\\leq &C_5\\left(\\sum\\limits_k\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\right)\\|u\\|_{L_2(P_0)}^2\\asymp \\varrho_n^{-1\/s}\\|u\\|_{L_2(P_0)}^2.\n\t\\end{align*}\n\tRecall that\n\t$${\\mathbb E} _{P_0}\\tilde{K}^2_n(X,X')=\\sum\\limits_k\\left(\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\right)^2\\asymp \\varrho_n^{-1\/s}.$$ In the light of (\\ref{tri}), they imply that\n\t\\begin{align*}\n\t{\\mathbb E} _{P}\\tilde{K}^2_n(X,X')\\leq 2\\{{\\mathbb E} _{P_0}\\tilde{K}^2_n(X,X')+{\\mathbb E} _{P_0}[u(X)u(X')\\tilde{K}_n^2(X,X')]\\}\\leq C_6\\varrho_n^{-1\/s}[1+\\|u\\|_{L_2(P_0)}^2].\n\t\\end{align*}\nOn the other hand, it is not hard to verify that with our choice of $\\varrho_n$,\n\t\\begin{align*}\n\t\\frac{1}{4}\\|u\\|_{L_2(P_0)}^2\\leq \\eta_{\\varrho_n}^2(P,P_0)\\leq \\|u\\|_{L_2(P_0)}^2,\n\t\\end{align*}\n\tfor any $P\\in\\mathcal{P}(\\Delta_n,\\theta)$. Thus\n\t\\begin{align*}\n\t&\\lim\\limits_{n\\rightarrow \\infty}\\sup\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}{\\mathbb E} _P\\tilde{K}_n^2(X,X')\/V_3^2\\\\\\leq &16C_6\\Big\\{\\Big(\\lim\\limits_{n\\rightarrow \\infty}\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}\\varrho_n^{1\/s}n^2\\|u\\|_{L_2(P_0)}^4\\Big)^{-1}+\\Big(\\lim\\limits_{n\\rightarrow \\infty}\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}\\varrho_n^{1\/s}n^2\\|u\\|_{L_2(P_0)}^2\\Big)^{-1}\\Big\\}=0\n\t\\end{align*}\n\tprovided that $\\lim\\limits_{n\\rightarrow \\infty}n^{\\frac{4s}{4s+\\theta+1}}\\Delta_n=\\infty$. This immediately implies \\eqref{as1a}.\n\t\n\\paragraph{Verifying \\eqref{as1b}.} Observe that\n\t\\begin{align*}\n\t{\\mathbb E} _PV_2^2\\leq &4n{\\mathbb E} _P\\Big\\{\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)][\\varphi_k(X)-{\\mathbb E} _P\\varphi_k(X)]\\Big\\}^2\\\\\n\t\\leq &4n{\\mathbb E} _P\\Big\\{\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)][\\varphi_k(X)]\\Big\\}^2\\\\\n =& 4n{\\mathbb E} _{P_0}\\left([1+u(X)]\\Big\\{\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)][\\varphi_k(X)]\\Big\\}^2\\right).\n\t\\end{align*}\n\t\nIt is clear that\n\t\\begin{align*}\n\t&{\\mathbb E} _{P_0}\\Big\\{\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)][\\varphi_k(X)]\\Big\\}^2\\\\=&\\sum\\limits_{k,k'\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\frac{\\lambda_{k'}}{\\lambda_{k'}+\\varrho_n^2}{\\mathbb E} _P\\varphi_k(X){\\mathbb E} _P\\varphi_{k'}(X){\\mathbb E} _{P_0}[\\varphi_k(X)\\varphi_{k'}(X)]\\\\=&\\sum\\limits_{k\\geq 1}\\Big(\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}\\Big)^2[{\\mathbb E} _P\\varphi_k(X)]^2\\leq \\eta_{\\varrho_n}^2(P,P_0).\n\t\\end{align*}\nOn the other hand,\n\\begin{align*}\n\t&{\\mathbb E} _{P_0}\\left(u(X)\\Big\\{\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)][\\varphi_k(X)]\\Big\\}^2\\right)\\\\\n\t\\leq&\\sqrt{{\\mathbb E} _{P_0}\\left(u^2(X)\\Big\\{\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)][\\varphi_k(X)]\\Big\\}^2\\right)}\\times\\\\\n\t&\\times\\sqrt{{\\mathbb E} _{P_0}\\Big\\{\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)][\\varphi_k(X)]\\Big\\}^2}\\\\\n\t\\leq&\\|u\\|_{L_2(P_0)}\\sup\\limits_{x}\\Big|\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)][\\varphi_k(x)]\\Big|\\cdot\\eta_{\\varrho_n}(P,P_0)\\\\\n\t\\leq&\\left(\\sup\\limits_{k}\\|\\varphi_k\\|_{\\infty}\\right)\\|u\\|_{L_2(P_0)}\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}|{\\mathbb E} _P\\varphi_k(X)|\\cdot\\eta_{\\varrho_n}(P,P_0)\\\\\n\t\\leq&\\left(\\sup\\limits_{k}\\|\\varphi_k\\|_{\\infty}\\right)\\|u\\|_{L_2(P_0)}\\sqrt{\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}}\\sqrt{\\sum\\limits_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)]^2}\\cdot\\eta_{\\varrho_n}(P,P_0)\\\\\\leq &C_7\\|u\\|_{L_2(P_0)}\\varrho_n^{-\\frac{1}{2s}}\\eta_{\\varrho_n}^2(P,P_0).\n\t\\end{align*}\nTogether, they imply that\n\\begin{align*}\n\t&\\lim\\limits_{n\\rightarrow \\infty}\\sup\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}{\\mathbb E} _PV_1^2\/V_3^2\\\\\\leq &4\\max\\{1,C_7\\}\\Bigg\\{\\Big(\\lim\\limits_{n\\rightarrow \\infty}\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}n\\eta_{\\varrho_n}^2(P,P_0)\\Big)^{-1}+\\lim\\limits_{n\\rightarrow \\infty}\\sup\\limits_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}\\Bigg(\\frac{\\|u\\|_{L_2(P_0)}}{\\varrho_n^{\\frac{1}{2s}}n\\eta_{\\varrho_n}^2(P,P_0)}\\Bigg)\\Bigg\\}=0,\n\t\\end{align*}\nunder the assumption that $\\lim\\limits_{n\\rightarrow \\infty}n^{\\frac{4s}{4s+\\theta+1}}\\Delta_n=\\infty$.\n\\end{proof}\n\\vskip 25pt\n\n\\begin{proof}[Proof of Theorem \\ref{cr}]\nWithout loss of generality, assume $M=1$ and $\\Delta_n=cn^{-\\frac{4s}{4s+\\theta+1}}$ for some $c>0$. The main idea behind our proof is to carefully construct a finite subset of $\\mathcal{P}(\\Delta_n,\\theta)\\setminus \\{P_0\\}$, and show that one can not reliably distinguish $P_0$ from an unknown instance from this subset based on a sample of $n$ observations. We shall consider the cases of $\\theta=0$ and $\\theta>0$ separately.\n\n\\paragraph{The case of $\\theta=0$.} \nWe first treat the case when $\\theta=0$. Let $K_n=\\lfloor{C_8\\Delta_n^{-\\frac{1}{2s}}}\\rfloor$ for a sufficiently small constant $C_8>0$ and $a_n=\\sqrt{{\\Delta_n}\/{K_n}}$. For any $\\xi_n:=(\\xi_{n1},\\xi_{n2},\\cdots,\\xi_{nK_n})^\\top\\in \\{\\pm 1\\}^{K_n}$, write\n$$\nu_{\\xi_n} = a_n\\sum_{k=1}^{K_n}\\xi_{nk}\\varphi_k.\n$$\nIt is clear that\n$$\\|u_{n,\\xi_n}\\|_{L_2(P_0)}^2=K_na_n^2=\\Delta_n$$\nand\t\n$$\n\\|u_{n,\\xi_n}\\|_\\infty\\le a_nK_n\\left(\\sup\\limits_{k}\\|\\varphi_k\\|_{\\infty}\\right)\\asymp \\Delta_n^{2s-1\\over 4s}\\rightarrow 0.\n$$\nBy taking $C_8$ small enough, we can also ensure\n$$\\|u_{\\xi_n}\\|_K^2=a_n^2\\sum\\limits_{k=1}^{K_n}\\lambda_k^{-1}\\leq 1,$$\n\nTherefore, there exists a probability measure $P_{\\xi_n}\\in\\mathcal{P}(\\Delta_n, 0)$ such that $dP\/dP_0=1+u_{n,\\xi_n}$. Following a standard argument for minimax lower bound, it suffices to show that\n\\begin{equation}\n\\label{eq:min}\n\\varlimsup\\limits_{n\\rightarrow \\infty}{\\mathbb E}_{P_0} \\left({1\\over 2^{K_n}}\\sum_{\\xi_n\\in \\{\\pm 1\\}^{K_n}}\\left\\{\\prod\\limits_{i=1}^{n}[1+u_{\\xi_n}(X_i)]\\right\\}\\right)^2<\\infty.\n\\end{equation}\nSee, \\textit{e.g.}, \\cite{ingster2003nptest,tsybakov2008introduction}.\n\nNote that\n\t\\begin{align*}\n&{\\mathbb E}_{P_0} \\left({1\\over 2^{K_n}}\\sum_{\\xi_n\\in \\{\\pm 1\\}^{K_n}}\\left\\{\\prod\\limits_{i=1}^{n}[1+u_{\\xi_n}(X_i)]\\right\\}\\right)^2\\\\\n=&{\\mathbb E}_{P_0} \\left({1\\over 2^{2K_n}}\\sum_{\\xi_n,\\xi_n'\\in \\{\\pm 1\\}^{K_n}}\\left\\{\\prod\\limits_{i=1}^{n}[1+u_{\\xi_n}(X_i)]\\right\\}\\left\\{\\prod\\limits_{i=1}^{n}[1+u_{\\xi_n'}(X_i)]\\right\\}\\right)\\\\\n\t=&{1\\over 2^{2K_n}}\\sum_{\\xi_n,\\xi_n'\\in \\{\\pm 1\\}^{K_n}}\\prod\\limits_{i=1}^n{\\mathbb E}_{P_0} \\Bigg\n\t\\{[1+u_{\\xi_n}(X_i)][1+u_{\\xi_n'}(X_i)]\\Bigg\\}\\\\\n\t=&{1\\over 2^{2K_n}}\\sum_{\\xi_n,\\xi_n'\\in \\{\\pm 1\\}^{K_n}}\\Big(1+a_{n}^2\\sum\\limits_{k=1}^{K_n}\\xi_{nk}\\xi_{nk}'\\Big)^n\\\\\n\t\\leq&{1\\over 2^{2K_n}}\\sum_{\\xi_n,\\xi_n'\\in \\{\\pm 1\\}^{K_n}}\\exp\\Big(na_n^2\\sum\\limits_{k=1}^{K_n}\\xi_{n,k}\\xi_{n,k}'\\Big)\\\\\n\t=&\\left\\{\\frac{\\exp(na_{n}^2)+\\exp(-na_{n}^2)}{2}\\right\\}^{K_n}\\\\\n\t\\leq&\\exp\\Big\n\t\\{K_n\\Big(\\frac{\\exp(na_{n}^2)+\\exp(-na_{n}^2)}{2}-1\\Big)\\Big\\}.\n\t\\end{align*}\nAn application of Taylor expansion shows that there exist $t_0>0$ and $C_9>0$ such that\n\t\\begin{align*}\n\t{t^2}-C_9|t|^3\\leq \\exp(t)+\\exp(-t)\\leq{t^2}+C_9|t|^3\n\t\\end{align*}\n\tfor any $|t|\\leq t_0$. With the particular choice of $K_n$, $a_n$, and the conditions on $\\Delta_n$, this immediately implies \\eqref{eq:min}.\n\t\n\\paragraph{The case of $\\theta>0$.} The main idea is similar to before. To find a set of probability measures in $\\mathcal{P}(\\Delta_n, \\theta)$, we appeal to the following lemma.\n\n\\begin{lemma}\\label{char0}\nLet $u=\\sum\\limits_{k}a_k\\varphi_k$. If\n\\begin{align*}\n\\left(\\sum\\limits_{k=1}^K\\frac{a_k^2}{\\lambda_k}\\right)^{2\/\\theta}\\left(\\sum\\limits_{k\\geq K}a_k^2\\right)\\leq M^2\n\\end{align*}\nthen $u\\in \\mathcal{F}(\\theta, M)$.\n\\end{lemma}\n\nSimilar to before, we shall now take $K_n=\\lfloor{C_{10}\\Delta_n^{-\\frac{\\theta+1}{2s}}}\\rfloor$ and $a_{n}=\\sqrt{{\\Delta_n}\/{K_n}}$. By Lemma \\ref{char0}, we can find $P_{\\xi_n}\\in\\mathcal{P}(\\Delta_n, \\theta)$ such that $dP\/dP_0=1+u_{n,\\xi_n}$, for appropriately chosen $C_{10}$. Following the same argument as in the previous case, we can again verify \\eqref{eq:min}.\n\\end{proof}\n\\vskip 25pt\n\n\\begin{proof}[Proof of Theorem \\ref{crtm3d}]\n\tWithout loss of generality, assume that $\\Delta_n(\\theta)= c_1({n}^{-1}{\\sqrt{\\log\\log n}})^{\\frac{4s}{4s+\\theta+1}}$ for some constant $c_1>0$ to be determined later. \n\n\\noindent{\\bf Type I Error.} We first prove the first statement which shows that the Type I error converges to $0$. Following the same notations as defined in Theorem \\ref{asympm3d}, let\n\t\\begin{align*}\n\tN_{n,2}={\\mathbb E} \\Big\\{\\sum\\limits_{j=2}^n{\\mathbb E} \\Big(\\tilde{\\zeta}_{nj}^2|\\mathcal{F}_{j-1}\\Big)-1\\Big\\}^2,\\quad L_{n,2}=\\sum\\limits_{j=2}^n{\\mathbb E} \\tilde{\\zeta}_{nj}^4\n\t\\end{align*}\nwhere $\\tilde{\\zeta}_{nj}={\\sqrt{2}\\zeta_{nj}}\/({n\\sqrt{v_n}})$. As shown by \\citet{haeusler1988rate},\n\t\\begin{align*}\n\t\\sup\\limits_{t}|P(T_{n,\\varrho_n}>t)-\\bar{\\Phi}(t)|\\leq C_{11}(L_{n,2}+N_{n,2})^{1\/5},\n\t\\end{align*}\n\twhere $\\bar{\\Phi}(t)$ is the survival function of the standard normal, \\textit{i.e.}, $\\bar{\\Phi}(t)=P(Z>t)$ where $Z\\sim N(0,1)$. Again by the argument from \\citet{hall1984central},\n\t\\begin{align*}\n\t{\\mathbb E} \\Big\\{\\sum\\limits_{j=2}^n{\\mathbb E} (\\zeta_{nj}^2|\\mathcal{F}_{j-1})-\\frac{1}{2}n(n-1)v_n\\Big\\}^2\\leq C_{12}[n^4{\\mathbb E} G_n^2(X,X')+n^3{\\mathbb E} \\tilde{K}_n^2(X,X')\\tilde{K}_n^2(X,X^{''})],\n\t\\end{align*}\nwhere $G_n(\\cdot,\\cdot)$ is defined in the proof of Theorem \\ref{asympm3d}, and \n\t\\begin{align*}\n\t\\sum\\limits_{j=2}^n{\\mathbb E} \\zeta_{nj}^4\\leq C_{13}[n^2{\\mathbb E} \\tilde{K}_n^4(X,X')+n^3{\\mathbb E} \\tilde{K}_n^2(X,X')\\tilde{K}_n^2(X,X^{''})],\n\t\\end{align*}\n\twhich ensure\n\t\\begin{align*}\n\tN_{n,2}=&\\frac{4{\\mathbb E} \\Big\\{\\sum\\limits_{j=2}^n{\\mathbb E} (\\zeta_{nj}^2|\\mathcal{F}_{j-1})-\\frac{1}{2}n(n-1)v_n-\\frac{1}{2}nv_n\\Big\\}^2}{n^4v_n^2}\\\\\\leq &8\\max\\left\\{C_{12},\\frac{1}{4}\\right\\}\\Bigg\\{\\frac{{\\mathbb E} G_n^2(X,X')}{v_n^2}+\\frac{{\\mathbb E} \\tilde{K}_n^2(X,X')\\tilde{K}_n^2(X,X^{''})}{nv_n^2}+\\frac{1}{n^2}\\Bigg\\},\n\t\\end{align*}\n\tand\n\t\\begin{align*}\n\tL_{n,2}=\\frac{4\\sum\\limits_{j=2}^n{\\mathbb E} \\tilde{\\zeta}_{nj}^4}{n^4v_n^2}\\leq 4C_{13}\\Bigg\\{\\frac{{\\mathbb E} \\tilde{K}_n^4(X,X')}{n^2v_n^2}+\\frac{{\\mathbb E} \\tilde{K}_n^2(X,X')\\tilde{K}_n^2(X,X^{''})}{nv_n^2}\\Bigg\\}.\n\t\\end{align*}\n\t\n\tAs shown in the proof of Theorem \\ref{asympm3d},\n\t\\begin{align*}\n\t\\frac{{\\mathbb E} G_n^2(X,X')}{v_n^2}\\leq C_3\\varrho_n^{1\/s},\\quad \\frac{{\\mathbb E} \\tilde{K}_n^4(X,X')}{n^2v_n^2}\\leq C_4n^{-2}\\varrho_n^{-1\/s},\\quad {\\rm and}\\quad \\frac{{\\mathbb E} \\tilde{K}_n^2(X,X')\\tilde{K}_n^2(X,X^{''})}{nv_n^2}\\leq C_3n^{-1}.\n\t\\end{align*}\n\tTherefore,\n\t\\begin{align*}\n\t\\sup\\limits_{t}|P(T_{n,\\varrho_n}>t)-\\bar{\\Phi}(t)|\\leq C_{14}(\\varrho_n^{\\frac{1}{5s}}+n^{-\\frac{1}{5}}+n^{-\\frac{2}{5}}\\varrho_n^{-\\frac{1}{5s}}),\n\t\\end{align*}\nwhich implies that\n\t\\begin{align*}\n\tP\\left(\\sup\\limits_{\\varrho_n\\in\\Lambda_n}T_{n,\\varrho_n}>t\\right)\\leq m_*\\bar{\\Phi}(t)+C_{15}(2^{m_*\\over5s}\\varrho_*^{1\\over 5s}+m_*n^{-\\frac{1}{5}}+n^{-\\frac{2}{5}}\\varrho_*^{-\\frac{1}{5s}}),\\qquad \\forall t.\n\t\\end{align*}\n\tIt is not hard to see, by the definitions of $m_*$,\n$$2^{m_*}\\varrho_*\\leq 2\\left(\\frac{\\sqrt{\\log\\log n}}{n}\\right)^{\\frac{2s}{4s+1}}$$\nand\n\t\\begin{align*}\n\tm_*=&(\\log 2)^{-1}\\{2s\\log n-\\frac{2s}{4s+1}\\log n+o(\\log n)\\}\\\\=&(\\log 2)^{-1}\\frac{8s^2}{4s+1}\\log n+o(\\log n)\\asymp \\log n.\n\t\\end{align*}\nTogether with the fact that $\\bar{\\Phi}(t)\\leq {1\\over 2} e^{-{t^2}\/{2}}$ for $t\\geq 0$, we get\n\t\\begin{align*}\n\t&P\\left(\\sup\\limits_{0\\leq k\\leq m_*}T_{n,2^k\\varrho_*}>\\sqrt{3\\log\\log n}\\right)\\\\\\leq &C_{16}\\left[e^{-\\frac{3}{2}\\log\\log n}\\log n+\\left(\\frac{\\sqrt{\\log n}}{n}\\right)^{\\frac{2}{5(4s+1)}}+n^{-\\frac{1}{5}}\\log\\log n+n^{-\\frac{2}{5}}\\left(\\frac{\\sqrt{\\log \\log n}}{n}\\right)^{-\\frac{2}{5}}\\right]\\rightarrow 0,\n\t\\end{align*}\n\tas $n\\rightarrow \\infty$.\n\t\n\\paragraph{Type II Error.} Next consider Type II error. To this end, write $\\varrho_n(\\theta)=({\\sqrt{\\log\\log n}\\over n})^{2s(\\theta+1)\\over 4s+\\theta+1}$. Let\n$$\\tilde{\\varrho}_ n(\\theta)=\\sup\\limits_{0\\leq k\\leq m_*}\\{2^{k}\\varrho_\\ast: \\varrho_n\\leq\\varrho_n(\\theta)\\}.$$\nIt is clear that $\\tilde{T}_n\\ge T_{n,\\tilde{\\varrho}_n(\\theta)}$ for any $\\theta\\ge 0$. It therefore suffices to show that for any $\\theta\\ge 0$,\n$$\n\\lim_{n\\to\\infty}\\inf\\limits_{\\theta\\geq 0}\\inf_{P\\in\\mathcal{P}(\\Delta_n,\\theta)}P\\left\\{T_{n,\\tilde{\\varrho}_n(\\theta)}\\geq \\sqrt{3\\log\\log n}\\right\\}=1.\n$$\nBy Markov inequality, this can accomplished by verifying\n\t\\begin{align}\n\t\\inf\\limits_{\\theta\\in[0,\\infty)}\\inf\\limits_{P\\in\\mathcal{P}(\\Delta_n(\\theta),\\theta)}{\\mathbb E} _PT_{n,\\tilde{\\varrho}_n(\\theta)}\\geq \\tilde{M}\\sqrt{\\log\\log n}\\label{mean}\n\t\\end{align}\n\tfor some $\\tilde{M}>\\sqrt{3}$; and\n\t\\begin{align}\n\t\\lim\\limits_{n\\rightarrow\\infty}\\sup\\limits_{\\theta\\ge 0}\\sup\\limits_{P\\in\\mathcal{P}(\\Delta_n(\\theta),\\theta)}\\frac{\\mathrm{Var}\\left(T_{n,\\tilde{\\varrho}_n(\\theta)}\\right)}{\\left({\\mathbb E} _PT_{n,\\tilde{\\varrho}_n(\\theta)}\\right)^2}=0\\label{mv}.\n\t\\end{align}\n\nWe now show that both (\\ref{mean}) and (\\ref{mv}) hold with $$\\Delta_n(\\theta)=c_1\\left({\\sqrt{\\log\\log n}\\over n}\\right)^{\\frac{4s}{4s+\\theta+1}}$$ for a sufficiently large $c_1=c_1(M,\\tilde{M})$.\n\nNote that $\\forall$ $\\theta\\in[0,\\infty)$, \n\t\\begin{align}\n\t\\frac{1}{2}\\varrho_n(\\theta)\\leq\\tilde{\\varrho_n}(\\theta)\\leq \\varrho_n(\\theta),\\label{lub}\n\t\\end{align},\n\twhich immediately suggests \n\t\\begin{align}\n\t\\eta_{\\tilde{\\varrho}_n(\\theta)}^2(P,P_0)\\geq\\eta_{\\varrho_n(\\theta)}^2(P,P_0).\\label{ineq}\n\t\\end{align}\n\t\nFollowing the arguments in the proof of Theorem \\ref{crm3d},\n$${\\mathbb E} _PT_{n,\\tilde{\\varrho}_n(\\theta)}\\geq C_{17}n[\\tilde{\\varrho}_n(\\theta)]^{1\/(2s)}\\eta_{\\tilde{\\varrho}_n(\\theta)}^2(P,P_0)\\geq 2^{-1\/(2s)}C_{17}n[\\varrho_n(\\theta)]^{1\/2s}\\eta_{\\varrho_n(\\theta)}^2(P,P_0),$$ and $\\forall\\ P\\in\\mathcal P(\\Delta_n(\\theta),\\theta)$, \n\\begin{align}\n\\eta_{\\varrho_n(\\theta)}^2(P,P_0)\\geq {1\\over 4}\\|u\\|_{L_2(P_0)}^2\\label{ineq2}\n\\end{align}\nprovided that $\\Delta_n(\\theta)\\geq C'(M)\\left({\\sqrt{\\log\\log n}\\over n}\\right)^{\\frac{4s}{4s+\\theta+1}}$.\n\nTherefore,\n$$\\inf\\limits_{P\\in\\mathcal P(\\Delta_n(\\theta),\\theta)}{\\mathbb E}_PT_{n,\\tilde{\\varrho}_n(\\theta)}\\geq C_{18}n[\\varrho_n(\\theta)]^{1\/(2s)}\\Delta_n(\\theta)\\geq C_{18}c_1\\sqrt{\\log\\log n}\\geq \\tilde{M}\\sqrt{\\log\\log n}$$\nif $c_1\\geq C_{18}^{-1}\\tilde{M}$. Hence to ensure (\\ref{mean}) holds, it suffices to take\n$$c_1=\\max\\{C'(M),C_{18}^{-1}\\tilde{M}\\}.$$\n\n\\begin{comment}\n\tWe shall write \n\t$$\\tilde{\\chi}_{\\varrho_n}^2(P,P_0):=\\tilde{\\chi}_2^2(P,P_0)=\\sum_{k\\geq 1}\\frac{\\lambda_k}{\\lambda_k+\\varrho_n^2}[{\\mathbb E} _P\\varphi_k(X)]^2$$\n\tto signify its dependence on $\\varrho_n$. It is clear that\n\t\\begin{align*}\n\t\\tilde{\\chi}_{\\tilde{\\varrho}_n(\\theta)}^2(P,P_0)\\geq\\tilde{\\chi}_{\\varrho_n(\\theta)}^2(P,P_0)\n\t\\end{align*}\n\t\n\tAs shown in Theorem \\ref{crm3d}, for any $\\varrho_n$,\n\t\\begin{align*}\n\t{\\mathbb E} _PT_{n,\\varrho_n}\\geq Cn\\varrho_n^{\\frac{1}{2s}}\\tilde{\\chi}_{\\varrho_n}^2(P,P_0)\n\t\\end{align*}\n\tand $\\forall$ $P\\in\\mathcal{P}(\\Delta_n(\\theta),\\theta,M)$,\n\t\\begin{align*}\n\t\\tilde{\\chi}_{\\varrho_n(\\theta)}^2(P,P_0)\\geq C\\|u\\|_{L_2(P_0)}^2\n\t\\end{align*}\n\twhere $u={{d}P}\/{{d}P_0}-1$. Therefore, by (\\ref{lub}),\n\t\\begin{align*}\n\t{\\mathbb E} _PT_{n,\\tilde{\\varrho}_n(\\theta)}\\geq &Cn[\\tilde{\\varrho}_n(\\theta)]^{\\frac{1}{2s}}\\tilde{\\chi}_{\\tilde{\\varrho}_n(\\theta)}^2(P,P_0)\\\\\\geq &Cn[\\varrho_n(\\theta)]^{\\frac{1}{2s}}\\tilde{\\chi}_{\\varrho_n(\\theta)}^2(P,P_0)\\\\\n\t\\geq& Cn[\\varrho_n(\\theta)]^{\\frac{1}{2s}}\\|u\\|_{L_2(P_0)}^2\\\\\n\t\\geq& Cn[\\varrho_n(\\theta)]^{\\frac{1}{2s}}\\Delta_n(\\theta),\n\t\\end{align*}\n\twhich immediately implies that (\\ref{mean}) holds for sufficiently large $n$.\n\\end{comment}\t\n\tWith (\\ref{lub}), (\\ref{ineq}) and (\\ref{ineq2}), the results in Theorem 3 imply that for sufficiently large $n$\n\t\\begin{align*}\n\t\\sup\\limits_{P\\in\\mathcal{P}(\\Delta_n^*(\\theta),\\theta,M)}\\frac{\\mathrm{Var}\\left(T_{n,\\tilde{\\varrho}_n(\\theta)}\\right)}{\\left({\\mathbb E} _PT_{n,\\tilde{\\varrho}_n(\\theta)}\\right)^2}\\leq& C_{19}\\Big\\{\\left([\\varrho_n(\\theta)]^{\\frac{1}{2s}}n\\Delta_n^*(\\theta)\\right)^{-2}+\\left([\\varrho_n(\\theta)]^{\\frac{1}{s}}n^2\\Delta_n^*(\\theta)\\right)^{-1}\\\\&+(n\\Delta_n^*(\\theta))^{-1}+\\left([\\varrho_n(\\theta)]^{\\frac{1}{2s}}n\\sqrt{\\Delta_n^*(\\theta)}\\right)^{-1}\\Big\\}\\\\\n\t\\leq&2C_{19}\\left([\\varrho_n(\\theta)]^{\\frac{1}{2s}}n\\Delta_n^*(\\theta)\\right)^{-1}= 2C_{19}(c_1\\log\\log n)^{-\\frac{1}{2}}\\rightarrow \\infty,\n\t\\end{align*}\n\twhich shows (\\ref{mv}).\n\\end{proof}\n\\vskip 25pt\n\n\\begin{proof}[Proof of Theorem \\ref{cra}]\nThe main idea of the proof is similar to that for Theorem \\ref{cr}. To this end, assume, without loss of generality, that\n$$\\Delta_n(\\theta)=c_2\\left(\\frac{n}{\\sqrt{\\log\\log n}}\\right)^{-\\frac{4s}{4s+\\theta+1}},\\qquad \\forall\\theta\\in[\\theta_1,\\theta_2],$$ \nwhere $c_2>0$ is a sufficiently small constant to be determined later.\n\n\t\n\tLet $r_n=\\lfloor C_{20}\\log n\\rfloor$ and $K_{n,1}=\\lfloor{C_{21}\\Delta_n^{-\\frac{\\theta_1+1}{2s}}(\\theta_1)}\\rfloor$for sufficiently small $C_{20},C_{21}>0$. Set $\\theta_{n,1}=\\theta_1$. For $2\\leq r\\leq r_n$, let\n\t$$\n\tK_{n,r}=2^{r-2}K_{n,1}\n\t$$\nand $\\theta_{n,r}$ is selected such that the following equation holds.\n\t\\begin{align*}\n\tK_{n,r}=\\left\\lfloor C_{21}[\\Delta_n(\\theta_{n,r})]^{-\\frac{\\theta_{n,r}+1}{2s}}\\right\\rfloor.\n\t\\end{align*}\n\tNote that by choosing $C_{20}$ sufficiently small,\n\t\\begin{align*}\n\tK_{n,r_n}=2^{r_n-2}K_{n,1}\\leq &\\left\\lfloor c_2^{\\frac{2(\\theta_1+1)}{4s+\\theta+1}}\\left(\\frac{n}{\\sqrt{\\log\\log n}}\\right)^{\\frac{2(\\theta_1+1)}{4s+\\theta+1}}\\cdot 2^{r_n-2}\\right\\rfloor\\\\=&\\left\\lfloor c_2^{\\frac{2(\\theta_1+1)}{4s+\\theta+1}}\\exp\\left(\\log\\left(\\frac{n}{\\sqrt{\\log\\log n}}\\right)\\cdot\\frac{2(\\theta_1+1)}{4s+\\theta_1+1}+(r_n-2)\\log 2\\right)\\right\\rfloor\\\\\\leq &\\left\\lfloor C_{21}\\exp\\left(\\log\\left(\\frac{n}{\\sqrt{\\log\\log n}}\\right)\\cdot\\frac{2(\\theta_2+1)}{4s+\\theta_2+1}\\right)\\right\\rfloor=\\lfloor C_{21}[\\Delta_n(\\theta_{2})]^{-\\frac{\\theta_{2}+1}{2s}}\\rfloor\n\t\\end{align*}\n\tfor sufficiently large $n$. Thus, we can guarante that $\\forall$ $1\\leq r\\leq r_n$, $\\theta_{n,r_n}\\in[\\theta_1,\\theta_2]$.\n\t\nWe now construct a finite subset of $\\cup_{\\theta\\in [\\theta_1,\\theta_2]}\\mathcal{P}(\\Delta_n(\\theta),\\theta)$ as follows. For each $\\xi_{n,r}=(\\xi_{n,r,1},\\cdots,\\xi_{n,r,K_{n,r}})\\in\\{\\pm 1\\}^{K_{n,r}}$, let\n\\begin{align*}\nf_{n,r,\\xi_{n,r}}=1+\\sum\\limits_{k=K^*_{n,r-1}+1}^{K^*_{n,r}}a_{n,r}\\xi_{n,r,k}\\varphi_k,\n\\end{align*}\nwhere $K^*_{n,r}=K_{n,1}+\\cdots+K_{n,r}$, and $a_{n,r}=\\sqrt{\\Delta_n(\\theta_{n,r})\/K_{n,r}}$. Following the same argument as that in the proof of Theorem \\ref{cr}, we can verify that with a sufficiently small $C_{21}$, each $P_{n,r,\\xi_{n,r}}\\in \\mathcal{P}(\\Delta_n(\\theta_{n,r}),\\theta_{n,r})$, where $f_{n,r,\\xi_{n,r}}$ is the Radon-Nikodym derivative $dP_{n,r,\\xi_{n,r}}\/dP_0$. With slight abuse of notation, write\n\\begin{align*}\nf_n(X_1,X_2,\\cdots,X_n)={1\\over r_n}{\\sum\\limits_{r=1}^{r_n}f_{n,r}(X_1,X_2,\\cdots,X_n)},\n\\end{align*}\nwhere\n\\begin{align*}\nf_{n,r}(X_1,X_2,\\cdots,X_n)={1\\over 2^{K_{n,r}}}\\sum_{\\xi_{n,r}\\in \\{\\pm 1\\}^{K_{n,r}}}\\prod\\limits_{i=1}^n f_{n,r,\\xi_{n,r}}(X_i).\n\\end{align*}\nIt now suffices to show that\n$$\n\\|f_n\\|_{L_2(P_0)}:={\\mathbb E}_{P_0}f_n^2(X_1,X_2,\\cdots,X_n)\\to 1,\\qquad {\\rm as\\ }n\\to\\infty.\n$$\n\t\n\tNote that\n\t\\begin{align*}\n\\|f_n\\|^2_{L_2(P_0)}=&\\frac{1}{r_n^2}\\sum\\limits_{1\\leq r,r'\\leq r_n}\\langle f_{n,r},f_{n,r'}\\rangle _{L_2(P_0)}\\\\\n\t=&\\frac{1}{r_n^2}\\sum\\limits_{1\\leq r\\leq r_n}\\|f_{n,r}\\|^2_{L_2(P_0)}+\\frac{1}{r_n^2}\\sum\\limits_{\\substack{1\\leq r,r'\\leq r_n\\\\r\\neq r'}}\\langle f_{n,r},f_{n,r'}\\rangle_{L_2(P_0)}.\n\t\\end{align*}\nIt is easy to verify that, for any $r\\neq r'$,\n\t\\begin{align*}\n\t\\langle f_{n,r},f_{n,r'}\\rangle_{L_2(P_0)}=1.\n\t\\end{align*}\nIt therefore suffices to show that\n\\begin{align*}\n\\sum\\limits_{1\\leq r\\leq r_n}\\|f_{n,r}\\|^2_{L_2(P_0)}=o(r_n).\n\t\\end{align*} \n\t\nFollowing the same derivation as that in the proof of Theorem \\ref{cr}, we can show that\n\t\\begin{align*}\n\t\\|f_{n,r}\\|_{L_2(P_0)}^2\\leq&\\left(\\frac{\\exp(na_{n,r}^2)+\\exp(-na_{n,r}^2)}{2}\\right)^{K_{n,r}}\\leq\\exp(K_{n,r}n^2a_{n,r}^4)\n\t\\end{align*}\n\tfor sufficiently large $n$. By setting $c_2$ in the expression of $\\Delta_n(\\theta)$ sufficiently small, we have\n\t\\begin{align*}\n\tK_{n,r}n^2a_{n,r}^4\\leq \\frac{1}{2}\\log r_n\n\t\\end{align*} \n which ensures that\n\t\\begin{align*}\n\t\\|f_{n,r}\\|_{L_2(P_0)}^2\\leq r_n^{1\/2}=o(r_n).\n\t\\end{align*}\n\\end{proof}\n\n\\bibliographystyle{myplainnat}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\n\nDuring the past 20 years a number of methods has been devised for\nstate selective preparation and manipulation of discrete-level\nquantum systems\n\\cite{paramonov1983,chelkowski1990,kaluza1993,bergmann1998,rabitz2003}.\nHowever, simple population oscillations, induced by a resonant\ndriving pulse have received negligible attention as a prospective\npopulation manipulation method. This might be attributed to two\nreasons. The first is that Rabi theory is based on the rotating\nwave approximation (RWA), and all attempts to generalize it\nwithout RWA (e.g. \\cite{shariar2002.1,barata2000,fujii2003}) are\nmathematically very involved. The second is that no attempt has\nbeen made to analytically generalize the original Rabi theory\nbeyond the two-level systems.\n\nIn this paper an analytic extension of Rabi theory to transitions\nin many-level systems is presented. The aim is to 'design' a\ndriving pulse of the form:\n\\begin{equation}\n F(t)= F_{\\rm 0} \\; m(t) \\; \\cos{(\\omega(t) \\; t)}\n\\label{pulse}\n\\end{equation}\nby establishing analytical optimization relations between its\nparameters: maximum pulse amplitude $F_{0}$, pulse envelope shape\n$m(t)$, and time dependent carrier frequency $\\omega(t)$. The goal\nof this enterprize is twofold: the first is to achieve as complete\nas possible transfer of population between two selected states of\nthe system; the second is to make this transfer as rapid as\npossible. These two requirements, however, are conflicting:\npopulation transfer can be accelerated by using a more intense\ndrive, but at the same time a stronger drive increases involvement\nof remaining system levels in population dynamics hence\ndeteriorating population transfer between a selected pair of\nlevels.\n\nIn the previous paper on this topic \\cite{bonacci2003.2} it was\nshown how, for a pulse of arbitrary shape and duration, the drive\nfrequency can be analytically optimized to maximize the amplitude\nof the population oscillations between the selected two levels in\na general many level quantum system. It was shown how the standard\nRabi theory can be extended beyond the simple two-level systems.\nNow, in order to achieve the quickest and as complete as possible\npopulation transfer between two pre-selected levels, driving pulse\nshould be tailored so that it produces only a single\nhalf-oscillation of the population. In this paper, this second\n(and final) step towards the controlled population transfer using\nmodified (i.e. many level system) Rabi oscillations is discussed.\nThe results presented herein can be regarded as an extension of\nthe standard $\\pi$-pulse theory (see e.g. \\cite{holthaus1994}) -\nalso strictly valid only in the two level systems - to the\ncoherently driven population oscillations in general many level\nsystems.\n\n\\section{Theoretical analysis}\n\nAll the calculations in this section are done in a system of units\nin which $\\hbar=1$.\n\n\\subsection{Calculation setup}\nA quantum system with N discrete stationary levels with energies\n$E_i \\ (i=1,...,N)$ is considered. The system is driven by a time\ndependent perturbation given in Eq. (\\ref{pulse}). In the\ninteraction picture, the dynamics of the system obeys the\nSchroedinger equation:\n\\begin{equation}\n \\frac{d}{dt}\\mathbf{a}(t)=-i \\oper{V}(t) \\mathbf{a}(t) ,\n\\label{schrodinger}\n\\end{equation}\nwhere $\\mathbf{a}(t)$ is a vector of time-dependent expansion\ncoefficients $a_1(t),..., a_N(t)$. The N$\\times$N Matrix\n$\\oper{V}(t)$ describes interaction between the system and\nperturbation. Explicitly, its elements are given by:\n\\begin{equation}\n V_{ij}(t) \\equiv \\frac{F_0 \\mu_{ij}}{2} m(t)(e^{i s_{ij}\n (\\omega(t)-\\omega_{ij}) t}+e^{-i s_{ij} (\\omega(t)+\\omega_{ij}) \\; t}).\n\\end{equation}\n$\\mu_{ij}$ is transition moment between the i-th and the j-th\nlevels induced by the perturbation. $s_{ij} \\equiv sign(E_i-E_j)$\nand $\\omega_{ij} \\equiv |E_i-E_j|$ are respectively the sign and\nthe magnitude of the resonant frequency for the transition between\nthe i-th and the j-th level.\n\nThe aim is to induce population transfer between two arbitrarily\nselected levels, designated by $\\alpha$ and $\\beta$, directly\ncoupled by the perturbation (i.e. such that $\\mu_{\\alpha \\beta}\\ne\n0$). To simplify equations, the time variable t is re-scaled to\n$\\tau$, with transformation between the two given by:\n\\begin{equation}\n d\\tau \\equiv \\frac{F_0 \\mu_{\\alpha \\beta}}{2} m(t) dt .\n\\label{definition tau}\n\\end{equation}\nThen with following substitutions:\n\\begin{eqnarray}\n f_{ij}(\\tau)&\\equiv&s_{ij} \\frac{2}{F_0 \\mu_{\\alpha \\beta}} (\\omega(t)-\\omega_{ij}) \\label{definition f} \\\\\n g_{ij}(\\tau)&\\equiv&s_{ij} \\frac{2}{F_0 \\mu_{\\alpha \\beta}} (\\omega(t)+\\omega_{ij}) \\label{definition g} \\\\\n x(\\tau)&\\equiv& \\frac{F_0 \\mu_{\\alpha \\beta}}{2} t(\\tau) \\label{definition x} \\\\\n R_{ij} &\\equiv& \\frac{\\mu_{ij}} {\\mu_{\\alpha \\beta}} \\label{definition R}\n\\end{eqnarray}\nEq. (\\ref{schrodinger}) transforms into:\n\\begin{equation}\n \\frac{d}{d \\tau}\\mathbf{a}(\\tau)=-i \\oper{W}(\\tau)\\mathbf{a}(\\tau),\n\\label{n level}\n\\end{equation}\nwhere:\n\\begin{equation}\n W_{ij}(\\tau) \\equiv R_{ij}(e^{i f_{ij}(\\tau) x(\\tau)}+e^{-i g_{ij}(\\tau)x(\\tau)}).\n\\label{wovi}\n\\end{equation}\n\nInitial conditions for the problem of selective population\ntransfer comprise complete population initially (at $t=\\tau=0$)\ncontained in only one of the selected levels, either $\\alpha$ or\n$\\beta$. The other selected level, as well as all the remaining\nN-2 'perturbing' levels of the system are unpopulated at this\ntime.\n\nPopulation evolution $\\Pi_i(t)$ of the i-th level is determined\nfrom $\\Pi_i(t)=|a_i(t)|^2$.\n\\subsection{Rabi-like population transfer in a three level system}\n\nIt was demonstrated in the previous paper on this topic\n\\cite{bonacci2003.2} that the analytical extension of the Rabi\noscillations theory beyond two-level systems is anchored in the\nanalysis of the simplest of the 'many-level' systems - a three\nlevel one. Hence, in this section the impact of the single\nadditional level on the population transfer period is discussed:\nbeyond the 'selected' levels $\\alpha$ and $\\beta$, the system now\ncontains one additional 'perturbing' level, designated with index\n\\textit{p}. The only requirements on the system internal structure\nare that $\\mu_{\\alpha \\beta}, \\mu_{\\beta p} \\ne 0$ and\n$\\mu_{\\alpha p}=0$. While the first two requirements are\nnecessary, the last one does not reduce the generality of the\nfinal results to any significant extent and is introduced for\ncalculational convenience exclusively.\n\nFor the observed three-level system, the dynamical equation\n(\\ref{n level}) reduces to:\n\n\\begin{eqnarray}\n\\label{3 level}\n \\frac{d}{d \\tau}\n \\begin{bmatrix}\n a_\\alpha(\\tau) \\\\\n a_\\beta(\\tau) \\\\\n a_p(\\tau) \\\\\n \\end{bmatrix}\n &=& \\\\\n -&i&\n \\begin{bmatrix}\n 0 & e^{i f_{\\alpha \\beta}(\\tau) x(\\tau)} + e^{-i g_{\\alpha \\beta}(\\tau) x(\\tau)} & 0 \\\\\n e^{-i f_{\\alpha \\beta}(\\tau) x(\\tau)} + e^{i g_{\\alpha \\beta}(\\tau) x(\\tau)} & 0\n & R_{\\beta p}(e^{-i f_{\\beta p}(\\tau) x(\\tau)} + e^{i g_{\\beta p}(\\tau) x(\\tau)}) \\\\\n 0 & R_{\\beta p}(e^{i f_{\\beta p}(\\tau) x(\\tau)} + e^{-i g_{\\beta p}(\\tau) x(\\tau)}) & 0 \\\\\n \\end{bmatrix}\n \\begin{bmatrix}\n a_\\alpha(\\tau) \\\\\n a_\\beta (\\tau) \\\\\n a_p(\\tau) \\\\\n \\end{bmatrix} \\nonumber\n\\end{eqnarray}\n\n\\subsubsection{Recapitulation: minimizing the impact of the perturbing level}\n\nAs it was shown in \\cite{bonacci2003.2}, Eq. (\\ref{3 level}), when\nthe driving frequency is near the resonant value for the\ntransition $\\alpha \\leftrightarrow \\beta$, the following\nexpression can be obtained for the population dynamics of level\n$\\textit{p}$:\n\n\\begin{equation}\n\\label{apert}\n a_p(\\tau) \\approx - a_{\\beta} (\\tau)\\Big( \\sigma_{\\beta p}\n \\frac{ m(t(\\tau)) }{1-\\Delta_{\\beta p}(\\tau)} \\Big) \\; e^{ i f_{\\beta\n p}(\\tau) x(\\tau)}\n\\end{equation}\n\nwhere\n\n\\begin{eqnarray}\n\\label{delta i Delta}\n \\sigma_{\\beta p} \\equiv \\frac{ F_0 \\mu_{\\beta p}}{2(\\omega_{\\alpha \\beta} - \\omega_{\\beta p})} \\, \\nonumber \\\\\n \\Delta_{\\beta p}(\\tau) \\equiv \\frac {\\omega(\\tau)- \\omega_{\\alpha \\beta}} {\\omega_{\\beta p} - \\omega_{\\alpha \\beta}} \\ .\n\\end{eqnarray}\n\nPut in words, with the conditions mentioned, the dynamics of the\nlevel \\textit{p} parametrically depends on the dynamics of the\nlevel $\\beta$ to which it is coupled. The relation between the\namplitudes of the population oscillations for levels \\textit{p}\nand $\\beta$ follows directly from the above expression:\n\n\\begin{eqnarray}\n\\label{beta and p}\n \\Pi_{p} &\\approx& \\epsilon_{\\beta p}(\\tau) \\Pi_{\\beta}(\\tau)\n\\end{eqnarray}\n\nwhere:\n\n\\begin{equation}\n\\epsilon_{\\beta p}(\\tau) \\equiv \\Big(\\sigma_{\\beta p}\n \\frac{m(t(\\tau))}{1-\\Delta_{\\beta p}(\\tau)}\\Big) ^2 \\ .\n\\end{equation}\n\n\nNote that, as $\\Delta_{\\beta p}(\\tau)$ is generally very small and\n$|m(\\tau)|\\leq1$, that parameter $\\sigma_{\\beta p}$ actually\ndetermines the effective strength of applied perturbation: if\n$\\sigma_{\\beta p}^2<<1$, then dynamical impact of level p is\nnegligible and perturbation may be considered weak; if\n$\\sigma_{\\beta p}^2\\sim 1$, perturbation is very strong.\n\nFurther, the requirement of the minimization of the dynamical\nimpact of the perturbing level $\\textit{p}$ on the transition\n$\\alpha \\leftrightarrow \\beta$ leads to the following equation for\nthe optimized dynamics of the ($\\alpha$,$\\beta$) subsystem:\n\n\\begin{equation}\n \\label{beta dynamics}\n \\frac {d }{d \\tau}\n \\begin{bmatrix}\n b_\\alpha(\\tau) \\cr\n b_\\beta(\\tau)\n \\end{bmatrix}\n = - i\n \\begin{bmatrix}\n 0 & 1 \\cr\n 1 & 0 \\cr\n \\end{bmatrix}\n \\begin{bmatrix}\n b_\\alpha(\\tau) \\cr\n b_\\beta(\\tau)\n \\end{bmatrix}\n\\end{equation}\n\nwhere the two-level state vector $\\big(\nb_\\alpha(\\tau),b_\\beta(\\tau)\\big)$ is merely the unitary\ntransformed vector of the subsystem ($\\alpha$,$\\beta$):\n\n\\begin{equation}\n\\label{transformation}\n \\begin{bmatrix}\n b_\\alpha(\\tau) \\\\\n b_\\beta(\\tau) \\\\\n \\end{bmatrix}\n = e^{-i \\oper{\\Lambda} (\\tau)}\n \\begin{bmatrix}\n a_\\alpha(\\tau) \\\\\n a_\\beta(\\tau) \\\\\n \\end{bmatrix}\n\\end{equation}\n\nNote that the precise form of the real transformation matrix\n$\\hat{\\mathbf{\\Lambda}}(\\tau)$ is irrelevant here as it has no\nimpact on the population dynamics.\n\nThe optimization procedure produces the analytic expression for\nthe chirp of the driving frequency, which in the lowest order of\napproximation (suitable for all but the most intensive\nperturbations) amounts:\n\n\\begin{equation}\n\\label{chirp}\n \\omega(t)=\n \\omega_{\\alpha \\beta} +\n (s_{\\beta \\alpha} s_{\\beta p})( \\omega_{\\beta p}- \\omega_{\\alpha\n \\beta})\\frac{2 \\omega_{\\beta p} }{ \\omega_{\\alpha \\beta} +\\omega_{\\beta p}}\n \\sigma_{\\beta p}^2 \\frac{1}{t} \\int_0^t \\big( m(t') \\big) ^2 dt'\n\\end{equation}\n\nand from the Eq (\\ref{beta dynamics}) it is found that the time\n$\\Theta$ required for a single population transfer between levels\n$\\alpha$ and $\\beta$, determined from the fundamental relation of\nthe $\\pi$-pulse theory:\n\n\\begin{equation}\n\\label{pi pulse theory}\n \\int_0^\\Theta d\\tau = \\frac{\\pi}{2}\n\\end{equation}\n\nequals (in units of $\\tau$):\n\\begin{equation}\n\\label{period pi}\n \\Theta=\\frac{\\pi}{2}\n\\end{equation}\n\nAs was shown in \\cite{bonacci2003.2}, the 'exact' numerical\nsolution to the Eq. (\\ref{3 level}) indeed maximizes the\npopulation oscillations in the $\\alpha-\\beta$ subsystem. However,\nas will be discussed below, the predicted value for the period of\nthe population oscillations (Eq. (\\ref{period pi})) is somewhat\nsmaller than the correct one, with the discrepancy increasing with\nthe increasing population leak to the level \\textit{p}. In the\nfollowing section this issue is resolved and the corrected\nanalytical expression for determination of the population transfer\n(or oscillation) period is obtained.\n\n\\subsubsection{Patching the population conservation of the total system}\n\nTo start the following discussion, notice that the optimized\nsolution for the population transfer between levels $\\alpha$ and\n$\\beta$ (described by the Eq. (\\ref{beta dynamics})) is\nunfortunately too good to be true. Namely, its serious drawback\nlays in the fact that the leak of the population from the\n($\\alpha$,$\\beta$) subsystem into the perturbing level \\textit{p}\ngoes by completely unnoticed!\n\nFormally, the root of the problem hides in the fact that the\nmathematical trick which enabled decoupling of the level\n\\textit{p} dynamics from the rest of the system (i.e. the step\nbetween Eq.(18) and Eq.(19) in \\cite{bonacci2003.2}) destroys the\nunitarity of the full dynamical equation for the three level\nsystem, Eq.(\\ref{3 level}). The consequence is that the dynamical\nequation for the $\\alpha-\\beta$ subsystem, Eq.(\\ref{beta\ndynamics}) itself claims to be unitary, keeping the population of\nthat subsystem fully conserved. This is clearly impossible, as\nlevel \\textit{p} does indeed capture some population - the exact\namount given by Eq.(\\ref{beta and p}).\n\nThis malfunction caused by the decoupling procedure unfortunately\ncannot be remedied within the decoupling procedure itself - the\npatch has to be provided by an independent approach. To do this,\nthe following argument is used: since it is the equation for the\ndynamics of level $\\beta$ that changes due to the decoupling\nprocedure and consequently causes the breakdown of the population\nconservation, it is only the dynamical equation for the level\n$\\beta$ that has to be modified; then, as the dynamics of the\nlevel $\\beta$ is governed by the elements in the lower row of the\ndynamical matrix in Eq.(\\ref{beta dynamics}), a particular ansatz\nintervention precisely into these elements might help rectify the\noverall population dynamics of the whole three level system.\nHence, the correction is sought in the following form:\n\n\\begin{equation}\n \\label{two level corrected}\n \\frac{d}{d\\tau}\n \\begin{bmatrix}\n b_{\\alpha}(\\tau) \\\\\n b_{\\beta}(\\tau) \\\\\n \\end{bmatrix}\n = - i\n \\begin{bmatrix}\n 0 & 1 \\\\\n \\zeta(\\tau) & i \\xi(\\tau) \\\\\n \\end{bmatrix}\n \\begin{bmatrix}\n b_{\\alpha}(\\tau) \\\\\n b_{\\beta}(\\tau) \\\\\n \\end{bmatrix}\n\\end{equation}\n\nwhere $\\zeta[\\tau]$ and $\\xi[\\tau]$ are real non-negative\nfunctions. Such an ansatz does not interfere with the\nphase-fitting effect of the driving frequency optimization and Eq.\n(\\ref{chirp}) - forged by the decoupling procedure - which\nmaximizes the population oscillations in the $\\alpha-\\beta$\nsubsystem, is left unharmed. Instead, it merely enables\nphase-independent modification of the \\textbf{amplitudes} of\n$\\alpha$ and $\\beta$ populations.\n\nExpressing requirement of population conservation in the total\nthree-level system as:\n\n\\begin{equation}\nd|b_{\\alpha}(\\tau)|^2+d|b_{\\beta}(\\tau)|^2+d|b_{p}(\\tau)|^2=0 \\ ,\n\\end{equation}\n\nsplitting the phase and amplitude contributions of the three wave\nfunction projections on the three stationary states:\n\n\\begin{eqnarray}\n b_{\\alpha}(\\tau) &\\equiv& B_{\\alpha}(\\tau) e^{i \\phi_{\\alpha}(\\tau)}\\ , \\nonumber \\\\\n b_{\\beta}(\\tau) &\\equiv& B_{\\beta}(\\tau) e^{i \\phi_{\\beta}(\\tau)}\\ , \\\\\n b_{p}(\\tau) &\\equiv& B_{p}(\\tau) e^{i \\phi_{p}(\\tau)} \\ \\nonumber ,\n\\end{eqnarray}\n\nand using the known relation between the populations of levels\n$\\beta$ and \\textit{p}, Eq.(\\ref{beta and p}), the following\nresult is obtained:\n\n\\begin{equation}\n\\label{cons condition}\n B_{\\alpha}(\\tau)\\; dB_{\\alpha} + (1+\\epsilon_{\\beta p}(\\tau))\n B_{\\beta}(\\tau)\\; dB_{\\beta} + \\frac{1}{2} B_{\\beta}(\\tau)^2 \\; d\\epsilon_{\\beta p} =\n 0\\ .\n\\end{equation}\n\nNow the corrected equation for the $\\alpha-\\beta$ subsystem,\nEq.(\\ref{two level corrected}), can be used to eliminate\n$dB_{\\alpha}$ and $dB_{\\beta}$ and introduce $\\zeta[\\tau]$ and\n$\\xi[\\tau]$ in their stead:\n\n\\begin{eqnarray}\n\\label{eqn condition}\n dB_{\\alpha}&=& -i B_{\\beta} \\; Im \\big(\n e^{i(\\phi_{\\beta}(\\tau)-\\phi_{\\alpha}(\\tau))}\\big)\n \\; d{\\tau} \\ , \\nonumber \\\\\n dB_{\\beta}&=& -i \\Big(\\zeta(\\tau) \\;B_{\\alpha}(\\tau) \\; Im \\big( e^{-i(\\phi_{\\beta}(\\tau)-\\phi_{\\alpha}(\\tau))}\\big) + \\xi(\\tau) \\; B_{\\beta}(\\tau) Im \\big(e^{-i\\phi_{\\beta}(\\tau)}\\big) \\Big) \\;\n d{\\tau} \\ .\n\\end{eqnarray}\n\nFinally, taking together Eq.(\\ref{cons condition}) and\nEq.(\\ref{eqn condition}) it is found that:\n\n\\begin{equation}\n\\label{final condition}\n B_{\\alpha}(\\tau) \\Big(\\zeta(\\tau)-\\frac{1}{1+\\epsilon_{\\beta p}(\\tau)}\\Big)\n \\ sin \\big( \\phi_{\\beta}(\\tau)-\\phi_{\\alpha}(\\tau) \\big)\n+ B_{\\beta}(\\tau) \\Big( \\xi(\\tau) + \\frac{d }{d\\tau}\\ln\n\\big(1+\\epsilon_{\\beta p}(\\tau)\\big)^{\\frac{1}{2}} \\Big) sin \\big(\n\\phi_{\\beta}(\\tau) \\big)=0 .\n\\end{equation}\n\nSince for population oscillations $B_{\\beta}$ and $B_{\\alpha}$ are\n$180^o$ out of phase, this condition can be satisfied only if:\n\n\\begin{eqnarray}\n\\label{zeta xi}\n \\zeta(\\tau) &=& \\frac{1}{1+\\epsilon_{\\beta p}(\\tau)} \\nonumber \\ , \\\\\n \\xi(\\tau) &=& - \\frac{d }{d\\tau}\\ln\n\\big(1+\\epsilon_{\\beta p}(\\tau)\\big)^{\\frac{1}{2}} \\ .\n\\end{eqnarray}\n\n\\subsubsection{Population oscillation period modified}\n\nHence, the correct dynamical equation for the $\\alpha-\\beta$\nsubsystem which both maximizes the population oscillation\namplitudes of these two levels as well as properly conserves the\noverall population of the three-level ($\\alpha-\\beta-p$) system\nis:\n\n\\begin{equation}\n \\label{two level final}\n \\frac{d}{d\\tau}\n \\begin{bmatrix}\n b_{\\alpha}(\\tau) \\\\\n b_{\\beta}(\\tau) \\\\\n \\end{bmatrix}\n = - i\n \\begin{bmatrix}\n 0 & 1 \\\\\n \\frac{1}{1+\\epsilon_{\\beta p}(\\tau)} & - i \\frac{d }{d\\tau}\\ln\n\\big(1+\\epsilon_{\\beta p}(\\tau)\\big)^{\\frac{1}{2}} \\\\\n \\end{bmatrix}\n \\begin{bmatrix}\n b_{\\alpha}(\\tau) \\\\\n b_{\\beta}(\\tau) \\\\\n \\end{bmatrix} \\ .\n\\end{equation}\n\nA simple extension of this result to the general many-level system\n(in which level $\\alpha$ also has some perturbing levels - jointly\ndesignated by q - attached to it) yields the total corrected\ndynamical equation for such a system:\n\n\\begin{equation}\n \\label{two level final}\n \\frac{d}{d\\tau}\n \\begin{bmatrix}\n b_{\\alpha}(\\tau) \\\\\n b_{\\beta}(\\tau) \\\\\n \\end{bmatrix}\n = - i\n \\begin{bmatrix}\n - i \\frac{d }{d\\tau}\\ln \\big(1+\\epsilon_{\\alpha q}(\\tau)\\big)^{\\frac{1}{2}} & \\frac{1}{1+ \\epsilon_{\\alpha q}(\\tau)} \\\\\n \\frac{1}{1+\\epsilon_{\\beta p}(\\tau)} & - i \\frac{d }{d\\tau}\\ln\n\\big(1+\\epsilon_{\\beta p}(\\tau)\\big)^{\\frac{1}{2}} \\\\\n \\end{bmatrix}\n \\begin{bmatrix}\n b_{\\alpha}(\\tau) \\\\\n b_{\\beta}(\\tau) \\\\\n \\end{bmatrix} \\ .\n\\end{equation}\n\nNow to finalize the calculation of the corrected population\ntransfer period the following procedure is administered. First,\nthe time variable is transformed $\\tau \\rightarrow \\varphi$\naccording to:\n\n\\begin{equation}\n \\label{var transform}\n d\\tau = \\kappa(\\varphi) d\\varphi\n\\end{equation}\n\nThe goal of this variable transformation is to produce, in the new\ntime variable $\\varphi$, the closed dynamical equations for\n$b_\\alpha(\\varphi)$ and $b_\\beta(\\varphi)$ describing the dynamics\nwhich is as close as possible to the simple harmonic oscillation.\nSecond, and to that end, the transformation Eq.(\\ref{var\ntransform}) is introduced into Eq.(\\ref{two level final}), the\nresulting relation is differentiated with respect to $\\varphi$ and\nall but the lowest order terms in the small parameters\n$\\epsilon_{\\alpha q}(\\tau)$ and $\\epsilon_{\\beta p}(\\tau)$ are\nkept. Hence the following result is established:\n\n\\begin{eqnarray}\n \\label{many level time correction}\n \\frac{d^2 b_{\\alpha}(\\varphi)}{d\\varphi^2} +\n \\frac{1}{2} \\frac{d}{d\\varphi}\\Big(\\ln \\frac{\\big(1+\\epsilon_{\\alpha q}(\\varphi)\\big)^3\n \\big(1+\\epsilon_{\\beta p}(\\varphi)\\big)}{\\kappa^2} \\Big)\\;\\frac{d b_{\\alpha}(\\varphi)}{d\\varphi}\n +\\frac{\\kappa^2}{\\big(1+\\epsilon_{\\alpha q}(\\varphi)\\big)\n \\big(1+\\epsilon_{\\beta p}(\\varphi)\\big)}b_{\\alpha}(\\varphi)= 0\n \\nonumber\n \\\\\n \\frac{d^2 b_{\\beta}(\\varphi)}{d\\varphi^2} +\n \\frac{1}{2} \\frac{d}{d\\varphi}\\Big(\\ln \\frac{\\big(1+\\epsilon_{\\alpha q}(\\varphi)\\big)\n \\big(1+\\epsilon_{\\beta p}(\\varphi)\\big)^3}{\\kappa^2} \\Big)\\;\\frac{d b_{\\beta}(\\varphi)}{d\\varphi}\n +\\frac{\\kappa^2}{ \\big(1+\\epsilon_{\\alpha q}(\\varphi)\\big)\n \\big(1+\\epsilon_{\\beta p}(\\varphi)\\big)}b_{\\beta}(\\varphi)= 0\n\\end{eqnarray}\n\nIn the third and final step, the appropriate value of the free\nparameter $\\kappa(\\varphi)$ is selected:\n\n\\begin{equation}\n \\kappa(\\varphi)^2 \\equiv \\big(1+\\epsilon_{\\alpha\n q}(\\varphi)\\big)\n \\big(1+\\epsilon_{\\beta p}(\\varphi)\\big)\n\\end{equation}\n\nwhich transforms Eq.(\\ref{many level time correction}) into:\n\n\\begin{eqnarray}\n\\label{approx equations}\n \\frac{d^2 b_{\\alpha}(\\varphi)}{d\\varphi^2}+ \\frac{d}{d\\varphi}(\\ln(1+\\epsilon_{\\alpha q}(\\varphi)))\\frac{db_{\\alpha}(\\varphi)}{d\\varphi}+\n b_{\\alpha}(\\varphi)=0 \\nonumber \\\\\n \\frac{d^2 b_{\\beta}(\\varphi)}{d\\varphi^2}+ \\frac{d}{d\\varphi}(\\ln(1+\\epsilon_{\\beta p}(\\varphi)))\\frac{db_{\\beta}(\\varphi)}{d\\varphi}+\n b_{\\beta}(\\varphi)=0\n\\end{eqnarray}\n\nBoth these equations are similar to the damped oscillator\nequation. For negligible damping ($\\epsilon_{\\alpha q}(\\varphi),\n\\epsilon_{\\beta p}(\\varphi)<<1$), they reduce to the harmonic\noscillator equations, in which case the population transfer time\n of $\\pi\/2$ is obtained in the variable $\\varphi$. In the the\noriginal time coordinate, $\\tau$, the corrected time $\\Theta$\nrequired for a single population transfer between the levels\n$\\alpha$ and $\\beta$ is then obtained from:\n\n\\begin{equation}\n\\label{transfer time corrected}\n \\int_0^\\Theta \\frac{d\\tau}{\\sqrt{(1+\\epsilon_{\\alpha q}(\\tau))(1+\\epsilon_{\\beta p}(\\tau))}} =\n \\frac{\\pi}{2}\n\\end{equation}\n\nNote the difference between this result, and the result in Eq.\n(\\ref{pi pulse theory}) obtained from the standard $\\pi$-pulse\ntheory: in the lowest order approximation, the corrected\npopulation transfer time is shorter then the one obtained from Eq.\n(\\ref{pi pulse theory}) by an order of\n$\\frac{1}{2}(\\epsilon_{\\alpha q}(\\tau)+\\epsilon_{\\beta p}(\\tau))$.\n\nOn the other hand, taking into consideration the damping factor in\nthe Eq.(\\ref{approx equations}), approximating:\n\n\\begin{equation}\n\\label{corrected period}\n \\frac{d}{d\\varphi}\\ln(1+\\epsilon_{\\alpha q, \\beta\n p}(\\varphi))\\approx \\frac{d}{d\\varphi}\\epsilon_{\\alpha q, \\beta\n p}(\\varphi)\n\\end{equation}\n\nand using the damped oscillator theory \\cite{Kent1996}(p.246), an\nincrease in the damping (expressed as an increase in\n$\\epsilon_{\\alpha q}(\\tau)$ and $\\epsilon_{\\beta p}(\\tau)$) leads\nto the an increase in the population time transfer by an order of\n$\\frac{1}{2}\\frac{d}{d\\tau}\\epsilon_{\\alpha q, \\beta p}^2(\\tau)$.\nAs this correction is an order of magnitude smaller than the\ncorrection obtained from Eq.(\\ref{transfer time corrected}), it\ncan be neglected for all practical purposes. Furthermore, the\nadditional corrections to the transfer period due to the neglected\nhigher order elements in the Eq.(\\ref{many level time correction})\nare of the same order of magnitude as this correction due to the\nfirst derivative component, and as they are impossible to obtain\nanalytically, the value of this whole second order correction for\nthe case of strong perturbations is somewhat shaky. However, this\nis not an issue, as the whole optimization theory developed in\n\\cite{bonacci2003.2} - and on whose applicability the results of\nthe above analysis hinge - assumes rather modest perturbations,\nand is not even expected to work properly for the extreme values.\n\n\\section{Numerical simulations}\n\n\\begin{figure}\n \\includegraphics[width=8cm]{BonacciFig1.eps}\\\\\n\\caption{In all of the numerical examples the same pulse form was\nused - $m(t)= \\sin(\\Omega t)^2$, but with different values of\nmaximum intensity parameter ($F_0$) and different total pulse\nduration, $T$. The respective values are quoted in each particular\nexample.}\n \\label{fig1}\n\\end{figure}\n\nIn this section, numerical simulations of system dynamics for\nunoptimized and fully optimized driving pulse of the form of Eq.\n(\\ref{pulse}) are presented and compared. Here, unoptimized\ndriving pulse is the one with driving frequency equal to the pure\nresonant frequency between the two levels selected for population\ntransfer ($\\omega(t)=\\omega_{\\alpha \\beta}$) and with pulse\nduration $T$ determined according to the standard $\\pi$-pulse\ntheory relation, Eq.(\\ref{pi pulse theory}). On the other hand,\nthe parameters of the fully optimized pulse are determined from\nEq.(\\ref{chirp}) and Eq.(\\ref{transfer time corrected}).\n\nIn all cases, a three-level system is considered, with the\nfollowing system parameters ($a.u.\\equiv atomic \\;units$):\n$\\omega_{\\beta \\alpha}=0.017671 \\;a.u.$, $s_{\\beta \\alpha}=1$,\n$\\mu_{\\beta \\alpha}=0.073 \\;a.u.$; $\\omega_{\\beta p}=0.017611\n\\;a.u.$, $s_{\\beta p}=-1$, $\\mu_{\\beta p}=0.098\\; a.u.$. These\nsystem parameters correspond to the three ro-vibrational levels of\nthe HF molecule in the ground electronic state: $\\alpha \\equiv\n(v=0,j=2,m=0)$, $\\beta \\equiv (v=1,j=1,m=0)$, $p \\equiv\n(v=2,j=2,m=0)$. The pulse shape in all of the examples is $m(t)=\n\\sin(\\Omega t)^2$ as shown in Fig 1.\n\n\\subsection{Population oscillations}\n\n\\begin{figure}\n \\includegraphics[width=12cm]{BonacciFig2.eps}\\\\\n\\caption{Significance of the total analytical correction (in\ndriving frequency and total pulse duration) for the dynamics of a\nmildly disturbed system. In all plots, major oscillations are the\npopulations of the two targeted levels ($\\alpha$ and $\\beta$)\nwhereas the minor oscillations are the population of the\nperturbing level ($p$). For the value of perturbation strength\nparameter $\\sigma_{\\beta p}^2=0.05$, the loss of the final\nunoptimized population transfer amplitude amounts about 2\\%.\nOptimization reduces this loss to below 0.05\\%. The difference\nbetween the pulse duration obtained from standard $\\pi$-pulse\ntheory and the optimized value is 1.6\\%. Right hand-side plots\npresent the details from the left hand-side plots.}\n \\label{fig2}\n\\end{figure}\n\nAs was demonstrated in \\cite{bonacci2003.2}, frequency\noptimization minimizes the impact of the perturbing levels on the\n\\textit{amplitude} of the population oscillations. In this\nsubsection, the necessity of the inclusion of additional\ncorrection Eq.(\\ref{transfer time corrected}) for the\n\\textit{population transfer time} - alongside the correction for\nthe driving frequency - will be demonstrated. Also, the validity\nand the limitations of the analytically obtained expression for\nthis correction will be discussed.\n\n\\subsubsection{Legitimate perturbation}\nFig.2 presents the dynamics of the system subjected to the\nexternal drive of limiting intensity, $\\sigma_{\\beta p}^2=0.05$,\ncorresponding to the $F_0=2.80534 \\ast 10^{-4} a.u.$. It is just\nstrong enough to noticeably (albeit not significantly) distort the\npure resonant oscillations, but at the same time weak enough so\nthat the theory developed in \\cite{bonacci2003.2} and further in\nthis paper provides the full and precise quantitative corrections.\n\nPulse duration determined according to the standard $\\pi$-pulse\ntheory expression, Eq.(\\ref{pi pulse theory}) is $T_{\\pi}=3077832\na.u.$, whereas the optimized one, obtained from Eq.(\\ref{transfer\ntime corrected}) is $T_{opt}=3126029 a.u.$. The pulse is aimed at\nproducing five complete population oscillations.\n\nThree cases of dynamics are presented: Fig. 2.a shows the\nunoptimized dynamics; Fig 2.b shows the 'semi-optimized' dynamics,\nwith optimized driving frequency, but unoptimized population\ntransfer period; finally, Fig. 2.c shows the fully optimized\ndynamics. Observe that in the unoptimized case, the population\noscillations end somewhat short of the complete cycle, and the\ninitially populated level never achieves complete depopulation.\nOptimizing only the driving frequency does indeed maximize the\npopulation oscillations by inducing the complete depopulation of\nthe initially populated level during oscillations, but at the same\ntime the final population oscillation stops even further from the\nfull cycle than in the unoptimized case. Finally, introducing the\npopulation transfer period correction alongside the driving\nfrequency correction yields the required result: complete cycle of\nmaximized population oscillations.\n\n\\subsubsection{Strong perturbation}\nIncreasing the driving perturbation intensity to somewhat greater\nvalue, $\\sigma_{\\beta p}^2=0.25$ ($F_0=6.11409 \\ast 10^{-4} \\\na.u.$.), the limitations of the analytical theory clearly emerge.\nThis is shown in Fig. 3: Fig. 3.a - Fig. 3.c respectively show the\nunoptimized, analytically optimized (according to Eq.(\\ref{chirp})\nand Eq.(\\ref{transfer time corrected})) and 'manually optimized'\ndynamics. The corresponding pulse duration times, aimed at\nproducing three complete population oscillations, are\n$T_{\\pi}=847324 \\ a.u.$, $T_{opt}=901075 \\ a.u.$ and\n$T_{man}=884300 \\ a.u.$.\n\nNotice that in the analytically optimized case, Fig. 3.b, the\ninitially populated level still fully depopulates, which indicates\nthat even for this rather strong perturbation, the frequency\ncorrection Eq.(\\ref{chirp}) still stands strong. However, the\ncorrected period, although closer to the correct value than in the\nunoptimized case, is still somewhat removed from the correct\nvalue. Unfortunately, this 'optimization error' cannot be remedied\nanalytically. Remember that the analytical result\nEq.(\\ref{transfer time corrected}) is obtained using only the\nfirst order approximation (Eq.(\\ref{many level time correction}))\nto the full dynamical equations Eq.(\\ref{two level final}). With\nperturbation as strong as in this case, the dynamical impact of\nthe neglected elements of that equation begin to show. However, as\nshown in Fig. 3.c, the full cycle of oscillations can still be\nproduced, but this additional correction to the pulse duration had\nto be found by hand, using the trial and error method.\n\n\\begin{figure}\n \\includegraphics[width=12cm]{BonacciFig3.eps}\\\\\n\\caption{Limitations of the analytical optimization theory. Again,\nmajor oscillations are the population of the two targeted levels\nwhereas the minor oscillations are the population of the\nperturbing level. For the value of perturbation strength parameter\nis now $\\sigma_{\\beta p}^2=0.25$, which is just beyond the\nlimiting value for the full applicability of the presented\noptimization procedure. Although the analytical correction\nimproves the final population transfer from 92\\% to 97\\% (with\npulse duration correction of 6\\%), the theory presented in this\npaper cannot account for an additional 1.6\\% correction in the\nduration of the pulse that further increases the final population\ntransfer to over 99.99\\%.}\n \\label{fig3}\n\\end{figure}\n\n\\subsection{Population transfer}\nThe two final examples demonstrate the application of the\ndeveloped optimization theory to the most interesting dynamical\ncase regarding the coherent control: that of the single population\ntransfer between the two targeted levels $\\alpha$ and $\\beta$. As\nthe validity and the limitations of the whole theory were already\nexplored in the previous two examples, the following examples will\nonly demonstrate the improvements to the population transfer that\ncan be produced using the above results.\n\n\\subsubsection{Legitimate perturbation}\nAgain as in the previous section, the first example (Fig. 4)\npresents the dynamics of the system subjected to the external\ndrive of limiting intensity. In this case, the perturbation\nstrength parameter amounts $\\sigma_{\\beta p}^2=0.1$, corresponding\nto the $F_0=4.07606 \\ast 10^{-4} \\ a.u.$. Calculated population\ntransfer times are $T_{\\pi}=211831 \\ a.u.$ and $T_{opt}=218483 \\\na.u.$.\n\nThe unoptimized (dotted line) and the optimized dynamics (solid\nline) are plotted on the same graph to facilitate the comparison\nbetween the two. Only the dynamics of the two target levels is\nshown - the plot of the perturbing level's ($p$) dynamics is\nomitted for the sake of clarity of the overall graph. Although the\nloss of the population transfer in the unoptimized case is not\ngreat, it nevertheless is noticeable. On the other hand,\nintroducing the corrections for pulse frequency and pulse duration\nclearly improves the population transfer bringing it very close to\n100\\%.\n\n\\begin{figure}\n \\includegraphics[width=12cm]{BonacciFig4.eps}\\\\\n\\caption{Applicability of the analytical optimization procedure to\nthe maximization of the population transfer. Yet again, major\noscillations are the population of the two targeted levels whereas\nthe minor oscillations are the population of the perturbing level.\nFor this limiting value of perturbation strength parameter of\n$\\sigma_{\\beta p}^2=0.10$, the optimization almost completely\neradicates the loss of the population transfer due to the\ndynamical impact of the perturbing level, increasing the\npopulation transfer from 96\\% to 99.7\\%. Optimized pulse lasts 3\\%\nlonger than the one obtained from the standard $\\pi$-pulse\ntheory.}\n \\label{fig4}\n\\end{figure}\n\n\\subsubsection{Extreme perturbation}\nThe final example - presented in Fig. 5. - is qualitative, rather\nthan quantitative, but even as such it is quite indicative of the\noverall usefulness of the whole optimization theory. The\nperturbation is now extreme, with strength parameter\n$\\sigma_{\\beta p}^2=1$ corresponding to the $F_0=1.22282 \\ast\n10^{-3}\\ a.u.$. Calculated population transfer times are\n$T_{\\pi}=70610 \\ a.u.$ and $T_{opt}=82816 \\ a.u.$.\n\nAgain, the unoptimized and the optimized dynamics are plotted on\nthe same graph. Although optimization now clearly does not lead to\nthe complete population transfer, the improvement from the\nunoptimized dynamics is significant demonstrating that even for\nthis perturbation intensity the developed optimization theory\nqualitatively works quite nicely.\n\n\\begin{figure}\n \\includegraphics[width=12cm]{BonacciFig5.eps}\\\\\n\\caption{Breakdown of the quantitative optimization, but\nqualitatively the theory is still applicable. Half way through the\npulse, in the unoptimized case now the population of the\nperturbing level surpasses the population of the initially\nunpopulated level. Introduction of the optimized driving frequency\nand pulse duration significantly - although not fully - rectifies\nthe population transfer from below 40\\% to almost 90\\%. Optimized\npulse is now almost 20\\% longer then the one obtained from the\nordinary $\\pi$-pulse theory.} \\label{fig5}\n\\end{figure}\n\n\\section{Conclusion}\n\nThe aim of research that led to this paper was to explore the\npossibility of using 'old fashioned' and rather simple phenomenon\nof Rabi oscillations for the controlled manipulation of the\npopulation in general many level system. This paper rounds up the\ntopic of analytical optimization of pulse parameters (frequency\nchirp and pulse duration), opened in the author's previous work\n(\\cite{bonacci2003.2}) that would lead to maximizing the\npopulation transfer between two targeted levels of the system. The\ntheory developed provides the exact quantitative predictions of to\nwhat extent the dynamical impact of the remainder of the many\nlevel system (beyond the two levels selected for the population\ntransfer) begins to interfere with the targeted population\ntransfer. It also provides the closed (albeit recursive)\nanalytical expressions for the optimization of pulse parameters.\n\nAlthough the major correction to the population transfer is\nachieved by optimizing the driving pulse's frequency chirp (given\nin \\cite{bonacci2003.2}), this paper provides the additional fine\ntuning by establishing similarly simple analytical expression for\nthe determination of the optimal pulse duration. It demonstrates\nthat the standard formula of the $\\pi$-pulse theory, Eq. (\\ref{pi\npulse theory}) begins to fail as the perturbation increases to and\nbeyond the well defined limiting value. It also provides some\nremedy to this failure.\n\nThe whole theory presented in \\cite{bonacci2003.2} and this paper\ndeals with only single laser pulse driving one particular\ntransition in the many level system. The further research\ncurrently under way considers the possibility of applying a number\nof distinct but simultaneous optimized pulses to drive the\npopulation through the chain of transitions through the system,\nhence producing as clean as possible transfer between the two\nlevels not coupled by the single photon transition. The\npreliminary results indicate that an analytical optimization\nformula can be developed even for such a case.\n\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\n\\label{sec:intro} \n\nThe uniform, random sampling of arbitrarily shaped surfaces is of\nimportance in several scientific and technological applications.\nFor example, generic surface sampling can be used to create and\ntest more realistic computer graphics models~\\cite{Tur92}.\nIn medical imaging, such sampling can be used to generate a uniform\ndistribution of target points over the surface of tumors~\\cite{Wil87}.\nSurface sampling has also been used to study oxygen production in\nforests~\\cite{Mel04}.\nIn low-background radiation detection, the application for which\nthe algorithm presented here was developed, the simulation of\nradioactive contaminants on various detector surfaces is important\nfor quantifying backgrounds and their impact on detector sensitivity.\nThis algorithm was successfully\nimplemented into the Geant4-based~\\cite{Geant4} simulation toolkit, MaGe~\\cite{MaGe},\nbeing jointly developed by the GERDA~\\cite{GERDA} and {\\sc Majorana}~\\cite{MJ} collaborations \nto simulate germanium detector arrays.\n\nSeveral algorithms exist to perform such generic surface sampling\n(see, for example, Refs.~\\cite{Tur92} - \\cite{Mel04}).\nUnfortunately, some of these methods (such as the retiling of\npolygonal surfaces) are algorithmically complex and computationally\nintensive. Other\nalgorithms require the surfaces to be represented as differentiable\nfunctions. Deriving such a function for each surface-of-interest\ncan be a computationally intensive task, particularly for\ncomplex geometries. Finally, to the authors' knowledge, little is available in the form of\nfree, open-source code for plug-and-play usage.\n\nWe have developed a Monte Carlo algorithm that only requires the\ngeometry modeling software to be able to find\nthe intersection points between an arbitrary line and the surfaces\nof the volumes to be sampled. The algorithm generates a random set of rays that impinge on\nthe surfaces of interest that are isotropic in direction and uniform\nin space. The intersection points, provided by the geometry modeling software,\nare sampled again to provide the final set of random\nand uniform surface points.\n\nWe demonstrate this generic surface sampling routine using the\nC\\nolinebreak\\hspace{-.05em}\\raisebox{.4ex}{\\tiny\\bf +}\\nolinebreak\\hspace{-.10em}\\raisebox{.4ex}{\\tiny\\bf +}-based Geant4 Monte Carlo simulation toolkit~\\cite{Geant4}.\nGeant 4 is used extensively in high-energy, nuclear and medical\nphysics to simulate the interactions of radiation with matter. In\nGeant4, arbitrary geometries can be constructed by arranging\ncollections of nested solid volumes and boolean combinations\n(intersections, additions, or subtractions) of those volumes in\nspecified positions and orientations relative to each other. The\navailable basic solids include fundamental solids such as spheres,\ncylinders, and polyhedra, as well as more generic and complex\nboundary-representation volumes. Our sampler relies on the fact\nthat each Geant4 volume class provides a function that finds the\nintersection points between the volume's surface and an arbitrary\nline, if such an intersection exists. Each volume class also defines\na function that returns a bounding radius for the volume in question,\nwhich is used to constrain the parameter space of lines sampled.\n\n\n\\section{Sampling Algorithm}\n\\label{sec:algorithm}\n\nThe principle of the sampling algorithm is based upon uniformly \nsampling the volume within a sphere. \nWhen the user selects a volume or set of volumes whose surfaces are\nto be sampled, the radius $R$ of a bounding sphere which wholly contains the \nvolume(s) must be determined. In the\ncase of multiple disjoint volumes, a ``mother'' volume that encompasses\nall the volumes to be sampled must be used. In practice, the radius of this bounding\nsphere is determined by querying the geometry modeling software. \nTo generate a uniform,\nisotropic flux of rays within this bounding sphere, first a random\nisotropic point ${\\bf r}$ on the sphere is generated, where ${\\bf r} = R {\\bf \\hat{\\Omega}}$ and \n${\\bf \\hat{\\Omega}}$ is the randomly generated direction. A disk, also of radius\n$R$, is defined tangential to the bounding sphere, with its center\nat position ${\\bf r}$. Figure~\\ref{fig:rayGeneration} shows the position of\nthis disk and the bounding sphere for a sampling trial of an arbitrary example volume.\nThe starting point for another ray $\\boldsymbol{\\rho}$ is\ngenerated on the interior of the disk at point ${\\bf r} + {\\bf b}$,\nwhere ${\\bf b}$ has polar coordinates $(b, \\alpha)$ in the coordinate\nsystem of the disk. The ``impact parameter'' $b$ is generated with\na uniform distribution in $b^2$ between 0 and $R$, and the angle $\\alpha$ is generated\nuniformly between 0 and $2\\pi$. The direction of $\\boldsymbol{\\rho}$ is taken\nto be $-{\\bf \\hat{\\Omega}}$, normal to the circle and hence pointing\ninto the bounding sphere. The uniformity and isotropy of the\nrays produced in this manner will be discussed in the next section.\n\n\\begin{figure}\n\\centering\n\\includegraphics[width=.95\\columnwidth]{SamplerGrayScale1}\n\\caption{An schematic of the bounding sphere \n(shown with a section missing for illustrative purposes),\ntangent disk, and ray $\\boldsymbol{\\rho}$ for a sampling trial of\nan arbitrary example volume. $\\boldsymbol{\\rho}$ originates\nat ${\\bf r} + {\\bf b}$ and continues in the $-{\\bf \\hat{\\Omega}}$\ndirection, in this case intersecting the enclosed volume twice.\nThe determination of the various rays and angles is described in the text.}\n\\label{fig:rayGeneration}\n\\end{figure} \n\nOnce $\\boldsymbol{\\rho}$ has been generated, the geometry modeling software is\nqueried to find the intersection points of the ray with all\nsurfaces among the volumes-of-interest. If no such intersections\nexist, another ray is generated with a new direction and starting point. \nIf $N$ intersections are found, a\nrandom integer $n$ is generated between one and the maximum number\nof intersections possible for the given geometry ($N_{\\textrm{max}}$),\nwhich is input by the user~\\footnote{A guess will suffice\nfor the value of $N_{\\textrm{max}}$, it merely needs to match or exceed\nthe greatest number of intersections encountered in the ouput set of \nsampled points. If the algorithm encounters more \nsurfaces than $N_{\\textrm{max}}$, a warning can be generated and the\nuser can rerun with a larger value of $N_{\\textrm{max}}$.}. \nIf $n > N$ the ray is discarded, and the algorithm starts over. \nOtherwise, one of the $N$\nintersections is chosen at random. The set of intersection points\nchosen in this way is the output of the algorithm. \n\n\\section{Algorithm Properties}\n\\label{sec:properties}\n\nIn the following, it is assumed that we have a random\nnumber generator that can generate a sequence of real numbers\nuniformly distributed between $0$ and $1$, with the standard\nrequirement of randomness~\\cite{Knu81}. Additionally, all vectors,\nvolumes and surfaces are assumed to lie in 3-dimensional Euclidean\nspace.\n\nWe first show that the flux of rays generated as described above\nis uniform and isotropic within the bounding sphere of the\nsurfaces-of-interest. For every point ${\\bf x}$ in the interior of\na sphere of radius $R$, and for every direction ${\\bf \\hat{\\Omega}}$\nfrom ${\\bf x}$, there exists one and only one line passing through\n${\\bf x}$ that is normal to the plane tangent to the sphere at ${\\bf\nr} = R {\\bf \\hat{\\Omega}}$. The set of all intersections with this\ntangent plane of rays in direction ${\\bf \\hat{\\Omega}}$ originating\nfrom all points ${\\bf x}$ interior to the sphere fill a disk of\nradius R centered at ${\\bf r}$. Since the direction ${\\bf \\hat{\\Omega}}$\nis chosen isotropically, and since the starting point on the disk\n${\\bf b}$ is chosen uniformly across the surface of the disk, then\nthe probability for a ray to pass within a small area ${\\bf \\Delta\nA}$ centered at ${\\bf x}$ with surface normal pointing in direction\n${\\bf \\hat{\\Omega}}$ is independent of ${\\bf x}$ (uniform), and is\nindependent of direction ${\\bf \\hat{\\Omega}}$ (isotropic). Symbolically,\nwe write the normalized vector flux of rays as $\\boldsymbol{\\phi}({\\bf x}, {\\bf \\hat{\\Omega}})\n= {\\bf \\hat{\\Omega}} \/ 4 \\pi^2 R^2$, which is independent\nof ${\\bf x}$. The randomness of this flux\nis guaranteed as long as a new direction ${\\bf \\hat{\\Omega}}$ and\ndisk position ${\\bf b}$ are chosen for each ray.\n\nThe uniformity and randomness of the set of intersection points\ngenerated by the uniform isotropic flux of rays can be demonstrated\nas follows. First, divide the surfaces-of-interest into an large number\nof surface elements ${\\bf \\Delta A}({\\bf x})$, where the direction\npoints normal to the surface at point ${\\bf x}$, and the magnitude\n$\\Delta A$ is independent of ${\\bf x}$ (${\\bf \\Delta A}({\\bf x}) =\n\\Delta A {\\bf \\hat{n}}({\\bf x})$). $\\Delta A$ is taken to be small enough\nthat each surface element may be approximated to be flat \\footnote{This\nis equivalent to requiring that the sampled surfaces be differentiable.\nWithin the Geant4 framework, this implies a requirement that the\nradius-of-curvature for any surface be much greater than the tolerance\nparameter, which sets the distance within which a point is considered\nto be ``on'' a volume's surface. This parameter has a default value\nof 1 pm, but can be tuned by the user to be as low as $\\sim$1 fm\nfor typical meter-sized or smaller geometries, at which point one\nis limited by numerical round-off of the 64-bit double-precision\nfloating point data type used to define volume dimensions. The\nassumption of flatness of the surface elements also neglects\ninfinitely sharp corners, which are unphysical.}. The\nprobability for a surface element to be hit by a ray from our\ngenerated vector flux $\\boldsymbol{\\phi}({\\bf x}, {\\bf \\hat{\\Omega}})$ is\n\\begin{eqnarray*}\n\\int_0^{4\\pi} \\left|\\boldsymbol{\\phi}({\\bf x}, \\Omega) \\cdot {\\bf \\Delta A}({\\bf x})\\right|~d\\Omega & = & \\int_0^{4\\pi} \\left|\\frac{\\Delta A}{4 \\pi^2 R^2} ~{\\bf \\hat{\\Omega}} \\cdot {\\bf \\hat{n}}({\\bf x})\\right|~d\\Omega \\\\ \n& = & \\frac{\\Delta A}{4 \\pi^2 R^2} \\int_0^{4\\pi} \\left|\\cos\\theta\\right|~d\\Omega\\\\ \n& = & \\frac{\\Delta A}{2 \\pi R^2} \\\\\n\\end{eqnarray*}\nwhich is independent of ${\\bf x}$. This implies that all surface\nelements are hit with constant probability. Thus the set of\nintersections of all rays with the surfaces-of-interest gives a\nuniform sampling of those surfaces.\n\nThe randomness of initial flux of rays implies that the set of\nintersection points generated by one ray is statistically independent\nfrom those of other rays. However, intersection points of a single\nray are not statistically independent from each other, as they all\nlie along a single line. For a truly random sampling, at most one\nintersection point can be chosen from each ray. Note that if a\nsingle point were chosen at random and kept for each ray with\nintersections, those points which lie along rays with fewer\nintersections would be sampled more often than those points lying\nalong lines with more intersections, ruining the uniformity of the\ndistribution. In essence, rays with $N$ intersections would effectively\nbe given a $1\/N$ weighting.\nFor this reason, the point selection is weighted by\n$N\/N_{\\textrm{max}}$, and uniformity is retained. \n\nThe efficiency of the above method, in terms of the number of surface\npoints generated per geometrical calculation, can be poor when the\nvolumes-of-interest sparsely fill the bounding sphere. If the volumes\nare disjoint, efficiency can be recovered by considering distant\nvolumes independently. Poor efficiency for volumes having needle-like\nor planar geometries, with one dimension much larger or smaller\nthan the other dimensions, can be remedied by considering bounding\nsurface other than a sphere, for example a wide plane or a narrow\ncylinder. In such cases care must be taken to ensure the generated\nflux of rays is (at least approximately) uniform and isoptropic.\nWe did not consider such cases in this paper.\n\nThe step in which rays with fewer intersections are preferentially\ndiscarded also imposes an efficiency reduction by a factor of roughly\n$\\bar{N}\/N_{\\textrm{max}}$, where $\\bar{N}$ is the average number\nof intersections per ray. This reduction can be significant for\ngeometries with many aligned, repeated volumes, as well as for\ngeometries with regions containing many small components. In such\ncases it may be prudent to simply keep all intersection points of\nall rays. The resulting set of points, taken as a whole, will still\ndistribute with uniform surface density, and with much higher\nefficiency, albeit at the cost of introducing correlations among\nsome consecutive points. For many applications, though, such correlations\nare irrelevant.\n\n\n\\section{Geant4 Implementation}\n\nWe implemented this algorithm within the Geant4 framework by deriving\nclasses from the ``user action'' base classes \\emph{G4VUserPrimaryGeneratorAction} and\n\\emph{G4UserSteppingAction}. At runtime the user\ninputs a list of volume names whose surfaces are to be sampled,\nwhich are sent to the generator action class. After geometry\ninitialization, the class queries the \\emph{G4PhysicalVolumeStore}\nto find the smallest volume which contains all volumes-of-interest\nas daughter volumes (this volume may itself be a volume-of-interest).\nThe \\emph{G4VSolid} corresponding to that mother volume is extracted\nfrom its \\emph{G4LogicalVolume}. A bounding radius for the\nsurfaces-of-interest is then obtained by calling\n\\begin{verbatim}\nG4VSolid::GetExtent().GetExtentRadius();\n\\end{verbatim}\nThe class then sets the primary particle to be a ``geantino'', an\nimaginary neutral, massless utility ``particle\" within the Geant4\nframework which undergoes no interactions, and only travels in\nstraight lines. Geantinos are commonly used for debugging purposes\nand to map out geometries. The geantino's position and direction\nare selected by our algorithm to give a uniform, isotropic flux of\ngeantinos throughout the interior of the bounding sphere. The energy\nof the geantino can be any value greater than 0. The choice of\ngeantinos delegates all geometrical calculations to Geant4.\n\nThe stepping action class checks at each step whether the geantino\nis entering or exiting a volume of interest. Each such entrance or\nexit point is added to a list of surface intersections. At the end\nof the event, one of these surface intersections can be chosen at\nrandom, or all surface\nintersections can be kept if efficiency requirements outweigh\nthe necessity for truly uncorrelated sampling. The set of surface\nintersections generated in this way uniformly sample the surfaces\nof interest, and may be saved to disk or used for further processing\nin the program (e.g.~as the vertex for the next event).\n\n\n\\section{Example Application and Verification}\n\nSuch an implementation of our generic surface sampling algorithm\nwas added to MaGe~\\cite{MaGe}, a Geant4-based Monte Carlo simulation\ntoolkit optimized for low-background germanium detector simulations.\nThe output vertices are written to a ROOT~\\cite{ROOT} file, which can then be\nused in simulations involving surface physics, for example\n$\\alpha$-particle backgrounds from natural U and Th decay chain isotopes in settled dust,\nor from Rn decay chain daughters plated out on detector surfaces.\n\nFigure~\\ref{fig:demonstration} demonstrates the usage of the surface sampler \non the 57-detector array design for the {\\sc Majorana} experiment~\\cite{MJ}.\nFigure~\\ref{fig:StringRender} shows a rendering of a 3-Ge-crystal string assembly,\ncomplete with detector supports and electronic connections and components. 19\nsuch strings are arranged in a hexagonal close-pack pattern, suspended from a \nCu cold plate, and housed in a cylindrical low-background cryostat made of \nelectroformed Cu. An imaging of the \nfull simulated geometry (minus the surrounding cryostat) \nby our surface sampling algorithm is shown in \nFigure~\\ref{fig:57BangerSamp}, as viewed from one side. \nWe also show more detailed samplings of two\nspecific detector components in Figures~\\ref{fig:SingXtalCoax} and \\ref{fig:TraysSamp}.\nFigure~\\ref{fig:SingXtalCoax} plots the output of the algorithm for\none close-ended coaxial high-purity germanium detector crystal. The detector is represented\nby a boolean combination of basic volumes. The body is modeled as\ntwo cylinders OR'd with a torus to form the rounded top face. A\nthird, smaller-radius cylinder OR'd with a sphere at one end is\nsubtracted from the body to form the coaxial well along the detector's\nvertical axis. Figure~\\ref{fig:TraysSamp} shows a surface sampling of one\nof the plastic trays on which the Ge crystals rest in the string assembly. A\nrendering of the simulated tray design is shown to the upper right of the surface \nsampling for comparison.\n\n\\begin{figure*}\n\\centering\n \\subfigure[~Rendering of a 3-Ge-crystal ``string'' assembly. The entire assembly is about 30~cm in length.]{\\label{fig:StringRender} \\includegraphics[width=.8\\columnwidth]{3CrystalAsm.pdf}}\n \\subfigure[~Horizontal view of 19 strings hanging from a Cu coldplate, imaged with our surface sampling algorithm.]{\\label{fig:57BangerSamp} \\includegraphics[width=.8\\columnwidth]{mod.png}}\n \\subfigure[~Surface sampling of a close-ended coaxial high-purity germanium detector crystal.]{\\label{fig:SingXtalCoax} \\includegraphics[width=.8\\columnwidth]{xtal.png}}\n \\subfigure[~Surface sampling of a crystal support tray. A rendering of the simulated geometry is shown in the upper right corner.]{\\label{fig:TraysSamp} \\includegraphics[width=.8\\columnwidth]{tray.pdf}} \n \\caption{Demonstration of the uniform surface sampling on various\n volumes in the {\\sc Majorana} 57-crystal array design. The\n 2-dimensional projection of 3-dimensional points leads to regions\n with apparent higher or lower sampling densities, for example at\n the edges of the displayed geometries. See Table~\\ref{tab:Verification}\n for an analytic verification of the sampler. }\n \\label{fig:demonstration}\n\\end{figure*} \n\nWe ran a high statistics simulation to test the behavior of the surface sampler\nand verify that the surface density of sampled points is\nindependent of surface shape and orientation. To this end, we sampled a portion of the\n{\\sc Majorana} 57-detector array design. We chose to \nsample the inner surface of the enclosing\ncylindrical cryostat, the cold plate from which all the crystals hang, two\ncrystal detectors, and a single ``contact ring\" (a thin plastic ring \nthat clamps leads against the crystal surface to make electrical connections\nto the detector) surrounding one of the crystals.\nThe inner cryostat surface and the cold plate are both simple cylinders.\nThe contact ring is an annulus, and the detectors are as described\nabove. All surfaces were sampled simultaneously, so the surface density\nof sampled points should be the same for all five components.\nThe ratio of points on a volume's surface to total number of sampled\npoints in the run were tabulated from the output ROOT file. These\nratios were then compared with analytical calculations of the surface\narea ratio for each volume to the total surface area of all sampled\nvolumes. The results are shown in\nTable~\\ref{tab:Verification}. In all cases, the ratios agree within the\nsampled statistics.\n\n\\begin{table}\n\\caption{A comparison of analytically calculated surface area ratios\nto the fractions of sampled points landing on each surface of a\nnumber of volumes sampled simulataneously using our generic surface\nsampling algorithm. In all cases, the ratios agree within the\nstatistics of the simulation.}\n\\label{tab:Verification}\n\\begin{center}\n\\begin{tabular}{|l|r@{.}l|r@{.}l|}\n\\hline\n & \\multicolumn{2}{|c|}{Analytic [\\%]} & \\multicolumn{2}{|c|}{Sampled [\\%]} \\\\ \\hline\nCryostat & ~~~~69 & 544 & ~69 & 577 $\\pm$ 0.042~ \\\\\nCold Plate & 25 & 906 & 25 & 881 $\\pm$ 0.026 \\\\\nDetector 1 & 2 & 173 & 2 & 171 $\\pm$ 0.007 \\\\\nDetector 2 & 2 & 173 & 2 & 167 $\\pm$ 0.007 \\\\\nContact Ring & 0 & 202 & 0 & 203 $\\pm$ 0.002 \\\\ \\hline\n\\end{tabular}\n\\end{center}\n\\end{table}\n\n\n\\section{Concluding Remarks}\n\nWe have developed a generic surface sampling algorithm that distributes\nvertices uniformly and randomly over sets of arbitrary surfaces.\nSuch an algorithm has potential application in many scientific and\ntechnical fields. Our implementation within the Geant4 Monte Carlo\nsimulation toolkit and the MaGe simulation framework for germanium\ndetector-based systems is of particular use to nuclear and particle\nphysicists. It may be used, for example, to study surface $\\alpha$\nbackgrounds, a key background in many low-background calorimetry-based\nexperiments in these fields.\n\n\n\\section{Acknowledgments}\n\nThis work was sponsored in part by the US Department of\nEnergy under Grant nos. DE-FG02-97ER41020 and\nDE-AC02-05CH11231. This research used the Parallel\nDistributed Systems Facility at the National Energy\nResearch Scientific Computing Center, which is supported\nby the Office of Science of the U.S. Department of Energy\nunder Contract no. DE-AC02-05CH11231. The authors would \nlike to thank D.\\,Y.\\,Sebe for assistance with some of the \nfigures. In addition, the authors acknowledge the MaGe group of the\nGERDA and {\\sc Majorana} collaborations for important comments\nand insight. \n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section*{Acknowledgements}\nThis work was supported by the National Science Foundation.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\subsection{Signal Asymmetry}\n\\label{sec:signal_asymmetry}\nAs described in section~\\ref{sec:Measurement_scheme}, the accumulated phase $\\Phi$ was read out by resonantly addressing the $H \\rightarrow C$ transition with linearly polarised light and monitoring the resulting fluorescence. The state readout laser was switched between orthogonal polarisations, $\\hat{X}$ and $\\hat{Y}$, at $100$~kHz (with $1.2~\\upmu$s of dead time between polarisations) in order to normalize against molecular flux variations. By switching at a rate fast enough that each molecule experienced both polarisations, we achieved nearly photon-shot-noise-limited phase measurements \\cite{Kirilov2013}. With a sufficiently wide laser beam, all molecules were completely optically pumped by both laser polarisations during their $\\sim$20~$\\upmu$s fly-through time. We induced approximately one fluorescence photon from each molecule by projecting the molecule state onto the two orthogonal spin states excited by laser beams with orthogonal polarisations.\n\nThe rapid switching of the laser polarisation resulted in a modulated PMT signal, $S(t)$, as shown in figure~\\ref{fig:modulation}. For the following discussion we consider the polarisation state to switch at a time $t=0$. Immediately after, there is a rapid increase in fluorescence as the molecules in the laser beam are quickly excited; while $\\Omega_rt\\ll1$, where $\\Omega_r\\sim2\\pi\\times1$~MHz is the Rabi frequency on the $H$ to $C$ transition, the fluorescence increases as $S(t)\\propto\\Omega_r^2\\times t^2$. At later times, when $\\Omega_rt\\gtrsim1$, population is about evenly mixed between the $H$ and $C$ states (since $\\Omega_r\\gtrsim\\gamma_C$); hence, $S(t)$ decays exponentially with a time constant of roughly $1\/(2\\gamma_C)\\approx1~\\upmu$s. Molecules that were not present at $t=0$ continue to enter the laser beam, causing $S(t)$ to approach a steady state. The laser is then turned off and the signal decays exponentially with time constant $1\/\\gamma_C\\approx0.5~\\upmu$s. The next laser pulse, with orthogonal polarisation, is turned on 1.2~$\\upmu$s $\\approx2.5\/\\gamma_C$ after the end of the previous one to prevent significant overlap of contributions to $S(t)$ induced by different polarisations. A low-pass filter in the PMT voltage amplifier with a cut-off frequency of $2\\pi\\times2$~MHz removed any short timescale dynamics from $S(t)$, and prevented aliasing of high frequency components in the signal given our fixed digitization rate of 5 MSa\/s.\n\nTo determine the fluorescence $F(t)$ produced by each polarisation state, we subtracted a time-dependent background, $B(t^{\\prime})$, taken from data with no molecule fluorescence present, i.e. $F(t)=S(t)-B(t^{\\prime})$. Examples of the extracted $F(t)$ and $B(t^{\\prime})$ time series are shown in figure~\\ref{fig:modulation}A and B, respectively. $B(t^{\\prime})$ was modulated in time due to scattered light from the state readout laser beam and has a DC electronic offset intrinsic to the PMTs. The first millisecond of data, which contains no fluorescence, was used to determine $B(t^{\\prime})$. We assumed that $B(t^{\\prime})$ was periodic with the switching of the laser polarisation but did not depend on the polarisation; we inferred its value by averaging together the recorded PMT signal across all polarisation bins for ${\\approx}1$~ms of data taken before the arrival of the molecule pulse. Since molecule beam velocity variations caused jitter in the temporal position of the molecule pulse within the trace, 9~ms of data were collected per pulse, despite the fact that only the ${\\approx}$2~ms of strong signal with $F(t)\\gg B(t^{\\prime})$ and ${\\approx}1$~ms of background contained useful information for the spin precession measurement. \n\\begin{figure}[!htbp]\n\\centering\n\\includegraphics[width=12.7cm]{fluorescence_background_asymmetry_v2.pdf}\n\\caption{(A) Molecule fluorescence signal $F(t)$ in photoelectrons\/s induced by $\\hat{X}$ (blue) and $\\hat{Y}$ (red) readout laser polarisations. Lines show the raw data for a single trace consisting of an average of 25 molecule pulses. Shaded regions show the waveform averaged over 16 traces. (B) Background signal $B(t^{\\prime})$ in photoelectrons\/s obtained before the arrival of molecules in the state readout region. (C) Integrated fluorescence signals $F_X$ and $F_Y$ throughout the molecule pulse. Dashed lines denote the region with $F=(F_X+F_Y)\/2>3\\times10^5~\\rm{s}^{-1}$, used as a typical cut for inclusion in eEDM data. Points are spaced by 5~$\\upmu$s. (D) Computed asymmetry throughout the molecule pulse. In this example, 18 of the ungrouped asymmetry points are grouped together to compute the mean and uncertainty shown as the grouped asymmetry.}\\label{fig:modulation}\n\\end{figure}\n\nIntegrating $F(t)$ over times associated with pairs of orthogonally polarised laser pulses resulted in signals $F_X, F_Y$. The integration was performed over a specified time window that we denoted as a `polarisation bin'. Figure~\\ref{fig:cuts}B shows two typical choices of polarisation bin and illustrates that the extracted eEDM is not significantly affected by this choice. Figure \\ref{fig:pixel_plot} shows that most of the extracted quantities did not vary linearly within the polarisation bin (Pol.\\ Cycle Time Dependence column).\n\nAfter polarisation binning, the data displayed a fluorescence signal modulated by the envelope of the molecule pulse, as in figure~\\ref{fig:modulation}C. Figure~\\ref{fig:modulation}D shows the asymmetry, $\\mathcal{A}$, computed from these data. \nThe asymmetry is computed for each 10~$\\upmu$s polarisation cycle, so that for the $i^{\\rm{th}}$ cycle we have\n\\begin{equation}\n\\A_i=\\frac{F_{X,i}-F_{Y,i}}{F_{X,i}+F_{Y,i}}.\n\\label{eq:asym_bins}\n\\end{equation}\nThe molecule phase, and hence asymmetry (see equation~\\ref{eq:asymmetry}), had a linear dependence on the time after ablation because the molecules precessed in a magnetic field over a fixed distance; the slower molecules, which arrive later, precessed more than the faster molecules, which arrived earlier. We applied a fluorescence signal threshold cut of around $F=(F_X+F_Y)\/2\\ge3\\times10^5~{\\rm s}^{-1}$, indicated by dashed lines in figure~\\ref{fig:modulation}C,D. Section \\ref{sec:data_cuts} describes the threshold choice in detail.\n\nTo determine the statistical uncertainty in $\\A$, $n\\approx$ 20--30 adjacent asymmetry points were grouped together. For each group, $j$, centred around a time after ablation $t_j$, we calculated the mean, $\\bar{\\mathcal{A}}_j$, and the uncertainty in the mean, $\\delta\\bar{\\mathcal{A}}_j$, depicted as red points and error bars in figure~\\ref{fig:modulation}D. For smaller $n$, the variance in the sample variance in the mean grows, in which case, error propagation that utilises a weighted mean of data ultimately leads to an understimate of the final statistical uncertainty \\cite{Kenny1951}. For larger $n$, the mean significantly varies within the group due to velocity dispersion, and the variance in the mean grows in a manner not determined by random statistical fluctuations. For the range $n=$ 20--30 we observed no significant change in any quantities which were deduced from the measured asymmetry. \n\nAs described earlier in this section, the background, $B(t^{\\prime})$, which we subtracted from the PMT signal, $S(t)$, was observed to be correlated with the fast switching of the readout laser beam polarisation. This can arise, for example, if the two polarisations have different laser beam intensities or pointings. \nWe chose to use a polarisation independent $B(t^{\\prime})$ by averaging over the two polarisation states. This produced an asymmetry offset as per equation~\\ref{eq:asym_bins} and hence a significant $\\Phi^{\\rm nr}$ associated with the polarisation-dependent background. However, we did not consider $\\Phi^{\\rm nr}$ to be a crucial physical or diagnostic quantity.\nWe found that this methodology produced accurate estimates of the uncertainties of quantities computed from the measured asymmetry, as verified by $\\chi^2$ analysis of measurements of $\\Phi^{\\N\\E}$. We also found that none of the phase channels of interest changed significantly dependent on whether a polarisation-dependent $B(t^{\\prime})$ was used.\n\n\\subsection{Computing Contrast and Phase}\nTo compute the measured phase $\\Phi$ we must also measure the fringe contrast $\\mathcal{C}$ and relative laser polarisation angle $\\theta=\\theta_{\\rm read}-\\theta_{\\rm prep}$, as described in section~\\ref{sec:Measurement_scheme}. The $\\hat{X}$ and $\\hat{Y}$ laser polarisations were set by a $\\lambda\/2$ waveplate and were determined absolutely by auxiliary polarimetry measurements \\cite{Hess2014}. The contrast, defined as either $2\\mathcal{C}=-\\partial\\A\/\\partial\\theta$ or $2\\mathcal{C}=\\partial\\A\/\\partial\\phi$\\footnote{Recall that in practice we consider $\\mathcal{C}$ as an unsigned quantity for the purposes of data analysis.}, can be determined by dithering either the accumulated phase $\\phi$ (by varying $\\mathcal{B}_z$) or the relative laser polarisation angle $\\theta$. We chose the latter as it could be changed quickly ($<1$~s) by rotating a half-wave plate with a stepper-motor-driven rotation stage. Figure~\\ref{fig:fringe} shows the asymmetry as a function of $\\theta$, for a range of values of applied magnetic field. We ran the experiment at the steepest part of the asymmetry fringe (where $\\theta=\\theta^{\\rm nr}$) and measured the contrast, $\\mathcal{C}_j$, for each asymmetry group, $\\bar{\\A}_j$, by switching $\\theta$ between two angles, $\\theta=\\theta^{\\rm nr}+\\Delta\\theta\\tilde{\\theta}$, for $\\tilde{\\theta}=\\pm1$ and $\\Delta\\theta=0.05$~rad:\n\\begin{equation}\n\\label{eq:contrast_1}\n\\mathcal{C}_j=-\\frac{\\bar{\\A}_{j}(\\tilde{\\theta}=+1)-\\bar{\\A}_{j}(\\tilde{\\theta}=-1)}{4\\Delta\\theta}.\n\\end{equation}\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[width=12cm]{pol_fringe.pdf}\n\\caption{Asymmetry vs.\\ relative laser polarisation angle $\\theta=\\theta_{\\rm read}-\\theta_{\\rm prep}$ for several magnetic field values. The value of $\\theta$ was dithered about the value $\\theta^{\\rm nr}$ by $\\pm\\Delta\\theta=\\pm0.05$~rad to measure fringe contrast, $\\mathcal{C}$. To stay on the steepest part of the fringe, we chose $\\theta^{\\rm nr}=0$ rad for $\\B=\\pm20$~mG and $\\theta^{\\rm nr}=\\pi\/4$ rad for $\\B=\\pm1,\\pm40$~mG. For these data $|\\mathcal{C}|<90\\%$ due to low preparation laser power; typically, however, $|\\mathcal{C}|\\approx 95\\%$. Solid lines represent the expected behaviour for a given magnetic field and contrast.}\n\\label{fig:fringe}\n\\end{figure}\n\nBecause the fringe contrast was fairly constant over the duration of the molecule pulse (figure~\\ref{fig:contrast}A), we used a weighted average\\footnote{Each $\\mathcal{C}_j$ measurement is weighted by its computed uncertainty.} of all $\\mathcal{C}_j$ measurements within the cut region for that trace to extract the accumulated phase. We also performed the analysis by fitting $\\mathcal{C}_j$ to a 2nd-order polynomial as a function of time during the ablation pulse; this led a better fit to the data, but had no significant effect on the results. We typically found $|\\mathcal{C}|\\approx95$\\%. We believe that this was limited by a number of effects including: imperfect state preparation\/readout, decay from the $C$ state back to the $H$ state and dispersion in the spin precession. We also observed that this value was constant over a $\\pm2\\pi\\times1$~MHz detuning range of the state preparation laser (figure~\\ref{fig:contrast}B), indicating complete optical pumping over this frequency range. Recall that, as defined, $\\C$ can be positive or negative, depending on the sign of the asymmetry fringe slope (see figure~\\ref{fig:fringe}, or equation~\\ref{eq:contrast_1}). Given that we worked near zero asymmetry where the fringe slope was steepest, and that $\\theta^{\\rm nr}$ was always chosen to be 0 or $\\pi\/4$, we computed the total accumulated phase as\n\\begin{equation}\n\\label{eq:phase_1}\n\\Phi_j=\\frac{\\bar{\\A}_j(\\tilde{\\theta}=+1)+\\bar{\\A}_j(\\tilde{\\theta}=-1)}{4\\C}+q\\frac{\\pi}{4}.\n\\end{equation}\nHere, $q=0,\\pm1$ or $\\pm2$, corresponds to applied magnetic fields of $\\pm1$, $\\pm20$, and $\\pm40$~mG, respectively. We chose to apply a small magnetic field, $\\B=1$ mG when operating at $q=0$ rather than turning off the magnetic field completely so that we would not need to change the experimental switch sequence or data analysis routine for data taken under this condition. Figure~\\ref{fig:fringe} illustrates the correspondence between $\\theta^{\\rm nr}$ and applied magnetic field needed to remain on the steepest part of the asymmetry fringe.\n\\begin{figure}[!htbp]\n\\centering\n\\includegraphics[trim=7mm 0mm 0mm 0mm,scale=0.6]{contrast_combined.pdf}\n\\caption{(A) Contrast vs time after ablation, averaged over 64~traces. The signal threshold window is indicated by dashed lines (cf.\\ figure~\\ref{fig:modulation}). (B) Contrast vs preparation laser detuning. Error bars were computed as the standard error associated with 64 averaged traces. The solid line is a fit of the form $\\mathcal{C}=a\\times{\\rm tanh}(b\\gamma_C^2\/(4\\Delta_{\\rm prep}^2+\\gamma_C^2))$, motivated by solution of a classical rate equation.}\n\\label{fig:contrast}\n\\end{figure}\n\n\\subsubsection{Accounting for Correlated Contrast}\n\\label{sec:corr_contrast}\n\\hspace*{\\fill} \\\\\nIt was possible for the magnitude of the contrast $|\\C|$ to vary between different experimental states. For example, if the state preparation laser detuning or fluorescence signal background were correlated with any of the block switches $\\Nsw$, $\\Esw$, or $\\Bsw$, then contrast would also be correlated with those switches. As described in section~\\ref{sec:systematics}, we observed both $\\Nsw$- and $\\Nsw\\Esw$-correlated contrast. The latter was particularly troubling since it could lead to a systematic offset in the measured eEDM if not properly accounted for: since $\\A=-\\C\\cos[2(\\phi-\\theta)]$, a nonzero $\\A^{\\mathcal{NE}}$ could occur due to either $\\C^{\\N\\E}$ or $\\phi^{\\N\\E}$. We accounted for contrast correlations by calculating $\\C$ separately for each combination of $\\Nsw$, $\\Esw$, and $\\Bsw$ experimental states (`state-averaged' contrast\\footnote{Since there were $2^3=8$ different $\\Nsw$, $\\Esw$, and $\\Bsw$ states in each 64-trace block, 64\/8 = 8 traces were averaged together to determine the contrast for each experimental state.}):\n\\begin{equation}\n\\label{eq:contrast_2}\n\\C_j(\\Nsw,\\Esw,\\Bsw)=-\\frac{\\bar{\\A}_j(\\tilde{\\theta}=+1,\\Nsw,\\Esw,\\Bsw)-\\bar{\\A}_j(-\\tilde{\\theta}=-1,\\Nsw,\\Esw,\\Bsw)}{4\\Delta \\theta}.\n\\end{equation}\nAs previously discussed, we averaged or applied a quadratic fit to all $\\C_j(\\Nsw,\\Esw,\\Bsw)$ within a molecule pulse to compute $\\bar{\\C}_j(\\Nsw,\\Esw,\\Bsw)$. The precession phase was calculated from each state-specific asymmetry and contrast measurement (cf.\\ equation~\\ref{eq:contrast_1}):\n\\begin{equation}\n\\label{eq:phase_2}\n\\Phi_j(\\Nsw,\\Esw,\\Bsw)=\\frac{\\bar{\\A}_j(\\Nsw,\\Esw,\\Bsw)}{2\\bar{\\C}_j(\\Nsw,\\Esw,\\Bsw)}+q \\frac{\\pi}{4},\n\\end{equation}\nwhere\n\\begin{equation}\n\\label{eq:asymmetry_avg}\n\\bar{\\A}_j(\\Nsw,\\Esw,\\Bsw)=\\frac{\\bar{\\A}_j(\\tilde{\\theta}=+1,\\Nsw,\\Esw,\\Bsw)+\\bar{\\A}_j(\\tilde{\\theta}=-1,\\Nsw,\\Esw,\\Bsw)}{2}\n\\end{equation}\nis the average asymmetry over the two $\\tilde{\\theta}$ states in a data block that share identical values of $\\Nsw$, $\\Esw$ and $\\Bsw$. By construction, phases computed from state-averaged contrast are immune to contrast correlations. We also computed phases by ignoring contrast correlations (i.e. treating contrast as independent of $\\Nsw,\\, \\Esw,\\, \\Bsw$) and the result did not change significantly.\n\n\n\\subsubsection{Computing Phase and Frequency Correlations}\n\\label{sec:compute_phase}\n\\hspace*{\\fill} \\\\\nAfter extracting the measured phase $\\Phi_j(\\Nsw,\\Esw,\\Bsw)$, we performed the basis change described in equation \\ref{eq:general_parity}, from this experiment switch \\emph{state} basis to the experiment switch \\emph{parity} basis, denoted by $\\Phi^p_j$, where $p$ is a placeholder for a given experiment switch parity. \n\nWe observed that the molecule beam forward velocity, and hence the spin precession time $\\tau_j$, fluctuated by up to 10\\% over a 10 minute time period. Since $\\B_z$ and $g_1$ are known from auxiliary measurements to a precision of around 1\\%, we were able to extract $\\tau_j$ from each block from the Zeeman precession phase measurement, $\\Phi^\\B_j=-\\mu_{\\rm B}g_1\\B_z\\tau_j$ (see section~\\ref{sec:Measurement_scheme_more_detail}). Velocity dispersion caused $\\tau_j$ to vary across the molecule pulse with a nominally linear dependence on time after ablation, $t$, however we observed significant deviations from linearity. Thus, we fit $\\tau_j$ to a 3rd order polynomial in $t$ in order to evaluate $\\bar{\\tau}_j$. Then, we evaluated the measured spin precession frequencies defined as\n\\begin{equation}\n\\omega^p_j=\\Phi^p_j\/\\bar{\\tau}_j,\n\\label{eq:omega_def}\n\\end{equation}\nfor all phase channels $p$ (see equation \\ref{eq:phase_parity} for definition). We extracted the eEDM from $\\omega_j^{\\N\\E}$, which in the absence of systematic errors would be given by $\\omega^{\\N\\E}=-d_e\\Eeff$ independent of $j$.\n\nFrom here on we will drop the $j$ subscript that denotes a grouping of $n$ adjacent asymmetry points about a particular time after ablation $t_j$; it is implicit that independent phase measurements were computed from many separate groups of data, each with different values of $t_j$ across the duration of the molecule pulse. At the end of the analysis, and whenever it was convenient to do so, we implicitly performed weighted averaging across the $j$ subscript.\n\\begin{figure}[htbp]\n\\centering\n\\includegraphics[scale=0.9]{omega_nb_vs_eb.pdf}\n\\caption{The difference between magnetic moments of the two $\\Omega$-doublet levels as measured by $\\omega^{\\N\\B}$. As expected, this phase component scales linearly with $\\E$ and $\\B_z$. The constant of proportionality is $\\eta \\mu_{\\rm B}$. Reproduced with permission from \\cite{Petrov2014}}\n\\label{fig:delta_g}\n\\end{figure}\n\nOther phase channels couuld be used to search for and monitor systematic errors, discussed in detail in section~\\ref{sec:systematics}, or to measure properties of ThO, as is the case with $\\omega^{\\N\\B}$. We discuss the latter case here. This channel provided a measure of $\\Delta g$, the magnetic moment difference between upper and lower $\\Nsw$-levels, arising from perturbations due to other electronic and rotational states \\cite{Bickman2009,Petrov2014}. Because this difference limits the extent to which the $\\Nsw$ reversal can suppress certain systematic errors \\cite{Vutha2010}, it is an important quantity both in our experiment and in other experiments measuring eEDMs in molecules with $\\Omega$-doublet structure \\cite{JILAEDM}. Figure~\\ref{fig:delta_g} illustrates an observed linear dependence $\\Delta g\/2=\\eta \\E$, as predicted \\cite{Bickman2009,Petrov2014}. Since $\\E$ and $\\B_z$ are precisely known from auxiliary measurements, the constant $\\eta$ can be directly calculated from our angular frequency measurements:\n\\begin{equation}\n\\label{eq:eta_2}\n\\eta=-\\frac{\\omega^{\\N\\B}}{\\mu_{\\rm B}\\E\\B_z}.\n\\end{equation}\nOur measured value of $\\eta=-0.79\\pm0.01~\\rm{nm}\/\\rm{V}$ was approximately half of what one would compute using the methods developed to understand the effect in the PbO molecule \\cite{Hamilton2010,Bickman2009}. This discrepancy was subsequently understood as being primarily due to coupling to other fine-structure components in the $^3\\Delta$ manifold \\cite{Petrov2014,HutzlerThesis}. The $\\omega^{\\N\\B}$ channel illustrates the importance of understanding phase channels besides that corresponding to the eEDM.\n\n\\subsection{Data Cuts}\n\\label{sec:data_cuts}\nThree data cuts were applied as part of the analysis: fluorescence rate threshold (see section~\\ref{sec:signal_asymmetry}), polarisation bin (see below), and contrast threshold (see below). These cuts made sure that we only used data taken under appropriate experimental conditions (e.g. only when lasers remained locked etc.) and thus ensured a high signal to noise ratio for the data used to extract the eEDM value. We thoroughly investigated how each of these cuts affected the calculated eEDM mean and uncertainty.\n\nAs previously mentioned, a fluorescence threshold cut of about $F_{\\rm{cut}}=3\\times10^5$~s$^{-1}$, was applied to each trace (average of 25 molecule pulses) to ensure that the fluorescence rate would always be larger than the background rate. This threshold was chosen to include the maximum number of asymmetry points in our measurement while also excluding low signal-to-noise asymmetry measurements that would increase the overall eEDM uncertainty, as described below. We also removed entire blocks (complete sets of $\\Nsw$,$\\Esw$,$\\Bsw$,$\\tilde{\\theta}$) of data from the analysis if \nany of the block's experiment states had $\\lesssim0.5$~ms of fluorescence data above $F_{\\rm{cut}}$. \n\nThe count rates of uncorrelated fluorescence photoelectrons exhibit Poissonian statistics. In each block we averaged together four traces with the same experimental configuration. After such averaging, the number of detected photoelectrons within a pair of laser polarisation bins was ${\\gtrsim}50$, which was large enough that the photoelectron number distribution closely resembled a normal distribution. Because the asymmetry was defined as a ratio of two approximately normally distributed random variables ($F_X-F_Y$ and $F_X+F_Y$), its distribution was not necessarily normal. Rather, it approached a normal distribution in the limit of large $F_X+F_Y$ \n\\cite{HutzlerThesis}. The same followed for all quantities computed from the asymmetry, including the eEDM. The fluorescence threshold cut therefore ensured that the distribution of eEDM measurements was very nearly normally distributed. Including low-signal data would have caused the distribution to deviate from normal and increase the overall uncertainty. To check that this signal size cut did not lead to a systematic error in our determination of $d_e$, the eEDM mean and uncertainty were calculated for multiple $F_{\\rm{cut}}$ values, as shown in figure~\\ref{fig:cuts}. If the cut was increased above $6\\times10^5$~s$^{-1}$ the mean value was seen to move slightly (but within the computed uncertainties), and the uncertainty to increase. However, for all plausible values of the cuts the resulting value of $d_e$ was consistent, within uncertainties, with our final stated value.\n\\begin{figure}[!htbp]\n\\centering\n\\includegraphics[width=14cm]{edm_vs_cut_new.pdf}\n\\caption{Measured eEDM mean and uncertainty as a function of (A) fluorescence signal threshold and (B) polarisation bin size and position. For the former, a value of $3\\times10^5$~s$^{-1}$ was used for the final result. For the latter, the two leftmost data points correspond to the polarisation bins used.}\n\\label{fig:cuts}\n\\end{figure}\n\nAs described in section~\\ref{sec:signal_asymmetry}, data points within a polarisation bin were averaged together when calculating the asymmetry (cf. figure~\\ref{fig:modulation}A). These data points were separated by 200~ns. Numbering these points from when the readout laser beam polarisation is switched, we binned points 5--20 or points 0--25, depending on the analysis routine (see section~\\ref{ssec:differences_between_data_analysis_routines} below) when reporting our final result. The former choice was made to cut out background signal and overlapping fluorescence between polarisation states while retaining as much of the fluorescence signal as possible whereas the latter was chosen to minimize the statistical uncertainty given the lack of evidence for systematic errors that depended on time within the polarisation switching cycle. As shown in figure~\\ref{fig:cuts}, we checked for systematic errors associated with this choice by also using several different polarisation bins to compute the eEDM. The eEDM uncertainty increased, as expected, for polarisation bins that cut out data with significant fluorescence levels, but the mean values were all consistent with each other within their respective\nuncertainties.\n\nIn order for a block of data to be included in our final measurement, we also required that \neach of the 8 $(\\Nsw,\\Esw,\\Bsw)$ experiment states\nhad a measured fringe contrast above 80\\%. The primary cause of blocks failing to meet this requirement was the state preparation laser becoming unlocked. This cut resulted in less than 1\\% of blocks being discarded. If the contrast cut was lowered, or not applied at all, the eEDM mean and uncertainty change by less than 3\\% of our statistical uncertainty. As with the signal threshold, if this cut threshold was increased to 90\\%, close to the average value of contrast, $\\mathcal{C}$, then a larger fraction of data was neglected and the eEDM uncertainty was seen to increase.\n\nFor all the cuts discussed, we significantly varied the associated cut and in some cases removed it entirely. The eEDM mean and uncertainty were very robust against significant variation of each of these cuts, and the cuts were chosen before the blind offset applied to the eEDM channel was removed.\n\n\\subsection{Differences Between Data Analysis Routines}\n\\label{ssec:differences_between_data_analysis_routines}\nAs a systematic error check, we performed three independent analyses of the data. Each routine followed the general analysis method described above, but varied in many small details such as background subtraction method, cut thresholds, numbers of points grouped together to compute asymmetry, polarisation bin choice, etc. The analyses differed in the polynomial order of the fits applied to both the contrast $\\mathcal{C}$ and the precession time $\\tau$ vs.\\ time after ablation $t$. The analyses also differed in the inclusion of a subset of the eEDM data that featured a particularly large unexplained signal in the $\\omega^\\N$ channel.\n\nEach of the three analyses independently computed the eEDM channel and the systematic error in the eEDM channel. The uncertainties for all three routines were nearly identical, and the means agreed to within $\\Delta\\omega^{\\N\\E}<3~\\rm{mrad\/s}$, which is within the statistical uncertainty of the measurement $\\delta\\omega^{\\mathcal{NE}}=\\pm4.8$~mrad\/s. The eEDM mean and uncertainty were averaged over the three analyses to produce the final result.\n\n\\subsection{EDM Mean and Statistical Uncertainty}\n\\begin{figure}[!htbp]\n\\centering\n\\includegraphics[width=15.5cm]{EDM_statistics.pdf}\n\\caption{The data set associated with our reported eEDM limit. \\textbf{(A)} Variations in the extracted eEDM as a function of position within the molecular pulse. \\textbf{(B)} Over 10,000 blocks of data were taken over a combined period of about two weeks. \\textbf{(C)}-\\textbf{(D)} The distribution of $\\sim$200,000 separate eEDM measurements (black) matches very well with a Gaussian fit (red). The same data is plotted with both a linear and a log scale. In these histograms the mean of each individual measurement was normalized to its corresponding error bar.}\n\\label{fig:statistics}\n\\end{figure}\nThe final data set used to report our result is shown in figure~\\ref{fig:statistics}. It consisted of ${\\sim}10^4$ blocks of data taken over the course of $\\sim$2~weeks (figure~\\ref{fig:statistics}B); each block contains ${\\approx}20$ separate eEDM measurements distributed over the duration of the molecule pulse (Figure~\\ref{fig:statistics}A). All ${\\approx}2\\times10^5$~measurements were combined with standard Gaussian error propagation to obtain the reported mean and uncertainty. Figure~\\ref{fig:statistics}C,D shows histograms of all measurements on a linear (C) and log (D) scale, showing the distribution agrees extremely well with a Gaussian fit. The resulting uncertainty was about 1.2 times that expected from the photoelectron shot-noise limit, taking into account the photoelectron rate from molecule fluorescence, background light, and PMT dark current. When the eEDM measurements were fit to a constant value, the reduced $\\chi^2$ was $0.996\\pm0.006$ where this uncertainty represents the $1\\sigma$ width of the $\\chi^2$ distribution for the appropriate number of degrees of freedom.\n\\begin{figure}[htbp]\n\\centering\n\\includegraphics[width=10cm]{edm_stats_v3.pdf}\n\\caption{Measured $\\omega^{\\mathcal{NE}}$ values grouped by the states of $\\left|\\mathcal{B}_{z}\\right|,$~$\\left|\\mathcal{E}_{z}\\right|$, $\\hat{k}\\cdot\\hat{z}$, and each superblock switch, before systematic error corrections. Reproduced with permission from \\cite{Baron2014}.}\n\\label{fig:edm_vs_superblock}\n\\end{figure}\n\nWhen computing the eEDM result, data from superblocks were averaged together. The mean could be either weighted or unweighted by the statistical uncertainty in each superblock state. Weighted averaging minimized the resulting statistical uncertainty, but unweighted averaging could suppress systematic errors that have well-defined superblock parity from entering into the extracted value for $\\omega^{\\N\\E}$.\n\nDue to molecule number fluctuations, each block of data had a different associated uncertainty. However, roughly equal amounts of data were gathered for the $2^4$ superblock states defined by the state readout parity $\\Psw$, field plate lead configuration $\\Lsw$, state readout laser polarisation $\\Rsw$, and global laser polarisation $\\Gsw$. For the reported eEDM value, unweighted averaging (or to be precise, performing the basis change prescribed by equation \\ref{eq:general_parity}) was used to combine data from the different $\\Psw$, $\\Rsw$, $\\Lsw$, $\\Gsw$ experiment states, since there were known systematic errors with well-defined superblock parity that were suppressed by these switches (see, for example, sections \\ref{sssec:stark_interference_between_E1_and_M1_transition_amplitudes} and \\ref{ssec:asymmetry_effects}). Note, however, that figure~\\ref{fig:edm_vs_superblock} shows that these systematic errors produced no significant eEDM shift, and that the overall uncertainty was comparable (within 10\\%) when the data was combined with weighted or unweighted averaging.\n\nUnequal amounts of data were collected for the $\\B_z$, $\\E$, and $\\hat{k}\\cdot\\hat{z}$ experimental states. For example, 40\\% (60\\%) of data were gathered with the state preparation and readout laser beams pointing east (west), $\\hat{k}\\cdot\\hat{z}=-1 (+1)$. To account for this, we performed state-by-state analysis of the systematic errors: the primary systematic errors (described in section \\ref{sssec:correlated_laser_parameters}) were allowed to depend on the magnitude of the magnetic field (though $\\B_z=1,40$ mG were grouped together), and the pointing direction, and separate systematic error subtractions were performed for each ($\\B_z$, $\\hat{k}\\cdot\\hat{z}$) state. After this subtraction, the systematic uncertainties were added in quadrature with the statistical uncertainties for each state, and the data from each state was averaged together weighted by the resulting combined statistical and systematic uncertainties.\n\nThe reported statistical uncertainty was obtained via the method above assuming no systematic uncertainty. The reported systematic uncertainty was defined such that the quadrature sum of the reported statistical and systematic uncertainties gives the same value as when incorporating the state-by-state analysis. A description of the methods used to evaluate the systematic error and the systematic uncertainty in the measurement is provided in section \\ref{ssec:total_systematic_error_budget}.\nTo prevent experimental bias we performed a blind analysis by adding an unknown offset to the mean of the eEDM channel, $\\omega^{\\mathcal{NE}}$. The offset was randomly generated in software from a Gaussian distribution with standard deviation $\\sigma=150$~mrad\/s and mean zero. The mean, statistical error, procedure for calculating the systematic error, and procedure for computing the reported confidence interval were all determined before revealing and subtracting the blind offset.\n\n\\subsection{Confidence Intervals}\n\\label{ssec:confidence_intervals}\nA classical (i.e.\\ frequentist) confidence interval \\cite{Riley2006} is a natural choice for reporting the result of an eEDM measurement.\nFor repeated and possibly different experiments measuring the eEDM, the frequency with which the confidence intervals include or exclude the value $\\de=0$ suggests whether the results are consistent or inconsistent, respectively, with the Standard Model.\nFurthermore, the confidence level (C.L.) represents an objective measure of the \\emph{a priori} probability that the confidence interval assigned to any one of these measurements, selected at random, includes the unknown true value of the eEDM $d_{e,{\\rm true}}$. \nSince no statistically significant eEDM has yet been observed, the recent custom has been for electron eEDM experiments to report an upper limit at the 90\\% C.L. \\cite{Regan2002,Hudson2011}. \nThe proper interpretation of such limits is that if the experiment were performed a large number of times, and the confidence interval were \\emph{computed in the same way} for each experimental trial, $d_{e,\\rm true}$ would fall within the interval 90\\% of the time.\n\nFeldman and Cousins pointed out that in order for this interpretation to be valid, the confidence interval construction must be independent of the result of the measurement \\cite{Feldman1998}. If the procedure for constructing 90\\% confidence intervals is chosen contingent upon the measurement outcome, the resulting intervals may `undercover', i.e. fail to include the true value more than 10\\% of the time. This happens, for example, if an upper bound is reported whenever the measured result falls within a few standard deviations of zero, and a two-sided confidence interval is reported whenever the measured result is significant at more than a few-sigma level. Feldman and Cousins termed this inconsistent approach `flip-flopping'.\n\n\nIn order to avoid flip-flopping, we chose a confidence interval construction, the Feldman-Cousins method described in reference~\\cite{Feldman1998}, that consistently unifies these two limits. We applied this method to a model with Gaussian statistics, in which the measured magnitude of the eEDM channel, $x=|\\omega^{\\N\\E}_{T,{\\rm meas}}|$, is sampled from a folded Gaussian distribution\n\\begin{equation}\\label{eq:foldednormal}\nP(x|\\mu)=\\frac{1}{\\sigma\\sqrt{2\\pi}}\\left(\\exp\\left[-\\frac{(x-\\mu)^2}{2\\sigma^2}\\right]+\\exp\\left[-\\frac{(x+\\mu)^2}{2\\sigma^2}\\right]\\right),\n\\end{equation}\nwhere the location parameter is the unknown true magnitude of the eEDM channel, $\\mu=|\\omega^{\\N\\E}_{T,{\\rm true}}|$, and the scale parameter $\\sigma$ is equal to the quadrature sum of the statistical and systematic uncertainties given in equation~\\ref{eq:wNEt_num_err_comb} and at the bottom of table~\\ref{tbl:syst_error}. \n\nThe central idea of the Feldman-Cousins approach is to use an ordering principle which, for each possible value of the parameter of interest $\\mu$, ranks each possible measurement outcome $x$ by the `strength' of the evidence it provides that $\\mu$ is the true value. The values of $x$ that provide the strongest evidence for each value of $\\mu$ are included in the confidence band for that value. In the Feldman-Cousins method, the metric for the strength of evidence is the likelihood of $\\mu$ given that $x$ is measured [i.e. $\\mathcal{L}(\\mu|x) = P(x|\\mu)$], divided by the largest probability $x$ can possibly achieve for any value of $\\mu$. The denominator in this prescription takes into account the fact that an experimental result that is somewhat improbable under a particular hypothesis can still provide good evidence for that hypothesis if the result is similarly improbable under even the most favorable hypothesis. This approach has its theoretical roots in likelihood ratio testing \\cite{Stuart1999}.\n\nOur specific procedure for computing confidence intervals was a numerical calculation performed using the following recipe (cf.\\ figure~\\ref{fig:fc_conf_int}):\n\\begin{enumerate}\n\\item{Construct the confidence bands on a Cartesian plane, of which the horizontal axis represents the possible values of $x$ and the vertical axis the possible values of $\\mu$. Divide the plane into a fine grid with $x$-intervals of width $\\Delta_x$ and $\\mu$-intervals of height $\\Delta_{\\mu}$. We will consider only the discrete possible values $x_i = i \\Delta_x$ and $\\mu_j = j \\Delta_{\\mu}$, where the index $i$($j$) runs from $0$ to $n_x$($n_{\\mu}$).}\\label{it:setup}\n\\item{For all values of $i$, maximize $P(x_i|\\mu_j)$ with respect to $\\mu_j$. Label the maximum points $\\mu^{\\mathrm{max},i}$.}\\label{it:ymax}\n\\item{For some value of $j$, say $j=0$, compute the likelihood ratio $R(x_i) = P(x_i|\\mu_j)\/P(x_i|\\mu^{\\mathrm{max},i})$ for every value of $i$.}\\label{it:R}\n\\item{Construct the `horizontal acceptance band' at $\\mu_j$ by including values of $x_i$ in descending order of $R(x_i)$. Stop adding values when the cumulative probability reaches the desired C.L. of 90\\%, i.e., $\\displaystyle \\sum_{x_i}P(x_i|\\mu_j)\\Delta_x = 0.9$.}\\label{it:horiz}\n\\item{Repeat steps (\\ref{it:R})--(\\ref{it:horiz}) for all values of $j$.}\n\\item{To determine the reported confidence interval, draw a vertical line on the plot at $x = |\\omega^{\\N\\E}_{T,{\\rm meas}}|$. The 90\\% confidence interval is the region where the line intersects the constructed confidence band.}\n\\end{enumerate}\n\n\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[width=0.49\\textwidth]{FC_conf_int.pdf}\n\\includegraphics[width=0.49\\textwidth]{Conf_int_compare.pdf}\n\\caption{Left: Feldman-Cousins confidence bands for a folded Gaussian distribution, constructed as described in the text, for a variety of confidence levels. Each pair of lines indicates the upper and lower bounds of the confidence band associated with each C.L. To the left of the $x$-intercepts, the lower bounds are zero. Confidence bands are plotted as a function of the possible measured central values $x$ scaled by the standard deviation $\\sigma$, and our result is plotted as a vertical dot-dashed line. The $\\mu$-value of the point at which our result line intersects with each of the colored lines gives the upper limit of our measurement at different C.L.'s. Right: Comparison between 90\\% confidence intervals computed using three different methods, described in the text. Confidence bands are plotted as a function of the possible measured central values of a quantity $x$ scaled by the standard deviation $\\sigma$. Our result, $|\\omega^{\\N\\E}_{T,{\\rm meas}}|\/\\sigma=0.46$, is plotted as a vertical dot-dashed line. The $\\mu$-values of the points at which our result line intersects the upper and lower line for each method give the upper and lower bounds of three possible 90\\% confidence intervals for our measurement. To avoid invalidating the confidence interval by flip-flopping, our result should be interpreted using the Feldman-Cousins method, which we chose before unblinding.}\n\\label{fig:fc_conf_int}\n\\end{figure}\n\nThe left-hand plot in figure~\\ref{fig:fc_conf_int} was generated using the prescription above at several different C.L.'s. \nNote that the 90\\% confidence intervals switch from upper bounds to two-sided confidence intervals when the value of $|\\omega^{\\N\\E}_{T,{\\rm meas}}|$ becomes larger than $1.64 \\sigma$. This is the level of statistical significance required to exclude the value $\\de = 0$ from a 90\\% C.L.\\ central Gaussian confidence band.\n\nFrom equation~(\\ref{eq:wNEt_num_err_comb}), we find $|\\omega^{\\N\\E}_{T,{\\rm meas}}|=0.46\\sigma$ with $\\sigma=5.79~\\rm{mrad}\/\\rm{s}$. In our confidence interval construction, this corresponds to an upper bound of $|\\wNEt|<1.9\\sigma=11~\\rm{mrad}\/\\rm{s}$ (90\\% C.L.). \nA comparison between three different 90\\% confidence interval constructions for small values of $\\mu$ is shown in the right-hand plot of figure~\\ref{fig:fc_conf_int}. The black dashed lines represent the central confidence band for the signed values (rather than the magnitude) of $\\mu$ and $x$, where $\\mu$ is the mean of a Gaussian probability distribution in $x$. The blue lines give an upper bound constructed by computing the the value of $\\mu$ such that the cumulative distribution function for the folded Gaussian in equation~\\ref{eq:foldednormal} is equal to $0.9$ for each value of $x$. It should be noted that this upper bound is more conservative than a true classical 90\\% confidence band, as it overcovers for small values of $\\mu$ (e.g., if the true value were $\\mu_{\\rm true} < 1.64 \\sigma$, the confidence intervals of 100\\% of experimental results would include $\\mu_{\\rm true}$). We nevertheless include this construction for comparison because we believe that previous experiments have reported EDM upper bounds using this method \\cite{Hudson2011,Griffith2009,Regan2002}. These intervals have a valid interpretation as Bayesian `credible intervals' conditioned on a uniform prior for $\\mu$ \\cite{Feldman1998}. Finally, the red lines represent the Feldman-Cousins approach described here, which unifies upper limits and two-sided intervals. For our measurement outcome, indicated by the vertical dot-dashed line, the Feldman-Cousins intervals yield a $7\\%$ larger eEDM limit than the folded Gaussian upper bound would have.\n\n\\subsection{Physical Quantities}\n\\label{ssec:physical_quantities}\n\n\nUnder the most general interpretation, our experiment is sensitive to any $P$- and $T$-violating interaction that produces an energy shift $\\wNEt$. The eEDM is not the only such predicted interaction for diatomic molecules \\cite{Kozlov1995}, and in particular a $P$- and $T$-odd nucleon-electron scalar-pseudoscalar interaction would also manifest as a $\\Nsw\\Esw$-odd phase in our experiment. Thus, we write\n\\begin{equation}\n\\wNEt=-d_e\\Eeff + W_{\\rm S}C_{\\rm S},\\footnote{Note that the sign of the $C_{\\rm S}$ term is opposite to that used, incorrectly, in our original paper \\cite{Baron2014}. In addition, here $W_{\\rm S}$ differs in magnitude from the related quantity $W_{\\rm T,P}$ given explictly in \\cite{Denis2016,Skripnikov2016}. A detailed discussion of the sign and notational conventions for this Hamiltonian is provided in \\ref{sec:sign_conventions}.}\n\\end{equation}\nwhere $W_{\\rm S}$ is a (calculated) energy scale specific to the species of study \\cite{Skripnikov2013,Dzuba2011a,DzubaErratum2012,Denis2016,Skripnikov2016} and $C_{\\rm S}$ is a dimensionless constant characterizing the strength of the $T$-violating nucleon-electron scalar-pseudoscalar coupling relative to the ordinary weak interaction. \n\nWe can use our measurement to set an upper limit on $\\de$ by assuming that $C_{\\rm S}=0$ and that $\\wNEt$ is therefore entirely attributable to the eEDM. Taking the effective electric field to be the unweighted mean of the two most recent calculations of this quantity \\cite{Denis2016,Skripnikov2016}, $\\Eeff=78~{\\rm GV\/cm}$, we can interpret our result in equation~(\\ref{eq:wNEt_num_err_comb}) as:\n\\begin{align}\n\\de&=(-2.2\\pm4.8)\\times10^{-29}~e\\cdot{\\rm cm}\\\\\n\\Rightarrow|\\de|&<9.3\\times10^{-29}~e\\cdot{\\rm cm}~(90\\%\\,{\\rm C.L.}),\n\\end{align}\nwhere the second line is obtained by appropriately scaling the upper bound on $\\wNEt$ derived in section \\ref{ssec:confidence_intervals}.\n\nIf, instead, we assume that $d_e=0$, our measurement of $\\wNEt$ in ThO can be restated as a measurement of $C_{\\rm S}$. Using an unweighted mean of the most recent calculations of the interaction coefficient, $W_{\\rm S} = -2\\pi\\times 282~{\\rm kHz}$ \\cite{Denis2016,Skripnikov2016}, we obtain:\n\\begin{align}\nC_{\\rm S}&=(-1.5\\pm3.2)\\times10^{-9}\\\\\n\\Rightarrow|C_{\\rm S}|&<6.2\\times10^{-9} \\:(90\\%\\,{\\rm C.L.}),\n\\end{align}\nwhich, at the time, was an order of magnitude smaller than the existing best limit set by the ${}^{199}$Hg EDM experiment \\cite{Swallows2013}, and is still a factor of 2 smaller than the recently improved limit from the same group \\cite{Heckel2016}.\n\n\\subsection{Determining Systematic Errors and Uncertainties}\n\\label{ssec:determining_systematic_uncertainty}\n\n\\begin{table}[tbp]\n\\caption{\\label{tbl:syst_check}Parameters varied during our systematic error search. Left: Category I Parameters --- These were ideally zero under normal experimental running conditions and we were able to vary them significantly from zero. For each of these parameters direct measurements or limits were placed on possible systematic errors. Right: Category II Parameters --- These had no single ideal value. Although direct limits on these systematic errors could not be derived, they served as checks for the presence of unanticipated systematic errors. See the main text for more details on all the systematic errors referenced.}\n\\begin{minipage}[t]{0.5\\textwidth}\n\\begin{tabular}[t]{l}\n\\br\nCategory I Parameters\\\\\n\\mr\n\\textbf{Magnetic Fields}\\\\\n- Non-reversing $\\B$-field: $\\B_{z}^{\\rm{nr}}$\\\\\n- Transverse $\\B$-fields: $\\B_{x},\\B_{y}$\\\\\n(both even and odd under $\\Bsw$)\\\\\n- $\\B$-field gradients: \\\\\n$\\frac{\\partial\\B_{x}}{\\partial x},\\frac{\\partial\\B_{y}}{\\partial x},\\frac{\\partial\\B_{y}}{\\partial y},\\frac{\\partial\\B_{y}}{\\partial z},\\frac{\\partial\\B_{z}}{\\partial x},\\frac{\\partial\\B_{z}}{\\partial z}$\\\\\n(both even and odd under $\\Bsw$)\\\\\n- $\\Esw$ correlated $\\B$-field: $\\B^{\\E}$\n(to simulate\\\\\n$\\vec{v}\\times\\vecE$\/geometric phase\/leakage current)\\\\\n\\textbf{Electric Fields}\\\\\n- Non-reversing $\\E$-field: $\\E^{\\rm{nr}}$\\\\\n- $\\E$-field ground offset\\\\\n\\textbf{Laser Detunings}\\\\\n- State preparation\/readout lasers: $\\Delta_{{\\rm prep}}^{\\rm nr}$, $\\Delta_{\\rm{read}}^{\\rm nr}$\\\\\n- $\\Psw$ correlated detuning, $\\Delta^{\\mathcal{P}}$\\\\\n- $\\Nsw$ correlated detunings: $\\Delta^{\\N}$\\\\\n\\textbf{Laser Pointings}\\\\\n- Change in pointing of prep.\/read lasers\\\\\n- State readout laser $\\hat{X}\/\\hat{Y}$ dependent pointing\\\\\n- $\\Nsw$ correlated laser pointing\\\\\n- $\\Nsw$ and $\\hat{X}\/\\hat{Y}$ dependent laser pointing\\\\\n\\textbf{Laser Powers}\\\\\n- $\\Nsw\\Esw$ correlated power $\\Omega_{\\rm r}^{\\N\\E}$\\\\\n- $\\Nsw$ correlated power $\\Omega_{\\rm r}^{\\N}$\\\\\n- $\\hat{X}\/\\hat{Y}$ dependent state readout laser power, $\\Omega_{\\rm r}^{XY}$\\\\\n\\textbf{Laser Polarisation}\\\\\n- Preparation laser ellipticity, $S_{{\\rm prep}}$\\\\\n\\textbf{Molecular Beam Clipping}\\\\\n- Molecule beam clipping along $\\hat{y}$ and $\\hat{z}$\\\\\n(changes $\\left\\langle v_{y}\\right\\rangle $,$\\left\\langle v_{z}\\right\\rangle $,$\\left\\langle y\\right\\rangle $,$\\left\\langle z\\right\\rangle $\nof molecule beam)\\\\\n\\br\n\\end{tabular}\n\\end{minipage}\n\\begin{minipage}[t]{0.5\\textwidth}\n\\begin{tabular}[t]{l}\n\\br\nCategory II Parameters \\\\\n\\mr\n\\textbf{Laser Powers}\\\\\n- Power of prep.\/read lasers \\\\\n\\textbf{Experiment Timing}\\\\\n- $\\hat{X}$\/$\\hat{Y}$ polarisation switching rate\\\\\n- Number of molecule pulses averaged \\\\\nper experiment trace\\\\\n\\textbf{Analysis}\\\\\n- Signal size cuts, asymmetry size cuts,\\\\\ncontrast cuts\\\\\n- Difference between two PMT detectors\\\\\n- Variation with time within molecule pulse\\\\\n(serves to check $v_{x}$ dependence)\\\\\n- Variation with time within polarisation \\\\\nswitching cycle\\\\\n- Variation with time throughout the \\\\\nfull data set (autocorrelation)\\\\\n- Search for correlations between all channels \\\\\nof phase, contrast and fluorescence signal \\\\\n- Correlations with auxiliary measurements\\\\\nof $\\B$-fields, laser powers, vacuum pressure\\\\\nand temperature\\\\\n- 3 independent data analysis routines\\\\\n\\br\n\\end{tabular}\n\\end{minipage}\n\\end{table}\n\nIn total, we varied more than 40 separate parameters during our search for systematic errors (see Table \\ref{tbl:syst_check}). These fall into two categories.\nCategory I contains parameters $P$ which are optimally zero; $P\\neq0$ represents an experimental imperfection. We were able to use experimental data to put a direct limit on the size of possible systematic errors proportional to these parameters. Category II contains parameters that have no optimum value and which we could vary significantly without affecting the nature of the spin precession measurement. The variation of these parameters could reveal systematic errors and serve as a check that we understood the response of our system to those parameters, but no quantitative bounds on the associated systematic errors were derived. \n\nFor each Category I parameter $P$, we exaggerated the size of the imperfection by a factor greater than $10$, if possible, relative to the maximum size of the imperfection under normal operating conditions, $\\bar{P}$, which was obtained from auxiliary measurements. Following previous work \\cite{Regan2002,Griffith2009,Hudson2011}, we assumed a linear relationship between $\\omega^{\\mathcal{NE}}$ and $P$, and extracted the sensitivity of the $\\omega^{\\mathcal{NE}}$ to parameter $P$, $\\partial\\omega^{\\mathcal{NE}}\/\\partial P$. The systematic error under normal operating conditions was computed as $\\omega_P^{\\N\\E}=(\\partial\\omega^{\\N\\E}\/\\partial P)\\bar{P}$. The statistical uncertainty in the systematic error (henceforth referred to as the systematic uncertainty) $\\delta\\omega_P^{\\N\\E}$ was obtained from linear error propagation of uncorrelated random variables,\n\\begin{equation}\n\\delta\\omega_P^{\\N\\E}= \\sqrt{\\left(\\frac{\\partial\\omega^{\\N\\E}}{\\partial P}^{\\:}\\delta\\bar{P}\\right)^{2}+\\left(\\bar{P}^{\\:}\\delta\\frac{\\partial\\omega^{\\N\\E}}{\\partial P}\\right)^{2}},\n\\end{equation}\nwhere $\\delta\\bar{P}$ is the uncertainty in $\\bar{P}$ and $\\delta\\partial\\omega^{\\N\\E}\/\\partial P$ is the uncertainty in $\\partial\\omega^{\\N\\E}\/\\partial P$. \n\nFor parameters that had been observed to produce statistically significant shifts in $\\omega^{\\mathcal{NE}}$, such as the non-reversing electric field, $\\E^{\\rm{nr}}$, we monitored the size of the systematic error throughout the reported data set during \\textit{Intentional Parameter Variations} (described in section \\ref{sec:Measurement_scheme_more_detail}) and deducted this quantity from $\\omega^{\\mathcal{NE}}$ to give a value of the spin precession frequency due to T-odd interactions in the H state of ThO, $\\wNEt=\\omega^{\\N\\E}-\\sum_{P}\\omega_P^{\\N\\E}$. Most Category I parameters did not cause a statistically significant $\\omega^{\\N\\E}_P$ and were not monitored. For these parameters, we did not subtract $\\omega_P^{\\N\\E}$ from $\\omega^{\\mathcal{NE}}$, but rather included an upper limit of $\\left[(\\omega_P^{\\N\\E})^{2}+(\\delta\\omega_P^{\\N\\E})^{2}\\right]^{1\/2}$ in the systematic uncertainty on $\\wNEt$, or chose to omit this parameter from the systematic error budget altogether based on the criteria described in section \\ref{ssec:total_systematic_error_budget}.\n\nWhere applicable, we also fit higher-order polynomial functions to $\\omega^{\\mathcal{NE}}$ with respect to $P$ during the systematic error searches. No significant increase in the systematic uncertainty was observed using such fits and hence the contributions to the systematic error budget in Table \\ref{tbl:syst_error} were all estimated from linear fits. We note, however, that certain non-linear dependences of $\\omega^{\\mathcal{NE}}$ on $P$ could lead to underestimates of the systematic uncertainty, for example if $\\omega^{\\mathcal{NE}}$ has a small (large) nonzero value for large (small) values of $P$. In efforts to avoid this, data were taken over as wide a range as possible, it is, however, always possible that such non-linear dependence is present between the parameter values for which we took data. We had no models by which non-linear dependence could manifest by variation of the parameters investigated, so we believe the procedure outlined above produced accurate estimates of the systematic errors.\n\n\n\\subsection{Systematic Errors Due to Imperfect Laser Polarisations}\n\\label{ssec:systematic_errors_due_to_imperfect_laser_polarizations}\n\nThe dominant systematic errors in our experiment were due to imperfections in the laser beams used to prepare the molecular and read out the molecular state. Non-ideal laser polarisations combined with laser parameters correlated with the expected eEDM signal resulted in three distinct systematic errors which we refer to as the $\\E^{\\rm{nr}}$, $\\Omega_{\\rm r}^{\\N\\E}$, and Stark Interference (S.I.) systematic errors. In this section, we model the effects of several types of polarisation imperfections on the measured phase $\\Phi$ (sections~\\ref{sssec:stark_interference_between_E1_and_M1_transition_amplitudes} and \\ref{sssec:AC_stark_shift_phases}) and discuss the correlated laser parameters that couple to these polarisation imperfections to result in systematic errors (section~\\ref{sssec:correlated_laser_parameters}). We then discuss how we were able to suppress and quantify the residual systematic errors in the eEDM experiment (sections~\\ref{sssec:suppression_of_the_AC_stark_shift_phases} and \\ref{sssec:correlated_laser_parameters}).\n\n\\subsubsection{Idealized Measurement Scheme with Polarisation Offsets}\n\\label{sssec:idealized_measurement_scheme_with_polarization_offsets}\n\nAs described in section \\ref{sec:Measurement_scheme}, the molecules initially enter the state preparation laser beam in an incoherent mixture of the two states $|\\pm,\\Nsw\\rangle$. The bright state $|B(\\hat{\\epsilon}_{{\\rm prep}},\\Nsw,\\Psw_{{\\rm prep}})\\rangle$ is then optically pumped away through $|C,\\Psw_{{\\rm prep}}\\rangle$ leaving behind the dark state $|D(\\hat{\\epsilon}_{{\\rm prep}},\\Nsw,\\Psw_{{\\rm prep}})\\rangle$ as the initial state for the spin precession. The molecules then undergo spin precession by angle $\\phi$ evolving to a final state $|\\psi_{f}\\rangle=U(\\phi)|D(\\hat{\\epsilon}_{{\\rm prep}},\\Nsw,\\Psw_{{\\rm prep}})\\rangle$ where $U(\\phi)=\\sum_{\\pm}e^{\\mp i\\phi}|\\pm,\\Nsw\\rangle\\langle\\pm,\\Nsw|$ is the spin precession operator. The molecules then enter the state readout laser that optically pumps the molecules with alternating polarisations $\\hat{\\epsilon}_{X}$ and $\\hat{\\epsilon}_{Y}$\n(which are nominally linearly polarised and orthogonal) between $|\\pm,\\Nsw\\rangle$ and $|C,\\Psw_{\\rm{read}}\\rangle$. For each polarisation, the optical pumping results in a fluorescence count rate proportional to the projection of the state onto the bright state, $F_{X,Y}=fN_{0}|\\langle B(\\hat{\\epsilon}_{X,Y},\\Nsw,\\Psw_{\\rm{read}})|\\psi_{f}\\rangle|^{2}$ where $f$ is the photon detection efficiency, and $N_{0}$ is the number of molecules in the addressed $\\Nsw$ level. We then compute the asymmetry, $\\mathcal{A}=(F_{X}-F_{Y})\/(F_{X}+F_{Y})$, dither the linear polarisation angles in the state readout laser beams to evaluate the fringe contrast, $\\mathcal{C}=(\\partial\\mathcal{A}\/\\partial\\phi)\/2\\approx-(\\partial\\mathcal{A}\/\\partial\\theta_{\\rm{read}})\/2$, and extract the measured phase, $\\Phi=\\mathcal{A}\/(2\\mathcal{C})+q\\pi\/4$.\\footnote{Recall $q$ is chosen to be an integer which depends on the size of the applied magnetic field.} We then report the result of the measurement in terms of an equivalent phase precession frequency $\\omega=\\Phi\/\\tau$ where $\\tau\\approx1^{\\:}\\mathrm{ms}$ is the spin precession time, which was measured for each block as described in section~\\ref{sec:compute_phase}.\n\nLet us first consider the idealized case in which all laser polarisations are exactly linear, $\\Theta_{i}=\\pi\/4$ for each laser $i\\in\\left\\{{\\rm prep},X,Y \\right\\}$, the angle between the state preparation laser polarisation (${\\rm prep}$) and state readout basis ($X,Y$) is $\\pi\/4$, $\\theta_{\\rm{read}}-\\theta_{{\\rm prep}}=-\\pi\/4$, and the accumulated phase is small, $\\left|\\phi\\right|\\ll1$ (i.e. no magnetic field is applied). Under these conditions, the measured phase $\\Phi$ is equal to the accumulated phase $\\phi$. Now consider the effect of adding polarisation offsets $d\\vec{\\epsilon}_{i}$ to each of the three laser beams such that $\\hat{\\epsilon}_{i}\\rightarrow\\hat{\\epsilon}_{i}+\\kappa d\\vec{\\epsilon}_{i}$, where $\\kappa = 1$ is a perturbation parameter. It is useful to cast the polarisation imperfections in terms of linear angle imperfections, $\\theta_{i}\\rightarrow\\theta_{i}+\\kappa d\\theta_{i}$ and ellipticity imperfections, $\\Theta_{i}\\rightarrow\\Theta_{i}+\\kappa d\\Theta_{i}$ where $S_{i}=-2d\\Theta_{i}$ is the laser ellipticity Stokes parameter; these are related by\n\\begin{equation}\n\\frac{\\hat{z}\\cdot(\\hat{\\epsilon}_{i}\\times d\\vec{\\epsilon}_{i})}{\\hat{\\epsilon}_{i}\\cdot\\hat{\\epsilon}_{i}}=d\\theta_{i}-id\\Theta_{i}.\\label{eq:extracting_polarization_imperfection_components}\n\\end{equation}\nNote that laser polarisations can have a nonzero projection in the $\\hat{z}$ direction, but we assume in the discussion above that $\\hat{\\epsilon}_{i}$ represents a normalized projection of the laser polarisation onto the $xy$ plane.\\footnote{The $z$-component of the polarisation can only drive $\\Delta M=0$ transitions, which are far off resonance from the state preparation\/readout lasers.} With these polarisation imperfections in place, the measured phase $\\Phi$ gains additional terms:\n\\begin{equation}\n\\Phi=\\phi+\\kappa(d\\theta_{{\\rm prep}}-\\frac{1}{2}(d\\theta_{X}+d\\theta_{Y}))-\\kappa^{2}\\Psw_{{\\rm prep}}\\Psw_{\\rm{read}}d\\Theta_{{\\rm prep}}(d\\Theta_{X}-d\\Theta_{Y})+O\\left(\\kappa^{3}\\right),\\label{eq:Measured_Phase_with_Polarization_Imperfections}\n\\end{equation}\nup to second order in $\\kappa$. In the eEDM measurement, we switch between two values of $\\Psw\\equiv\\Psw_{\\rm{read}}$, the parity of the excited state addressed during state readout, and we set $\\Psw_{{\\rm prep}}=+1$, the parity of the excited state addressed during state preparation. It is worth dwelling on equation \\ref{eq:Measured_Phase_with_Polarization_Imperfections} for a moment. A rotation of all polarisations by the same angle leaves the measured phase unchanged: $d\\theta_{i}\\rightarrow d\\theta_{i}+d\\theta\\implies\\Phi\\rightarrow\\Phi$, as expected. A deviation in the relative angle between the state preparation and readout beams, $d\\theta_{{\\rm prep}}\\rightarrow d\\theta_{{\\rm prep}}+d\\theta$ and $d\\theta_{X,Y}\\rightarrow d\\theta_{X,Y}-d\\theta$, enters into the phase measurement as $\\Phi\\rightarrow\\Phi+2d\\theta$, but is benign so long as $d\\theta$ is uncorrelated with the expected eEDM signal. The laser ellipticities affect the\nphase measurement only when the state readout beams differ in ellipticity, and this contribution to the phase can be distinguished from the others by switching the excited state parity, $\\Psw$. This last term is particularly interesting because it allows for multiplicative couplings between polarisation imperfections in the state preparation and state readout beams to contribute to the measured phase.\n\nAlthough the polarisation imperfection terms in equation \\ref{eq:Measured_Phase_with_Polarization_Imperfections} are uncorrelated with the $\\Nsw\\Esw$ and hence do not contribute to the systematic error, we will see in later sections that additional imperfections can lead to changes in the molecule state that is prepared or read-out that are equivalent to correlations $d\\theta_{i}^{\\N\\E}$ and $d\\Theta_{i}^{\\N\\E}$. The framework of equation \\ref{eq:Measured_Phase_with_Polarization_Imperfections} is useful for understanding how these correlations result in systematic errors in the eEDM measurement extracted from $\\Phi^{\\N\\E}$.\n\n\n\\subsubsection{Stark interference between E1 and M1 transition amplitudes}\n\\label{sssec:stark_interference_between_E1_and_M1_transition_amplitudes}\n\nIn this section we describe in detail how interference between multipole transition amplitudes can lead to a measured phase that mimicks an eEDM spin precession phase. We develop a general framework illustrating how such phases depend on laser polarisation and pointing.\n\nIn an applied electric field, opposite parity levels are mixed, allowing both odd parity (E1, M2,...) and even parity (M1, E2,...) electromagnetic multipole amplitudes to contribute when driving an optical transition. These amplitudes depend on the orientation of the electric field relative to the light polarisation $\\hat{\\epsilon}$ and the laser pointing direction $\\hat{k}$. This Stark interference (S.I.) effect forms the basis of precise measurements of weak interactions through parity non-conserving amplitudes in atoms and molecules \\cite{Bouchiat1974,Demille2008,Wood1997}. However, it can also generate a systematic error in searches for permanent electric dipole moments which look for spin precession correlated with the orientation of an applied electric field. These Stark interference amplitudes have been calculated and measured for optical transitions in Rb \\cite{Chen1994,Hodgdon1991} and Hg \\cite{Lamoreaux1992,Loftus2011}, and have been included in the systematic error analysis in the Hg EDM experiment \\cite{Griffith2009,Swallows2013}.\n\nIn this section, we consider Stark interference as a source of systematic errors in the ACME experiment. There are two important differences between molecular and atomic systems. First, molecular states such as the $H^{3}\\Delta_{1}$ state in ThO can be highly polarisable and opposite parity states can be completely mixed by the application of a modest laboratory electric field. Second, molecular selection rules can be much weaker than atomic selection rules: the $H^{3}\\Delta_{1}\\rightarrow C^{3}\\Pi_{1}$ transition that we drive is nominally an E1 forbidden spin-flip transition ($\\Delta\\Sigma=1$, where $\\Sigma$ is the projection of the total electron spin $S=1$ onto the intermolecular axis), \nbut these states have significant subdominant contributions from other spin-orbit terms \\cite{Paulovic2003}, between some of which the E1 transition is allowed. Both of these effects significantly amplify the effect of Stark interference in molecules relative to atoms. In this section we will derive the effect of Stark interference on the measured phase $\\Phi$.\n\nConsider a plane wave vector potential $\\vec{A}$ with real amplitude $A_{0}$, oscillating at frequency $\\omega$, that is resonant with a molecular optical transition $\\left|g\\right\\rangle \\rightarrow\\left|e\\right\\rangle$,with wave vector $\\vec{k}=\\left(\\omega\/c\\right)\\hat{k}$, and complex polarisation $\\hat{\\epsilon}$:\n\\begin{align}\n\\vec{A}\\left(\\vec{r},t\\right)= & A_{0}\\hat{\\epsilon}e^{i\\vec{k}\\cdot\\vec{r}-i\\omega t}+\\mathrm{c.c}.\n\\end{align}\nThe interaction Hamiltonian $H_{\\mathrm{int}}$ between this classical light field and the molecular system is given by:\n\\begin{align}\nH_{\\mathrm{int}}\\left(t\\right)= & -\\sum_{a}\\frac{e^{a}}{m^{a}}\\vec{A}\\left(\\vec{r}^{\\,a},t\\right)\\cdot\\vec{p}^{a}\n\\end{align}\nwhere $a$ indexes a sum over all of the particles in the system with charge $e^{a}$, mass $m^{a}$, position $\\vec{r}^{\\,a}$ and momentum $\\vec{p}^{a}$. Typically we apply the multipole expansion on the transition matrix element between states $\\left|g\\right\\rangle $ and $\\left|e\\right\\rangle$; the matrix element can then be written as \n\\begin{equation}\n\\mathcal{M}\\equiv\\langle e|H_{\\mathrm{int}}|g\\rangle=iA_{0}\\omega_{eg}\\sum_{\\lambda=1}^{\\infty}\\langle e|\\hat{\\epsilon}\\cdot\\vec{E}_{\\lambda}+(\\hat{k}\\times\\hat{\\epsilon})\\cdot\\vec{M}_{\\lambda}|g\\rangle,\n\\end{equation}\nwhere $\\vec{E}_{\\lambda}$ describes the electric interaction of order $O((\\vec{k}\\cdot\\vec{r})^{\\lambda-1})$ and $\\vec{M}_{\\lambda}$ describes the magnetic interaction of order $O(\\alpha(\\vec{k}\\cdot\\vec{r})^{\\lambda-1})$\n(where $\\alpha$ is the fine structure constant) such that\n\\begin{align}\n\\vec{E}_{\\lambda}= & \\frac{\\left(i\\right)^{\\lambda-1}}{\\lambda!}\\sum_{a}e^{a}\\vec{r}^{\\,a}\\left(\\vec{k}\\cdot\\vec{r}^{\\,a}\\right)^{\\lambda-1},\\\\\n\\vec{M}_{\\lambda}= & \\frac{\\left(i\\right)^{\\lambda-1}}{\\left(\\lambda-1\\right)!}\\sum_{a}\\left(\\frac{e^{a}}{2m^{a}}\\right)\\left[\\left(\\vec{k}\\cdot\\vec{r}^{\\,a}\\right)^{\\lambda-1}\\left(\\frac{1}{\\lambda+1}\\vec{L}^{a}+\\frac{1}{2}g^{a}\\vec{S}^{a}\\right)+\\left(\\frac{1}{\\lambda+1}\\vec{L}^{a}+\\frac{1}{2}g^{a}\\vec{S}^{a}\\right)\\left(\\vec{k}\\cdot\\vec{r}^{\\,a}\\right)^{\\lambda-1}\\right],\\nonumber \n\\end{align}\nwhere $L^{a}$ is the orbital angular momentum, $S^{a}$ is the spin angular momentum, and $g^{a}$ is the spin g-factor for particle of index $a$ (see e.g.\\ \\cite{Sachs1987}). For typical atomic or molecular optical transitions, if all moments are allowed, we expect the dominant\ncorrections to the leading order E1 transition moment to be on the order of M1\/E1 $\\sim\\alpha\\sim10^{-2}$--$10^{-3}$ and E2\/E1$\\sim ka_{0}\\sim10^{-3}$--$10^{-4}$, where $a_0$ is the Bohr radius. In this work we neglect the higher order contributions beyond E2, though the effects may by evaluated by using the expansion\nabove.\n\n\n\\begin{center}\n\\begin{table}\n\\centering\n\\begin{tabular}{cccc}\n\\hline \n\\multicolumn{4}{c}{}\\tabularnewline\n\\multicolumn{4}{c}{$\\left\\langle e\\left|H_{\\mathrm{int}}\\left(O^{\\lambda}\\right)\\right|g\\right\\rangle =iA_{0}\\omega_{eg}\\left[\\hat{\\epsilon}_{+1}^{*}\\left\\langle e\\left|T_{+1}^{\\lambda}\\left(O^{\\lambda}\\right)\\right|g\\right\\rangle +\\hat{\\epsilon}_{-1}^{*}\\left\\langle e\\left|T_{-1}^{\\lambda}\\left(O^{\\lambda}\\right)\\right|g\\right\\rangle \\right]\\cdot\\vec{V}\\left(O^{\\lambda}\\right)+\\dots$}\\tabularnewline\n\\tabularnewline\n\\hline \n\\multirow{2}{*}{Term} & Tensor & \\multirow{2}{*}{Molecular Operator, $O^{\\lambda}$} & \\multirow{2}{*}{Light Vector, $\\vec{V}\\left(O^{\\lambda}\\right)$}\\tabularnewline\n & rank, $\\lambda$ & & \\tabularnewline\n\\hline \nE1 & 1 & $\\Sigma_{a}e^{a}r_{i}^{a}$ & $\\hat{\\epsilon}$\\tabularnewline\nM1 & 1 & $\\Sigma_{a}\\frac{e^{a}}{2m^{a}}\\left(L_{i}^{a}+g^{a}S_{i}^{a}\\right)$ & $\\hat{k}\\times\\hat{\\epsilon}$\\tabularnewline\nE2 & 2 & $\\frac{\\omega}{2c}\\sum_{a}e^{a}r_{i}^{a}r_{j}^{a}$ & $\\frac{i}{\\sqrt{2}}\\left[\\hat{\\epsilon}(\\hat{k}\\cdot\\hat{z})+\\hat{k}(\\hat{\\epsilon}\\cdot\\hat{z})\\right]$\\tabularnewline\nM2 & 2 & $\\frac{\\omega}{c}\\Sigma_{a}\\frac{e^{a}}{2m^{a}}\\left\\{ r_{i}^{a},\\frac{1}{3}L_{j}^{a}+\\frac{1}{2}g^{a}S_{j}\\right\\} $ & $\\frac{i}{\\sqrt{2}}\\left[\\hat{k}((\\hat{k}\\times\\hat{\\epsilon})\\cdot\\hat{z})+(\\hat{k}\\times\\hat{\\epsilon})(\\hat{k}\\cdot\\hat{z})\\right]$\\tabularnewline\n\\hline \n\\end{tabular}\n\\par\n\\protect\\caption{Only spherical tensor operators $T_{q}^{\\lambda}$ with projection $q=\\pm1$ contribute to the $\\left|H\\right\\rangle \\rightarrow\\left|C\\right\\rangle$ transition amplitude. With this simplifying assumption, we can write the matrix element for each multipole operator in the form shown at the top of this table, which factors the molecule properties and the light properties (where $\\hat{\\epsilon}_{\\pm}=\\mp\\left(\\hat{x}\\pm i\\hat{y}\\right)\/\\sqrt{2}$ are the spherical basis vectors, and $\\hat{z}$ is the direction of the electric field). Here, the molecular operators $O^{\\lambda}$ and the corresponding light vectors $\\vec{V}\\left(O^{\\lambda}\\right)$ are listed for the E1, M1, E2, and M2 operators.}\n\\label{tab:spher_tens}\n\\end{table}\n\n\\par\\end{center}\n\nDuring the state preparation and readout of the molecule state, transitions are driven between the state $|g\\rangle=\\sum_{\\pm}d_{\\pm}|\\pm,\\Nsw\\rangle$ and $|e\\rangle=|C,\\Psw\\rangle$, where $d_{\\pm}$ are state amplitudes that denote the particular superposition in $\\left|H\\right\\rangle $ that is being interrogated. The particular $d_{\\pm}$ combination that results in $\\mathcal{M}=0$ describes the state that is dark, and the orthogonal state is bright and is optically pumped away.\n\nIt is convenient to expand the Hamiltonian $H_{\\mathrm{int}}$ in terms of spherical tensor operators. Furthermore, the laser is only resonant with $\\Delta M=\\pm1$ transitions, so the spherical tensor\noperators with angular momentum projections other than $\\pm1$ can be reasonably omitted. In table \\ref{tab:spher_tens}, we factor the first 4 multipole operators into products of molecule and light field operators and express the molecular operators in terms of spherical tensors $T_{\\pm1}^{\\lambda}$ of rank $\\lambda=1,2$. The E1 and M1 terms consist of vector operators with $\\lambda=1$. The E2 and M2 operators are rank 2 cartesian operators which can have spherical tensor operator contributions for $\\lambda=0,1,2$. The rank $\\lambda=0$ components of the E2 and M2 operators, and the $\\lambda=1$ component of the E2 operator, vanish. The rank $\\lambda=1$ component of the M2 operator does not vanish, but the light field angular dependence of this operator is equivalent to E1, so we may treat it as such.\n\nUsing well-known properties of angular momentum matrix elements \\cite{Brown2003}, we may write the transition matrix element in the following form,\n\\begin{align}\n\\mathcal{M}= & iA_{0}\\omega_{eg}c_{\\rm E1}\\frac{1}{\\sqrt{2}}\\left[\\left(-1\\right)^{J+1}\\Psw\\right]^{(1-\\mathcal{\\tilde{N}}\\Esw)\/2}\\left(\\hat{\\epsilon}_{-1}^{*}d_{+}+\\Psw\\left(-1\\right)^{J'}\\hat{\\epsilon}_{+1}^{*}d_{-}\\right)\\cdot\\vec{\\varepsilon}_{\\mathrm{eff}},\n\\end{align}\nsuch that $\\vec{\\varepsilon}_{\\mathrm{eff}}$ is the `effective E1 polarisation' (i.e. including the effects of interference between multipole transition matrix elements is equivalent to an E1 transition with this polarisation) with the form\n\\begin{align}\n\\vec{\\varepsilon}_{\\mathrm{eff}}=& \\hat{\\epsilon}-a_{\\rm M1}i\\hat{n}\\times(\\hat{k}\\times\\hat{\\epsilon})+a_{\\rm E2}(\\Psw)i(\\hat{k}(\\hat{\\epsilon}\\cdot\\hat{n})+\\hat{\\epsilon}(\\hat{k}\\cdot\\hat{n}))+\\dots\\label{eq:effective E1 polarization}\n\\end{align}\nwhere $\\hat{n}=\\Nsw\\Esw\\hat{z}$ is the orientation of the internuclear axis in the laboratory frame, $a_{\\rm E2}(\\Psw)=c_{\\rm E2}(\\Psw)\/(\\sqrt{2}c_{\\rm E1})$ and $a_{\\rm M1}=c_{\\rm M1}\/c_{\\rm E1}$ are real dimensionless ratios describing the strength of the M1 and E2 matrix elements relative to E1, and the $c$ coefficients are matrix elements,\n\\begin{align}\nc_{\\rm E1}= & \\left\\langle C,J,0,1\\left|\\mathrm{E1}\\right|H,J',1,1\\right\\rangle \\\\\nc_{\\rm M1}= & \\left\\langle C,J,0,1\\left|\\mathrm{M1}\\right|H,J',1,1\\right\\rangle \\\\\nc_{\\rm E2}(\\Psw)= & \\left\\langle C,J,0,1\\left|\\mathrm{E2}\\right|H,J',1,1\\right\\rangle +\\nonumber \\\\\n & \\Psw\\left(-1\\right)^{J}\\left\\langle C,J,0,1\\left|\\mathrm{\\rm E2}\\right|H,J',1,-1\\right\\rangle ,\n\\end{align}\nwhich are defined using the state notation $\\left|A,J,M,\\Omega\\right\\rangle $ for electronic state $A$, and `E1, M1, E2' refer to the corresponding molecular operators in table \\ref{tab:spher_tens}. It is useful to define the Rabi frequency $\\Omega_{\\rm r}=|\\mathcal{M}|$ as the magnitude of the amplitude connecting to the bright state, and the unit vector $\\hat{\\varepsilon}_{\\mathrm{eff}}$ corresponding to the projection of $\\vec{\\varepsilon}_{\\mathrm{eff}}$ onto the $xy$ plane,\n\\begin{align}\n\\hat{\\varepsilon}_{\\mathrm{eff}}= & \\frac{\\vec{\\varepsilon}_{\\mathrm{eff}}-(\\vec{\\varepsilon}_{\\mathrm{eff}}\\cdot\\hat{z})\\hat{z}}{\\sqrt{|\\vec{\\varepsilon}_{\\mathrm{eff}}|^{2}-|\\vec{\\varepsilon}_{\\mathrm{eff}}\\cdot\\hat{z}|^{2}}}.\\label{eq:unit vector}\n\\end{align}\nThis completely determines the bright and dark states, which have been previously defined in equations \\ref{eq:bright_state} and \\ref{eq:dark_state} for solely E1 transition matrix elements.\n\nThe odd parity E1 and even parity M1 and E2 contributions to the effective polarisation differ by a factor of $\\Nsw\\Esw$, which is correlated with the expected eEDM signal. Expanding the effective E1 polarisation in terms of switch parity components, $\\hat{\\varepsilon}_{\\mathrm{eff}}=\\hat{\\varepsilon}_{\\mathrm{eff}}^{\\rm{nr}}+\\Nsw\\Esw d\\vec{\\varepsilon}_{\\mathrm{eff}}^{\\N\\E}$, and evaluating the effective $\\Nsw\\Esw$ correlated polarisation imperfections using equation \\ref{eq:extracting_polarization_imperfection_components}, we find that the bright and dark states have effective polarisation correlations given by:\n\\begin{align}\n\\frac{\\hat{z}\\cdot(\\hat{\\varepsilon}_{\\mathrm{eff}}^{\\rm{nr}}\\times d\\vec{\\varepsilon}_{\\mathrm{eff}}^{\\N\\E})}{\\hat{\\varepsilon}_{\\mathrm{eff}}^{\\rm{nr}}\\cdot\\hat{\\varepsilon}_{\\mathrm{eff}}^{\\rm{nr}}}\\approx & \\, d\\theta_{\\mathrm{eff}}^{\\N\\E}-id\\Theta_{\\mathrm{eff}}^{\\N\\E}\\\\\n\\approx & -i(a_{M1}-a_{E2}(\\Psw))(\\hat{\\epsilon}\\cdot\\hat{z})((\\hat{k}\\times\\hat{\\epsilon})\\cdot\\hat{z}).\n\\label{eq:state_correlations}\n\\end{align}\nIt is useful to use a particular parameterization of the laser pointing $\\hat{k}$ and polarisation $\\hat{\\epsilon}$ to expand the expression in equation \\ref{eq:state_correlations} in terms of pointing and polarisation imperfections. The state preparation laser $\\hat{k}$-vector is aligned along (or against) the $\\hat{z}$ direction in the laboratory, so it is convenient to parameterize the pointing deviation from normal by spherical angle $\\vartheta_{k}$, and the direction of this pointing imperfection by polar angle $\\varphi_{k}$ in the $xy$ plane, such that:\n\\begin{align}\n\\hat{k}= & \\cos\\varphi_{k}\\sin\\vartheta_{k}\\hat{x}+\\sin\\varphi_{k}\\sin\\vartheta_{k}\\hat{y}+\\cos\\vartheta_{k}\\hat{z}.\n\\label{eq:pointing_imperfection}\n\\end{align}\nWe may use a parameterization for the polarisation $\\hat{\\epsilon}$ that is similar to that in equation \\ref{eq:polarization_parametrization}, but a slight modification is required to ensure that $\\hat{k}\\cdot\\hat{\\epsilon}=0$:\n\\begin{align}\n\\hat{\\epsilon}= & N_{\\epsilon}\\left(-e^{-i\\theta}\\cos\\Theta\\hat{\\epsilon}_{+1}+e^{i\\theta}\\sin\\Theta\\hat{\\epsilon}_{-1}+\\epsilon_{z}\\hat{z}\\right)\\\\\n\\epsilon_{z}= & -\\frac{1}{\\sqrt{2}}\\tan\\theta_{k}\\left(e^{-i\\left(\\theta-\\varphi_{k}\\right)}\\cos\\Theta+e^{i\\left(\\theta-\\varphi_{k}\\right)}\\sin\\Theta\\right)\n\\end{align}\nwhere $N_{\\epsilon}$ is a normalization constant that ensures that $\\hat{\\epsilon}^{*}\\cdot\\hat{\\epsilon}=1$. With these parameterizations in place, and expanding about small ellipticities $d\\Theta$ such that $\\Theta=\\pi\/4+d\\Theta$, and small laser pointing deviation, $\\vartheta_{k}\\ll1$, we find that the $\\Nsw\\Esw$-correlated effective laser polarisation imperfections are given by:\n\\begin{align}\nd\\theta_{\\mathrm{eff}}^{\\N\\E}\\approx & -\\frac{1}{2}(a_{M1}-a_{E2}(\\Psw))\\vartheta_{k}^{2\\:}S^{\\:}\\cos(2(\\theta-\\varphi_{k}))\\\\\nd\\Theta_{\\mathrm{eff}}^{\\N\\E}\\approx & -\\frac{1}{2}(a_{M1}-a_{E2}(\\Psw))\\vartheta_{k}^{2\\:}\\sin(2(\\theta-\\varphi_{k}))\n\\end{align}\nwhere $S_{i}=-2d\\Theta_{i}$ describe the laser ellipticities. Hence, following equation \\ref{eq:Measured_Phase_with_Polarization_Imperfections}, there is a systematic error in $\\omega^{\\mathcal{NE}}$:\n\\begin{align}\n\\omega_{\\mathrm{S.I.}}^{\\N\\E}=&\\frac{1}{\\tau}\\frac{1}{4}\\left(a_{M1}-a_{E2}\\left(\\Psw\\right)\\right)\\times\\\\&\\left[\\vartheta_{k,{\\rm prep}}^{2}\\left(-2S_{{\\rm prep}}c_{{\\rm prep}}+\\Psw s_{{\\rm prep}}\\left(S_{X}-S_{Y}\\right)\\right)+\\right.\\\\&\\left.\\vartheta_{k,X}^{2}\\left(S_{X}c_{X}+\\Psw S_{{\\rm prep}}s_{X}\\right)+\\vartheta_{k,Y}^{2}\\left(S_{Y}c_{Y}-\\Psw S_{{\\rm prep}}s_{Y}\\right)\\right]\n\\end{align}\nwhere $c_{i}\\equiv\\cos\\left(2(\\theta_{i}-\\varphi_{i,k})\\right)$ and $s_{i}\\equiv\\sin\\left(2(\\theta_{i}-\\varphi_{i,k})\\right)$ describe the dependence of the systematic error on the difference between the linear polarisation angle $\\theta_{i}$ and the pointing angle $\\varphi_{i,k}$ in the $xy$ plane. \n\nThere is another contribution to this systematic error that arises when the coupling to the off-resonant\nopposite parity excited state $|C,-\\Psw\\rangle$ is also taken into account. This additional contribution becomes significant when the ellipticities are comparable to or smaller than $\\gamma_{C}\/\\Delta_{\\Omega,C,J=1}\\approx0.5\\%$.\n\nThe eEDM channel, $\\omega^{\\mathcal{NE}}$, was defined to be even under the superblock switches (including $\\Psw$), hence those terms proportional to $\\Psw$ in the equation above do not contribute to our reported result. Additionally, the $\\Gsw$ and $\\Rsw$ switches rotate the polarisation angles for each laser by roughly $\\theta_{i}\\rightarrow\\theta_{i}+\\pi\/2$ periodically and the resulting $\\omega^{\\mathcal{NE}}$ signal is averaged over these states. Provided that the pointing drift is much slower than the timescale of these switches, and to the extent that the laser polarisations constituting the $\\Rsw$ and $\\Gsw$ states are orthogonal, then these systematic errors should dominantly contribute to the $\\omega^{\\mathcal{NEG}}$ and $\\omega^{\\mathcal{NER}}$ channels which were found to be consistent with zero (see Figure~\\ref{fig:pixel_plot}). \n\nAn indirect limit on the size of the systematic error due to Stark interference, $\\omega^{\\mathcal{NE}}_{\\mathrm{S.I.}}$, may be estimated by assuming a reasonable suppression factor by which the effects in $\\omega^{\\N\\E\\R}$ and $\\omega^{\\N\\E\\G}$ may `leak' into $\\omega^{\\mathcal{NE}}$. We monitored the pointing drift on a beam profiler and observed pointing drifts up to $d\\vartheta_k\\sim 50~\\upmu\\rm{rad}$ throughout a full set of superblock states. The absolute pointing misalignment angle was not well known but was estimated to be larger than $\\vartheta_k\\gtrsim0.5~\\rm{mrad}$. Hence we may estimate a conservative suppression factor $d\\vartheta_k\/\\vartheta_k\\lesssim1\/10$ by which pointing drift may contaminate $\\omega^{\\mathcal{NE}}$ from $\\omega^{\\N\\E\\R}$ and $\\omega^{\\N\\E\\G}$. The two $\\mathcal{\\tilde{R}}$ states are very nearly orthogonal, but the $\\Gsw$ states deviate sufficiently from orthogonal (see section~\\ref{sssec:suppression_of_the_AC_stark_shift_phases}) such that the leakage from $\\omega^{\\N\\E\\G}\\rightarrow\\omega^{\\N\\E}$ will dominate the systematic error; we estimate a suppression factor of about $c_p^{\\rm{nr}}\/c_p^{\\mathcal{G}}\\sim s_p^{\\rm{nr}}\/s_p^{\\mathcal{G}}\\sim1\/5$. Based on the upper limits on the measured values for $\\omega^{\\N\\E\\R}$ and $\\omega^{\\N\\E\\G}$ combined with leakage from $\\omega^{\\N\\E\\R}$ and $\\omega^{\\N\\E\\G}$ into $\\omega^{\\N\\E}$ due to pointing drift, and leakage from $\\omega^{\\N\\E\\G}$ into $\\omega^{\\N\\E}$ due to non-orthogonality of the two $\\Gsw$ states, we estimate the possible size of the systematic error to be $\\omega_{\\mathrm{S.I.}}^{\\N\\E}\\lesssim 1^{\\:}\\mathrm{mrad}\/\\mathrm{s}$.\n\nNote that the mechanism for this systematic error was not discovered until after the publication of our result \\cite{Baron2014} and hence was not included in our systematic error analysis there. Furthermore, since we did not observe this effect, this systematic error does not match any of the inclusion criteria outlined in section \\ref{ssec:total_systematic_error_budget} and hence is not included in the systematic error budget in this paper. Since we did not understand the mechanism for this systematic error while running the apparatus, we were not able to place direct limits on the size of this systematic error. We estimate that the absolute pointing deviation from ideal was at most $5^{\\:}\\mathrm{mrad}$ and the ellipticity of each laser was no more than $S_{i}\\approx5\\%$. The E1\/M1 interference coefficient is $a_{M1}\\approx0.1$ for the $H\\rightarrow C$ transition. This gives an estimate of $\\omega_{\\mathrm{S.I.}}^{\\N\\E}\\sim0.1^{\\:}\\mathrm{mrad}\/\\mathrm{s}$ before suppression due to the $\\Rsw$ and $\\Gsw$ switches. Hence, we do not believe that this systematic error significantly shifted the result of our measurement.\n\n\\subsubsection{AC Stark shift phases}\n\\label{sssec:AC_stark_shift_phases}\nIn this section we describe contributions to the measured phase $\\Phi$ that depend on the AC Stark shifts induced by the state preparation and readout lasers. We describe mechanisms by which such phase contributions may arise, and we describe mechanisms by which $\\Nsw\\Esw$ correlated experimental imperfections may couple to these phases to result in eEDM-mimicking phases. Concise descriptions of some of the effects described here can be found in \\cite{Hess2014,SpaunThesis,HutzlerThesis}.\n\n\nDuring our search for systematic errors as described in section \\ref{ssec:determining_systematic_uncertainty}, we empirically found that there was a contribution to the measured phase $d\\Phi(\\Delta,\\Omega_{\\rm r})$ that had an unexpected linear dependence on the laser detuning, $\\Delta$, a quadratic dependence on laser detuning $\\Delta$ in the presence of a nonzero magnetic field, and a linear dependence on small changes to the magnitude of the Rabi frequency, $d\\Omega_{\\rm r}\/\\Omega_{\\rm r}$, in the presence of a nonzero magnetic field,\n\\begin{align}\nd\\Phi\\left(\\Delta,\\Omega_{\\rm r}\\right)=&\\sum_{i}\\left[\\alpha_{\\Delta,i}\\Delta_{i}+\\alpha_{\\Delta^{2},i}\\Delta_{i}^{2}+\\beta_{d\\Omega_{{\\rm r}, i}}(d\\Omega_{{\\rm r}, i}\/\\Omega_{{\\rm r}, i})+\\dots\\right].\n\\label{eq:Empirical_AC_Stark_Shift_Phase_Result}\n\\end{align}\nwhere $i\\in\\left\\{ {\\rm prep},X,Y \\right\\}$ indexes the state preparation and readout lasers. The coefficients we measured were $\\alpha_{\\Delta}\\sim1^{\\:}\\mathrm{mrad}\/(2\\pi\\times\\mathrm{MHz})$, $\\alpha_{\\Delta^{2}}\\sim1^{\\:}\\mathrm{mrad}\/\\left(2\\pi\\times\\mathrm{MHz}\\right)^{2}$ and $\\beta_{d\\Omega_{\\rm r}}\\sim10^{-3}$. We performed these measurements by independently varying the laser detunings $\\Delta_i$ across resonance using AOMs or modulating the laser power using AOMs with the set-up depicted in figure \\ref{fig:HC_transitions_setup} and extracting the measured phase $\\Phi$. Examples of such measurements are given in figure~\\ref{fig:phase_vs_detuning}.\n\nWe determined that this behaviour can be caused by mixing between bright and dark states, due to a small non-adiabatic laser polarisation rotation or Zeeman interaction present during the optical pumping used to prepare and read out the spin state. The mixed bright and dark states differ in energy by the AC Stark shift, which leads to a relative phase accumulation between the bright and dark state components that depends on the laser parameters $\\Delta$ and $\\Omega_{\\rm r}$. We shall now derive the AC Stark shift phase that results in equation \\ref{eq:Empirical_AC_Stark_Shift_Phase_Result}, under simplifying assumptions amenable to analytic calculations.\n\nConsider a three level system consisting of the bright $|B(\\hat{\\varepsilon},\\Nsw,\\Psw)\\rangle$ and dark $|D(\\hat{\\varepsilon},\\Nsw,\\Psw)\\rangle$ states and the lossy excited state $|C,\\Psw\\rangle$ with decay rate $\\gamma_{C}$. For simplicity, assume that there is no applied\nmagnetic field for the time being. In this system, the instantaneous eigenvectors (depicted in figure \\ref{fig:bases}C) are\n\\begin{align}\n|B_{\\pm}\\rangle\\equiv & \\pm\\kappa_{\\pm}|C,\\Psw\\rangle+\\kappa_{\\mp}|B(\\hat{\\varepsilon},\\Nsw,\\Psw)\\rangle,^{\\:\\:}|D\\rangle\\equiv|D(\\hat{\\varepsilon},\\Nsw,\\Psw)\\rangle,\n\\label{eq:inst_eigv}\n\\end{align}\nand the instantaneous eigenvalues are\n\\begin{align}\nE_{B\\pm}= & \\frac{1}{2}\\left(\\Delta\\pm\\sqrt{\\Delta^{2}+\\Omega_{\\rm r}^{2}}\\right),^{\\:}E_{D}=0,\n\\label{eq:inst_eig}\n\\end{align}\nsuch that the mixing amplitudes $\\kappa_{\\pm}$ are given by \n\\begin{align}\n\\kappa_{\\pm}= &\\frac{1}{\\sqrt{2}} \\sqrt{1\\pm\\frac{\\Delta}{\\sqrt{\\Delta^{2}+\\Omega_{\\rm r}^{2}}}}.\n\\end{align}\n\nThe effect of the decay of the excited state (which occurs almost entirely to states outside of the three level system) may be taken into account by adding an anti-Hermitian operator term in the Schrodinger equation, $|\\dot{\\psi}\\rangle=-i(H-i\\frac{1}{2}\\Gamma)|\\psi\\rangle$, where $\\Gamma=\\gamma_{C}|C,\\Psw\\rangle\\langle C,\\Psw|$ is the decay operator. This formulation is equivalent to the Lindblad master equation,\n\\begin{align}\n\\dot{\\rho}= & -i\\left[H,\\rho\\right]-\\frac{1}{2}\\left\\{ \\Gamma,\\rho\\right\\} ,\n\\end{align}\nthat governs the time evolution of the density matrix $\\rho=|\\psi\\rangle\\langle\\psi|$. In practice, we implement this decay term by calculating the time evolution of the system according to $H$, and then making the substitution $\\Delta\\rightarrow\\Delta-i\\gamma_C\/2$ before calculating squares of amplitudes. \n\nIt is useful to work in the dressed state basis, $|D\\rangle$, $|B_\\pm\\rangle$, (basis C in figure \\ref{fig:bases}) because these are nearly stationary states and have simple time evolution in the case that laser polarisation and Rabi frequency are stationary. If we allow the laser polarisation to vary in time, then the dressed state basis varies in time, and the system evolves according to the Hamiltonian,\n\\begin{align}\n\\tilde{H}= & UHU^{\\dagger}-iU\\dot{U}^{\\dagger},\n\\end{align}\nwhere $U$ is the transformation from time independent basis A to time dependent basis C (from figure \\ref{fig:bases}), $UHU^{\\dagger}$ is diagonal, and $-iU\\dot{U}^{\\dagger}$ is a fictitious force term that arises because we are working in a non-inertial frame when the laser polarisation is time dependent \\cite{Budker2008}.\n\nAssuming that the polarisation is nearly linear, $\\Theta\\approx\\pi\/4$, but allowing the polarisation to rotate slightly, and allowing for a nonzero two photon detuning due to the Zeeman shift $\\delta=-g_1\\mu_{\\rm B}\\B_z\\Bsw$, the Hamiltonian in the dressed state picture is:\n\\begin{align}\n\\tilde{H}= & \\left(\\begin{array}{ccc}\n0 & -i\\dot{\\chi}^{*}\\kappa_{+} & -i\\dot{\\chi}^{*}\\kappa_{-}\\\\\ni\\dot{\\chi}\\kappa_{+} & E_{B-} & -\\frac{i}{2}\\frac{\\dot{\\Omega_{\\rm r}}\\Delta-\\Omega_{\\rm r}\\dot{\\Delta}}{\\Delta^{2}+\\Omega^{2}}\\\\\ni\\dot{\\chi}\\kappa_{-} & \\frac{i}{2}\\frac{\\dot{\\Omega_{\\rm r}}\\Delta-\\Omega_{\\rm r}\\dot{\\Delta}}{\\Delta^{2}+\\Omega_{\\rm r}^{2}} & E_{B+}\n\\end{array}\\right)\\begin{array}{c}\n\\ket{D} \\\\\n\\ket{B_{-}} \\\\\n\\ket{B_{+}} \n\\end{array}\n\\end{align}\nwhere $\\dot{\\chi}=\\dot{\\Theta}-i(\\dot{\\theta}+\\delta)$ can be considered to be a complex polarisation rotation rate, $\\dot{\\Omega}_{\\rm r}$ is the rate of change of the Rabi frequency, and $\\dot{\\Delta}$ is\nthe rate of change of the detuning. Note that this Hamiltonian implies that the effect of a two photon detuning arising from the Zeeman shift is equivalent to that of a linear polarisation rotating at a constant rate.\n\n\\begin{figure}[htbp]\n\\centering\n\\includegraphics[width=15cm]{various_bases_used.pdf}\n\\caption{Energy level diagrams depicting the Hamiltonian when the three-level $H\\rightarrow C$ transition is addressed by the state preparation or readout lasers in three different bases. Solid double-sided blue arrows denote strong laser couplings between $H$ and $C$. Wiggly red arrows denote spontaneous emission from $C$ to states outside of the three level system. Dashed orange lines denote weak couplings induced by laser polarisation rotation. Basis A is useful for describing the spin precession phase induced by the Zeeman and eEDM Hamiltonians. Basis B is useful for describing the states that are prepared and read-out in the spin precession measurement. Basis C is useful for evaluating the AC Stark Shift phases induced by laser polarisation rotations.}\n\\label{fig:bases}\n\\end{figure}\n\nWe may then apply first order time-dependent perturbation theory in this picture to determine the extent of bright\/dark state mixing due to $\\dot{\\chi}$ in the time evolution of the system. If we parameterize the time-dependent state as\n\\begin{align}\n\\left|\\psi\\left(t\\right)\\right\\rangle = & c_{D}\\left(t\\right)\\left|D\\right\\rangle +c_{B+}\\left(t\\right)\\left|B_{+}\\right\\rangle +c_{B-}\\left(t\\right)\\left|B_{-}\\right\\rangle,\n\\end{align}\nthen in the case of a uniform laser field $\\dot{\\Omega}_{\\rm r}=0$, of duration $t$ and with a constant detuning $\\dot{\\Delta}=0$, the time evolution of the coefficients is given at first order by:\n\\begin{align}\nc_{D}\\left(t\\right)= & c_{D}\\left(0\\right)-\\sum_{\\pm}\\int_{0}^{t}\\dot{\\chi}^{*}\\left(t'\\right)\\kappa_{\\mp}\\left(t'\\right)e^{-iE_{B\\pm}t'}c_{B\\pm}\\left(0\\right)\\enspace dt'\\label{eq:first order perturbation theory dark state}\\\\\nc_{B\\pm}\\left(t\\right)= & e^{-iE_{B\\pm}t}c_{B\\pm}\\left(0\\right)+e^{-iE_{B\\pm}t}\\int_{0}^{t}\\dot{\\chi}\\left(t'\\right)\\kappa_{\\mp}\\left(t'\\right)e^{iE_{B\\pm}t'}c_{D}\\left(0\\right)\\enspace dt'.\\label{eq:first order perturbation theory bright state}\n\\end{align}\n\n\nIn the state preparation region, the molecules begin in an incoherent mixture of the states $|B(\\hat{\\varepsilon}_{{\\rm prep}},\\Nsw,\\Psw)\\rangle$ and $|D(\\hat{\\varepsilon}_{{\\rm prep}},\\Nsw,\\Psw)\\rangle$ and then enter the state preparation laser beam. In the ideal case of uniform laser polarisation, molecules that were in the bright state are optically pumped out of the three level\nsystem, and molecules that are in the dark state remain there; this results in a pure state, $|D(\\hat{\\varepsilon}_{{\\rm prep}},\\Nsw,\\Psw)\\rangle$. However, if there is a small polarisation rotation by amount $d\\chi\\equiv\\int_{0}^{t}\\dot{\\chi}\\left(t'\\right)dt'\\equiv d\\Theta-i(d\\theta-g_1\\mu_{\\rm B}\\B_z\\Bsw t)$, such that $\\left|d\\chi\\right|\\ll1$, then the dark state obtains a bright state admixture that may not be completely optically pumped away before leaving the laser beam.\\footnote{This is most liable to occur just before a molecule leaves the laser beam, such that complete optical pumping does not occur.} In this case, the final state can be written as\n\\begin{align}\n|D(\\hat{\\varepsilon}'_{{\\rm prep}},\\Nsw,\\Psw)\\rangle= & |D(\\hat{\\varepsilon}_{{\\rm prep}},\\Nsw,\\Psw)\\rangle+d\\chi\\Pi|B(\\hat{\\varepsilon}_{{\\rm prep}},\\Nsw,\\Psw)\\rangle\n\\end{align}\nwhere $\\hat{\\varepsilon}'_{{\\rm prep}}$ is the effective polarisation that parameterizes the initial state in the spin precession region \n\\begin{align}\n\\hat{\\varepsilon}'_{{\\rm prep}}= & \\hat{\\varepsilon}_{{\\rm prep}}+d\\chi\\Pi i\\hat{z}\\times\\hat{\\varepsilon}_{{\\rm prep}}^{*},\n\\end{align}\nand $\\Pi$ is an amplitude that accounts for the AC Stark shift phase and the time dependent dynamics of the non-adiabatic mixing due to the polarisation rotation,\n\\begin{equation}\n\\Pi=\\sum_{\\pm}(\\kappa_{\\mp})^{2}e^{-iE_{B\\pm}t}\\int_{0}^{t}dt'^{\\:}\\frac{\\dot{\\chi}\\left(t'\\right)}{d\\chi}e^{iE_{B\\pm}t'}.\\label{eq:Pi_def}\n\\end{equation}\nThe deviations between the effective polarisation and the actual laser polarisation can be viewed as effective polarisation imperfections,\n\\begin{align}\nd\\theta_{{\\rm prep},\\mathrm{eff}}= & -d\\Theta_{{\\rm prep}}\\text{Im}\\Pi+(d\\theta_{{\\rm prep}}-g_1\\mu_{\\rm B}\\B_z\\Bsw t)\\text{Re}\\Pi,\\\\\nd\\Theta_{{\\rm prep},^{\\:}\\mathrm{eff}}= & -d\\Theta_{{\\rm prep}}\\text{Re}\\Pi-(d\\theta_{{\\rm prep}}-g_1\\mu_{\\rm B}\\B_z\\Bsw t)\\text{Im}\\Pi,\n\\end{align}\nthat lead to shifts in the measured phase $\\Phi$ as described in equation \\ref{eq:Measured_Phase_with_Polarization_Imperfections}.\nFor definiteness, consider the case in which the polarisation rotation rate $\\dot{\\chi}(t')=d\\chi\/t$ is a constant for the duration of the optical pumping pulse $t$. In this case,\n\\begin{align}\n\\Pi= & \\sum_{\\pm}(\\kappa_{\\mp})^{2}e^{-iE_{B\\pm}t\/2}\\mathrm{sinc}(E_{B\\pm}t\/2).\n\\end{align}\n\n\nThis function has the property that $\\text{Im}\\Pi$ is an odd function in $\\Delta$ that can take on values up to order unity across resonance (a frequency range on the order of $\\gamma_{C}$) and is exactly zero on resonance. $\\text{Re}\\Pi$ is an even function quadratic in $\\Delta$ about resonance, and depends on Rabi frequency on resonance. If the laser beam intensity reduces quickly as the molecule leaves it then most of the AC Stark shift phase arises from the last Rabi flopping period before the molecule exits the laser beam (provided $\\dot{\\chi}$ is nonzero during that time). If the intensity reduces slowly, the AC Stark shift phase can be exacerbated since the bright state amplitude is not as effectively optically pumped away while $\\Omega_{\\rm r}<\\gamma_C$. Nevertheless, beamshaping tests shown in figure \\ref{fig:phase_vs_detuning} and numerical simulations indicate that $\\Pi$ is not very sensitive to the shape of the spatial intensity profile of the laser beam or the shape of the spatial variation of the polarisation.\n\nIf we consider only the first order contribution to the shift in the measured phase in equation \\ref{eq:Measured_Phase_with_Polarization_Imperfections}, $d\\theta_{{\\rm prep},\\mathrm{eff}}$, and neglect the second order shift that arises due to $d\\Theta_{{\\rm prep},\\mathrm{eff}}$, then we can relate the parameters in equation \\ref{eq:Empirical_AC_Stark_Shift_Phase_Result} to the amplitude $\\Pi$ accounting for the AC Stark shift phase and the complex polarisation rotation $d\\chi$, by\n\\begin{align}\n\\alpha_{\\Delta,{\\rm prep}}\\approx&-\\frac{\\partial\\text{Im}\\Pi}{\\partial\\Delta_{{\\rm prep}}}d\\Theta_{{\\rm prep}}\\\\\n\\alpha_{\\Delta^{2},{\\rm prep}}\\approx&\\frac{\\partial^{2}\\text{Re}\\Pi}{\\partial\\Delta_{{\\rm prep}}^{2}}\\left(d\\theta_{{\\rm prep}}-g\\mu_{\\rm B}\\B_{z}\\tilde{\\B}t\\right)\\\\\n\\beta_{d\\Omega_{\\rm r},{\\rm prep}}\\approx&\\Omega_{\\rm r}\\frac{\\partial\\text{Re}\\Pi}{\\partial\\Omega_{\\rm r}}\\left(d\\theta_{{\\rm prep}}-g\\mu_{\\rm B}\\B_{z}\\tilde{\\B}t\\right).\\label{eq:bdOmega}\n\\end{align}\nWe can interpret these results as follows. The linear dependence of the measured phase on detuning, $\\alpha_{\\Delta,{\\rm prep}}$, comes from a spatially varying ellipticity in the $x$ direction coupling to the AC Stark shift phase. Similarly, the quadratic dependence of $\\Phi$ on $\\Delta$, $\\alpha_{\\Delta^{2},{\\rm prep}}$, and the dependence of $\\Phi$ on a relative change in $\\Omega_{\\rm r}$, $\\beta_{d\\Omega_{\\rm r}, {\\rm prep}}$, come from either a spatially varying linear polarisation in the $x$ direction or a Zeeman shift, each coupling to the AC Stark shift phase. Here, we only analyzed the phase shift that results from AC Stark shift effects in the state preparation laser beam, but there is an analogous phase shift in the state readout beam.\n\nThere are several other subdominant effects that also contribute to the AC Stark shift phase behavior described in equation \\ref{eq:Measured_Phase_with_Polarization_Imperfections} in the presence of polarisation imperfections. The opposite parity excited state $|C,-\\Psw\\rangle$ couples strongly to the dark state, but the mixing between these two states is weak because the transition frequency is off-resonant by a detuning $\\Delta_{\\Omega,C,J=1}\\approx2\\pi\\times51~\\mathrm{MHz}\\gg\\gamma_{C}$. In the case that an optical pumping laser has nonzero ellipticity, the bright state gains a weak coupling to the opposite-parity excited state proportional to this ellipticity. Then, two-photon bright-dark state mixing ensues in such a way that the mixing amplitude, and hence the measured phase, depends on the laser detuning.\n\nThe rapid polarisation switching of the state readout beam can also introduce AC Stark shift-induced phases in the absence of a polarisation gradient, if the average ellipticity between the two polarisations is nonzero. Suppose a particular molecule is first excited by the $\\hat{\\epsilon}_{X}$ polarised beam. The two bright eigenstates $\\ket{B_{\\pm}}$ are mostly optically pumped away, resulting in a fluorescence signal $F_{X}$. The population remaining in the bright eigenstates acquires a phase relative to the dark state, due to the AC Stark shift. Then the molecules are optically pumped by the $\\hat{\\epsilon}_{Y}$ polarised beam. If there is a nonzero average ellipticity, $\\hat{\\epsilon}_{Y}$ is not quite orthogonal to $\\hat{\\epsilon}_{X}$ and the new bright eigenstates that give rise to the fluorescence signal $F_Y$ are superpositions of the former bright and dark states that acquired a relative AC Stark shift phase. This results in a fluorescence signal, and hence measured phase component, that depends linearly on laser detuning $\\Delta$. \n\n\\subsubsection{Polarisation Gradients from Thermal Stress-Induced Birefringence}\n\\label{sssec:polarization_gradients_from_thermal_stress_induced_birefringence}\n\n\\hspace*{\\fill} \\\\\nThe AC Stark shift phases described in the previous section can be induced by polarisation gradients in $\\hat{x}$ across the state preparation and readout laser beams. In this section we describe a known mechanism by which these arose. Recall that these laser beams passed through transparent, ITO-coated electric field plates. For an absorbance $\\alpha$ and laser intensity $I$, the rate of heat deposition into the plates is $\\dot{Q}\\left(x,y\\right)=\\alpha\\, I\\left(x,y\\right)$. The laser beam profile is stretched in the $y$ direction to ensure that all molecules are addressed. For simplicity we assume that the heating distribution, $\\dot{Q}\\left(x,y\\right)=\\dot{Q}\\left(x\\right)$, is completely uniform in the $y$ direction. We also assume that there are no shear stresses, i.e.\\ local expansion of the glass is isotropic. Under these assumptions, the relationship between the heating rate, $\\dot{Q}$, and the internal stress tensor $\\sigma_{ij}$ (where $i,j$ are Cartesian indices) is\n\\begin{equation}\n\\frac{\\partial^{2}\\sigma_{yy}}{\\partial x^{2}}= \\frac{E\\alpha_{V}}{\\kappa}\\dot{Q}\\left(x\\right),\n\\end{equation}\nwhere $E$, $\\alpha_{V}$ and $\\kappa$ are the Young's modulus, coefficient of thermal expansion, and thermal conductivity, respectively \\cite{Barber2010}. Unit vectors $\\hat{x}$ and $\\hat{y}$ correspond to the principal axes of the stress tensor due to the symmetry of the heating function, hence the off-diagonal (shear) elements are zero, $\\sigma_{xy}=0$. The other diagonal component, $\\sigma_{xx}$, is uniform across the plates, and equal to $\\sigma_{yy}$ far away from the laser. The stress-optical law states that the birefringence and stress are linearly proportional along the principal axes of the stress tensor \\cite{Dally1991}. The difference between the indices of refraction in the $x$ and $y$ directions is then $\\Delta n=K\\left(\\sigma_{xx}-\\sigma_{yy}\\right)$, where $K\\approx4\\times10^{-6}\\,\\mbox{MPa}^{-1}$ is the stress-optical coefficient for Borofloat glass \\cite{Schott2013b}. The retardance of an incident laser beam of index $i$ is $\\Gamma_i=2\\pi\\Delta n\\left(t\/\\lambda\\right)$, where $t$ is the thickness of the field plates (in the $z$ direction), and $\\lambda$ is the wavelength of light. Hence, in this limit, the retardance due to thermal stress-induced birefringence is related to the laser intensity by:\n\\begin{equation}\n\\frac{\\partial^{2}\\Gamma}{\\partial x^{2}}=\\eta\\frac{t}{\\lambda}I\\left(x\\right),\n\\label{eq:retarddiff}\n\\end{equation}\nwhere $\\eta=2\\pi KE\\alpha_{V}\\alpha\/\\kappa\\approx26\\times10^{-6}$~W$^{-1}$ is a material constant of Borofloat glass \\cite{Schott2013b}.\nThe ellipticity imprinted on the nominally linearly polarised laser beam is given by\n\\begin{equation}\nS_i=\\Gamma_i(x)\\sin\\left(2(\\theta_i-\\phi_{\\Gamma,i})\\right),\n\\label{eq:s3}\n\\end{equation}\nwhere $\\theta_i$ is the linear polarisation angle and $\\phi_{\\Gamma,i}$ is the orientation of the fast axis of the birefringent material (nominally $\\hat{x}$ in our case).\n\nAssuming the laser has total power $P$, a Gaussian profile in $x$ with standard deviation $w_{x}$, and a top-hat profile in $y$ with half width $w_{y}$, the intensity is given by\n\\begin{equation}\nI\\left(x\\right)= \\frac{P}{\\sqrt{8\\pi}w_{x}w_{y}}e^{-\\frac{x^{2}}{2w_{x}^{2}}\n\\end{equation}\nwhere $2w_y \\gg w_x$. There is then an analytic solution to equation~\\ref{eq:retarddiff} from which we extracted a retardance gradient in the laser tail, $x=w_{x}$, of\n\\begin{equation}\n\\frac{\\partial\\Gamma}{\\partial x}\\approx\\frac{{\\rm erf}(1\/\\sqrt{2})P\\kappa t}{4w_y\\lambda}\\approx0.03~\\mathrm{rad}\/{\\rm mm}\n\\label{eq:retardance_gradient}\n\\end{equation}\nfor a nominal laser power of ${\\approx}2$~W. Similar results were obtained from numerical finite element analysis. Thermal stress-induced birefringence has been observed in similar systems such as in UHV vacuum windows \\cite{Solmeyer2011}, laser output windows \\cite{Eisenbach1992}, and Nd:YAG rods \\cite{Koechner1970}.\n\\begin{figure}\n\\begin{centering}\n\\includegraphics[width=10cm]{Ellipticity_and_Thermo_elastic_model.pdf}\n\\par\\end{centering}\n\\caption{Measurement of the ellipticity, $S$, as a function of position along $x$ within the state readout laser beam. A fit to the thermo-elastic model, which assumes a Gaussian laser profile and has the amplitude and offset in $S$ as free parameters, is overlaid.}\n\\label{ite:birefringence}\n\\end{figure}\n\nThe estimates of the ellipticity gradient agree well with measurements of the polarisation of the beam, as shown in figure~\\ref{ite:birefringence}. These polarimetry measurements were adapted from the procedure described in \\cite{Berry1977}; a polarimeter was constructed consisting of a rotating quarter-wave plate, fixed polariser, and fast photodiode.\nThe use of a fast photodetector allows for polarimetry of the probe beam during the 100~kHz polarisation switching. The resolution of the system was such that we could quickly measure the normalized circular Stokes parameter, $S$, to a few percent, which is sufficient to measure typical birefringence gradients of ${\\sim}10\\%$ across the beam.\n\n\n\\subsubsection{Suppression of AC Stark Shift Phases}\n\\label{sssec:suppression_of_the_AC_stark_shift_phases}\n\n\\hspace*{\\fill} \\\\\nWe were able to suppress the magnitude of the AC Stark shift phases in several different ways that are illustrated in figure~\\ref{fig:phase_vs_detuning}. The ellipticity gradient across the state preparation laser beam was suppressed by tuning the linear polarisation angle: as per equation~\\ref{eq:s3}, the ellipticity gradient is proportional to $\\sin(2\\theta_{{\\rm prep}}-2\\phi_{\\Gamma,{\\rm prep}})$, which vanishes when the polarisation is aligned along a birefringence axis, i.e. $\\theta_{{\\rm prep}}=\\phi_{\\Gamma,{\\rm prep}},\\phi_{\\Gamma,{\\rm prep}}+\\pi\/2$. To determine $\\phi_{\\Gamma,{\\rm prep}}$ we measured the total accumulated phase as a function of laser detuning for various $\\theta_{{\\rm prep}}$ and then extracted the slope $\\alpha_{\\Delta,{\\rm prep}}^{\\rm{nr}}=\\partial\\Phi^{\\rm{nr}}\/\\partial\\Delta_{{\\rm prep}}$ for small detuning values. Note that when fitting the phase vs.\\ detuning data we found that cubic functions provided significantly better fits over the detuning ranges used (see Figure~\\ref{fig:phase_vs_detuning}(B)). We then selected $\\theta_{{\\rm prep}}$ to minimize $\\alpha_{\\Delta,{\\rm prep}}^{\\rm{nr}}$. This suppressed $\\alpha_{\\Delta,{\\rm prep}}^{\\rm{nr}}$ by about a factor of 50 relative to its original value, to $\\alpha_{\\Delta,{\\rm prep}}^{\\rm{nr}}\\lesssim0.1$~mrad\/(2$\\pi~\\times$~MHz). \n\nAnother method implemented to suppress AC Stark shift phases was to reduce the time-averaged power of the state preparation laser incident on the field plates. We used a chopper wheel to modulate the laser at 50~Hz, synchronous with the molecular beam pulses, with a 50\\% duty cycle. We estimated the time scale for thermal changes to be on the order of $Q\/\\dot{Q}\\sim2\\rho Cw_{x}^{2}\/\\kappa\\sim10^{\\:}\\mathrm{s}$, where $\\rho$ and $C$ are the density and heat capacity of Borofloat respectively, so did not anticipate any significant transient effects\nto be introduced. This modification reduced the retardance gradient, and hence the value of $\\alpha_{\\Delta,{\\rm prep}}^{\\rm{nr}}$, by about a factor of two, as shown in Figure~\\ref{fig:phase_vs_detuning}(C).\n\nFinally, $\\alpha_{\\Delta,{\\rm prep}}^{\\rm{nr}}$ was suppressed by shaping of the laser beam intensity profile. AC Stark shift phases were most significant at the downstream edge of the state preparation laser beam. Here, the intensity is such that bright-dark state mixing is still occurring but the bright state is not efficiently optically pumped away. By making the spatial intensity profile drop off more rapidly, we reduced the time that molecules spent in this intermediate intensity regime. This was achieved by taking advantage of the aspherical distortion introduced by misaligning a telescope immediately before the laser beam entered the spin-precession region. This suppressed $\\alpha_{\\Delta,{\\rm prep}}$ and $\\beta_{\\Delta^{2},{\\rm prep}}$ by ${\\approx}2$, as shown in Figure~\\ref{fig:phase_vs_detuning}(C). In addition to a phase suppression, we noticed that the optimal laser polarisation angle changed after implementing the steps described, as can be seen in Figure~\\ref{fig:phase_vs_detuning}(C). The reason for this change is not definitively known, but we suspect that as we suppressed the birefringent contribution to the AC Stark shift phase, the non-birefringent contributions (i.e. the phase due to nonzero ellipticity causing bright-dark state mixing via the off-resonant opposite parity excited state) became fractionally larger, and we needed to tune the polarisation angle to obtain cancellation between these two classes of effects.\n\\begin{figure}[htbp]\n\\centering\n\\includegraphics[width=15cm]{phase_vs_detuning.pdf}\n\\caption{(A) Measured molecule phase as a function of preparation laser detuning. The slope agrees with originally observed $\\Phi^{\\N\\E}$ dependence on $\\Delta^{\\N\\E}$. (B) Phase dependence on detuning for multiple preparation laser polarisation angles. (C) $\\partial \\Phi\/\\partial \\Delta^{\\rm{nr}}$ shows clear sinusoidal dependence on preparation laser polarisation. The magnitude of $\\partial \\Phi\/\\partial \\Delta^{\\rm{nr}}$ decreases for all polarisation angles when the Gaussian beam tails are clipped (blue) and when the average laser power is reduced with a chopper wheel (red).}\n\\label{fig:phase_vs_detuning}\n\\end{figure}\n\nWe observed much smaller AC Stark shift phases in the state readout laser beam than in the state preparation laser beam. This is not surprising since the effect is largely birefringent; the contributions to the effective polarisation imperfections for the $\\hat{\\epsilon}_{X}$ and $\\hat{\\epsilon}_{Y}$ polarised lasers should be opposite in sign, $d\\theta_{X}\\propto\\sin(2(\\theta_{\\rm{read}}-\\phi_{\\Gamma,\\rm{read}}))$, $d\\theta_{Y}\\propto\\sin(2(\\theta_{\\rm{read}}-\\phi_{\\Gamma,\\rm{read}}+\\pi\/2))$, such that they cancel each other in the measured phase (cf.\\ equation~\\ref{eq:Measured_Phase_with_Polarization_Imperfections}). The residual AC Stark shift phases measured in the state readout beam gave $\\alpha_{\\Delta,\\rm{read}}^{\\rm{nr}}\\approx0.5^{\\:}\\mathrm{mrad}\/(2\\pi\\times\\mathrm{MHz})$. This was sufficiently small that the methods of suppression described above were only implemented in the state preparation region.\n\n\\subsubsection{Systematic Errors due to Correlated Laser Parameters}\n\\label{sssec:correlated_laser_parameters}\n\nIn the discussion above, we described how polarisation imperfections can lead to contributions to the measured phase that depend on the AC Stark shifts and hence on the laser detunings $\\Delta_{i}$ and Rabi frequencies $\\Omega_{{\\rm r}, i}$. However, these phases only produce a systematic error in $\\omega^{\\mathcal{NE}}$ if there is a nonzero correlation $\\Delta_{i}^{\\N\\E}$ or $\\Omega_{{\\rm r}, i}^{\\N\\E}$ of the laser detuning or Rabi frequency. We observed such correlations and discuss them in this section. We will also describe how we evaluated the associated systematic errors.\n\nIn section~\\ref{sec:state_prep_read} (see figure~\\ref{fig:Enr_wNE}) we discussed how a non-reversing component of the applied electric field, $\\E^{\\rm{nr}}$, could produce a $\\Delta^{\\N\\E}$. In an entirely analogous manner, the Rabi frequency magnitude $\\Omega_{\\rm r}$ of the $H\\rightarrow C$ transition can exhibit the following correlations:\n\\begin{align}\n\\Omega_{{\\rm r}, i}=&\\Omega_{{\\rm r}, i}^{\\rm{nr}}+\\Nsw\\Omega_{{\\rm r}, i}^{\\N}+\\Nsw\\Psw\\Omega_{{\\rm r}, i}^{\\N\\P}+\\Nsw\\Esw\\Omega_{{\\rm r}, i}^{\\N\\E}+\\dots\n\\end{align}\nHere, $\\Omega_{{\\rm r}, i}^{\\rm{nr}}$ is the dominant component of the Rabi frequency for laser $i\\in\\left\\{ {\\rm prep},X,Y\\right\\} $, which could fluctuate in time on the order of 5\\% due to laser power instability. $\\Omega_{{\\rm r}, i}^{\\N}$ is generated by a laser power difference between the $\\tilde{\\N}$ states. This arose because we routed the laser light along different paths through a series of AOMs for each state. We measured this effect with photodiodes and found that the largest fractional power correlation was $\\Omega_{\\rm r}^{\\N}\/\\Omega_{\\rm r}^{\\rm{nr}}\\approx2.5\\times10^{-3}$. An additional contribution to $\\Omega_{{\\rm r}, i}^{\\N}$ and a contribribution to $\\Omega_{{\\rm r}, i}^{\\N\\P}$ on the same order arises due to Stark mixing between rotational levels in $H$ and $C$, leading to $\\Nsw$- and $\\Nsw\\Psw$-correlated transition amplitudes on the $H\\rightarrow C$ transition.\n\nAlthough we did not observe a laser power correlation with $\\Nsw\\Esw$ we did observe signals consistent with a Rabi frequency correlation, $\\Omega_{\\rm r}^{\\N\\E}$. A nonzero $\\Nsw\\Esw$-correlated fluorescence signal (as defined in section \\ref{sec:signal_asymmetry}) that also reversed with the laser propagation direction $\\hat{k}\\cdot\\hat{z}$, $F^{\\N\\E}\/F^{\\rm{nr}}\\approx-(2.4\\times10^{-3})(\\hat{k}\\cdot\\hat{z})$, together with a nonzero $\\omega^{\\N\\E\\B}\\approx(2.5{}^{\\:}\\mathrm{mrad}\/\\mbox{s})(\\B_{z}\/\\mathrm{mG})(\\hat{k}\\cdot\\hat{z})$, provided the first evidence that a nonzero $\\Omega_{\\rm r}^{\\N\\E}$ existed in our system. We believe that this fluorescence correlation arises from a linear dependence of the fluorescence signal size on Rabi frequency, $F^{\\N\\E}=(\\partial F\/\\partial\\Omega_{\\rm r}^{\\rm{nr}})\\Omega_{\\rm r}^{\\N\\E}$, which is nonzero since the state readout transitions were not fully saturated. We believe that the signal in $\\omega^{\\N\\E\\B}$ was caused by a coupling between the Rabi-frequency correlation and the $\\B$-odd AC Stark shift phase, $\\omega^{\\N\\E\\B}=\\frac{1}{\\tau}\\beta_{d\\Omega_{\\rm r}}^{\\B}\\B_{z}(\\Omega_{\\rm r}^{\\N\\E}\/\\Omega_{\\rm r}^{\\rm{nr}})$. We were able to verify a linear dependence of both of these channels on $\\Omega_{\\rm r}^{\\N\\E}$ by intentionally correlating the laser intensity with $\\Nsw\\Esw$ using AOMs; this is shown for the $\\Phi^{\\N\\E\\B}$ channel in Figure~\\ref{fig:Omega_NE}. Varying the size of this artificial $\\Omega_{\\rm r}^{\\N\\E}$ allowed us to measure the value present in the experiment under normal operating conditions, $\\Omega_{\\rm r}^{\\N\\E}\/\\Omega_{\\rm r}^{\\rm{nr}}=(-8.0\\pm0.8)\\times10^{-3}(\\hat{k}\\cdot\\hat{z})$. $\\Omega_{\\rm r}^{\\N\\E}$ can couple to $\\beta_{d\\Omega_{\\rm r},i}^{\\rm{nr}}$ as per equations~\\ref{eq:Empirical_AC_Stark_Shift_Phase_Result} and \\ref{eq:bdOmega} to result in a systematic error in $\\omega^{\\mathcal{NE}}$. A nonzero $\\beta_{d\\Omega_{\\rm r},i}^{\\rm{nr}}$ can be produced by a linear polarisation angle gradient (not observed in the experiment) or by a non-reversing Zeeman shift component $g_1\\mu_{\\rm B}\\B_{z}^{\\rm{nr}}$.\n\nWhile searching for a model to explain the intrinsic $\\Omega_{\\rm r}^{\\N\\E}$, we developed the Stark interference model presented in section \\ref{sssec:stark_interference_between_E1_and_M1_transition_amplitudes}. For unnormalized effective polarisation $\\vec{\\varepsilon}_{\\mathrm{eff}}=\\vec{\\varepsilon}_{\\mathrm{eff}}^{\\rm{nr}}+\\Nsw\\Esw d\\vec{\\varepsilon}_{\\mathrm{eff}}^{\\N\\E}$,\nthis model predicts $\\Omega_{\\rm r}^{\\N\\E}\/\\Omega_{\\rm r}^{\\rm{nr}}\\approx\\text{Re}(\\vec{\\varepsilon}_{\\mathrm{eff}}^{\\rm{nr} *}\\cdot d\\vec{\\varepsilon}_{\\mathrm{eff}})\\approx-\\text{Im}\\left[(a_{M1}+a_{E2})\\right](\\hat{k}\\cdot\\hat{z})$, which correctly predicts the dependence of $\\Omega_{\\rm r}^{\\N\\E}$ on the laser propagation direction $\\hat{k}\\cdot\\hat{z}$. However, the factors $a_{\\rm M1}$ and $a_{\\rm E2}$, which correspond to the ratio of M1 and E2 amplitudes to the E1 amplitude, must be real for a plane wave, so $\\text{Im}\\left[(a_{M1}+a_{E2})\\right]=0$. Hence this model fails to explain this Rabi frequency correlation unless there is some additional effect that introduces a phase shift between the E1 and M1 amplitudes. For example, interference between the E1 amplitude due to the incident laser beam, and a phase shifted M1 amplitude due to a (low intensity) reflected beam can lead to a nonzero $\\Omega_{\\rm r}^{\\N\\E}$ by this model. However, this phase factor oscillates spatially on the scale of the light wavelength, which is very small compared to the size of the molecule cloud and hence should average out over the entire molecular beam cloud. The origin of the intrinsic $\\Omega_{\\rm r}^{\\N\\E}$ is still not fully understood, and we are continuing to explore models to understand this effect.\n\\begin{figure}[htbp]\n\\centering\n\\includegraphics[width=12cm]{P_NE.pdf}\n\\caption{$\\Phi^{\\N\\E\\B}$ as a function of applied $\\Nsw\\Esw$-correlated laser power, $P^{\\N\\E}$, for both directions of laser pointing, $\\hat{k}\\cdot\\hat{z}$. The artificial $\\Omega_{\\rm r}^{\\N\\E}$ resulting from correlated power $P^{\\N\\E}$ systematically shifts $\\omega^{\\N\\E\\B}$ in accordance with equation~\\ref{eq:Empirical_AC_Stark_Shift_Phase_Result}. $\\Phi^{\\N\\E\\B}$ is zero when the applied $P^{\\N\\E}$ is such that there is no net $\\Nsw\\Esw$-correlated Rabi frequency. The intrinsic $\\Omega_{\\rm r}^{\\N\\E}$ (i.e. that inferred when $P^{\\N\\E}=0$) changed sign with $\\hat{k}\\cdot\\hat{z}$ within the resolution of the measurement. The slopes between the two measurements differ due to differences in the AC Stark shift phase, believed to be due to differences in the spatial intensity profile and polarisation structure between the two measurements.}\n\\label{fig:Omega_NE}\n\\end{figure}\n\nGiven the empirical AC Stark shift phase model in equation~\\ref{eq:Empirical_AC_Stark_Shift_Phase_Result}, the resulting systematic errors in the frequency measurement are given by\n\\begin{align}\n\\omega^{\\N\\E}_{\\E^{\\rm{nr}}} & =\\frac{1}{\\tau}\\sum_{i\\in\\left\\{ {\\rm prep},X,Y\\right\\} }\\alpha_{\\Delta,i}^{\\rm{nr}}D_1\\E^{\\rm{nr}}(x_{i})\\\\\n\\omega^{\\N\\E}_{\\Omega_{\\rm r}^{\\N\\E}} & =\\frac{1}{\\tau}\\sum_{i\\in\\left\\{ {\\rm prep},X,Y\\right\\} }\\beta_{d\\Omega_{\\rm r},i}^{\\rm{nr}}(\\Omega_{\\rm r}^{\\N\\E}\/\\Omega_{\\rm r}^{\\rm{nr}}).\n\\end{align}\nEarly in the experiment, we observed a nonzero systematic shift $\\omega^{\\N\\E}_{\\E^{\\rm{nr}}}$ and took the steps outlined in section~\\ref{sssec:suppression_of_the_AC_stark_shift_phases} to suppress it. To verify that the steps taken were effective, we examined $\\omega^{\\mathcal{NE}}$ as a function of an intentionally applied non-reversing electric field. The resulting data are shown in figure~\\ref{fig:Enr_slope}. The original slope, $\\partial\\omega^{\\N\\E}\/\\partial\\E^{\\rm{nr}}=(6.7\\pm0.4)(\\mathrm{rad\/s})\/(\\mbox{V\/cm})$,\ncorresponded to a systematic shift of $\\omega^{\\N\\E}_{\\E^{\\rm{nr}}}\\approx-34~\\mathrm{mrad}\/\\mathrm{s}$ when combined with the measured $\\E^{\\rm{nr}}\\approx-5^{\\:}\\mathrm{mV\/\\mathrm{cm}}$. Following the modifications described above, the $\\partial\\omega^{\\N\\E}\/\\partial\\E^{\\rm{nr}}$ slope was greatly suppressed, reducing the systematic error to $\\omega^{\\N\\E}_{\\E^{\\rm{nr}}}<1~\\mathrm{mrad}\/\\mathrm{s}$, well below the statistical uncertainty in the measurement of $\\omega^{\\mathcal{NE}}$.\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[width=12cm]{Enr_slope.pdf}\n\\caption{Linear dependence of the $\\omega^{\\mathcal{NE}}$ channel on an applied non-reversing electric field observed before (red) and after (black) we suppressed the known AC Stark shift phase by optimizing the preparation laser beam shape, time-averaged power and polarisation.}\n\\label{fig:Enr_slope}\n\\end{figure}\n\nBecause we observed that the parameters $\\E^{\\rm{nr}}$ and $\\Omega_{\\rm r}^{\\N\\E}$ caused systematic errors in $\\omega^{\\mathcal{NE}}$, we intermittently measured the size of the associated systematic errors throughout the datasets that were used for our reported result. We measured $\\partial\\omega^{\\N\\E}\/\\partial\\E^{\\rm{nr}}$ by applying a range of large non-reversing electric fields, up to around 70 times that present under normal running conditions. The value of $\\partial\\omega^{\\N\\E}\/\\partial\\Omega_{\\rm r}^{\\N\\E}$ was measured by applying a correlated laser power $P^{\\N\\E}$ in the state preparation and state readout beams with a magnitude corresponding to an applied $\\Omega_{\\rm r}^{\\N\\E}$ that was up to 20 times that measured under normal operating conditions. These parameters were measured for multiple values of the magnetic field magnitude, $\\B_{z}$, for which different state readout laser beam polarisations were required. Due to known birefringent behavior of the AC stark shift phases, we allowed for this possibility for all AC stark shift phase systematic errors. We measured $\\partial\\omega^{\\N\\E}\/\\partial\\E^{\\rm{nr}}$ for both $\\hat{k}\\cdot\\hat{z}=\\pm1$, but the $\\Omega_{\\rm r}^{\\N\\E}$ systematic error was only discovered after the $\\hat{k}\\cdot\\hat{z}=+1$ dataset and hence $\\partial\\omega^{\\N\\E}\/\\partial\\Omega_{\\rm r}^{\\N\\E}$\nwas only monitored during the $\\hat{k}\\cdot\\hat{z}=-1$ dataset. The $\\Omega_{\\rm r}^{\\N\\E}$ systematic error during the $\\hat{k}\\cdot\\hat{z}=+1$ dataset was determined from auxiliary measurements of the AC Stark\nshift phase. As described in section \\ref{ssec:efields}, $\\E^{\\rm{nr}}(x)$ exhibits significant spatial variation along the beam-line axis, $x$. However the $\\E^{\\rm{nr}}$ that was intentionally applied to determine $\\partial\\omega^{\\N\\E}\/\\partial\\E^{\\rm{nr}}$ was spatially uniform, and hence these measurements were insensitive to the difference $(\\E^{\\rm{nr}}(x_{{\\rm prep}})-\\E^{\\rm{nr}}(x_{\\rm{read}}))$ between the state preparation laser beam at $x_{{\\rm prep}}$ and the state readout beam at $x_{\\rm{read}}$. For this reason, we deduced the systematic error proportional to the difference $(\\E^{\\rm{nr}}(x_{{\\rm prep}})-\\E^{\\rm{nr}}(x_{\\rm{read}}))$ from auxiliary measurements of the AC Stark shift phase parameters, $\\alpha_{\\Delta,i}^{\\rm{nr}}$.\n\nIn summary, the systematic errors proportional to $\\E^{\\rm{nr}}$ and $\\Omega_{\\rm r}^{\\N\\E}$ that were evaluated and subtracted from $\\omega^{\\N\\E}$ to report a measured value of $\\wNEt$ can be expressed as\n\n\\begin{align}\n\\omega_{\\E^{\\rm{nr}}}^{\\N\\E}= & \\left(\\frac{\\partial\\omega^{\\N\\E}}{\\partial\\E^{\\rm{nr}}}\\right)\\frac{1}{2}(\\E^{\\rm{nr}}(x_{{\\rm prep}})+\\E^{\\rm{nr}}(x_{\\rm{read}}))\\nonumber\\\\\n&+\\frac{1}{\\tau}(\\alpha_{\\Delta,{\\rm prep}}^{\\rm{nr}}-\\alpha_{\\Delta,X}^{\\rm{nr}}-\\alpha_{\\Delta,Y}^{\\rm{nr}})\\frac{1}{2}(\\E^{\\rm{nr}}(x_{{\\rm prep}})-\\E^{\\rm{nr}}(x_{\\rm{read}}))\\label{eq:Enr_systematic_error_value}\\\\\n\\omega_{\\Omega_{\\rm r}^{\\N\\E}}^{\\N\\E}= & \\begin{cases}\n\\frac{1}{\\tau}\\sum_{i\\in\\left\\{ {\\rm prep},X,Y\\right\\} }\\beta_{d\\Omega_{\\rm r},i}^{\\rm{nr}}\\left(\\frac{\\Omega_{\\rm r}^{\\N\\E}}{\\Omega_{\\rm r}^{\\rm{nr}}}\\right) & (\\hat{k}\\cdot\\hat{z})=+1\\\\\n\\left(\\frac{\\partial\\omega^{\\N\\E}}{\\partial\\Omega_{\\rm r}^{\\N\\E}}\\right)\\Omega_{\\rm r}^{\\N\\E} & (\\hat{k}\\cdot\\hat{z})=-1\n\\end{cases}\n\\end{align}\nwhere $(\\partial\\omega^{\\N\\E}\/\\partial\\E^{\\rm{nr}})$ and $(\\partial\\omega^{\\N\\E}\/\\partial\\Omega_{\\rm r}^{\\N\\E})$ were monitored by \\emph{Intentional Parameter Variations} (see section~\\ref{sec:Measurement_scheme_more_detail}) throughout the dataset used for our reported result, and $\\E^{\\rm{nr}}(x_{{\\rm prep}})$, $\\E^{\\rm{nr}}(x_{\\rm{read}})$,\n$\\Omega_{\\rm r}^{\\N\\E}$, $\\alpha_{\\Delta,i}^{\\rm{nr}}$, and $\\beta_{d\\Omega_{\\rm r},i}^{\\rm{nr}}$ were obtained from auxiliary measurements. These two systematic errors account for almost all of the systematic offset that was subtracted from $\\omega^{\\mathcal{NE}}$ to obtain $\\wNEt$ as described in section~\\ref{ssec:total_systematic_error_budget}.\n\n\n\n\\subsection{\\texorpdfstring{$\\A^{\\N\\E}$}{ANE} asymmetry effects}\n\\label{ssec:asymmetry_effects}\nIn addition to the dependence of the measured phase on laser detuning and Rabi frequency, we observed dependence of the asymmetry $\\A$ (as defined in section~\\ref{sec:signal_asymmetry}) on the laser parameters $\\Delta_{\\rm{read}}$ and $\\Omega_{{\\rm r},\\rm{read}}$, due to differences between the properties of the $X$ and $Y$ readout laser beams. The laser-induced fluorescence signal $F(\\Delta,\\Omega_{\\rm r})$ varies quadratically with detuning (for small detuning) and linearly with Rabi frequency. Under normal conditions, the signal sizes from $X$ and $Y$ are comparable, $F_X \\approx F_Y \\approx F$. If the $X$ and $Y$ beams have different wavevectors, $\\vec{k}_{X,Y} = \\vec{k}^{\\mathrm{nr}} \\pm \\vec{k}^{XY}$, and $\\vec{k}^{XY}$ has some component along $\\hat{x}$, then the two beams will acquire different Doppler shifts. This leads to a linear dependence of the asymmetry on detuning, which in turn can couple to $\\Delta^{\\N\\E}$ to result in a contribution to $\\A^{\\N\\E}$,\n\\begin{equation}\n\\A^{\\N\\E} \\approx\\frac{1}{F} \\frac{\\partial^2 F}{\\partial \\Delta_{\\rm{read}}^2} (\\vec{k}^{XY}\\cdot\\langle\\vec{v}\\rangle)\\Delta^{\\N\\E}.\n\\end{equation}\nSimilarly, if the two readout beams differ in Rabi frequency, $\\Omega_{r, X\/Y} \\approx \\Omega_{\\rm r}^{\\mathrm{nr}} \\pm \\Omega_{\\rm r}^{XY}$, the asymmetry becomes linearly dependent on Rabi frequency, which in turn can couple to $\\Omega_{\\rm r}^{\\N\\E}$ to result in a contribution to $\\A^{\\N\\E}$,\n\\begin{equation}\n\\A^{\\N\\E} \\approx -\\left(\\frac{1}{F} \\frac{\\partial F}{\\partial \\Omega_{\\rm r}}\\right)^2 \\Omega_{\\rm r}^{XY} \\Omega_{\\rm r}^{\\N\\E}.\n\\end{equation}\n\nHowever, these asymmetry effects are very distinguishable from spin precession phases and polarisation misalignments. Since the $\\Psw$ and $\\Rsw$ switches effectively swap the role of the $X$ and $Y$ readout beams, the $\\A^{\\N\\E}$ effects described above do not contribute to $\\omega^{\\mathcal{NE}}$ when summed over these switches. Additionally, asymmetry effects, once converted to an equivalent frequency or phase, depend on the sign of the contrast, $\\C$, unlike true phases. In the $\\B_z\\approx 20$~mG configuration, ${\\rm sgn}(\\C)={\\rm sgn}(\\B_z)$, but ${\\rm sgn}(\\C)$ has no dependence on ${\\rm sgn}(\\B_z)$ for $\\B_z\\approx 1,~40$~mG. Hence asymmetry correlations $\\A^{\\N\\E}$ are mapped onto frequency correlations $\\omega^{\\N\\E\\P\\R}$ or $\\omega^{\\N\\E\\B\\P\\R}$ depending on the magnetic field magnitude. \n\nIf the pointing or Rabi frequency differences between the $X$ and $Y$ beams drift on timescales comparable to or shorter than the $\\Psw$ or $\\Rsw$ switches, these effects can occasionally `leak' into the `adjacent' channels $\\omega^{\\N\\E\\P}$, $\\omega^{\\N\\E\\R}$, $\\omega^{\\N\\E\\B\\P}$, $\\omega^{\\N\\E\\B\\R}$; however, we have not seen any evidence of these effects contributing to the $\\omega^{\\N\\E}$ channel itself, and hence did not include systematic error contributions due to these effects in our systematic error budget.\n\n\n\\subsection{\\texorpdfstring{$\\Esw$}{E}-Correlated Phase}\n\\label{ssec:E_correlated_phase}\n\nPrevious eEDM measurements have often been limited by a variety of systematic errors that would have produced an $\\Esw$-correlated phase precession frequency in our experiment, $\\omega^{\\E}$ \\cite{Khriplovich1997,Murthy1989,Regan2002,Eckel2013}, such as $\\Esw$-correlated leakage currents, geometric phases, and motional magnetic fields. Our ability to spectroscopically reverse the molecular orientation through a choice of $\\Nsw$ distinguished these effects from an eEDM-generated phase. In addition, the aforementioned effects scale with the magnitude of the applied electric field, which was orders of magnitude smaller in our experiment than previous similar eEDM experiments due to the high polarisability of ThO \\cite{Regan2002}. Also, because the molecular polarisation was saturated, the eEDM phase should have been independent of the magnitude of the applied field. We also note that any shifts from leakage currents and motional magnetic fields coupled through the magnetic dipole moment, which is near-zero in the $H$-state of ThO. Thus we expected $\\omega^{\\E}$ to be substantially suppressed, and that it should not enter $\\omega^{\\N\\E}$ at any significant level.\n\nThe reversal of $\\Nsw$ did not, however, entirely eliminate an eEDM-like phase due to $\\omega^{\\E}$. As discussed in section~\\ref{sec:compute_phase}, there was a small and $\\E$-field dependent difference between the $g$-factors of the two $\\Nsw$ levels \\cite{Bickman2009,Petrov2014}, which meant that a systematic error in the $\\omega^\\E$ channel showing up in $\\omega^{\\N\\E}$ at a level given by $\\omega^{\\N\\E}_{\\omega^\\E}=(\\eta\\E\/g_1)\\omega^{\\E}$. \nWe verified this relation by intentionally correlating a 1.4~mG component of our applied magnetic field with $\\Esw$. This deliberate $\\B^{\\E}$ resulted in a large shift in the value of $\\omega^\\E$ and a $\\sim$1000-times smaller offset of $\\omega^{\\mathcal{NE}}$, as illustrated in figure~\\ref{fig:phi_E}.\n\\begin{figure}[htbp]\n\\centering\n\\includegraphics[width=12cm]{B_E_systematic.pdf}\n\\caption{Illustration of the $\\sim$1000-fold suppression of systematic errors associated with $\\omega^{\\E}$ provided by the $\\Nsw$ switch. Large values of $\\omega^{\\E}$ occur when there is a component of $\\B_z$ correlated with $\\Esw$, $\\B^\\E$. In previous eEDM experiments, this would have corresponded to a systematic error. In our experiment a much smaller shift in $\\omega^{\\mathcal{NE}}$ results from the small difference in magnetic moments between the two $\\Nsw$ levels. Error bars for the $\\omega^{\\E}$ data are significantly smaller than the data points. Data were taken with $\\E=142~\\mathrm{V}\/\\mathrm{cm}$ and the measured ratio of the slopes, $(\\partial\\omega^{\\mathcal{NE}}\/\\partial\\B^\\E)\/(\\partial\\omega^{\\E}\/\\partial\\B^\\E)=(2.8\\pm0.8)\\times 10^{-3}$ is consistent with the expected value $\\eta \\E\/g_1=(2.5\\pm0.1)\\times 10^{-3}$.}\n\\label{fig:phi_E}\n\\end{figure}\n\nThe intentionally applied $\\B^\\E$ was the only experimental parameter that was observed to produce a measurable shift in $\\omega^{\\E}$. Even large ($\\sim$20~mG) magnetic fields components along $\\hat{x}$ and $\\hat{y}$, which exaggerate the effect of motional magnetic fields, did not shift $\\omega^{\\E}$ (this is expected, since the large tensor Stark shift in $\\ket{H,J=1}$ dramatically suppresses the effect of motional magnetic fields \\cite{Player1970}). For our eEDM data set, $\\omega^{\\E}$ was consistent with zero. We included a contribution from $\\omega^{\\E}$ in our error budget for $\\omega^{\\mathcal{NE}}$ by multiplying the mean and uncertainty of the extracted $\\omega^{\\E}$ by our measured $|\\E|$-dependent suppression factors $\\eta\\E\/g_1$.\n\n\n\\subsection{\\texorpdfstring{$\\Nsw$}{N}-Correlated Laser Pointing}\n\\label{ssec:N_correlated_pointing}\nWe discovered a nonzero, time-dependent signal in $\\omega^{\\N}$ which was associated with an $\\Nsw$-correlated laser pointing, $\\hat{k}^{\\N}\\approx5~\\upmu$rad. An investigation into the mechanism behind this effect was inconclusive. We found that the pointing correlation appeared downstream of the AOMs that created the rapid polarisation switching and improved alignment was able to reduce the effect. We also found that the observed pointing was in some way correlated with the seed power and input angle of incidence into the high-power fiber amplifier immediately upstream of the polarisation switching, despite the fact that pointing out of the amplifier did not fluctuate. Since we used four different sets of AOMs to perform the $\\Nsw$ and $\\Psw$ switches before the amplifier, we observed laser pointing correlated with both of these switches. By matching the characteristics of these four beam paths we were able to suppress $\\hat{k}^{\\N}$ to $<1~\\upmu$rad.\n\nThe effect of $\\hat{k}^{\\N}$ on $\\omega^{\\N}$ was studied by exaggerating the former with piezoelectrically actuated mirrors. Examining $\\partial\\omega^{\\N}\/\\partial\\hat{k}^{\\N}$ showed significant fluctuations in its value. We were unable to identify the mechanism by which $\\hat{k}^\\N$ affected $\\omega^{\\N}$.\n\nWe had no evidence that the effect causing the observed variation in $\\omega^{\\N}$ also caused a systematic error in $\\omega^{\\mathcal{NE}}$, but to be cautious we included an associated systematic uncertainty in our systematic error budget (section \\ref{ssec:total_systematic_error_budget}). Assuming a linear relationship between $\\omega^{\\N\\E}$ and $\\omega^{\\N}$, we extracted $\\partial\\omega^{\\N\\E}\/\\partial\\omega^{N}$ from a combination of data taken under normal conditions and with an exaggerated $\\omega^{\\N}$ induced by an exaggerated $\\hat{k}^{\\N}$. We then placed an upper limit on a possible systematic error $\\omega^{\\mathcal{NE}}_{\\omega^{\\N}}$ based on the value of $\\omega^{\\N}$ obtained under normal running conditions.\nThe resulting systematic uncertainty was four times smaller than our statistical uncertainty.\n\n\\subsection{Laser Imperfections}\n\\label{ssec:laser_imperfections}\nOf the lasers used in our experiment, only the state preparation and readout lasers were known to produce possible systematic errors; imperfections in the rotational cooling, optical pumping or target ablation lasers simply resulted in a reduction in usable molecule flux. As part of our search for systematic errors, we intentionally exaggerated all known state preparation and readout laser imperfections possible without dismantling the apparatus (cf.\\ table~\\ref{tbl:syst_check}). In this section we describe this procedure and the resulting contributions to our systematic error budget.\n\n\\subsubsection{Laser Detuning}\n\\label{sssec:laser_detuning}\n\\hspace*{\\fill} \\\\\nThe correlated components of the state preparation and readout laser beam detunings are described in detail in section~\\ref{sec:state_prep_read}. Each detuning component was separately exaggerated and in some cases multiple components were simultaneously exaggerated. Most of the detuning terms in equation~\\ref{eq:detuningcorrelations} were exaggerated to $\\pm2\\pi\\times1$--2~MHz. No detuning or detuning correlation produced a significant shift in $\\omega^{\\mathcal{NE}}$ other than $\\Delta^{\\N\\E}$ caused by $\\E^{\\rm{nr}}$, discussed in section~\\ref{sssec:correlated_laser_parameters}. In some cases, shifts in other phase channels were induced, but all shifts were consistent with well-understood AC Stark shift and asymmetry models described in sections \\ref{sssec:AC_stark_shift_phases} and \\ref{ssec:asymmetry_effects}.\nFor example, the combination of nonzero $\\Delta^{\\N}$ and $\\Delta^{\\rm{nr}}$ coupled to the $\\B$-dependent component of the AC stark shift phase (equation~\\ref{eq:bdOmega}) induces a significant shift in $\\omega^{\\N\\B}$ (cf.\\ equation~\\ref{eq:Empirical_AC_Stark_Shift_Phase_Result}). \nAsymmetry correlations also resulted from these detuning correlations, but these were only manifested in channels odd with respect to $\\Psw$ and $\\Rsw$, and hence had no plausible effect on $\\omega^{\\mathcal{NE}}$. Because the YbF eEDM experiment \\cite{Kara2012} observed unexplained dependence of the measured eEDM value on state preparation microwave detuning, we included a systematic error contribution from all detuning imperfections in our systematic error budget.\n\n\\subsubsection{Laser Pointing and Intensity}\n\\label{sssec:laser_pointing_and_intensity}\n\\hspace*{\\fill} \\\\\nSimilar to detuning imperfections, the state preparation and readout lasers could have imperfect pointing and correlated intensities. Ideally the laser propagation direction, $\\hat{k}$, would have been parallel to the laboratory electric field. This would have diminished the amount of $\\hat{z}$ polarised light experienced by the molecules, which could drive unwanted off-resonant transitions, and prevented stray retroflection from the ITO field plate surfaces. Using this ITO retroflection as a guide, we aligned $\\hat{k}$ perpendicular to the field plate surface, and therefore parallel to $\\hat{\\E}$, to within $\\sim{3}$~mrad. To test for errors related to imperfect pointing, both the state preparation and readout pointing misalignments were exaggerated in the $x$-direction to $\\pm$10~mrad, as was the relative pointing of the $\\hat{X}$ and $\\hat{Y}$ state readout beams. The vacuum windows and $\\sim$3.8~cm wide holes in the magnetic shields prevented us from further misaligning the beams. To decouple pointing imperfections from detuning imperfections, the state preparation and readout laser frequencies were tuned to resonance after each pointing adjustment. No shift in $\\omega^{\\mathcal{NE}}$ was observed and no systematic error contribution from pointing imperfections was included. Pointing imperfections were only observed to affect the signal asymmetry, as previously discussed in section \\ref{ssec:asymmetry_effects}.\n\nUnlike laser pointing and detuning, there was no `ideal' value for laser intensity. The state preparation and readout laser intensities were chosen such that we were driving optical pumping to completion on the $H\\rightarrow C$ transition without producing unnecessary thermal stress on the field plates. We decreased each laser intensity by a factor of four to check that there was no variation in $\\omega^{\\mathcal{NE}}$. We observed a nonzero $\\Omega_{\\rm r}^{\\N}$ \ncaused by the $\\Nsw$-correlated seed power into the high-power fiber amplifiers and by Stark mixing between rotational levels in $H$ and $C$ as discussed in section \\ref{sssec:correlated_laser_parameters}. We exaggerated this imperfection by a factor of 20. Only $\\omega^{\\N\\B}$ was shifted, consistent with our understanding of the $\\B$-correlated AC Stark shift phase. These intensity systematic error checks were not included in the systematic error budget.\n\n\n\\subsection{Magnetic Field Imperfections}\n\\label{ssec:magnetic_field_imperfections}\nThe $H$ state is very insensitive to a magnetic field $\\B_z$ due to its small $g$-factor, as discussed in section~\\ref{sec:tho_molecule}. Sensitivity to the transverse fields is even further suppressed by the large size of the tensor Stark shift relative to the Zeeman interaction. Nevertheless, there are known mechanisms by which magnetic field imperfections can contribute to systematic errors: $\\B_z^{\\rm{nr}}$ can contribute to the $\\omega^{\\mathcal{NE}}_{\\Omega_{\\rm r}^{\\N\\E}}$ systematic error discussed in section~\\ref{sssec:correlated_laser_parameters}, and transverse fields $\\B_x^{\\rm{nr}}$ and $\\B_y^{\\rm{nr}}$ can lead to the geometric phase systematic errors \\cite{Vutha2010} discussed in section~\\ref{ssec:E_correlated_phase}. We designed the experiment to allow a wide variety of magnetic field tilts and gradients to be applied as described in section~\\ref{sec:bfields} and we directly looked for systematic errors resulting from these magnetic field imperfections.\n\nBoth $\\B$-correlated and uncorrelated imperfections were applied. We did not precisely measure the residual values of each of these parameters along the molecule beam line until we had studied all systematic errors and collected our published data set. Based on the projected ${\\sim}10^5$ magnetic shielding factor, we expected all stray magnetic fields and gradients to be on the order of 10~$\\upmu$G and 1 $\\upmu$G\/cm, respectively. For this reason we only exaggerated these imperfections to $\\sim$2~mG and $\\sim$0.5~mG\/cm. When we mapped out the magnetic field with a magnetometer inserted between the electric field plates as described in section \\ref{sec:bfields}, we discovered that several imperfections were much larger than we expected (e.g.\\ $\\B_y \\approx 0.5$~mG). This was caused by poor magnetic shielding due to insufficient shield degaussing. For this reason we gathered additional eEDM data with some magnetic field parameters exaggerated by an additional factor of five. $\\omega^{\\mathcal{NE}}$ and nearly all other frequency channels, apart from $\\omega^{\\rm{nr}}$ and $\\omega^{\\B}$ were not observed to be affected by any of these magnetic field parameters. \nBecause uncorrelated stray magnetic fields and magnetic field gradients caused unexpected eEDM offsets in the PbO eEDM experiment \\cite{Eckel2013}, we included contributions from all uncorrelated magnetic field imperfections in our systematic error budget described in section \\ref{ssec:total_systematic_error_budget}.\n\n\\subsection{Electric Field Imperfections}\n\\label{ssec:electric_field_imperfections}\nUnlike the magnetic field, we do not have the ability to control electric field gradients and stray electric fields, aside from the average value of $\\E^{\\rm{nr}}$. The field plates were located at the center of the experiment, inside the vacuum chamber and magnetic shields and coils, with no direct access available. To search for systematic errors related to the electric field, equal amounts of eEDM data were gathered with two different electric field magnitudes. The $\\omega^{\\mathcal{NE}}$ values from both field magnitudes were consistent with each other. The YbF eEDM experiment observed unexplained eEDM dependence on the voltage offset common to both field plates. For this reason we exaggerated this offset by a factor of 1000 (relative to its residual value of ${\\approx}5$~mV) and, even though it did not shift our eEDM measurement, included it in our systematic error budget. \n\n\\subsubsection{Molecule Beam} \\label{ssec:molecular_beam}\n\\hspace*{\\fill} \\\\\nThe molecule beam should have ideally travelled parallel to the electric field plates and well-centred between the plates. This minimizes Doppler shifts, protects the plates from being coated with ThO, and ensures that the molecules experience the most uniform electric field. The entire beam source vacuum chamber sat on a two axis ($yz$) translation stage. The exit aperture of the buffer gas cell was aligned to within 1~mm of the centre of the fixed collimators and electric field plates, using a theodolite. Geometric constraints only allowed us to exaggerate the cell misalignment by roughly a factor of three (up to 3~mm) before the molecules would have hit the sides of the field plates. We also \nvaried the transverse spatial and velocity distributions\nby using adjustable collimators between the beam source and spin-precession region to block half of the beam from the $\\pm\\hat{x},\\pm\\hat{z}$ directions. The value of $\\omega^{\\mathcal{NE}}$ was not observed to shift with any molecule beam parameter adjustment.\n\n\n\n\n\\subsection{Searching for Correlations in the eEDM Data Set} \\label{ssec:correlations_in_the_eEDM_data_set}\n\n\nIn addition to performing systematic error checks for possible variations of $\\omega^{\\N\\E}$ with various experimental parameters, we searched for statistically nonzero values within the set of 1536 possible correlations with the block and superblock switches. This analysis was performed for our primary measured quantities $\\omega$, $\\C$, and $\\F$ and for a wide range of auxiliary measurements such as laser powers, magnetic field, room temperature, etc. We also examined the switch-parity channels of $\\omega$, $\\C$, and $\\F$ as a function of time within the molecule beam pulse, and as a function of time within the polarisation switching cycle. We used the Pearson correlation coefficient to look for correlations between the aforementioned switch-parity channels and used the autocorrelation function to look for signs of time variation of the mean within those channels. Figure~\\ref{fig:pixel_plot} illustrates data from such a search with a subset of the previously described quantities. \nIn this search, we looked at 4390 quantities and we set the significance threshold at $4\\sigma$ which correponds to a probability of $p\\approx0.25$ that there will be one or more false positives above that threshold. We represented the significance of each of these quantities with a grayscale pixel. Each pixel that was significant at the $4\\sigma$ level is marked with a symbol corresponding to a known explanatory physical model, or a red dot if the signal is not yet explained. The fact that we understand most of the significant signals present in our experiment, combined with the fact that the statistical distribution of the remaining signals below the significance threshold is consistent with a normal distribution, gives us added confidence in our models of the experiment and our reported eEDM result.\n\n\\begin{figure}[htbp]\n\\centering\n\\includegraphics[width=\\textwidth]{pixel_plot_new_jpeg.pdf}\n\\caption{Over 4,000 switch-parity channels (left) and correlations between switch parity channels (upper right) computed from the eEDM data set. The deviation of each quantity from zero in units of the statistical uncertainty is indicated by the grayscale shading. We set a significance threshold of $4\\sigma$ above which there is a probability of $p=25\\%$ of finding at least 1 false positive. We mark each significant channel\/correlation with a symbol corresponding to a model known to produce a signal in that channel. The quantities below this threshold exhibit a normal distribution, shown in the lower right.\n}\n\\label{fig:pixel_plot}\n\\end{figure}\n\nChannels\/correlations marked with symbols are significantly nonzero due to known mechanisms as follows:\n\\begin{itemize}\n \\item Green stars: Correlations due to the nonzero and drifting signal in the $\\omega^{\\N}$ channel described in section~\\ref{ssec:N_correlated_pointing}.\n \\item Light blue squares: Signals in $\\omega^{\\N\\E\\B}$ channels due to the $\\Bsw$-odd AC stark shift phase coupling to $\\Omega_{\\rm r}^{\\N\\E}$ as described in section~\\ref{sssec:correlated_laser_parameters}.\n \\item Orange triangles: Correlations due to contrast or asymmetry coupling to $\\Omega_{\\rm r}^{\\N\\E}$. Contrast correlations arise simply because there is a linear dependence of total contrast on Rabi frequency, and the asymmetry correlation is described in section~\\ref{ssec:asymmetry_effects}.\n \\item Brown diamond: Correlations in $\\C^{\\N}$ and related contrast channels due to nonzero Rabi frequency correlations $\\Omega_{\\rm r}^{\\N}$ and $\\Omega_{\\rm r}^{\\N\\P}$. These arise due to laser power correlations with the $\\Nsw$ and $\\Psw$ switches and due to Stark mixing between rotational levels in $H$ and $C$, which create $\\Nsw$- and $\\Psw$-correlated transition amplitudes on the $H\\rightarrow C$ transition as described in section~\\ref{sssec:laser_pointing_and_intensity}.\n \\item Red dot: Signals above our significance threshold for which we have been unable to find a plausible explanation. Even if these quantities arise from real physical effects, they would need to couple to other correlated quantities to contribute to $\\omega^{\\N\\E}$ and there is no evidence for this in the eEDM dataset. \n\\end{itemize}\n\n\n\\subsection{Systematic Error Budget}\n\\label{ssec:total_systematic_error_budget}\n\n\n\n\n\nThe method used for construction of a systematic uncertainty varies from experiment to experiment (see for example \\cite{sinervo2003,barlow2002}), and it is ultimately a subjective quantity. Even if individual contributions are derived from objective measurements, their inclusion or exclusion in the systematic uncertainty is subjective. Furthermore, the systematic uncertainty cannot possibly be a measure of the uncertainty in all systematic errors in the experiment, but rather only those which were identified and searched for. Although we work hard to identify all significant systematic errors in the measurement, we cannot rule out the possibility that some were missed.\n\nOur criteria for including a given quantity in the systematic uncertainty consist of three classes of systematic errors in order of decreasing importance of inclusion:\n\n\\begin{enumerate}[(A)]\n\\item If we measured a nonzero correlation between $\\omega^{\\mathcal{NE}}$ and some parameter which had an ideal value in the experiment, we performed auxiliary measurements to evaluate the corresponding systematic error and subtract that error from $\\omega^{\\mathcal{NE}}$ to obtain $\\wNEt$. The statistical uncertainty in the shift made to $\\omega^{\\mathcal{NE}}$ contributed to the systematic uncertainty.\n\\item If we observed a signal in a channel that we deemed important to understand, and it was not understood, but was not observed to be correlated with $\\omega^{\\mathcal{NE}}$, we set an upper limit on the shift in $\\omega^{\\mathcal{NE}}$ due to a possible correlation between the two channels. Since such a signal represented a gap in our understanding of the experiment, we added this upper limit as a contribution to the systematic uncertainty.\n\\item If a similar experiment saw a nonzero, not understood correlation between their measurement channel and some parameter with an ideal experimental value, but we did not observe an analogous correlation, we set an upper limit on the shift in $\\omega^{\\mathcal{NE}}$ due to this imperfection. Since this signal may have signified a gap in our understanding of our experiment, we added this upper limit as a contribution to the systematic uncertainty.\n\\end{enumerate}\n\n\n\\begin{table}[tbp]\n\\centering\n\\caption{Systematic error shifts and uncertainties for $\\omega^{\\mathcal{NE}}$, in units of mrad\/s grouped by inclusion class (defined in the text). Total uncertainties are calculated by summing the individual contributions in quadrature. Note that $\\omega^{\\mathcal{NE}}\\approx1.3$~mrad\/s corresponds roughly to $1\\times10^{-29}~\\ecm$ for our experiment.}\n\\begin{tabular}{llcc}\n\\br\nClass & Parameter & Shift (mrad\/s) & Uncertainty (mrad\/s)\\\\\n\\mr\nA & $\\E^{\\rm{nr}}$ correction & $-0.81$ & $0.66$\\\\\nA & $\\Omega_{\\rm r}^{\\N\\E}$ correction & $-0.03$ & $1.58$\\\\\nA & $\\omega^{\\E}$ correlated effects & $-0.01$ & $0.01$\\\\\nB & $\\omega^{\\N}$ correlation & & $1.25$\\\\\nC & Non-reversing $\\B$-field $\\left(\\B_{z}^{\\rm{nr}}\\right)$ & & $0.86$\\\\\nC & Transverse $\\B$-fields $\\left(\\B_{x}^{\\rm{nr}},\\B_{y}^{\\rm{nr}}\\right)$ & & $0.85$\\\\\nC & $\\B$-field gradients & & $1.24$\\\\\nC & Prep.\/readout laser detunings & & $1.31$\\\\\nC & $\\Nsw$ correlated detuning & & $0.90$\\\\\nC & $\\E$-field ground offset & & $0.16$\\\\\n\\mr\n & Total Systematic & $-0.85$ & $3.24$\\\\\n\\mr\n & Statistical Uncertainty & & $4.80$\\\\\n\\mr\n & Total Uncertainty & & $5.79$\\\\\n\\br\n\\end{tabular}\n\\label{tbl:syst_error}\n\\end{table}\n\nTable \\ref{tbl:syst_error} contains a list of the contributions to our systematic error, grouped by inclusion class, with the corresponding shifts and\/or uncertainties. Accounting for class A systematic errors was obligatory, and the removal of these errors from $\\omega^{\\mathcal{NE}}$ can be viewed as a redefinition of the measurement channel to $\\wNEt$ which does not contain those unwanted effects. These systematic errors consisted of those that depended on the parameters $\\E^{\\rm{nr}}$, $\\Omega_{\\rm r}^{\\N\\E}$, and $\\omega^{\\E}$ as described in sections \\ref{sssec:correlated_laser_parameters} and \\ref{ssec:E_correlated_phase}, and as such our reported measurement of the $T$-odd spin precession frequency is defined as $\\wNEt=\\omega^{\\mathcal{NE}}-\\omega^{\\mathcal{NE}}_{\\E^{\\rm{nr}}}-\\omega^{\\mathcal{NE}}_{\\Omega_{\\rm r}^{\\N\\E}}-\\omega^{\\mathcal{NE}}_{\\omega^\\E}$. The class B and class C systematic errors were included in the systematic uncertainty to lend credance to our result despite unexplained signals and unexplained systematic errors in experiments similar to ours.\nAll uncertainties in the contributions to the systematic error were added in quadrature to obtain the systematic uncertainty.\n\nWith reference to the class B criterion, we deemed the following channels as important to understand: $\\omega^{\\N},$ $\\omega^{\\E},$ $\\omega^{\\E\\B}$, and $\\omega^{\\N\\E\\B}$. Signals were initially not expected in any of these channels and could be measured with the same precision as $\\omega^{\\mathcal{NE}}$. The $\\omega^{\\rm{nr}}$, $\\omega^{\\B}$ and $\\omega^{\\N\\B}$ channels were not included in our systematic error since the Zeeman spin precession signals present in these channels had non-stationary means and additional noise due to drift in the molecule beam velocity. Only one of these channels, $\\omega^{\\N}$, described in section \\ref{ssec:N_correlated_pointing}, met the class B inclusion criterion. \n\nWith reference to the class C criterion, we defined the set of experiments similar to ours to include other eEDM experiments performed in molecules: the YbF experiment \\cite{Hudson2011} and the PbO experiment \\cite{Eckel2013}. The PbO experiment observed unexplained systematic errors coupling to stray magnetic fields and magnetic field gradients (cf.\\ section~\\ref{ssec:magnetic_field_imperfections}), and the YbF experiment observed unexplained systematic errors proportional to detunings (cf.\\ section~\\ref{sssec:laser_detuning}) and a field plate ground voltage offset (cf.\\ section~\\ref{ssec:electric_field_imperfections}). Thus we included the systematic uncertainty associated with the aforementioned effects in our budget.\n\nAfter having accounted for the systematic errors and systematic uncertainty, we reported $\\wNEt$, the contribution to the channel $\\omega^{\\mathcal{NE}}$ induced by $T$-odd interactions present in the $H$ state of ThO, as\n\\begin{align}\n\\label{eq:wNEt_num}\n\\wNEt=&2.6 \\pm 4.8_{\\rm{stat}}\\pm 3.2_{\\rm{syst}}~\\rm{mrad}\/\\rm{s}\\\\\n =&2.6 \\pm 5.8~\\rm{mrad}\/\\rm{s}, \\label{eq:wNEt_num_err_comb}\n\\end{align}\nwhere the combined uncertainty is defined as the quadrature sum of the statistical and systematic uncertainties, $\\sigma^2=\\sigma_{\\rm{stat}}^2+\\sigma_{\\rm{syst}}^2$. This result is consistent with zero within $1\\sigma$. Since $\\sigma_{\\rm{syst}}$ is to some extent a subjective quantity, its inclusion should be borne in mind when interpreting confidence intervals based on $\\sigma$. Nevertheless, this inclusion decision does not have a large impact on the meaning of the resulting confidence intervals since $\\sigma$ is only about 20\\% larger than $\\sigma_{\\rm{stat}}$.\n\n\n\n\n\\subsubsection{Overview}\n\\hspace*{\\fill} \\\\\nIn this section we provide an overview of our experimental procedure and the important components of our apparatus. The reader should consult subsequent subsections for further details. A schematic of the experimental apparatus is shown in figure~\\ref{fig:apparatus_overview}.\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[scale=0.46]{apparatus_overview.pdf}\n\\caption{A schematic of the overall ACME experimental apparatus. A beam of ThO molecules was produced by a cryogenic buffer-gas-cooled source. After exiting the source, the molecules were rotationally cooled via optical pumping and microwave mixing and then collimated before entering a magnetically shielded spin-precession region where nominally uniform magnetic and electric fields were applied. Using optical pumping, the molecules were transferred into the eEDM-sensitive $H$ state and then a spin superposition state was prepared. The spin precessed for a distance of ${\\approx}22$~cm and was then read out via laser-induced fluorescence. The fluorescence photons were collected by lenses and passed out of the chamber for detection by photomultiplier tubes. See main text for further details.\\label{fig:apparatus_overview}}\n\\end{figure}\n\nThO molecules were produced via pulsed laser ablation of a ThO$_2$ ceramic target. This took place in a cryogenic neon buffer gas cell, held at a temperature of ${\\approx}16$~K, at a repetition rate of 50~Hz. The resulting molecular beam was collimated and had a forward velocity $v_{\\parallel}\\approx200$~m\/s. In the state readout region the molecular pulses had a temporal (spatial) length of around 2~ms (40~cm). The buffer gas beam source is described in detail in section~\\ref{sec:beamsource}.\n\nAfter leaving the buffer gas source, the molecules had a velocity distribution and rotational level populations consistent with a Maxwell-Boltzmann distribution at a temperature of ${\\approx}4$~K. This was lower than the cell temperature due to expansion cooling, which enhanced the number of usable ThO molecules in the relevant rotational state. Further rotational cooling was provided via optical pumping and microwave mixing (see section~\\ref{sec:rotcool}). The molecules then passed through adjustable horizontal and vertical collimators consisting of a double layer of razor blades affixed to linear translation vacuum feedthroughs. Under normal running conditions, these collimators were withdrawn so that they did not affect the profile of the molecule beam in the spin-precession region; however, they were used to modify the spatial profile of the molecule beam during systematic checks to investigate the effect of molecule beam position and pointing. Just before the field plates, 126~cm from the beam source, the molecules passed through a 1~cm square collimating aperture, which determined the beam profile in the spin-precession region and prevented particles in the beam from being deposited on the field plates.\n\nAs described in section~\\ref{sec:Measurement_scheme}, a spin precession measurement was performed where the precession angle provided a measure of the interaction energy of an eEDM with the effective electric field, $\\mathcal{E}_{\\rm eff}$, in the molecule. A pair of transparent, ITO-coated glass plates provided an electric field that polarised and aligned the molecules. Laser beams passed through these plates to perform state preparation and readout. Around the vacuum chamber were coils that provided a uniform magnetic field in the $+\\hat{z}$ direction, and five layers of magnetic shielding which shielded against environmental magnetic fields. The electric and magnetic fields are discussed in detail in sections~\\ref{ssec:efields} and \\ref{sec:bfields}. The fluorescence induced by the state readout laser beam was collected by a set of eight lenses and transferred out of the spin-precession region using fiber bundles and light pipes (see section \\ref{sec:fluorescence_collection}), where it was detected by photo-multiplier tubes\\footnote{Hamamatsu R8900U-20.}. \n\n\\subsubsection{Buffer Gas Beam Source}\n\\hspace*{\\fill} \\\\\n\\label{sec:beamsource}\nThe basic operation of our beam source \\cite{Maxwell2005,Petricka2007,Sushkov2008,Patterson2009,Campbell2009Review,Tu2009,Patterson2010,Hutzler2011,Barry2011,Lu2011,Skoff2011PRA,Skoff2011Thesis,Hutzler2012,HutzlerThesis,Hummon2013,Bulleid2013} is depicted in figure~\\ref{fig:beam_source_schematic}.\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[width=13.5cm]{beam_source_schematic.pdf}\n\\caption{A schematic of the buffer gas beam source. Neon buffer gas flowed into a cell at a temperature of 16~K where it served to thermalise the hot ThO molecules produced by laser ablation. The ThO was entrained in the buffer gas flow. The mixture exited the cell and its expansion cooled the ThO to $\\approx4$~K. The resulting beam passed through collimating apertures in the 4~K and 50~K radiation shields and exited the beam source into the high vacuum region of the experiment. Solid circles represent buffer gas atoms. Open circles represent ThO molecules being cooled (red to blue transition).}\n\\label{fig:beam_source_schematic}\n\\end{figure}\nNeon buffer gas was flowed at a rate of $\\approx30$~SCCM (standard cubic centimetres per minute) through a copper cell held at a $T\\approx16$~K. The inside of the cell was cylindrical with a diameter of 13~mm and a length of 75~mm. Within the cell ThO was introduced at high temperature via laser ablation: overlapped beams of light with wavelengths 532~nm and 1064~nm emitted by a pulsed Nd:YAG laser\\footnote{Litron Nano TRL 80-200.} were focussed onto a 1.9~cm diameter ${\\rm ThO}_2$ target fabricated from pressed and sintered powder \\cite{Balakrishna1988,KiggansPrivate}. The laser pulses had a duration of a few ns, a pulse energy up to approximately 100~mJ and a repetition rate of $50$~Hz. The resulting hot plume of ejected particles, which contained ThO along with various other ablation byproducts, was cooled by collisions with the neon buffer gas, became entrained, and then exited the cell. The cell temperature was maintained by a combination of a pulse tube refrigerator\\footnote{Cryomech PT415.} and a resistive heater.\n\nThe cell was surrounded by a 4~K copper shield that protected the cell from black-body radiation and cryopumped most of the neon emerging from the cell. This shield was also partially covered with activated charcoal that acted as a cryopump for residual helium in the neon buffer gas. We observed a background pressure of $10^{-7}$~Torr without any mechanical pumping of the beam source when cold and with no buffer gas flow. The 4~K shield had a stainless steel conical collimator with a circular aperture of diameter 6~mm, located 25~mm from the cell aperture, by which distance the expanding beam was sufficiently diffuse that intra-beam collisions were negligible and most trajectories were ballistic. This collimator thus functioned as a differential pumping aperture without affecting the beam's cooling, acceleration or expansion \\cite{Hutzler2011}. The collimator had a thermal standoff relative to the 4~K shield to which it was mounted so that it could be kept at a temperature above the freezing point of neon by a resistive heater to prevent ice buildup on the collimator adversely affecting the beam dynamics. Another layer of shielding surrounded the 4~K copper shield, constructed from aluminium and held at a temperature of 60~K. Both the 4~K and 60~K radiation shields were thermally connected to the pulse tube by heat links made of flexible copper rope.\n\nThe aluminium vacuum chamber that housed the buffer gas beam source\\footnote{Precision Cryogenic Systems Inc.} had windows on each side, providing optical access for both the ablation laser and spectroscopy lasers, the latter allowing characterisation and monitoring of beam properties. The ThO beam's forward velocity distribution was roughly Gaussian with mean $v_{\\parallel}\\approx200$~m\/s and standard deviation $\\sigma_{v_{\\parallel}}\\approx13$~m\/s, corresponding to a temperature of ${\\approx}5$~K. The rotational temperature was $T_{\\rm rot}\\approx4$~K (rotational constant $B_X\\approx0.33$~cm$^{-1}$), meaning that ${\\approx}90$\\% of the population was contained in the levels $J=0$--$3$. Upon exiting the cell, the beam had a FWHM angular spread of $\\approx45^{\\circ}$. Several stages of collimation were applied before reaching the spin-precession region. The final collimator subtended a solid angle of $\\approx6\\times10^{-5}~{\\rm sr}$, meaning 1 in ${\\sim}20,000$ molecules exiting the cell reached the spin-precession region, where the precession measurement was performed (see figure~\\ref{fig:apparatus_overview}).\n\nThO yields from a given ablation spot decreased significantly after ${\\sim}10^4--10^5$ YAG pulses (${\\sim}10$~mins), at which time the laser spot was moved to an un-depleted region via a motorised mirror to re-optimise the beam flux. Each target was found to provide acceptable levels of molecule flux for around 300~hours of continuous running (${\\approx}5\\times10^7$ shots) before requiring replacement.\n\n\\subsubsection{Rotational Cooling}\n\\hspace*{\\fill} \\\\\n\\label{sec:rotcool}\nWe observed that ${\\approx}2$~cm downstream of (further from) the buffer gas beam source cell aperture, $J$-changing collisions were `frozen out' \\cite{Hutzler2011}, and the distribution of rotational state populations was fairly well described by a Boltzmann distribution with temperature $T_{\\rm rot}\\approx4$~K. \nAt this temperature the resulting fractions of molecules in the $J=0$--3 levels were estimated to be 0.1, 0.3, 0.3 and 0.2 respectively.\n\nAs described in section~\\ref{sec:state_prep_read}, we sought to transfer as much of the initial ground state population as possible into $\\ket{H,J=1}$ via optical pumping. To enhance the population which was transferred, we accumulated population in a single rotational level of the ground state before state preparation. The scheme used to achieve this, which we refer to as rotational cooling, is illustrated schematically in figure~\\ref{fig:rotcool} and discussed in detail in \\cite{SpaunThesis}.\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[scale=0.55]{rotcool.pdf}\n\\caption{Schematic of the rotational cooling process. Numbers label $J$ and $M_y$ (projection of total angular momentum along $y$) sublevels are unlabelled but are $-1$, 0, $+1$ from left to right. Population was first optically pumped out of the $J=2$ and $J=3$ levels ($C$-state $\\Omega$-doublet structure and $M_y$ sublevels omitted for clarity) in a nominally field-free region. Next, population was equilibrated between $\\ket{J=0}$ and $\\ket{J=1,M_y=0}$ via microwave pumping. An electric field of ${\\approx}40$~V\/cm along $\\hat{y}$ was empirically observed to lead to an increased population in $\\ket{X,J=1}$. Grey dots represent population before these pumping processes. The schematic on the right represents the populations inside the spin-precession region (after pumping).\\label{fig:rotcool}}\n\\end{figure}\nThe first stage of the process was the optical pumping of molecules out of $\\ket{X,J=2}$ ($\\ket{X,J=3}$), via $\\ket{C,J^{\\prime}=1}$ ($\\ket{C,J^{\\prime}=2}$) into $\\ket{X,J=0}$ ($\\ket{X,J=1}$) using laser light at 690~nm. The natural linewidth of the $X\\rightarrow C$ transition is ${\\approx}2\\pi\\times0.3$~MHz, however the usable molecules had a ${\\approx}\\pm0.7$~m\/s transverse velocity spread, corresponding to a $1\\sigma$ Doppler width of ${\\approx}2\\pi\\times1.5$~MHz at 690~nm. Because the lasers used had linewidths of ${\\lesssim}1$~MHz, to completely optically pump these molecules we relied on a combination of power broadening and extended interaction time. Optical pumping occured in a magnetically unshielded region where a background field $\\B\\approx500$~mG was present; however, the magnetic moment of $X$ ($C$) is ${\\sim}\\mu_{\\rm N}$ (${\\approx}\\mu_{\\rm B}\/J(J+1)$), the nuclear magneton, which led to a Zeeman shift of ${\\sim}2\\pi\\times400$~Hz (${\\lesssim}2\\pi\\times400$~kHz) such that the $M$ sublevels were not resolved by our lasers. The $\\ket{C,J=1}$ state has an $\\Omega$-doublet splitting of $\\Delta_{\\Omega,C,J=1}\\approx2\\pi\\times51$~MHz \\cite{Edvinsson1965}. This splitting scales as $\\Delta_{\\Omega,C,J}\\propto J(J+1)$, meaning we could spectroscopically resolve the $\\Omega$-doublets for all $\\ket{C,J}$. In addition, having no $\\E$-field present meant that the $M$ sublevels of $C$ and $X$ remained unresolved and the energy eigenstates remained parity eigenstates. The $X$ state is also insensitive to $\\E$-fields due to the lack of $\\Omega$-doublet substructure; opposite parity states are separated by ${\\sim}10$~GHz and were hence unmixed. Laser beams with linear polarisation alternating between $\\hat{x}$ and $\\hat{y}$ were used to ensure that all population in $\\ket{X,J=2,3}$ was addressed. This was achieved by directing around 10 passes of the beam, offset in $x$, through the vacuum chamber, passing through a quarter-wave plate twice in each pass, over a distance of around 2~cm. \n\nThe laser light for rotational cooling was derived from home-built extended cavity diode lasers (ECDLs). The lasers were frequency-stabilised using a scanning transfer cavity with a computer-controlled servo \\cite{YuliaThesis}. Frequency-doubled light at 1064~nm from a frequency-stabilised Nd:YAG laser, locked to a molecular iodine line via modulation transfer spectroscopy \\cite{FarkasThesis}, provided the reference for the transfer cavity.\n\nAfter this first stage of rotational cooling, there was significantly greater population in the $\\ket{X,J=0}$ state than in any of the $\\ket{X,J=1,M}$ sublevels. We obtained a ${\\approx}25~\\%$ increase in the $J=1$ population by applying a continuous microwave field, resonant with the $J=0\\rightarrow J=1$ transition; a sufficiently high microwave power combined with the inherent velocity dispersion of the molecule beam led to an equilibration of population between the coupled levels \\cite{SpaunThesis}. In this second stage of rotational cooling it was empirically observed that applying an electric field to lift the $M_y$ sublevel degeneracy was necessary to obtain the increased population in $\\ket{X,J=1}$. A pair of copper electric field plates (spacing $\\approx4$~cm) provided a field of ${\\approx}40$~V\/cm in the $\\hat{y}$ (vertical) direction. We applied microwaves resonant with the Stark-shifted $\\ket{J=0}\\rightarrow\\ket{J=1,M_y=0}$ transition at a frequency of $2\\pi\\times19.904521$~GHz from an \\emph{ex vacuo} horn. Between the rotational cooling and spin-precession regions of the experiment (see figure~\\ref{fig:apparatus_overview}) there was not a well-defined quantisation axis, and we observe that the populations of the $\\ket{J=1,M}$ magnetic sublevels were equalised by the time the molecules reached the state preparation region. \n\nOverall, we find that rotational cooling provided a factor of between 1.5 and 2.0 increase in the molecule fluorescence signal $F$ in the state readout region. This gain factor was observed to vary slowly over time, possibly due to variations in the rotational temperature of the molecule beam, with significant changes sometimes observed when the ablation target was changed.\n\n\\subsubsection{State Preparation and Readout}\n\\hspace*{\\fill} \\\\\n\\label{sec:state_prep_read}\nFollowing rotational cooling, the molecular beam passed into the spin-precession region, where the molecules experienced a nominally uniform electric field, $\\vec{\\E}$, which was nominally collinear with a magnetic field, $\\vec{\\B}$. Note that since neither of the states $X^1\\Sigma^+$ nor $A^3\\Pi_{0+}$ have $\\Omega$-doublet structure, parity remained a good quantum number for these levels for the small (${\\sim}100$~V\/cm) electric fields we applied. \n\nWe transferred the molecules into the $H$ electronic state via optical pumping, as illustrated in figure~\\ref{fig:op_sublevels}.\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[width=10cm]{op_sublevels.pdf}\n\\caption{Schematic of the optical pumping scheme used to populate the $H$ state. Spontaneous decay to the $H$ state (green arrows) led to an incoherent mixture of all indicated levels. See main text for detailed explanation.}\n\\label{fig:op_sublevels}\n\\end{figure}\nA 943~nm laser beam nominally propagating along $\\hat{z}$ excited molecules from the $\\ket{X,J=1}$ to $\\ket{A,J=0}$. The laser beam passed through a quarter-wave plate, was retroflected and offset in $x$, then passed again through the quarter-wave plate, such that the molecules were pumped by two spatially separated laser beams of orthogonal polarisations, allowing all population in both the $\\ket{X,J=1,M=\\pm1}$ levels to be excited. After excitation to $A$, the molecules could spontaneously decay into the $\\ket{H,J=1}$ manifold of states. We observed a transfer efficiency from $X$ to $H$ of ${\\approx}0.3$ \\cite{SpaunThesis}. In this decay, five out of the six sublevels were populated; 1\/6 of the population decayed to each of $\\ket{H,M=\\pm1,\\Nsw=\\pm 1}$ and 1\/3 to $\\ket{H,\\Psw=-1,M=0}$ (see sections~\\ref{sec:tho_molecule} and \\ref{sec:Measurement_scheme} for definitions of $\\Nsw$ and $\\Psw$); decay to $\\ket{H,\\Psw=+1,M=0}$ is forbidden. \nOf these five populated states, only one corresponded to the desired initial state described by equation~\\ref{eq:dark_state}, and only 1\/6 of the population in the $H$ state was in this desired state.\nWe estimated a total transfer efficiency from $\\ket{X,J=1,M=\\pm 1}$ to the state in equation~\\ref{eq:dark_state} of $30\\%\\times1\/6=5\\%$.\n\nThe 943~nm laser light was derived from a commercial ECDL and then amplified by a commercial tapered amplifier\\footnote{Toptica DL Pro and BoosTA.}, generating $\\approx400$~mW. As with the rotational cooling lasers, we verified that the power was sufficient to drive optical pumping to completion across the entire transverse velocity distribution of the molecular beam. This laser was also stabilised via the previously described (section~\\ref{sec:rotcool}) transfer cavity. The frequency of the laser light was monitored every 30--60 mins by scanning across the molecular resonances, allowing for independent fine-tuning and compensation of long-term frequency changes (${\\lesssim}2\\pi\\times100$~kHz per half hour) due to e.g. temperature drifts in the cavity.\n\nAround 1~cm downstream of the optical pumping laser beam that transferred population to $H$, we prepared the initial state of $H$ (equation~\\ref{eq:dark_state}) by driving the transition between $\\ket{H,M=\\pm1,\\Nsw}$ and $\\ket{C,\\Psw=+1}$ (see section~\\ref{sec:Measurement_scheme} for more details) using laser light at 1090~nm. A distance $L=22$~cm downstream of the preparation laser, a second 1090~nm laser beam was used to read out the molecule state via the same transition (but with the option to excite to either $\\Psw$ state). This laser light was also derived from a commercial ECDL. It was then amplified using a fiber amplifier\\footnote{Keopsys KPS-BT2-YFA-1083-SLM-PM-05-FA.}, increasing the power to ${\\approx}250$~mW. AOMs were then used to split and frequency shift the light to address both $\\Nsw$ states in the $H$ state, allowing spectroscopic selection of molecular alignment, and of both $\\Psw$ levels in the $C$ state. Switching between these frequencies was achieved with either RF switches\\footnote{Mini-Circuits ZYSWA-2-50DR.} or a DDS synthesizer\\footnote{Novatech 409B.}. Given the linear Stark shifts $D_1\\E\\approx2\\pi\\times146$~MHz ($2\\pi\\times37$~MHz) in $H$ with an applied electric field strength $|\\E|=141$~V\/cm (36~V\/cm), and the excited state $\\Omega$-doublet splitting $\\Delta_{\\Omega,C,J=1}\\approx50$~MHz in $C$, these transitions were spectroscopically well-resolved. We fixed the nominal frequency of the state preparation laser to only address $\\Psw=+1$, but periodically switched the state readout laser frequency to address $\\Psw=\\pm1$ (${\\sim}1$~min period). The transition frequencies of the state preparation and state readout laser beams were changed synchronously to always address the same $\\Nsw$ level, with a switch between $\\Nsw$ levels every 0.5~s. The state preparation and readout laser beams were then independently amplified with a pair of fiber amplifiers\\footnote{Nufern PSFA-1084-01-10W-1-3.}, providing ${\\sim}3$--4~W of power. Immediately before interrogating the molecules, the polarisation of the state readout laser beam was rapidly (100~kHz) switched between two orthogonal linear polarisations. The scheme for producing the $\\Nsw$ and $\\Psw$ switches, and this fast polarisation switch, together with the corresponding laser transitions, is shown in figure~\\ref{fig:HC_transitions_setup}. We now describe in detail how the appropriate frequency laser light was produced.\n\\begin{figure}[ht]\n\\centering\n\\includegraphics[width=\\linewidth]{HC_transitions_setup.pdf}\n\\caption{Top: transitions addressed during state preparation and readout (not to scale). The grey arrow represents the ECDL output frequency, $\\omega_0$, not resonant with any transition and referenced from halfway between the two $H$ state $\\Omega$-doublets. Bottom: simplified schematic of how we produced light at the appropriate frequencies. AOM-induced frequency shifts are denoted in the corresponding boxes. Bifurcation of grey lines represents light being split equally. Multiple lines represent different frequencies; only one frequency is used at once. Dashed grey lines represent a continuation of the optical path. AOMs to perform switching between $\\Nsw$ states; switching between $\\Psw$ states and adding relative detuning $\\Delta$; tuning Rabi frequency $\\Omega_{\\rm r}$; and performing polarisation switching are shown. The setup shown is used with $\\E=142$~V\/cm and changes slightly if a different value of $\\E$ is used. For a full description, consult the main text.}\n\\label{fig:HC_transitions_setup}\n\\end{figure}\n\\clearpage\n\nLight from the ECDL was amplified and split equally, passing to two AOMs which produced shifts $\\pm\\omega_{\\rm L}^{\\mathcal{N}}$ where $\\omega_{\\rm L}^{\\mathcal{N}}$ is half the splitting between the two $\\Nsw$ states; these AOMs were switched on and off to perform the $\\Nsw$ switch. The two frequency-shifted beams were combined and overlapped. For state preparation (lower branch of diagram), another AOM shifted the light by $+\\wLs{1}$, into resonance with the lower $\\Omega$-doublet in $C$ ($\\Psw=+1$). This light was then amplifed again and passed through an AOM to vary the power (used as a systematic check). For the state readout (upper branch of diagram), a single AOM switched frequency to produce shifts $+\\wLs{2,3}$ for the two $\\Psw$ states. A relative detuning between state preparation and readout laser beams (not shown) was also implemented with this AOM. (Shifts common to both beams were made by changing $\\omega_0$.) The light was then amplified again and passed through an AOM to vary the power. Finally, polarisation switching was achieved with two AOMs switched on and off at 100~kHz, $\\pi$ out of phase with each other; light not diffracted (and frequency shifted by $-\\wLs{\\rm PS}$) by the first AOM was diffracted (and also frequency shifted by $-\\wLs{\\rm PS}$) by the second AOM. The diffracted light from each path was combined on a polarising beam splitter such that the linear polarisation of the final output beam alternated. \n\nBased on the notation above we can now write the components of the frequencies of the state preparation and readout laser beams which do not reverse with any experimental switch as $\\omega_{\\rm L,prep}^{\\rm{nr}}=\\omega_{\\rm L,0}+\\omega_{\\rm L,1}$ and $\\omega_{\\rm L,read}^{\\rm{nr}}=\\omega_{\\rm L,0}+(\\omega_{\\rm L,2}+\\omega_{\\rm L,3})\/2-\\omega_{\\rm L,PS}$, respectively. We can also write the $\\Psw$-correlated frequency component of the state readout laser as $\\omega_{\\rm L,read}^{\\P}=(\\omega_{\\rm L,2}-\\omega_{\\rm L,3})\/2$. We then write the detuning components as $\\Delta_i=\\omega_{{\\rm L},i}-\\omega_{HC}$ where $i\\in\\left\\{\\mathrm{ prep},X,Y\\right\\}$ indexes the laser and $\\omega_{HC}$ is the transition frequency between the line centres of the $\\ket{H,J=1}$ and $\\ket{C,J=1}$ manifolds\\footnote{Note that this can in principle vary between different laser beams (denoted with the subscript $i$) if there is a relative pointing between them, which produces a relative Doppler shift, but we ignore this effect in our current treatment.}. We can rewrite this overall detuning in terms of various switch parity components:\n\\begin{align}\n\\Delta_{i}=&\\omega_{{\\rm L},i}-\\omega_{HC,i}\\\\\n=&\\left(\\omega_{{\\rm L},i}^{\\rm{nr}}+\\Nsw\\wL^{\\N}+\\Psw\\wL^{\\P}\\delta_{i,\\left\\{X,Y\\right\\} }\\right)-\\left(\\omega_{HC}^{\\rm{nr}}+\\Nsw D_1\\left|\\E(x_{i})\\tilde{\\E}+\\E^{\\rm{nr}}(x_{i})\\right|-\\frac{1}{2}\\Delta_{\\Omega,C,J=1}\\Psw\\delta_{i,\\left\\{ X,Y\\right\\} }\\right)\\\\\n=&\\Delta_{i}^{\\rm{nr}}+\\Nsw\\Delta_{i}^{\\N}+\\Nsw\\Esw\\Delta_{i}^{\\N\\E}+\\Psw\\Delta_{i}^{\\P}\\delta_{i,\\left\\{ X,Y\\right\\}}.\n\\label{eq:detuningcorrelations}\n\\end{align}\nIn the above equations we have defined detuning components of given switch parities --- we shall now explain each component in turn. $\\Delta_{i}^{\\N}=(\\wL^{\\N}-D_1\\E(x_{i}))$ is the mismatch between the Stark shift $D_1\\E(x_{i})$ and the AOM frequency $\\wL^{\\N}$ used to switch between resonantly addressing the two $\\Nsw$ states, where $x_i$ is the $x$ position of laser beam $i$. $\\Delta_{i}^{\\N\\E}=D_1\\E^{\\rm{nr}}(x_{i})$ is a detuning component correlated like an eEDM signal which is due to a non-reversing component of the applied electric field. To understand this relation, consider figure~\\ref{fig:Enr_wNE}. Recall that $\\Delta_{\\Omega,C,J=1}$ is the $\\Omega$-doublet splitting of the $C$ state.\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[width=8cm]{Enr_wNE.pdf}\n\\caption{Illustration of $\\Delta^{\\N\\E}$ arising from a non-reversing electric field $\\E^{\\rm{nr}}$. Dashed lines show energy levels in the presence of $\\E^{\\rm{nr}}$. Colours indicate if the the laser shown in dark red is blue- or red-detuned from the transition.}\n\\label{fig:Enr_wNE}\n\\end{figure}\nFor a $\\E^{\\rm{nr}}\\ne0$, $|\\E|$, and hence the splitting between the $\\Nsw$ levels in $H$, depends on $\\Esw$. If the laser frequency for each $\\Nsw$ is set assuming $\\E^{\\rm{nr}}=0$, a nonzero $\\E^{\\rm{nr}}$ leads to blue or red detuning from resonance, correlated with $\\Esw$. Because the sign of the Stark shift is correlated with $\\Nsw$, the resulting detuning is also correlated with $\\Nsw$.\n\n$\\Delta_{i}^{\\P}=\\wL^{\\P}+\\Delta_{\\Omega,C,J=1}\/2$ is the mismatch between the excited state parity splitting and the AOM frequency, $\\wL^{\\P}=(\\omega_{\\rm L,3}-\\omega_{\\rm L,2})\/2$, used to switch between the two states ($\\delta_{i,\\left\\{ X,Y\\right\\}}$ is the Kronecker delta, 1 if $i=X$ or $i=Y$, zero else). We observed that $\\Delta^{\\N}$ ($\\Delta^{\\P}$) was typically less than $2\\pi\\times20$~kHz ($2\\pi\\times50$~kHz). Although we could measure $\\Delta^{\\N}$ with ${\\sim}2\\pi\\times1$~kHz precision, fluctuations in the Stark splitting, likely caused by thermally-induced fluctuations of the field plate spacing, limited our ability to zero out this correlated detuning.\n\nWe define $\\Delta^{\\rm{nr}}=(\\Delta^{\\rm{nr}}_{{\\rm prep}}+(1\/2)(\\Delta^{\\rm{nr}}_{X}+\\Delta^{\\rm{nr}}_{Y}))\/2$ as the average non-reversing detuning of the state preparation and readout laser beams; its value typically fluctuated by ${\\sim}2\\pi\\times0.1$~MHz over several hours. Every 30--60 minutes the value of $\\Delta^{\\rm{nr}}$ was scanned across the molecular resonance in the readout region using the $\\Delta$-tuning AOM (see figure~\\ref{fig:HC_transitions_setup}), as an auxiliary optimisation. $\\Delta^{\\rm{nr}}$ was set to the value where the fluorescence signal was maximum. This ensured that the average detuning of the state readout laser beams, $(\\Delta_X^{\\rm nr}+\\Delta_Y^{\\rm nr})\/2$, was zero, however, if the state preparation and readout laser beams were not exactly parallel, there could be a difference between $\\Delta^{\\rm{nr}}_i$ due to the resulting difference in Doppler shifts. The effect of a detuning difference between the two state readout polarisations $\\Delta^{XY}=(\\Delta^{\\rm{nr}}_{X}-\\Delta^{\\rm{nr}}_{Y})\/2$ is discussed in section~\\ref{ssec:asymmetry_effects}. Additionally, each day we scanned the frequency of the preparation laser across the molecule resonance while monitoring the contrast of our fluorescence signal to ensure $\\Delta^{\\rm{nr}}_{{\\rm prep}}$ was kept below $2\\pi\\times0.2$~MHz (an example scan is shown in figure~\\ref{fig:contrast}). The ways in which detuning components can contribute to systematic errors are discussed in detail in sections~\\ref{sssec:AC_stark_shift_phases} and \\ref{sssec:correlated_laser_parameters}.\n\nOther polarisation switches of the state preparation and readout laser beams ($\\Rsw$ and $\\Gsw$) were controlled independently via half-wave plates mounted in high resolution rotation stages\\footnote{Newport URS50BCC.}. These switches and their use in the experiment are described in detail in section~\\ref{sec:data_analysis}. Both beams were shaped using cylindrical lenses to be extended in $y$ so all molecules in the beam were addressed. The Gaussian standard deviations of the beam intensities were 1.1~mm and 7.5~mm in the $x$ and $y$ directions, respectively \\cite{SpaunThesis}. The preparation laser beam was temporally modulated at $50$~Hz with a chopper wheel, synchronous with the molecule beam pulses, to minimise the incident power on the field plates so as to reduce an important systematic error, described in sections~\\ref{sssec:AC_stark_shift_phases} and \\ref{sssec:polarization_gradients_from_thermal_stress_induced_birefringence}.\n\n\\subsubsection{Electric Field}\n\\hspace*{\\fill} \\\\\n\\label{ssec:efields}\nThe applied $\\E$-field was generated with a pair of 43~cm~$\\times$~23~cm parallel conducting plates composed of ${\\approx}1.25$~cm thick Borofloat glass, coated with a ${\\sim}200$~nm layer of indium tin oxide on the inner faces\\footnote{The plates were fabricated by Custom Scientific, Inc.}. The plates were transparent to the $X\\rightarrow A$ optical pumping laser (943~nm), the $H\\rightarrow C$ state preparation and readout lasers (1090~nm), and the $C\\rightarrow X$ molecule fluorescence (690~nm). The outside faces of the electric field plates were prepared with a broadband anti-reflection coating with a specified \\textless1\\% reflectivity at normal incidence from 600--1000~nm. The plates were made much larger than the precession region in order to minimise inhomogeneity of the field through which the molecules passed, and to enable large solid angle collection of fluorescence through the plates. One of the field plates was mounted in an aluminium frame fixed to the base of the vacuum chamber. The other field plate was secured a distance of 2.5~cm away in a kinematic aluminium frame. On the inward-facing surfaces, a frame of gold-plated copper clamped each field plate to the aluminium mounts and also functioned as a `guard ring' electrode, suppressing the effect of fringing fields near the edges of the plate. The field plates were protected from impinging molecular beam particles by a $1~\\mathrm{cm}\\times 1~\\mathrm{cm}$ square collimator fixed to the entrance of the assembly.\n\nThe applied electric field was controlled by a 20-bit DAC, amplified to produce up to $\\pm200$~V\\footnote{PA98A Power OpAmp.}. The field plate assembly was referenced to the vacuum chamber ground. Equal and opposite voltages, $\\pm V$, were applied to each side of the assembly. The direction of the field (the $\\Esw$ switch) was reversed every 1--2~s by reprogramming the output of the DAC channels to reverse their polarity. The configuration of the electrical connections between the amplified voltage and the field plates, denoted by $\\Lsw$, was reversed via a pair of mercury-wetted relays every 2.6~minutes\\footnote{Note that $\\Lsw$ constitutes a reversal of the supply voltages as well as a reversal of the leads connecting the power supply to the field plates, such that $\\Esw$ is unchanged.}. Data were also taken with two different values of $\\mathcal{E}=36$ and 141~V\/cm, varied on a ${\\sim}1$~day time scale.\n\nWe measured the homogoneity of the electric field in a number of ways which we shall describe in turn now. Firstly, an indirect measure was obtained by determining the spatial variation of the field plate separation $d$ using a `white light' Michelson interferometer \\cite{Patten1971}. A schematic of the setup is shown in figure~\\ref{fig:Interferometer_setup}.\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[scale=0.4]{interferometer_setup_inset.pdf}\n\\caption{\\label{fig:Interferometer_setup}Schematic of the apparatus used to perform an interferometric measurement of the electric field plate separation. A spectrally broad light beam is reflected perpendicularly off the field plates and passes into a conventional Michelson interferometer setup with one fixed arm (length $L_2$) and one movable arm (length $L_1$). An example of a pair of beam paths of interest is shown as solid and dashed red lines. If the two paths are slightly tilted relative to each other, a spatial interference pattern (inset) is observed on the CCD detector when the path length difference between the two beams is less than the coherence length, e.g. $L_1+d-L_20$, $\\left|\\Omega\\right|>0$, that\nrefers to states with opposite molecular alignment with respect to\nthe applied electric field. It is also used to refer to the experiment\nswitch between spectroscopically addressing states in $\\left|H,J=1\\right\\rangle $\nwith opposite values of $\\Nsw$.\n\\item [{$\\Esw$}] Denotes the alignment of the applied electric\nfield with respect to the laboratory $\\hat{z}$ axis, $\\Esw=\\rm{sgn}\\left(\\vec{\\mathcal{E}}\\cdot\\hat{z}\\right)$ where $\\vec{\\mathcal{E}}$ is the applied electric field.\n\\item [{$\\Bsw$}] Denotes the alignment of the applied magnetic\nfield with respect to the laboratory $\\hat{z}$ axis, $\\Bsw=\\rm{sgn}\\left(\\vec{\\mathcal{B}}\\cdot\\hat{z}\\right)$ where $\\vec{\\mathcal{B}}$ is the applied magnetic field.\n\\item [{$\\tilde{\\theta}$}] Denotes the state of the polarisation dither\nthat is used to extract the contrast in the spin precession measurement.\nIt refers to the direction of the offset angle in the $xy$ plane\nof the state readout polarisation basis $\\hat{X},\\hat{Y}$, relative\nto the average polarisation of these lasers.\n\\item [{$\\Psw$}] Used as a quantum number to denote the\nparity (eigenvalue of the parity operator $P$) of a given molecular\nstate of well-defined parity. It is also used to refer to the experiment\nswitch between spectroscopically addressing states in $\\left|C,J=1\\right\\rangle $\nwith opposite values of $\\Psw$ with the state readout\nlasers.\n\\item [{$\\Lsw$}] Denotes the state of the mapping between\nthe two output channels of the electric field voltage supply, and\nthe two electric field plates which can be either connected normally\n(+1), or inverted relative to normal (-1).\n\\item [{$\\Rsw$}] Denotes the state of an experimental switch\nof the state readout polarisation basis offset angle with respect\nto the $x$-axis by either 0 $\\left(+1\\right)$ or $\\pi\/2$ $\\left(-1\\right)$.\n\\item [{$\\Gsw$}] Denotes the state of an experimental switch\nof the global polarisation; the state preparation and state readout lasers are rotated synchronously by a common angle. This can be thought of as a redefinition\nof the $\\hat{x}$ and $\\hat{y}$ axes in the $xy$ plane.\n\\item [{$\\B_{z}$}] Denotes the magnitude of the magnetic field\nalong the $\\hat{z}$ direction in the laboratory, $\\B_{z}=|\\vec{\\B}\\cdot\\hat{z}|$.\nThis parameter is switched between three values differing by about\n$20^{\\:}\\mathrm{mG}$. In figure~\\ref{fig:pixel_plot}, channels $X$ that are `odd'\nwith respect to this parameter refer to the linear variation $\\partial X\/\\partial\\mathcal{B}_{z}$.\n\\item [{$\\E$}] Denotes the magnitude of the electric field, $\\E=|\\vec{\\E}|$.\nThis parameter is switched between two values.\n\\item [{$\\hat{k}\\cdot\\hat{z}$}] Denotes the orientation of both the state\npreparation and the state readout laser pointing directions with\nrespect to the laboratory $\\hat{z}$ axis. This is a binary switch,\n$\\hat{k}\\cdot\\hat{z}=\\pm1$, but we do not denote this switch with\na tilde as we do with the other binary switch parameters.\n\\end{description}\n\n\\subsection{Laser Parameters}\nThere are a variety of laser parameters which are used to describe\nthe state preparation laser that is denoted with a subscript `prep',\nor the state readout lasers that are denoted with a subscript `read'\nif the property applies to both state readout lasers, or with subscripts\n$X$ and $Y$, if the parameter can vary between the two readout lasers.\n\\begin{description}\n\\item [{$\\hat{k}$}] Laser pointing direction. In this paper, the pointing\ndirection is always nearly aligned or antialigned with respect to\nthe laboratory $\\hat{z}$ axis such that $\\hat{k}\\cdot\\hat{z}\\approx\\pm1$.\n\\item [{$\\vartheta_{k}$}] Defined in equation~\\ref{eq:pointing_imperfection}. Polar angle of deviation\nof the pointing $\\hat{k}$ from aligned or anti-aligned with the $\\hat{z}$\naxis.\n\\item [{$\\varphi_{k}$}] Defined in equation~\\ref{eq:pointing_imperfection}. Azimuthal angle denoting\nthe direction in the $xy$ plane, relative to the $x$-axis, of the deviation of the pointing\n$\\hat{k}$ from the $\\hat{z}$ axis.\n\\item [{$\\hat{\\epsilon}$}] Complex laser polarisation. The readout laser\npolarisations are also referred to as $\\hat{X}$ and $\\hat{Y}$ as\nan alternative to $\\hat{\\epsilon}_{X}$ and $\\hat{\\epsilon}_{Y}$\nat some points.\n\\item [{$\\hat{\\varepsilon}$}] Effective polarisation. Used to parameterize\nthe effect of experiment imperfections on the molecule state as the\npolarisation vector that would be required to obtain the same molecule\nstate in the absence of those experiment imperfections.\n\\item [{$\\theta$}] Defined in section~\\ref{sec:Measurement_scheme} and equation~\\ref{eq:polarization_parametrization} as the linear polarisation angle of the complex polarisation vector.\n\\item [{$\\Theta$}] Defined in section~\\ref{sec:Measurement_scheme} and equation~\\ref{eq:polarization_parametrization} as encoding the ellipticity of the complex polarisation vector.\n\\item [{$S$}] Defined in section~\\ref{sec:Measurement_scheme_more_detail} as the relative circular Stokes parameter,\n$S\\equiv S_{3}\/I=\\cos2\\Theta$.\n\\item [{$\\omega_{\\rm L}$}] Laser frequency.\n\\item [{$P$}] Laser power.\n\\item [{$\\Omega_{\\rm r}$}] Rabi frequency for a particular laser beam and transition. Defined as the transition dipole matrix element multiplied by the amplitude of the electric field associated with the laser beam.\n\\item [{$\\Gamma$}] Optical retardance for some birefrigent element along\nthe laser beam path.\n\\item [{$\\phi_{\\Gamma}$}] Angle in the $xy$ plane of the fast axis associated\nwith an optical retardance $\\Gamma$.\n\\end{description}\n\n\\subsection{Molecular States and Parameters}\nThese symbols are all used to describe the molecular energy level structure and the manner in which our laser light interacts with the molecules, in particular for the state preparation and readout processes.\n\\begin{description}\n\\item [{$J$}] Total angular momentum.\n\\item [{$M$}] Projection of $J$ onto the laboratory $\\hat{z}$-axis.\n\\item [{$\\Omega$}] Projection of $J$ onto the internuclear axis, $\\hat{n}$.\n\\item [{$B_H$}] Rotational constant of the $H$ state.\n\\item [{$\\Eeff$}] `Effective electric field' to which we consider the eEDM to be subjected.\n\\item [{$\\Delta_{\\Omega,1}$}] The $\\Omega$-doublet splitting of the $\\ket{H,J=1}$ state.\n\\item [{$D_1$}] Expectation value of the molecular electric dipole moment of the $\\ket{H,J=1}$ state.\n\\item [{$g_1$}] The $g$-factor of the $\\ket{H,J=1}$ state.\n\\item [{$\\eta$}] Defined in equation~\\ref{eq:eta_2}, it is proportional to the $g$-factor difference between the two $\\Nsw$ states.\n\\item [{$\\left|\\pm,\\Nsw\\right\\rangle $}] Sublevels within the $\\ket{H,J=1}$ (eEDM sensitive) manifold, labelled by their values of $M$ and $\\Nsw$.\n\\item [{$\\left|C,\\Psw\\right\\rangle $}] Sublevel to which molecules are excited during state preparation and readout. One of two sublevels in the $\\ket{C,J=1}$ manifold, with $M=0$ and parity $\\Psw=\\pm1$.\n\\item [{$\\left|B(\\hat{\\epsilon}),\\Nsw,\\Psw\\right\\rangle $}] Superposition of $M$ sublevels within the $\\ket{H,J=1,\\Nsw}$ manifold that is depleted during state preparation with a laser beam of polarisation $\\hat{\\epsilon}$, as defined in equation~\\ref{eq:bright_state}.\n\\item [{$\\left|D(\\hat{\\epsilon}),\\Nsw,\\Psw\\right\\rangle $}] Superposition of $M$ sublevels within the $\\ket{H,J=1,\\Nsw}$ manifold that remains after state preparation with a laser beam of polarisation $\\hat{\\epsilon}$, as defined in equation~\\ref{eq:dark_state}.\n\\item [{$\\left|B_{\\pm}(\\hat{\\epsilon}),\\Nsw,\\Psw\\right\\rangle$}] Instantaneous eigenvectors of the three-level system formed by $\\left|B(\\hat{\\epsilon}),\\Nsw,\\Psw\\right\\rangle$, $\\left|D(\\hat{\\epsilon}),\\Nsw,\\Psw\\right\\rangle$ and $\\left|C,\\Psw\\right\\rangle$, as defined in equation~\\ref{eq:inst_eigv}.\n\\item [{$\\Delta$}] One-photon detuning from resonance, discussed in section~\\ref{sec:state_prep_read} and defined in equation~\\ref{eq:detuningcorrelations}.\n\\item [{$\\gamma$}] Decay rate of the a given electronic state. The electronic state label is given in the subscript. In most of the paper, only $\\gamma_C$, the decay rate of the $C$ state, is relevant.\n\\item [{$\\Omega_{\\rm r}$}] Transition Rabi frequency, which is proportional\nto the square root of the laser intensity.\n\\item [{$E_{B\\pm},^{\\:}E_{D}$}] Instantaneous eigenenergies of the dressed three-level system, defined in equation~\\ref{eq:inst_eig}.\n\\item [{$\\dot{\\chi}$}] Complex polarisation rotation rate defined in section~\\ref{sssec:AC_stark_shift_phases}.\n\\item [{$\\Pi$}] Defined and discussed in section~\\ref{sssec:AC_stark_shift_phases} and equation~\\ref{eq:Pi_def}. This is a factor in the AC Stark shift phase that is independent of laser polarisation but depends on the laser detuning and Rabi frequency.\n\\item [{$v_{\\parallel}$}] The mean longitudinal velocity of the molecular beam.\n\\end{description}\n\n\\subsection{Measurement Quantities}\nThese symbols represent quantities related to the measurement of the accumulated phase and the way in which it is extracted during data analysis, as well as some related quantities pertaining to systematic studies.\n\\begin{description}\n\\item [{$N$}] Total number of measurments performed, equivalent to the number of detected photoelectrons.\n\\item [{$N_0$}] Number of molecules in the state readout region in the particular $\\Nsw$ level being addressed.\n\\item [{$f$}] Fraction of fluorescence photons emitted in the state readout region that are detected.\n\\item [{$S$}] Recorded photoelectron count rate measured on the photodetectors.\n\\item [{$F$}] Photoelectron count rate due to the molecule fluorescence.\n$F_{X,Y}$ is used to denote the molecular fluorescence induced by\nthe $X$ and $Y$ state readout lasers, respectively. $F_{\\mathrm{cut}}$\nis used to denote the fluorescence threshold above which data was\nincluded in the analysis.\n\\item [{$B$}] Background count rate primarily due to scattered\nlight from the state readout lasers. This background signal is subtracted\nfrom the raw photoelectron signal $S$ to obtain the fluorescence\nphotoelectron count rate, $F=S-B$.\n\\item [{$\\mathcal{A}$}] Signal asymmetry as defined in equation~\\ref{eq:Asymmetry}.\n\\item [{$\\mathcal{C}$}] Spin precession fringe contrast, as defined in\nequation~\\ref{eq:Contrast_Definition}, is the sensitivity of the asymmetry to molecular\nspin precession.\n\\item [{$\\phi$}] Actual spin precession phase of the molecules as defined in equation~\\ref{eq:total_phase}.\n\\item [{$\\Phi$}] Measured spin precession phase as described in section~\\ref{sec:Measurement_scheme_more_detail}, $\\Phi=\\mathcal{A}\/(2\\mathcal{C})$.\n\\item [{$\\tau$}] Measured spin precession time as described in sections~\\ref{sec:Measurement_scheme} and \\ref{sec:compute_phase}.\n\\item [{$\\omega$}] Measured spin precession frequency, as defined in equation~\\ref{eq:omega_def}, $\\omega=\\Phi\/\\tau$.\n\\item [{$\\chi^{2}$}] Reduced chi-squared statistic, $\\chi^2=\\frac{1}{N_{\\rm dof}}\\sum_i\\left(\\frac{x_i - f_i(\\{x\\})}{dx_i}\\right)^2$,\nwhere $N_{\\rm dof}$ is the number of degrees of freedom, $x_i$ are the data points, $dx_i$ are the uncertainties, and $f_i(\\{x\\})$ is a fit function that can depend on $i$ and the ensemble of all of the data, $\\{x\\}$. \nFor normally distributed data that fits well to the applied fit function, $\\chi^2$ should be consistent with 1.\n\\item [{$\\omega^{\\mathcal{NE}}$}] The measurement channel of interest, the spin precession frequency channel that is correlated with $\\Nsw$ and $\\Esw$. The expected eEDM signal should contribute to this channel.\n\\item [{$\\omega^{\\mathcal{NE}}_T$}] The contribution to spin precession frequency $\\omega^{\\mathcal{NE}}$ induced by $T$-odd spin precession effects in the $H$ state in ThO.\n\\item [{$\\omega^{\\mathcal{NE}}_P$}] A systematic error in the $\\omega^{\\mathcal{NE}}$ channel that is proportional to some parameter $P$.\n\\end{description}\n\n\\section{Introduction}\n\\input{Introduction_FINAL.tex} \n\n\\section{Atom and Molecule eEDM Experiments}\n\\subsection{Theory}\n\\input{theory_FINAL.tex}\n\n\\subsection{ThO Molecule}\n \\input{ThO_Molecule_FINAL.tex} \n\n\\section{ACME Experiment}\n\\subsection{Overview of Measurement Scheme}\n \\input{measurement_scheme_FINAL.tex}\n\n\\subsection{Apparatus}\n \\input{apparatus_FINAL.tex}\n\n\\section{Data Analysis}\n \\input{Data_Analysis_FINAL.tex}\n\n\\section{Systematic Errors}\n \\input{Systematics_FINAL.tex}\n\n\\section{Interpretation}\n \\input{Interpretation_FINAL.tex}\n\n\\section{Summary and Outlook}\n \\input{Conclusion_FINAL.tex}\n\n\n\\subsubsection{Basic Measurement Scheme}\n\\hspace*{\\fill} \\\\\nWe performed a spin precession measurement, resembling previous beam-based eEDM experiments \\cite{Hudson2011,Regan2002,Commins1994}, on $^{232}\\rm{Th}^{16}\\rm{O}$ molecules in a pulsed molecular beam generated by a cryogenic buffer gas beam source. Figure~\\ref{fig:meas_scheme_simple} shows a simplified schematic of the measurement. The molecules fly at velocity $v\\approx200$~m\/s into a magnetically shielded region with nominally uniform and parallel electric $\\vec{\\E}$ and magnetic $\\vec{\\B}$ fields. Molecule population is transfered from $|X^1\\Sigma^+,J=1,M=\\pm1\\rangle$ in the electronic ground state to the metastable $|H,J=1,M=\\pm1,\\Omega=\\tilde{\\N}\\tilde{\\E}M\\rangle\\equiv|\\pm,\\tilde{\\N}\\rangle$ state manifold (in the $\\ket{\\pm,\\Nsw}$ nomenclature we use $\\pm$ to refer to $M=\\pm1$) by optical pumping through the short-lived $|A^3\\Pi_{0^+},J=0,M=0\\rangle$ state with a 943~nm laser. This results in an even distribution of population in an incoherent mixture of the four $|\\pm,\\Nsw\\rangle$ states in $H$.\\footnote{A glossary of symbols used throughout this paper is provided in section~\\ref{sec:glossary}.} Figure~\\ref{fig:ThOlevels} shows the electronic states of ThO relevant to the eEDM measurement.\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[width=0.5\\textwidth]{ThO_Levels.pdf}\n\\caption{Levels and transitions in ThO used in our measurement of the eEDM, based on \\cite{Vutha2010,Edvinsson1985,Paulovic2003}. Solid arrows indicate transitions we address with lasers, wavy arrows indicate spontaneous decays of interest. For more details on how these transitions were used, see the main text.}\n\\label{fig:ThOlevels}\n\\end{figure}\n\nIn the absence of any experimental imperfections, we describe our system in terms of coordinate axes $+\\hat{z}$ along $+\\vec{\\E}$ (for a specified sign of applied field that we denote as positive, pointing approximately east to west in the lab) and $+\\hat{x}$ along the direction of the molecular beam (which travels approximately south to north) such that $+\\hat{y}$ is approximately aligned with gravity (cf.\\ figure~\\ref{fig:meas_scheme_simple}). Note that when we reverse the direction of the electric field, by construction the laboratory coordinate system does not change and the orientation of the electric field can be described by $\\Esw\\equiv{\\rm sgn}(\\hat{z}\\cdot\\vec{\\E})=\\pm1$. Analogously, we reverse the direction of the magnetic field between two $\\Bsw\\equiv{\\rm sgn}(\\hat{z}\\cdot\\vec{\\B})=\\pm1$ states. Since the directions of the fields are encoded by $\\Esw$ and $\\Bsw$, we define the magnitudes of the fields simply as $\\B_z\\equiv|\\B_z|$ and $\\E\\equiv|\\vec{\\E}|$.\n\nA superposition of the $M=\\pm1$ sublevels is prepared by optically pumping on the transition at 1090~nm between states $|\\pm,\\Nsw\\rangle$ and $|C^1\\Pi_1,J=1,M=0\\rangle(|\\Omega=+1\\rangle-\\Psw|\\Omega=-1\\rangle)\/\\sqrt{2}\\equiv|C,\\Psw\\rangle$, where $\\Psw=\\pm1$ is the excited state parity\\footnote{In this paper we follow the convention given in \\cite{Brown2003}.}, with laser light linearly polarised in the $xy$ plane. The resulting state corresponds to having the total angular momentum of the molecule aligned in the $xy$ plane. Because the $\\sigma$ electron's spin is aligned with $\\vec{J}$, by the Wigner-Eckart theorem this is equivalent to aligning the spin \\cite{Budker2008}, and we use this shorthand from here on. The state preparation laser frequency is tuned to spectroscopically select the molecule alignment $\\Nsw$, while the nearly degenerate $M=\\pm1$ states remain unresolved. The excited state $C$, which decays at a rate $\\gamma_C\\approx2\\pi\\times0.3$ MHz, decays primarily (${\\approx}75~\\%$ \\cite{Hess2014}) to the ground state so that one superposition of the two $|\\pm,\\Nsw\\rangle$ states is optically pumped out of $H$ and the remaining orthogonal superposition, which is `dark' to the preparation laser beam, is the prepared state. The linear polarisation of the state preparation laser beam, $\\hat{\\epsilon}_{{\\rm prep}}$, sets the relative coupling of each of the two $|\\pm,\\Nsw\\rangle$ states to $\\ket{C,\\Psw}$ and determines the spin alignment angle of the remaining state in the laboratory frame. The bright superposition $\\ket{B(\\hat{\\epsilon}_{\\rm prep})}$\nis pumped away, and the orthogonal dark superposition $\\ket{D(\\hat{\\epsilon}_{\\rm prep})}$ remains.\n\nFor the moment, we consider the specific case $\\Psw=+1$ and $\\hat{\\epsilon}_{{\\rm prep}}=\\hat{x}$, (the general case will be discussed in section \\ref{sec:Measurement_scheme_more_detail}). In this case, the prepared state\n\\begin{equation}\n\\ket{\\psi(t=0),\\Nsw}=\\frac{1}{\\sqrt{2}}\\left(\\ket{+,\\Nsw}-\\ket{-,\\Nsw}\\right)\n\\label{eq:initial_state}\n\\end{equation}\nhas the electron spin aligned along the $\\hat{y}$ axis. As the molecules traverse the spin precession region of length $L=22$ cm (which takes a time $\\tau\\approx1$~ms), the electric and magnetic fields exert torques on the electric and magnetic dipole moments, causing the spin to precess in the $xy$ plane by angle $2\\phi$; this corresponds to the state\n\\begin{equation}\n|\\psi(t=\\tau),\\Nsw\\rangle=\\frac{1}{\\sqrt{2}}\\left(e^{-i\\phi}|+,\\Nsw\\rangle-e^{+i\\phi}|-,\\Nsw\\rangle\\right),\n\\end{equation}\nwhere $\\phi$ is given approximately by the sum of the Zeeman and eEDM contributions to the spin precession angles,\n\\begin{equation}\n\\phi=-(\\Bsw g_1\\mu_{\\rm B}\\B_z+\\Nsw\\Esw d_e\\Eeff)\\tau.\n\\label{eq:simple_phase}\n\\end{equation}\nThe sign of the eEDM term, $\\Nsw\\Esw$, arises from the relative orientation between $\\vec{\\E}_{\\rm eff}$ and the electron spin as illustrated in figure~\\ref{fig:H-state}.\n\nAt the end of the spin precession region, we measure $\\phi$ by optically pumping on the same $H\\rightarrow C$ transition with the linearly polarised state readout laser beam. The polarisation alternates rapidly between two orthogonal linear polarisations $\\hat{X}$ and $\\hat{Y}$, such that each molecule is subject to excitation by both polarisations as it flies through the detection region, and we record the modulated fluorescence signals $F_X$ and $F_Y$ from the decay of $C$ to the ground state at 690 nm. This procedure amounts to a projective measurement of the spin onto $\\hat{X}$ and $\\hat{Y}$, which are defined such that $\\hat{X}$ is at an angle $\\theta$ with respect to $\\hat{x}$ in the $xy$ plane. To determine $\\phi$ we compute the asymmetry,\n\\begin{equation}\n\\mathcal{A}\\equiv\\frac{F_X-F_Y}{F_X+F_Y}\\propto\\cos{[2(\\phi-\\theta)]}.\n\\label{eq:asymmetry}\n\\end{equation}\nWe set $\\B_z$ and $\\theta$ such that $\\phi-\\theta\\approx(\\pi\/4)(2n+1)$ for integer $n$, so that the asymmetry is linearly proportional to small changes in $\\phi$ and maximally sensitive to the eEDM. A simplified schematic of the experimental procedure just described is shown in figure~\\ref{fig:meas_scheme_simple}.\n\\hspace*{\\fill} \\\\\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[width=16cm]{meas_scheme_simple.pdf}\n\\caption{Simplified schematic of the measurement scheme; numbers next to energy levels label $J$. \\textbf{1.} Molecules in the $\\ket{X,J=1}$ state are optically pumped via the $A$ state into $\\ket{H,J=1}$ by a retroflected (and offset in $x$) laser beam (blue arrows into\/out of page), polarised along $\\hat{x}$ and $\\hat{y}$ (blue arrows). \\textbf{2.} Molecules from one of the $\\Nsw$ states are then prepared in a superposition of $M$ sublevels ($M=-1,0,+1$ from left to right) by a linearly polarised laser beam (red) addressing the $H\\rightarrow C$ transition. This aligns the molecule's angular momentum, $\\vec{J}$, which in turn aligns the spin of the eEDM-sensitive $\\sigma$ electron, which is on average aligned with $\\vec{J}$. \\textbf{3.} The angular momentum (and hence electron spin) then precesses due to the electric and magnetic fields present (into the page) by an angle $\\phi$. This precession is dominated by the magnetic interaction but also includes a term linear in $d_e$ (see equation~\\ref{eq:simple_phase}). \\textbf{4.} The spin state is projected onto orthogonal superpositions of the $M$ sublevels by laser beams polarised along $\\hat{X},\\hat{Y}$ (red arrows). The resulting fluorescence is determined by the population in each superposition state and hence the precession angle $\\phi$.}\n\\label{fig:meas_scheme_simple}\n\\end{figure}\n\nBy repeating the measurement of $\\phi$ after having reversed any one of the signs $\\Nsw$, $\\Esw$ or $\\Bsw$, we may isolate the eEDM phase from the Zeeman phase. In practice, we repeat the phase measurement under all $2^3$ $(\\Nsw,\\Esw,\\Bsw)$ experiment states to reduce the sensitivity of the eEDM measurement to other spurious phases, and we extract the phase $\\phi^{\\N\\E}=-d_e\\Eeff\\tau=\\phi_{\\rm EDM}$. Here, we have introduced the notation $\\phi^u$, discussed in detail in the next section, which we use throughout this document to refer to the component of $\\phi$ that is odd under the set of switches listed in the superscript $u$, and implicitly even under those which are not listed (see section~\\ref{sec:Measurement_scheme_more_detail} and equation~\\ref{eq:general_parity} for a rigorous definition). A component which is even under all switches is considered to be `non-reversing' and is given an `nr' superscript.\n\n\\subsubsection{Measurement Scheme in Detail}\n\\label{sec:Measurement_scheme_more_detail}\n\\hspace*{\\fill} \\\\\nTo fully describe the method by which we extracted $d_e$ from the data in section \\ref{sec:data_analysis}, and to describe the systematic error models in section \\ref{sec:systematics}, we must introduce some additional formalism to describe the spin precession measurement to generalize the simple case described in the previous section. \n\nWe work in the regime in which the Stark shift in $H$ is approximately linear, $E_{\\rm Stark}\\approx-\\Nsw D_1\\E$, which holds when the Stark interaction energy is large compared to the $\\Omega$-doublet energy splitting $\\Delta_{\\Omega,1}$ but small compared to the rotational energy scale, described by the $H$-state rotational constant $B_H\\approx2\\pi\\times$~9.8 GHz, i.e. $\\Delta_{\\Omega,1}\\ll D_1\\E\\ll B_H$. In this regime, the molecular alignment is approximately related to $\\Omega$ by $\\Nsw=\\Esw M\\Omega$; this relation is assumed throughout this document. This is a good approximation, but it is notable that due to the Stark interaction at first order in perturbation theory, each $|M,\\Nsw\\rangle$ state is a superposition of all four $|H,J,M,\\Omega\\rangle$ states with $J=1,2$ and $\\Omega=\\pm1$. This effect is discussed further in sections~\\ref{sssec:correlated_laser_parameters} and \\ref{sssec:laser_pointing_and_intensity}.\n\nLet us consider the preparation of a spin-aligned state again. Starting from an incoherent mixture of the four $|\\pm,\\Nsw\\rangle$ states, we perform optical pumping on the electric dipole transition between $\\ket{\\pm,\\Nsw}$ and $\\ket{C,\\Psw}$, for a specific $\\Nsw$, with laser light of polarisation $\\hat{\\epsilon}_{{\\rm prep}}$ that is nominally linear in the $xy$ plane. This step depletes the bright superposition state (see e.g. \\cite{Bickman2009})\n\\begin{equation}\n\\ket{B(\\hat{\\epsilon}_{{\\rm prep}},\\Nsw,\\Psw)}=(\\hat{\\epsilon}_{+1}^{*}\\cdot\\hat{\\epsilon}_{{\\rm prep}}^{*})\\ket{+,\\Nsw}-\\Psw(\\hat{\\epsilon}_{-1}^{*}\\cdot\\hat{\\epsilon}_{{\\rm prep}}^{*})\\ket{-,\\Nsw},\n\\label{eq:bright_state}\n\\end{equation}\nwhere $\\hat{\\epsilon}_{\\pm1}=\\mp\\left(\\hat{x}\\pm i\\hat{y}\\right)\/\\sqrt{2}$\nare unit vectors for circular polarisation. The corresponding dark state (with which the laser does not interact) is the orthogonal superposition\n\\begin{equation}\n\\ket{D(\\hat{\\epsilon}_{{\\rm prep}},\\Nsw,\\Psw)}=(\\hat{\\epsilon}_{+1}^{*}\\cdot\\hat{\\epsilon}_{{\\rm prep}})\\ket{+,\\Nsw}+\\Psw(\\hat{\\epsilon}_{-1}^{*}\\cdot\\hat{\\epsilon}_{{\\rm prep}})\\ket{-,\\Nsw}.\n\\label{eq:dark_state}\n\\end{equation}\nThis dark state serves as the initial state, $|\\psi(0),\\Nsw\\rangle = |D(\\hat{\\epsilon}_{{\\rm prep}},\\Nsw,\\Psw=+1)\\rangle$, for the spin-precession experiment, where we fixed the state preparation laser frequency to address the excited state with parity $\\Psw=+1$. The state preparation laser polarisation can be parameterised as\n\\begin{equation}\n\\hat{\\epsilon}_{{\\rm prep}}=-e^{-i\\theta_{{\\rm prep}}}\\cos\\Theta_{{\\rm prep}}\\hat{\\epsilon}_{+1}+e^{+i\\theta_{{\\rm prep}}}\\sin\\Theta_{{\\rm prep}}\\hat{\\epsilon}_{-1},\n\\label{eq:polarization_parametrization}\n\\end{equation}\nwhere $\\Theta_{{\\rm prep}}\\approx\\pi\/4$ defines the ellipticity Stokes parameter $(S_3\/I)_{{\\rm prep}}=\\cos2\\Theta_{{\\rm prep}}\\approx0$, and $\\theta_{{\\rm prep}}$ defines the linear polarisation angle with respect to $\\hat{x}$ in the $xy$ plane. From here on, we refer to the ellipticity Stokes parameter as $S\\equiv S_3\/I$. There is a one-to-one correspondence between the dark state superposition and the projection of the laser polarisation $\\hat{\\epsilon}_{{\\rm prep}}$ onto the $xy$ plane. If the laser polarisation does not lie entirely in the $xy$ plane, equations \\ref{eq:bright_state} and \\ref{eq:dark_state} are still appropriate, but require normalization. Note that if the laser is linearly polarised, switching the excited state parity $\\tilde{\\mathcal{P}}$ has the same effect on the dark state as rotating the laser polarisation angle by $\\pi\/2$.\n\nFollowing the initial state preparation, the molecules traverse the spin-precession region with their forward velocity nominally along $\\hat{x}$. In this region there are nominally uniform and parallel electric ($\\vec{\\E}$) and magnetic ($\\vec{\\B}$) fields, which produce energy shifts given by\n\\begin{equation}\nE(M,\\Nsw) =-|M|D_1\\E\\Nsw-Mg_1\\mu_{\\rm{B}}\\B_z\\tilde{\\B}-M\\eta\\mu_{\\rm{B}}\\E\\B_z\\Nsw\\tilde{\\B}-Md_e\\Eeff\\Nsw\\tilde{\\E},\n\\label{eq:Energy}\n\\vspace{10pt}\n\\end{equation}\nwhere $D_1$ is the electric dipole moment of $\\ket{H,J=1}$. Here $\\eta=0.79(1)$~nm\/V accounts for the $\\E$-dependent magnetic moment difference between the two sets of $\\Nsw$ levels in $\\ket{H,J=1}$ \\cite{Petrov2014}, as described in section~\\ref{sec:compute_phase}. The energy shift terms that depend on the sign of $M$ contribute to the spin precession angle $\\phi$, which is given by:\n\\begin{equation}\n\\phi=\\frac{1}{2}\\int_0^L(E(M=+1,\\Nsw)-E(M=-1,\\Nsw))\\frac{{\\rm d}x}{v}.\n\\label{eq:total_phase}\n\\end{equation}\nThis phase is dominated by the magnetic (Zeeman) interaction. The Stark shift, proportional to $|M|$, does not contribute. The state then evolves to: \n\\begin{equation}\n|\\psi(\\tau),\\Nsw\\rangle = \\left(e^{-i\\phi}|+,\\Nsw\\rangle \\langle +,\\Nsw| + e^{+i\\phi}|-,\\Nsw\\rangle \\langle -,\\Nsw|\\right)|\\psi(0),\\Nsw\\rangle,\n\\end{equation}\n(recall $\\ket{\\psi(0),\\Nsw}=\\ket{D(\\hat{\\epsilon}_{{\\rm prep}},\\Nsw,\\Psw=+1)}$ per equation~\\ref{eq:dark_state}) and molecules enter a detection region where the state is read out by optically pumping again between the $\\ket{H,J=1}$ and $\\ket{C,J=1}$ manifolds. This optical pumping is performed alternately by two laser beams with nominally orthogonal linear polarisations \n$\\hat{\\epsilon}_X$ and $\\hat{\\epsilon}_Y$.\\footnote{For convenience, the notation $\\hat{\\epsilon}_{X}$, $\\hat{\\epsilon}_{Y}$ is used interchangeably with the previously used notation $\\hat{X}$, $\\hat{Y}$.}\nThese beams excite the projection of $\\ket{\\psi(\\tau),\\Nsw}$ onto the bright states\n\\begin{equation}\n\\ket{B(\\hat{\\epsilon}_X,\\Nsw,\\Psw)}\\quad{\\rm and}\\quad\\ket{B(\\hat{\\epsilon}_Y,\\Nsw,\\Psw)},\n\\end{equation}\n(with the same $\\Nsw$ that was addressed in the state preparation optical pumping step, but with an independent choice of $\\Psw$) with probability $P_{X,Y}$ respectively. In the ideal case in which all laser polarisations are exactly linear, this probability is given by\n\\begin{equation}\n\\label{eq:xprojection}\nP_{X,Y}(\\phi,\\theta_{{\\rm prep}},\\theta_{ X,Y},\\Nsw,\\Psw)=\\left|\\braket{B(\\hat{\\epsilon}_{X,Y},\\Nsw,\\Psw)|\\psi(\\tau),\\Nsw}\\right|^2=\\left[1-\\Psw\\cos(2(\\theta_{{\\rm prep}}-\\theta_{X,Y}+\\phi))\\right]\/2,\n\\end{equation}\nwhere $\\theta_{X,Y}$ are the linear polarisation angles of the state readout beams, with respect to $\\hat{x}$. The result is a signal that varies sinusoidally with the precession angle $\\phi$. To measure these probabilities, we observe the associated modulated fluorescence signals, $F_{X,Y}=fN_0P_{X,Y}$, where $N_0$ is the number of molecules in the addressed $\\Nsw$ level at the state readout region, and $f$ is the fraction of total fluorescence photons that are detected. \n\nTo distinguish between molecule number fluctuations and phase variations, we normalize with respect to the former by rapidly switching the state readout laser between the two orthogonal polarisations, $\\hat{\\epsilon}_{X,Y}$, every 5~$\\upmu$s. This is significantly quicker than fluctuations in the molecule number and is sufficiently quick that every molecule is interrogated by both polarisations (see section~\\ref{sec:data_analysis} or \\cite{Kirilov2013} for more details). We then form an asymmetry $\\A$, which is immune to molecule number fluctuations, given by\n\\begin{equation}\n\\A=\\frac{F_X-F_Y}{F_X+F_Y}=\\Psw\\cos[2(\\phi-\\theta)],\n\\label{eq:Asymmetry}\n\\end{equation}\nwhere we have assumed that the readout polarisations are exactly orthogonal, given by $\\theta_X=\\theta_{\\rm{read}}$ and $\\theta_Y=\\theta_{\\rm{read}}+\\pi\/2$, and where we have defined $\\theta\\equiv\\theta_{\\rm{read}}-\\theta_{{\\rm prep}}$.\\footnote{Note that this reduces to equation~\\ref{eq:asymmetry} for $\\theta_{\\rm prep}=0$ (i.e. $\\hat{\\epsilon}_{\\rm prep}=\\hat{x}$) and $\\Psw=+1$.} In this equation and from now on unless otherwise noted, $\\Psw$ refers to the excited state parity that is addressed by the state readout laser, not to be confused with the excited state parity addressed by the state preparation laser, which is kept fixed.\n\nThe value of $\\mathcal{B}_z$ and the state preparation and readout laser beam polarisations are chosen so that $|\\phi-\\theta|\\approx\\pi\/4$. This corresponds to the linear part of the asymmetry fringe in equation~(\\ref{eq:Asymmetry}), where $\\A$ is most sensitive to, and linearly proportional to, small changes in $\\phi$ (cf.\\ figure~\\ref{fig:fringe}). A variety of effects including imperfect optical pumping, decay from $C$ back to $H$, elliptical laser polarisation and forward velocity dispersion, reduce the measurement sensitivity by a `contrast' factor\n\\begin{equation} \n\\C\\equiv-\\frac{1}{2}\\frac{\\partial\\A}{\\partial\\theta}\\approx \\frac{1}{2}\\frac{\\partial\\A}{\\partial\\phi},\n\\label{eq:Contrast_Definition}\n\\end{equation}\nwith $|\\C|\\le1$. We measure this parameter by dithering $\\theta=\\theta^{\\rm nr} + \\Delta\\theta\\tilde{\\theta}$ (where $\\theta^{\\rm nr}$ is the average or 'non-reversing' polarisation angle)\nbetween states of $\\tilde{\\theta}=\\pm 1$, with amplitude $\\Delta\\theta=0.05$~rad. \nWe found that typically $|\\C|\\approx0.94$. \nWe then extract the measured phase, $\\Phi=\\mathcal{A}\/(2\\mathcal{C})+q\\pi\/4$, by normalising the asymmetry measurements according to the measured contrast --- see section~\\ref{sec:data_analysis} for more details on the data analysis methods used to evaluate this quantity. In the ideal case, the measured phase matches closely with the precession phase, $\\Phi\\approx\\phi$. However, a variety effects that are investigated closely in section~\\ref{sec:systematics} lead to slight deviations between these two quantities, which can contribute to systematic errors in the measurement. Unless explicitly specified, $\\C$ is assumed to be an unsigned quantity from here on. In particular, when averaging over multiple states of the experiment, $|\\C|$ is used.\n\nTo isolate the eEDM term from other components of the energy shift in equation~(\\ref{eq:Energy}), the experiment is repeated under different conditions that are characterised by parameters whose sign is switched regularly during the experiment. The spin precession measurement is repeated for all $2^4$ experiment states defined by the four primary binary switch parameters: $\\Nsw$, the molecular orientation relative to the applied electric field (changed every 0.5~s); $\\Esw$, the direction of the applied electric field in the laboratory (2~s); $\\tilde{\\theta}$, the sign of the readout polarisation dither (10~s); and $\\tilde{\\mathcal{B}}$, the direction of the applied magnetic field in the laboratory (40~s). For each ($\\Nsw,\\Esw,\\tilde{\\mathcal{B}}$) state, the asymmetry $\\mathcal{A}(\\Nsw,\\Esw,\\tilde{\\mathcal{B}})$, contrast $\\mathcal{C}(\\Nsw,\\Esw,\\tilde{\\mathcal{B}})$, and measured phase $\\Phi(\\Nsw,\\Esw,\\tilde{\\mathcal{B}})$ are determined as described earlier. The data taken under all $2^4=16$ experimental states derived from these four binary switches constitutes a `block' of data.\n\nWe can write the phase $\\Phi(\\Nsw,\\Esw,\\tilde{\\mathcal{B}})$ in terms of components with particular parity with respect to the experimental switches:\n\\begin{align}\n\\Phi(\\tilde{\\mathcal{N}},\\tilde{\\mathcal{E}},\\tilde{\\mathcal{B}})=&\\Phi^{\\mathrm{nr}}+\\Phi^{\\mathcal{N}}\\tilde{\\mathcal{N}}+\\Phi^{\\mathcal{E}}\\tilde{\\mathcal{E}}+\\Phi^{\\mathcal{B}}\\tilde{\\mathcal{B}}\\nonumber\\\\+&\\Phi^{\\mathcal{NE}}\\tilde{\\mathcal{N}}\\tilde{\\mathcal{E}}+\\Phi^{\\mathcal{NB}}\\tilde{\\mathcal{N}}\\tilde{\\mathcal{B}}+\\Phi^{\\mathcal{EB}}\\tilde{\\mathcal{E}}\\tilde{\\mathcal{B}}+\\Phi^{\\mathcal{NEB}}\\tilde{\\mathcal{N}}\\tilde{\\mathcal{E}}\\tilde{\\mathcal{B}}.\n\\label{eq:phase_parity}\n\\end{align}\nWe refer to these components as `switch-parity channels'. A channel is said to be odd with respect to some subset of switches (labelled as superscripts) if it changes sign when any of those switches is performed. Thus it will also change sign if an odd number of those switches is performed. It is implicitly even under all other switches. We use this general notation throughout this document to refer to correlations of various measured quantities and experimental parameters with experiment switches. To generalize, if we have $k$ binary experiment switches $(\\tilde{\\mathcal{S}}_{1},\\tilde{\\mathcal{S}}_{2},\\dots,\\tilde{\\mathcal{S}}_{k})$ such that $\\tilde{\\mathcal{S}}_{i}=\\pm1$, and we perform a measurement of the parameter $X(\\tilde{\\mathcal{S}}_{1},\\tilde{\\mathcal{S}}_{2},\\dots,\\tilde{\\mathcal{S}}_{k})$ for a complete set of the $2^{k}$ switch states, then the component of $X$ that is odd under the product of switches $\\left[\\tilde{\\mathcal{S}}_{a}\\tilde{\\mathcal{S}}_{b}\\dots\\right]$ is given by\n\\begin{equation}\nX^{\\mathcal{S}_{a}\\mathcal{S}_{b}\\dots}\\equiv \\frac{1}{2^{k}}\\sum_{\\tilde{\\mathcal{S}}_{1}\\dots\\tilde{\\mathcal{S}}_{k}=\\pm1}\n\\left[\\tilde{\\mathcal{S}}_{a}\\tilde{\\mathcal{S}}_{b}\\dots\\right]X\\left(\\tilde{\\mathcal{S}}_{1},\\tilde{\\mathcal{S}}_{2},\\dots,\n\\tilde{\\mathcal{S}}_{k}\\right).\n\\label{eq:general_parity}\n\\end{equation}\nThe switch parity behavior of a given component is expressed in the superscript which lists the experimental switches with respect to which the component is odd. We order the switch labels in the superscripts such that the fastest switches are listed first and the slowest switches are listed last. Some components give particularly important physical quantities. Most notably, the eEDM precession phase is extracted from the $\\tilde{\\mathcal{N}}\\tilde{\\mathcal{E}}$-correlated component of the measured phase: that is, in the ideal case $\\Phi^{\\mathcal{NE}}=-d_{e}\\mathcal{E}_{\\mathrm{eff}}\\tau$. Additionally, the Zeeman precession phase is nominally given by $\\Phi^{\\B}=-\\mu_{\\rm B}g_1\\mathcal{B}_z\\tau$. Recall we label `non-reversing' components with an `nr' superscript. In a few cases, we drop the superscript parity because it is redundant. For example, we drop the superscript on the dominant components of the applied electric and magnetic fields, $\\mathcal{E}\\equiv\\mathcal{E}^{\\mathcal{E}}$ and $\\mathcal{B}_{z}\\equiv\\mathcal{B}_{z}^{\\mathcal{B}}$.\n\nMany other experimental parameters are also varied between blocks of data to suppress and monitor systematic errors (figure~\\ref{fig:timing}). These `superblock' switches include: excited-state parity addressed by the state readout laser beams, $\\Psw$ (chosen randomly after every block, with equal numbers of $\\Psw=\\pm1$); simultaneous change of the power supply polarity and interchange of leads connecting the electric field plates to their voltage supply, $\\Lsw$ (4~blocks); a rotation of the state readout polarisation basis by $\\theta_{\\rm{read}}\\rightarrow\\theta_{\\rm{read}}+\\pi\/2$ to interchange the roles of the $X$ and $Y$ beams, $\\Rsw$ (8~blocks); and a global polarisation rotation of both state preparation and readout lasers by $\\theta_{\\rm{read}}\\rightarrow\\theta_{\\rm{read}}+\\pi\/2$ and $\\theta_{{\\rm prep}}\\rightarrow\\theta_{{\\rm prep}}+\\pi\/2$, $\\Gsw$ (16~blocks).\n\nAdditionally, the magnitude of the magnetic field, $\\B_z$, was switched on the timescale of 64--128 blocks (${\\sim}1$~hour), and the magnitude of the applied electric field, $\\E$, and the laser propagation direction, $\\hat{k}\\cdot\\hat{z}$, were changed on timescales of ${\\sim}1$~day and ${\\sim}1$~week, respectively. \n\nOn these longer timescales, we also alternated between taking eEDM data under \\textit{Normal} conditions, for which all experiment parameters were set to their nominally ideal values, and taking data with \\textit{Intentional Parameter Variations} (IPVs), during which some experimental parameter was set to deviate from ideal so that we could monitor the size of the known systematic errors described in section \\ref{sssec:correlated_laser_parameters}. We took IPV data in which we varied (a) the non-reversing electric field $\\E^{\\rm{nr}}$ and (b) the $\\Nsw\\Esw$-correlated Rabi frequency, $\\Omega_{\\rm r}^{\\N\\E}$, to measure the sensitivity of the eEDM measurement to these parameters and we varied (c) the state preparation laser detuning $\\Delta_{{\\rm prep}}$ to monitor the size of the residual $\\E^{\\rm{nr}}$. These systematic errors are discussed in more detail in sections~\\ref{ssec:efields} and \\ref{sssec:correlated_laser_parameters}.\n\n\\begin{figure}[htbp]\n\\centering\n\\includegraphics[width=10cm]{Switch_Timescales.pdf}\n\\caption[Timescales of experimental parameter switches]{A schematic of the switches performed during our experiment and the associated timescales. See the main text for a description of each of the switch parameters and a description of the distinction between the \\textit{Normal} and IPV (\\emph{Intentional Parameter Variation}) data types. The 15-hour run time and $|\\E|$ switching timescale are approximate.}\n\\label{fig:timing}\n\\end{figure}\n\nThe details of the data analysis required to extract the eEDM-correlated phase $\\Phi^{\\mathcal{NE}}$ are described in section \\ref{sec:data_analysis}. A lower bound on the statistical uncertainty $\\delta\\Phi^{\\mathcal{NE}}$ of the eEDM-correlated phase is given by photoelectron shot noise to be $\\delta\\Phi^{\\mathcal{NE}}=1\/(2|\\C|\\sqrt{N})$ for $N$ detected photoelectrons \\cite{Khriplovich1997,VuthaThesis}. In the case where shot noise is the sole contribution, we can express the statistical uncertainty $\\delta d_e$ in our measurement of the eEDM as\n\\begin{equation}\n\\delta\\de=\\delta\\Phi^{\\N\\E}\\frac{1}{\\E_{\\rm eff}\\tau}=\\frac{1}{2|\\mathcal{C}|\\tau\\mathcal{E}_{\\rm eff}\\sqrt{\\dot{N}T}},\n\\end{equation}\nwhere $\\dot{N}\\approx f\\dot{N_0}$ is the measurement rate (equivalent to the photoelectron detection rate) and $T$ is the integration time (recall $f$ is the fraction of fluorescence photons detected and $N_0$ is the number of molecules in the addressed $\\Nsw$ level). Further discussion of the achieved statistical uncertainty is presented in section~\\ref{sec:data_analysis}.\n\\subsection{eEDM Interaction}\n\nTo make contact with common language in the literature about the eEDM in molecules, we first write the effective, nonrelativistic eEDM interaction in terms of an internal electric field $\\vec{\\mathcal{E}}_{\\rm int}$. (As we will see, this is closely related, but not identical, to the effective field $\\vec{\\mathcal{E}}_{\\rm eff}$.) We choose a convention where $\\vec{\\mathcal{E}}_{\\rm int} = -\\mathcal{E}_{\\rm int} \\hat{n}$. This means that the internal field vector is defined to be directed \\textit{opposite} to $\\hat{n}$, i.e., along the average direction of the electric field \\textit{inside} the molecule (here, from positive Th ion to negative O ion) when \n$\\mathcal{E}_{\\rm int}$ is positive. We also adopt the convention that, in the $H$ state of ThO, there is an effective eEDM $\\vec{d}_e^{\\rm eff} = d_e\\vec{S}$ (where again $S=1$ to a fair approximation). This choice appears, at first glance, to contradict the discussion in section~\\ref{sec:theory}, where for a single electron we wrote $\\vec{d}_e=2d_e\\vec{s}$ (where $s=1\/2$). However, these two definitions are in fact consistent when taking into account that in the $H~^3\\Delta_1$ state of ThO only one of the two valence electrons (the one in the $\\sigma$ orbital) contributes significantly to the EDM energy shift, while both electrons contribute to the total spin $S=1$. Hence, in our formulation, the molecule-frame projection $\\vec{d}_e^{\\rm eff}\\cdot\\hat{n}$ can take extreme values $\\pm d_e$, as expected for a single contributing electron. (This `single contibuting electron' approximation is valid for all molecules used to date in searches for the eEDM.)\n\nWe then write the effective eEDM Hamiltonian $H_{\\rm EDM}^{\\rm eff}$ in the standard form for interaction of an electric dipole moment with the internal electric field:\n\\begin{equation}\nH_{\\rm EDM}^{\\rm eff}=-\\vec{d}_e^{\\rm eff}\\cdot\\vec{\\mathcal{E}}_{\\rm int}= +d_e \\mathcal{E}_{\\rm int} \\vec{S}\\cdot\\hat{n},\n\\label{eq:HEDMapp1a}\n\\end{equation}\nwhere the + sign in the final expression arises from the sign convention for $\\vec{\\mathcal{E}}_{\\rm int}$.\nIn eigenstates of $\\Omega$, the expectation value of $H_{\\rm EDM}^{\\rm eff}$---that is, the energy shift $\\Delta E_{\\rm EDM}$ due to the eEDM---can be written as\n\\begin{equation}\n\\Delta E_{\\rm EDM} = +d_e \\mathcal{E}_{\\rm int} \\left\\langle\\Sigma\\right\\rangle\n = +d_e \\left( \\mathcal{E}_{\\rm int} |\\!\\left\\langle\\Sigma\\right\\rangle\\! | \\right) \\mathrm{sgn}\\left(\\langle\\Sigma\\rangle\\right).\n\\label{eq:HEDMapp1b}\n\\end{equation}\n\nNow, we finally re-introduce the effective electric field $\\Eeff$ used throughout the main text of this paper. This is related to the internal field introduced above, via \n\\begin{equation}\n \\Eeff \\equiv |\\!\\left\\langle\\Sigma\\right\\rangle\\! | \\mathcal{E}_{\\rm int},\n\\end{equation}\nWe can then use this notation to describe the effective nonrelativistic eEDM interaction, within a given electronic state and eigenstate of $\\Omega$ (and otherwise independent of molecular structure), as follows:\n\\begin{eqnarray}\n\\vec{\\mathcal{E}}_{\\rm eff} \\equiv -\\Eeff \\hat{n}; \\\\\n\\vec{d}_e \\equiv d_e \\vec{S}\/ | \\left\\langle \\Sigma \\right\\rangle |; \\\\\nH_{\\rm EDM}^{\\rm eff} = -\\vec{d}_e \\cdot \\vec{\\mathcal{E}}_{\\rm eff} = +d_e \\Eeff \\Sigma\/ | \\left\\langle \\Sigma \\right\\rangle |; \\\\\n\\Delta E_{\\rm EDM} = \\mathrm{sgn}(\\left\\langle \\Sigma \\right\\rangle) d_e \\Eeff,\n\\label{eq:HEDMapp1d}\n\\end{eqnarray}\nwhere the sign in the last expressions arises from the defined definitions of $\\Sigma$ (component of $\\vec{S}$ along $\\hat{n}$) and $\\vec{\\mathcal{E}}_{\\rm eff}$ (antiparallel to $\\hat{n}$). All relevant quantities are summarised pictorially in figure~\\ref{fig:ACME_signs}.\n\\begin{figure}[!ht]\n\\centering\n\\includegraphics[width=\\linewidth]{ACME_signs.pdf}\n\\caption{Summary of sign conventions used in the ACME experiment. All vectors depict expectation values of operators defined in the text, in the states $| H, J=1, \\tilde{\\N},M\\rangle$. Note the difference between\nscalar $\\Omega$ and vector $\\vec{\\Omega}$. The figure is drawn with a negative $g$-factor, i.e. the magnetic moment $\\vec{\\mu}$ opposes $\\vec{J}$, and with positive values of $d_e$ and $\\Eeff$. Energy levels are shown in the centre of the figure --- solid lines show the Stark-shifted levels ($M=0$ levels are unaffected), dashed lines include Zeeman shifts and dotted lines include a non-zero eEDM interaction. Figure inspired by \\cite{Lee2009}.}\n\\label{fig:ACME_signs}\n\\end{figure}\n\nIn most of the theoretical literature on this subject, this energy shift is written in the unambiguous form $\\Delta E_{\\rm EDM} = +d_e W_d \\Omega$. However, there has been no consistent definition in the literature for the relation between $W_d$ and $\\Eeff$. In particular, both their relative signs and the dependence of their relative magnitude on the value of $|\\Omega |$ (encompassing both the case of one- and two-electron systems) are often defined differently, or imprecisely. \nIn our notation, the expressions above imply a general relationship between $\\Eeff$ and $W_d$:\n\\begin{equation}\n\\Eeff = W_d \\Omega \\mathrm{sgn}(\\left\\langle \\Sigma \\right\\rangle).\n\\label{eq:genHEDMapp1}\n\\end{equation}\nThis relation is valid for systems with one or two valence electrons (in the `single contributing electron' approximation for the latter case), and regardless of the relative directions of $\\vec{\\Sigma}$ and $\\vec{\\Omega}$.\n\nNow we apply these general considerations to the specific case of the $H$ state of ThO. Here, since $\\left\\langle \\Sigma \\right\\rangle \\approx -\\Omega$, we find that $\\Eeff = -W_d$ with our conventions. Thus, the energy shifts can be written for ThO as\n\\begin{equation}\n\\Delta E_{\\rm EDM} = -d_e\\Eeff \\Omega.\n\\label{eq:HEDMapp1c}\n\\end{equation}\nIn our experiment, this gives rise to energy shifts, for a given direction of the laboratory electric field $\\E$, given by\n\\begin{equation}\n\\langle H, J=1, \\tilde{\\N},M|H_{\\rm eEDM}^{\\rm eff}| H, J=1, \\tilde{\\N},M\\rangle=-d_e\\E_{\\rm eff}M\\tilde{\\N}\\tilde{\\E},\n\\label{eq:HEDMapp2}\n\\end{equation}\nsince in our notation $\\Omega=M\\tilde{\\N}\\tilde{\\E}$. \nThen, finally, the experimentally determined energy shift arising from the eEDM is \n\\begin{eqnarray}\n\\omega^{\\N\\E}_{\\rm EDM} = \\frac{1}{2}\\frac{1}{\\tilde{\\N}\\tilde{\\E}} \n\\left[ \\langle H, J=1, \\tilde{\\N},M=+1|H_{\\rm eEDM}^{\\rm eff}| H, J=1, \\tilde{\\N},M=+1 \\rangle \\right. \\nonumber \\\\\n\\hphantom{H,J=1,\\N,} -\\left. \\langle H, J=1, \\tilde{\\N},M=-1|H_{\\rm eEDM}^{\\rm eff}| H, J=1, \\tilde{\\N},M=-1 \\rangle \\right] \\nonumber \\\\\n\\hphantom{\\omega^{\\N\\E}_{\\rm EDM}} = -d_e\\E_{\\rm eff} .\n\\label{eq:HEDMapp2a}\n\\end{eqnarray}\n\n\n\n\n\\subsection{Scalar-Pseudoscalar Nucleon-Electron Interaction}\n\nWe next turn to notation describing the $T$-violating scalar-pseudoscalar (SP) interaction between a nucleon and an electron.\nThe relativistic Hamiltonian for this interaction can be written as\n\\begin{equation}\nH_{\\rm SP}=i\\frac{G_{\\rm F}}{\\sqrt{2}}(ZC_{\\rm S,p}+NC_{\\rm S,n})\\gamma_0\\gamma_5\\rho_{\\rm N}(\\vec{r}),\n\\end{equation}\nwhere $G_F$ is the Fermi coupling constant, $\\gamma_i$ are Dirac matrices, $\\rho_{\\rm N}(\\vec{r})$ is the normalised nuclear density, $Z(N)$ is the proton (neutron) number, and $C_{\\rm S,p}$ and $C_{\\rm S,n}$ are dimensionless constants which describe the interaction strength (relative to that of the ordinary weak interaction) specifically for protons and neutrons, respectively. \nUsing the definition\n\\begin{equation}\nC_{\\rm S}=\\frac{Z}{A} C_{\\rm S,p} + \\frac{N}{A} C_{\\rm S,n} = \\frac{Z}{A} C_{\\rm S,p} + \\left( 1-\\frac{Z}{A}\\right) C_{\\rm S,n},\n\\end{equation}\nwhere $A=Z+N$, $C_\\mathrm{S}$ represents a weighted average of the couplings to protons and neutrons, and is different for every nuclear species. However, since the ratio $Z\/A$ is nearly the same for all heavy nuclei used in molecular and atomic EDM experiments (ranging only from $Z\/A=0.41$ for $^{133}$Cs to $Z\/A=0.39$ for $^{232}$Th), typically a common value for $C_{\\rm S}$ is assumed for all experiments of this type.\nThus we can write\n\\begin{equation}\nH_{\\rm SP}=i\\frac{G_{\\rm F}}{\\sqrt{2}} AC_{\\rm S} \\gamma_0\\gamma_5\\rho_{\\rm N}(\\vec{r}).\n\\label{eq:HPSapp1}\n\\end{equation}\nIn a given molecular electronic state, this gives rise to a non-relativistic, single-electron effective Hamiltonian of the form\n$ H_{\\rm SP}^{\\rm eff} = 2\\vec{s}\\cdot\\hat{n} C_{\\rm S} Y_{\\rm S}$; the factor of 2 is included so that the maximal energy shifts due to this term have the simple form $\\Delta E_\\mathrm{SP}^\\mathrm{max} = \\pm C_\\mathrm{S} Y_\\mathrm{S}$. \nBy analogy with our discussion of the eEDM Hamiltonian, in a molecular state with $S = 1$ and a `single contributing electron', as in the $H~^3\\Delta_1$ state of ThO, we rewrite this in the form\n\\begin{equation}\nH_{\\rm SP}^{\\rm eff} = \\vec{S}\\cdot\\hat{n} C_{\\rm S} Y_{\\rm S}.\n\\end{equation}\nHence, the energy shift due to this interaction can be written as\n\\begin{equation}\n\\Delta E_{\\rm SP} = \\langle \\vec{S}\\cdot\\hat{n} \\rangle C_{\\rm S} Y_{\\rm S} = Y_{\\rm S} \\left[ \\langle \\Sigma \\rangle \/ \\Omega \\right] \\Omega,\n\\end{equation}\nwhere the term in square brackets is a constant of the molecular state, determined by the fixed relative size and orientation of $\\vec{\\Sigma}$ and $\\vec{\\Omega}$, with value $\\approx -1$ in the $H~^3\\Delta_1$ state of ThO. In the literature on molecular eEDM systems, this energy shift is typically written in the simpler form\n\\begin{equation}\n\\Delta E_{\\rm SP} = C_{\\rm S} W_{\\rm S}\\Omega.\n\\end{equation}\nHere, in our notation, $W_{\\rm S}\\equiv Y_{\\rm S}\\left[\\langle\\Sigma\\rangle\/\\Omega\\right]$ ($\\approx -Y_{\\rm S}$ in ThO).\nHowever, quantities analogous to $Y_{\\rm S}$ (in terms of which the energy shifts depend explicitly on the spin direction) are rarely introduced in the literature; instead, only forms analogous to $W_{\\rm S}$ (where the energies depend only on $\\Omega$) are used.\n\n\nOur definition for $C_{\\rm S}$ was historically a standard notation used in the literature. However, in some recent papers (e.g. references \\cite{Skripnikov2015,Denis2016}) it is implicitly assumed that the neutron coupling $C_{\\rm S,n}$ vanishes. In these papers, the factor $AC_{\\rm S}$ in equation \\ref{eq:HPSapp1} is replaced by $ZC_{\\rm S,p}$ (or its equivalent in a different notation),\\footnote{In reference \\cite{Skripnikov2015} our $C_{\\rm S,p}$ is denoted as $k_{\\rm T,P}$ and our $W_{\\rm S,p}$ as $W_{\\rm T,P}$; in Ref.\\ \\cite{Denis2016}, our $W_{\\rm S,p}$ is denoted simply as $W_{\\rm S}$. References \\cite{Dzuba2011,DzubaErratum2012} denote our $C_{\\rm S}$ as $C^{\\rm SP}$ and our $W_{\\rm S}$ as $W_{\\rm c}$.}\nand the energy shift is written in the analogous form \n$\\Delta E_{\\rm SP} = C_{\\rm S,p} W_{\\rm S,p}\\Omega$. \nThese papers report values of $W_{\\rm S,p}$ in the $H$ state of ThO, based on sophisticated calculations of the molecular wavefunctions. However, since there is no particular reason to expect this interaction to couple more strongly to protons than to neutrons, we prefer to report our results in terms of $C_{\\rm S}$. To do so, we use the relation $W_S = (A\/Z)W_{\\rm S,p}$ to determine $W_S$ from the reported values for $W_{\\rm S,p}$. \n\nFinally, the experimentally determined energy shift arising from the nucleon-electron SP interaction is \n\\begin{equation}\n\\omega^{\\N\\E}_{\\rm SP} = C_{\\rm S} W_{\\rm S},\n\\label{eq:HPSapp3}\n\\end{equation}\nand the total T-violating energy shift is\n\\begin{equation}\n\\omega^{\\N\\E}_{\\rm T}= -d_e\\E_{\\rm eff} + C_{\\rm S} W_{\\rm S} = d_e W_d + C_{\\rm S} W_{\\rm S}.\n\\label{eq:HSP}\n\\end{equation}\nNote that the sign of the $C_{\\rm S}$ term is opposite to that used, incorrectly, in our original paper \\cite{Baron2014}.\n\n\\subsection{Relation to other notations in the literature}\n\nTable~\\ref{tab:sign_convs} shows some of the conventions used in the literature to describe the $T$-violating electron-nucleon interaction in molecular systems, and how they relate to our conventions. We note in particular three key differences between the (shared) conventions of references \\cite{Skripnikov2015,Denis2016}---which currently provide the most accurate values for $W_d$ and $W_S$---and ours. First: these references define $\\hat{n}$ in the direction opposite to $\\vec{D}$, and hence opposite to ours. This in turn means that their definition of $\\Omega$ has opposite sign to ours. Hence, the same physical energy shifts (defined as $\\Delta E_{\\rm EDM} = W_d\\Omega$ both there and here) are obtained only if we take $W_d$ to have sign opposite to that of the reported $W_d$ in these papers. Second: these references define the eEDM energy shift as $\\Delta E_{\\rm EDM} = +d_e\\Eeff \\Omega$, while we have shown that in our notation $\\Delta E_{\\rm EDM} = -d_e\\Eeff \\Omega$. Here there are two sign differences (one from the overall sign, one from the definition of $\\Omega$). Hence, the same physical energy shifts are obtained when taking $\\Eeff$ to have the same sign as reported in these papers. Third: these references formulate the scalar-pseudoscalar nucleon-electron interaction in terms of a quantity equivalent to our $W_{\\rm S,p}$ rather than our $W_{\\rm S}$. Hence we must rescale these values as described above, using $W_S = (A\/Z)W_{\\rm S,p}$. In addition, the same physical energy shifts $\\Delta E_{\\rm SP} = W_S\\Omega$ are obtained only if we take $W_{\\rm S,p}$ to have sign opposite to that of the reported $W_{\\rm S,p}$ in these papers.\n\n\\begin{center}\n\\begin{threeparttable}\n\\centering\n\\begin{tabular}{C{2.9cm}C{1.1cm}C{0.6cm}C{4cm}C{4cm}}\n\\hline \n& $\\hat{n}$ & $\\vec{\\mathcal{E}}_{\\rm eff}$ & $\\Delta E_{\\rm EDM}$ & $\\Delta E_{\\rm SP}$ \\tabularnewline\n\\hline\nACME & \\includegraphics[width=10pt]{nup.pdf} & \\includegraphics[width=10pt]{adown.pdf} & $d_e W_d\\Omega=-d_e \\E_{\\rm eff} \\Omega = -\\vec{d}_e\\cdot\\vec{\\mathcal{E}}_{\\rm eff}$ & $C_{\\rm S}W_{\\rm S}\\Omega$ \\tabularnewline\nLee et al. \\cite{Lee2009} & \\includegraphics[width=10pt]{nup.pdf} & \\includegraphics[width=10pt]{adown.pdf} & $-\\vec{d}_e\\cdot\\vec{\\mathcal{E}}_{\\rm eff}$\\tnote{a} & \\tabularnewline\nYbF \\cite{Kara2012} & \\includegraphics[width=10pt]{nup.pdf} & \\includegraphics[width=10pt]{adown.pdf} & $-\\vec{d}_e\\cdot\\vec{\\mathcal{E}}_{\\rm eff}$\\tnote{b} & \\tabularnewline\nKozlov et al. \\cite{Kozlov1995,Kozlov2002} & \\includegraphics[width=10pt]{ndown.pdf} & & $+W_dd_e\\Omega$\\tnote{c} & \\tabularnewline\nSkripnikov et al. \\cite{Skripnikov2013,Skripnikov2015,Skripnikov2016} & \\includegraphics[width=10pt]{ndown.pdf} & & $+W_dd_e\\Omega=+d_e\\Eeff{\\rm sgn}(\\Omega)$\\tnote{d} & $+W_{T,P}k_{T,P}\\Omega$\\tnote{e}, where $k_{T,P}=AC_{\\rm S}\/Z$\\tnote{f} \\tabularnewline\nFleig et al. \\cite{Fleig2014,Fleig2013,Denis2016} & \\includegraphics[width=17.2pt]{bndown.pdf} & & $+W_dd_e\\Omega=+d_e\\Eeff[{\\rm sgn}(\\Omega)]$\\tnote{g} & $+W_{P,T}k_S\\Omega$\\tnote{h}, where $k_S=AC_S\/Z$ \\tabularnewline\nDzuba et al. \\cite{Dzuba2011a,DzubaErratum2012} & \\includegraphics[width=17.2pt]{bndown.pdf} & & $+W_dd_e[{\\rm sgn}(\\Omega)]=-d_e\\Eeff[{\\rm sgn}(\\Omega)]$\\tnote{i} & $+W_cC^{\\rm SP}[{\\rm sgn}(\\Omega)]$\\tnote{j} \\tabularnewline\n\\hline\n\\end{tabular}\n\\begin{tablenotes}\n \\item[a] Reference \\cite{Lee2009}, p.\\ 2007\n \\item[b] Reference \\cite{Kara2012}, p.\\ 3\n \\item[c] Reference \\cite{Kozlov1995}, above equation 6.27\n \\item[d] Reference \\cite{Skripnikov2015}, equation 1 and following\n \\item[e] Reference \\cite{Skripnikov2015}, equation 4\n \\item[f] Reference \\cite{Skripnikov2015}, equation 4 and \\cite{Dzuba2011a}, equation 25 and following\n \\item[g] Reference \\cite{Fleig2014}, equation 1 and Reference \\cite{Fleig2013} equations 2--4\n \\item[h] Reference \\cite{Denis2015}, equations 3 and 4\n \\item[i] Reference \\cite{Dzuba2011a}, equation 24 and table IV\n \\item[j] Reference \\cite{Dzuba2011a}, equation 25\n\\end{tablenotes}\n\\par\n\\protect\\caption{Summary of the different conventions used in some of the literature relating to eEDM measurements\/theory. Where entries are left blank the convention is not stated in the reference provided. Quantities in square brackets are not explicitly stated in the references but are implied. In some cases, nomenclature has been modified for consistency. Footnotes provide specific references for the equations shown.}\n\n\\label{tab:sign_convs}\n\\end{threeparttable}\n\\end{center}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}}